mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-13 16:54:22 +00:00
Fix substitution tests
This commit is contained in:
1 parent
9a09ff68aa
commit
c5ffe46f48
1 file changed
+5
-5
@@ -99,7 +99,7 @@ public class SubstitutionInjectionTest
|
||||
assertEquals("ItemBlock points at vanilla block", toSub, dirtitem.getBlock());
|
||||
|
||||
// TEST 2: Is the substitute still in the registry? The snapshot was taken before the substitute was added so it should NOT exist
|
||||
GameData.injectSnapshot(snapshot, true, true);
|
||||
GameData.injectSnapshot(snapshot, false, true);
|
||||
ObjectHolderRegistry.INSTANCE.applyObjectHolders();
|
||||
fnd = blockRegistry.getValue(MC_DIRT);
|
||||
currDirt = Blocks.DIRT;
|
||||
@@ -120,16 +120,16 @@ public class SubstitutionInjectionTest
|
||||
dirtitem = (ItemBlock) itemRegistry.getValue(MC_DIRT);
|
||||
assertEquals("ItemBlock points at vanilla block", toSub, dirtitem.getBlock());
|
||||
|
||||
// TEST 2 repeat: Is the substitute still in the registry? The snapshot was taken before the substitute was added so it should NOT exist
|
||||
// TEST 3: Is the substitute still in the registry? The snapshot was taken before the substitute, but we inject frozen data, so we SHOULD have the sub.
|
||||
GameData.injectSnapshot(snapshot, true, true);
|
||||
ObjectHolderRegistry.INSTANCE.applyObjectHolders();
|
||||
fnd = blockRegistry.getValue(MC_DIRT);
|
||||
currDirt = Blocks.DIRT;
|
||||
assertEquals("Got my dirt substitute - Blocks", vanilDirt, currDirt);
|
||||
assertEquals("Got vanilla dirt - Blocks", toSub, currDirt);
|
||||
assertEquals("ObjectHolder didn't apply - Blocks and registry", currDirt, fnd);
|
||||
assertEquals("Got my dirt substitute - registry", vanilDirt, fnd);
|
||||
assertEquals("Got vanilla dirt - registry", toSub, fnd);
|
||||
dirtitem = (ItemBlock) itemRegistry.getValue(MC_DIRT);
|
||||
assertEquals("ItemBlock points at my block", vanilDirt, dirtitem.getBlock());
|
||||
assertEquals("ItemBlock points at vanilla block", toSub, dirtitem.getBlock());
|
||||
|
||||
// TEST 3 repeat: Does the substitute get restored when reverting to frozen state? The substitute should be found in the registry again
|
||||
GameData.revertToFrozen();
|
||||
|
||||
Reference in new issue
Block a user