mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-17 19:15:32 +00:00
Implement override tracking and syncing.
Overrides MUST be registered within a tracked event so we know what mod it came from. This will allow servers/saves to select which mod 'wins' and becomes to active entry. This should also mean that when connecting to a vanilla server things will revert.
This commit is contained in:
1 parent
4b45eb8b68
commit
f4afb6f56c
5 files changed
+154
-35
No files matched your search
@@ -58,10 +58,6 @@ public class SubstitutionInjectionTest
|
||||
@Test
|
||||
public void testSubstitutionInjection() throws Exception
|
||||
{
|
||||
//TODO: Decide exactly how I want to deal with subs, this test doesn't really do anything right now
|
||||
if (true == Boolean.valueOf("true").booleanValue())
|
||||
return;
|
||||
|
||||
final ForgeRegistry<Block> blockRegistry = (ForgeRegistry<Block>)RegistryManager.ACTIVE.getRegistry(Block.class);
|
||||
final ForgeRegistry<Item> itemRegistry = (ForgeRegistry<Item>)RegistryManager.ACTIVE.getRegistry(Item.class);
|
||||
|
||||
@@ -111,7 +107,7 @@ public class SubstitutionInjectionTest
|
||||
assertEquals("ObjectHolder didn't apply - Blocks and registry", currDirt, fnd);
|
||||
assertEquals("Got my dirt substitute - registry", vanilDirt, fnd);
|
||||
dirtitem = (ItemBlock) itemRegistry.getValue(MC_DIRT);
|
||||
assertEquals("ItemBlock points at my block", toSub, dirtitem.getBlock());
|
||||
assertEquals("ItemBlock points at my block", vanilDirt, dirtitem.getBlock());
|
||||
|
||||
// TEST 3: Does the substitute get restored when reverting to frozen state? The substitute should be found in the registry again
|
||||
GameData.revertToFrozen();
|
||||
@@ -133,7 +129,7 @@ public class SubstitutionInjectionTest
|
||||
assertEquals("ObjectHolder didn't apply - Blocks and registry", currDirt, fnd);
|
||||
assertEquals("Got my dirt substitute - registry", vanilDirt, fnd);
|
||||
dirtitem = (ItemBlock) itemRegistry.getValue(MC_DIRT);
|
||||
assertEquals("ItemBlock points at my block", toSub, dirtitem.getBlock());
|
||||
assertEquals("ItemBlock points at my block", vanilDirt, 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