From 78828246f5b80bf1aa224f4a499c1f879fdcdbbf Mon Sep 17 00:00:00 2001 From: Ben Staddon Date: Sun, 30 Jul 2017 07:04:02 +0100 Subject: [PATCH] Fix some broken test mods (#4245) --- .../java/net/minecraftforge/debug/DynBucketTest.java | 12 +++++++----- .../net/minecraftforge/debug/ModelFluidDebug.java | 8 ++++---- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/test/java/net/minecraftforge/debug/DynBucketTest.java b/src/test/java/net/minecraftforge/debug/DynBucketTest.java index b6bb3efc5..b23e1c004 100644 --- a/src/test/java/net/minecraftforge/debug/DynBucketTest.java +++ b/src/test/java/net/minecraftforge/debug/DynBucketTest.java @@ -75,7 +75,7 @@ public class DynBucketTest private static final ResourceLocation simpleTankName = new ResourceLocation(MODID, "simpletank"); private static final ResourceLocation testItemName = new ResourceLocation(MODID, "testitem"); - private static final boolean ENABLE = true; + private static final boolean ENABLE = false; private static Logger logger; @ObjectHolder("testitem") @@ -96,14 +96,14 @@ public class DynBucketTest } @SubscribeEvent - public void registrBlocks(RegistryEvent.Register event) + public void registerBlocks(RegistryEvent.Register event) { event.getRegistry().register(new BlockSimpleTank().setRegistryName(simpleTankName)); GameRegistry.registerTileEntity(TileSimpleTank.class, "simpletank"); } @SubscribeEvent - public void registrItems(RegistryEvent.Register event) + public void registerItems(RegistryEvent.Register event) { FluidRegistry.addBucketForFluid(FluidRegistry.getFluid(TestFluid.name)); FluidRegistry.addBucketForFluid(FluidRegistry.getFluid(TestGas.name)); @@ -116,7 +116,7 @@ public class DynBucketTest } @SubscribeEvent - public void registrRecipes(RegistryEvent.Register event) + public void registerRecipes(RegistryEvent.Register event) { ItemStack filledBucket = FluidUtil.getFilledBucket(new FluidStack(ModelFluidDebug.FLUID, Fluid.BUCKET_VOLUME)); GameRegistry.addShapelessRecipe(new ResourceLocation(MODID, "diamond_to_fluid"), null, filledBucket, Ingredient.fromItem(Items.DIAMOND)); @@ -128,7 +128,7 @@ public class DynBucketTest { logger = event.getModLog(); - if (!ENABLE || !ModelFluidDebug.ENABLE) + if (ENABLE && ModelFluidDebug.ENABLE) { MinecraftForge.EVENT_BUS.register(this); } @@ -168,6 +168,8 @@ public class DynBucketTest @SubscribeEvent public static void setupModels(ModelRegistryEvent event) { + if (!ENABLE || !ModelFluidDebug.ENABLE) return; + ModelLoader.setBucketModelDefinition(DYN_BOTTLE); final ModelResourceLocation bottle = new ModelResourceLocation(new ResourceLocation(ForgeVersion.MOD_ID, "dynbottle"), "inventory"); diff --git a/src/test/java/net/minecraftforge/debug/ModelFluidDebug.java b/src/test/java/net/minecraftforge/debug/ModelFluidDebug.java index 63fc19fd1..c643df2f4 100644 --- a/src/test/java/net/minecraftforge/debug/ModelFluidDebug.java +++ b/src/test/java/net/minecraftforge/debug/ModelFluidDebug.java @@ -30,10 +30,10 @@ public class ModelFluidDebug public static final String MODID = "forgedebugmodelfluid"; public static final String VERSION = "1.0"; - public static final boolean ENABLE = true; - private static ModelResourceLocation fluidLocation = new ModelResourceLocation(MODID.toLowerCase() + ":" + TestFluidBlock.name, "fluid"); - private static ModelResourceLocation gasLocation = new ModelResourceLocation(MODID.toLowerCase() + ":" + TestFluidBlock.name, "gas"); - private static ModelResourceLocation milkLocation = new ModelResourceLocation(MODID.toLowerCase() + ":" + TestFluidBlock.name, "milk"); + public static final boolean ENABLE = false; + private static ModelResourceLocation fluidLocation = new ModelResourceLocation(MODID + ":" + TestFluidBlock.name, "fluid"); + private static ModelResourceLocation gasLocation = new ModelResourceLocation(MODID + ":" + TestFluidBlock.name, "gas"); + private static ModelResourceLocation milkLocation = new ModelResourceLocation(MODID + ":" + TestFluidBlock.name, "milk"); @ObjectHolder(TestFluidBlock.name) public static final Block FLUID_BLOCK = null; @ObjectHolder(TestFluidBlock.name)