From 04eab6476a9ed560d2367d3a6b137dcd2d93265c Mon Sep 17 00:00:00 2001 From: Caedis Date: Sat, 6 Jul 2024 12:50:03 -0500 Subject: [PATCH] Add Remapping For TFPlank to TFPlanks (#81) * Add Remapping For TFPlank to TFPlanks --- .../java/twilightforest/TwilightForestMod.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/main/java/twilightforest/TwilightForestMod.java b/src/main/java/twilightforest/TwilightForestMod.java index 43cef69d99..3b8fa16655 100644 --- a/src/main/java/twilightforest/TwilightForestMod.java +++ b/src/main/java/twilightforest/TwilightForestMod.java @@ -20,6 +20,7 @@ import cpw.mods.fml.common.Mod.Instance; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.event.FMLInitializationEvent; +import cpw.mods.fml.common.event.FMLMissingMappingsEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.event.FMLServerStartingEvent; @@ -396,6 +397,21 @@ public void startServer(FMLServerStartingEvent event) { event.registerServerCommand(new CommandTFProgress()); } + @EventHandler + public void missingMappings(FMLMissingMappingsEvent event) { + for (FMLMissingMappingsEvent.MissingMapping mapping : event.get()) { + if (mapping.name.equals("TwilightForest:tile.TFPlank")) { + if (mapping.type == GameRegistry.Type.BLOCK) { + mapping.remap(TFBlocks.planks); + } else if (mapping.type == GameRegistry.Type.ITEM) { + mapping.remap(Item.getItemFromBlock(TFBlocks.planks)); + } + } else { + FMLLog.fine("missing mapping?: %s - %s", mapping.name, mapping.id); + } + } + } + private void registerCreatures() { TFCreatures.registerTFCreature( twilightforest.entity.passive.EntityTFBoar.class,