Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
9143c71
Add SaveBlocks to AnvilManager
invalid-email-address Sep 9, 2018
2c225b8
Add Concrete, Concrete power, Acacia Wood block into
invalid-email-address Sep 9, 2018
6d8d487
Expose Chunk log properties on BlockManager
invalid-email-address Sep 9, 2018
13ac098
Add negative bounds checks when resolving neighbors
invalid-email-address Sep 9, 2018
5ed8695
Add some additional tree and brick types
invalid-email-address Sep 9, 2018
d32e005
Update to use string based item IDs
invalid-email-address Sep 9, 2018
4f25c7b
Refactor schema verification
invalid-email-address Sep 9, 2018
8698e09
Make region xlog/zlog public
invalid-email-address Sep 9, 2018
49b758b
Add SaveBlocks virtual
invalid-email-address Sep 9, 2018
c8ef915
Refactor schema verification
invalid-email-address Sep 9, 2018
19e0fb6
Create Time tag on missing
invalid-email-address Sep 9, 2018
e4a81ce
Add SEA_LANTERN block ID
invalid-email-address Sep 9, 2018
2d15cc7
Add banner support
invalid-email-address Sep 15, 2018
1769fce
Add purpur blockinfo
DinoV Jul 14, 2019
2fc4a96
Anvil support
DinoV Jul 23, 2026
5928af6
Update csproj
DinoV Jul 23, 2026
6747fc3
Upgrade .NET
DinoV Jul 25, 2026
aa36423
Acquatic support
DinoV Jul 25, 2026
d969020
More block types
DinoV Jul 25, 2026
51198a6
Add 26.2 block types
DinoV Jul 25, 2026
40a4c65
26.2 support start
DinoV Jul 25, 2026
1db70b9
Fix spawn for 26.2
DinoV Jul 25, 2026
d283b92
Fix level handling and block ID mapping
DinoV Jul 26, 2026
588b795
Add property accessors
DinoV Jul 26, 2026
9e52281
Add a couple of missing blocks
DinoV Jul 26, 2026
4146d6c
Fix a couple of schema issues
DinoV Jul 26, 2026
5df85e4
Make verification failure breakpointable
DinoV Jul 28, 2026
e25c01d
Add block properties
DinoV Jul 28, 2026
16b112f
Merge remote-tracking branch '26/anvil' into HEAD
DinoV Jul 28, 2026
b758e65
Height map support
DinoV Jul 28, 2026
d17b459
Fix issue with empty lists
DinoV Jul 28, 2026
9fa28ee
Reduce memory usage
DinoV Jul 28, 2026
7dccc72
Add rebuild height maps support
DinoV Jul 28, 2026
e891135
Fix legacy block id mismatch
DinoV Jul 29, 2026
e0cac67
Fix glass pane connections
DinoV Jul 29, 2026
9c660c9
More connection updates
DinoV Jul 29, 2026
a0a42a8
Fix sign rendering for 26.2
DinoV Jul 29, 2026
621814f
Fix height map rebuilding for non-solid blocks
DinoV Jul 30, 2026
00af688
relight
DinoV Jul 30, 2026
1f34c45
Add atomic legacy ID and data writes
DinoV Jul 30, 2026
0362370
Add API for setting blocks by name
DinoV Jul 31, 2026
0e85e4b
Add GetModernBlockState
DinoV Jul 31, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
542 changes: 542 additions & 0 deletions Substrate.Tests/AnvilTests.cs

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added Substrate.Tests/Data/26_2-creative/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Substrate.Tests/Data/26_2-creative/level.dat
Binary file not shown.
Binary file added Substrate.Tests/Data/26_2-creative/level.dat_old
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"minecraft:recipes/decorations/crafting_table": {
"criteria": {
"unlock_right_away": "2026-07-25 12:32:33 -0700"
},
"done": true
},
"minecraft:adventure/adventuring_time": {
"criteria": {
"minecraft:beach": "2026-07-25 12:32:35 -0700",
"minecraft:forest": "2026-07-25 12:34:46 -0700"
},
"done": false
},
"DataVersion": 4903
}
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"stats": {
"minecraft:custom": {
"minecraft:time_since_rest": 2653,
"minecraft:walk_one_cm": 1450,
"minecraft:total_world_time": 3526,
"minecraft:leave_game": 1,
"minecraft:play_time": 2653,
"minecraft:time_since_death": 2653
},
"minecraft:picked_up": {
"minecraft:leaf_litter": 1
}
},
"DataVersion": 4903
}
1 change: 1 addition & 0 deletions Substrate.Tests/Data/26_2-creative/session.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Binary file not shown.
Binary file not shown.
Binary file not shown.
8 changes: 6 additions & 2 deletions Substrate.Tests/Substrate.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'net40-client-Debug|AnyCPU'">
<AssemblyName>Substrate.Tests.net40-client</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<!--<TargetFrameworkProfile>Client</TargetFrameworkProfile>-->
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
Expand Down Expand Up @@ -105,12 +105,16 @@
<Compile Include="LevelTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="BlockTests.cs" />
<Compile Include="TileEntityBannerTests.cs" />
<Compile Include="TileTickTests.cs" />
<Compile Include="AnvilTests.cs" />
<Compile Include="WorldTests.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SubstrateCS\Substrate %28NET4%29.csproj">
<Project>{7264a1c4-ab4a-4437-b252-7379b98b5509}</Project>
<Name>Substrate %28NET4%29</Name>
<AdditionalProperties>Configuration=Debug</AdditionalProperties>
</ProjectReference>
</ItemGroup>
<Choose>
Expand Down Expand Up @@ -140,4 +144,4 @@
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>
36 changes: 36 additions & 0 deletions Substrate.Tests/TileEntityBannerTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Substrate.Nbt;
using Substrate.TileEntities;

