Search in sources :

Example 1 with MissingMapping

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);
    }
}
Also used : Item(net.minecraft.item.Item) MissingMapping(cpw.mods.fml.common.event.FMLMissingMappingsEvent.MissingMapping) BPEventHandler(com.bluepowermod.event.BPEventHandler) WorldConversionEventHandler(com.bluepowermod.convert.WorldConversionEventHandler) EventHandler(cpw.mods.fml.common.Mod.EventHandler)

Example 2 with MissingMapping

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");
        }
    }
}
Also used : MissingMapping(cpw.mods.fml.common.event.FMLMissingMappingsEvent.MissingMapping) EventHandler(cpw.mods.fml.common.Mod.EventHandler)

Aggregations

EventHandler (cpw.mods.fml.common.Mod.EventHandler)2 MissingMapping (cpw.mods.fml.common.event.FMLMissingMappingsEvent.MissingMapping)2 WorldConversionEventHandler (com.bluepowermod.convert.WorldConversionEventHandler)1 BPEventHandler (com.bluepowermod.event.BPEventHandler)1 Item (net.minecraft.item.Item)1