Skip to content

Commit

Permalink
Add Remapping For TFPlank to TFPlanks (#81)
Browse files Browse the repository at this point in the history
* Add Remapping For TFPlank to TFPlanks
  • Loading branch information
Caedis authored Jul 6, 2024
1 parent 3e69ed4 commit 04eab64
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/main/java/twilightforest/TwilightForestMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 04eab64

Please sign in to comment.