namespace Substrate.Tests
{
[TestClass]
public class TileEntityBannerTests
{
[TestMethod]
public void CompoundPatternEntriesValidateAndLoad()
{
TagNodeCompound tree = new TagNodeCompound();
tree["id"] = new TagNodeString(TileEntityBanner.TypeId);
tree["x"] = new TagNodeInt(1);
tree["y"] = new TagNodeInt(2);
tree["z"] = new TagNodeInt(3);
tree["Base"] = new TagNodeInt(0);

TagNodeList patterns = new TagNodeList(TagType.TAG_COMPOUND);
for (int i = 0; i < 5; i++) {
TagNodeCompound pattern = new TagNodeCompound();
pattern["Color"] = new TagNodeInt(i);
pattern["Pattern"] = new TagNodeString("bs");
patterns.Add(pattern);
}
tree["Patterns"] = patterns;

TileEntityBanner banner = new TileEntityBanner();

Assert.IsTrue(banner.ValidateTree(tree));
Assert.IsNotNull(banner.LoadTreeSafe(tree));
Assert.AreEqual(5, banner.Patterns.Length);
}
}
}
48 changes: 48 additions & 0 deletions Substrate.Tests/TileTickTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Substrate.Nbt;

namespace Substrate.Tests
{
[TestClass]
public class TileTickTests
{
[TestMethod]
public void StringBlockIdLoadsAndRoundTrips()
{
TagNodeCompound tree = CreateTick(new TagNodeString("minecraft:flowing_lava"));

TileTick tick = TileTick.FromTreeSafe(tree);

Assert.IsNotNull(tick);
Assert.AreEqual(BlockType.LAVA, tick.ID);
Assert.AreEqual("minecraft:flowing_lava", tick.StringID);
Assert.AreEqual(TagType.TAG_STRING, tick.BuildTree()["i"].GetTagType());
Assert.AreEqual("minecraft:flowing_lava", tick.BuildTree()["i"].ToTagString().Data);
}

[TestMethod]
public void NumericBlockIdRemainsSupported()
{
TagNodeCompound tree = CreateTick(new TagNodeInt(BlockType.LAVA));

TileTick tick = TileTick.FromTreeSafe(tree);

Assert.IsNotNull(tick);
Assert.AreEqual(BlockType.LAVA, tick.ID);
Assert.IsNull(tick.StringID);
Assert.AreEqual(TagType.TAG_INT, tick.BuildTree()["i"].GetTagType());
}

private static TagNodeCompound CreateTick(TagNode id)
{
TagNodeCompound tree = new TagNodeCompound();
tree["i"] = id;
tree["t"] = new TagNodeInt(5);
tree["p"] = new TagNodeInt(0);
tree["x"] = new TagNodeInt(1);
tree["y"] = new TagNodeInt(2);
tree["z"] = new TagNodeInt(3);
return tree;
}
}
}
Loading