use of cpw.mods.fml.common.event.FMLMissingMappingsEvent.MissingMapping in project BluePower by Qmunity.
the class BluePower method event.
@EventHandler
public void event(FMLMissingMappingsEvent event) {
for (MissingMapping mapping : event.get()) {
String name = mapping.name;
if (mapping.name.startsWith("bluepower:lamp")) {
name = name.replace("silver", "light_gray");
if (mapping.type == Type.BLOCK) {
mapping.remap(GameData.getBlockRegistry().getObject(name));
} else {
mapping.remap(GameData.getItemRegistry().getObject(name));
}
continue;
}
if (mapping.name.equals("bluepower:bluepower_multipart")) {
mapping.ignore();
continue;
}
name = name.replace("silver", "light_gray");
name = name.replace("bluestoneWire", "wire.bluestone");
name = name.replace("cagelamp", "cagelamp.").replace("fixture", "fixture.");
if (name.contains("inverted"))
name = "bluepower:part." + name.substring("bluepower:part.inverted".length()) + ".inverted";
if (name.equals("bluepower:stone_wire"))
name = "bluepower:bluestone_wire_tile";
if (name.equals("bluepower:stone_cathode"))
name = "bluepower:bluestone_cathode_tile";
if (name.equals("bluepower:stone_anode"))
name = "bluepower:bluestone_anode_tile";
if (name.equals("bluepower:stone_pointer"))
name = "bluepower:bluestone_pointer_tile";
if (name.equals("bluepower:silicon_chip"))
name = "bluepower:silicon_chip_tile";
if (name.equals("bluepower:taintedsilicon_chip"))
name = "bluepower:tainted_silicon_chip_tile";
if (name.equals("bluepower:quartz_resonator"))
name = "bluepower:quartz_resonator_tile";
Item item = GameData.getItemRegistry().getObject(name);
if (item == null)
continue;
mapping.remap(item);
}
}
use of cpw.mods.fml.common.event.FMLMissingMappingsEvent.MissingMapping in project PneumaticCraft by MineMaarten.
the class PneumaticCraft method onMissingMapping.
@EventHandler
public void onMissingMapping(FMLMissingMappingsEvent event) {
for (MissingMapping mapping : event.get()) {
if (mapping.type == GameRegistry.Type.BLOCK && mapping.name.equals("PneumaticCraft:etchingAcid")) {
mapping.remap(Fluids.etchingAcid.getBlock());
Log.info("Remapping Etching Acid");
}
if (mapping.type == GameRegistry.Type.ITEM && mapping.name.equals("PneumaticCraft:etchingAcidBucket")) {
mapping.remap(Fluids.getBucket(Fluids.etchingAcid));
Log.info("Remapping Etching Acid Bucket");
}
}
}
Aggregations