Beispiel #1
0
  @Method(modid = "appliedenergistics2")
  public void registerAE2P2P() {
    String energyP2P = "add-p2p-attunement-rf-power";
    if (IC2Loaded) {
      energyP2P = "add-p2p-attunement-ic2-power";
    }

    for (TransmitterType type : TransmitterType.values()) {
      if (type.getTransmission().equals(TransmissionType.ITEM)) {
        FMLInterModComms.sendMessage(
            "appliedenergistics2",
            "add-p2p-attunement-item",
            new ItemStack(MekanismItems.PartTransmitter, 1, type.ordinal()));
        continue;
      }

      if (type.getTransmission().equals(TransmissionType.FLUID)) {
        FMLInterModComms.sendMessage(
            "appliedenergistics2",
            "add-p2p-attunement-fluid",
            new ItemStack(MekanismItems.PartTransmitter, 1, type.ordinal()));
        continue;
      }

      if (type.getTransmission().equals(TransmissionType.ENERGY)) {
        FMLInterModComms.sendMessage(
            "appliedenergistics2",
            energyP2P,
            new ItemStack(MekanismItems.PartTransmitter, 1, type.ordinal()));
        continue;
      }
    }
  }
  public static void registerMFRPlant(Block block) {
    FMLInterModComms.sendMessage(
        "MineFactoryReloaded", "registerHarvestable_Crop", new ItemStack(block, 1, 7));

    NBTTagCompound compound = new NBTTagCompound();
    compound.setString("plant", Block.blockRegistry.getNameForObject(block));
    FMLInterModComms.sendMessage("MineFactoryReloaded", "registerFertilizable_Crop", compound);
  }
 @Mod.EventHandler
 public void whiteListAppliedEnergetics(FMLInitializationEvent event) {
   FMLInterModComms.sendMessage(
       "appliedenergistics2", "whitelist-spatial", TileLaser.class.getCanonicalName());
   FMLInterModComms.sendMessage(
       "appliedenergistics2", "whitelist-spatial", TileAssemblyTable.class.getCanonicalName());
   FMLInterModComms.sendMessage(
       "appliedenergistics2",
       "whitelist-spatial",
       TileAdvancedCraftingTable.class.getCanonicalName());
   FMLInterModComms.sendMessage(
       "appliedenergistics2", "whitelist-spatial", TileIntegrationTable.class.getCanonicalName());
 }
  @SuppressWarnings("unchecked")
  @Init
  public void load(FMLInitializationEvent event) {

    // Register the GUI Handler
    NetworkRegistry.instance().registerGuiHandler(instance, proxy);

    // Register the PlayerDestroyItem Handler
    MinecraftForge.EVENT_BUS.register(new PlayerDestroyItemHandler());

    // Register the Item Pickup Handler
    MinecraftForge.EVENT_BUS.register(new ItemEventHandler());

    // Register the EntityLiving Handler
    MinecraftForge.EVENT_BUS.register(new EntityLivingHandler());

    MinecraftForge.EVENT_BUS.register(new ActionRequestHandler());

    MinecraftForge.EVENT_BUS.register(new WorldTransmutationHandler());

    GameRegistry.registerCraftingHandler(new CraftingHandler());

    // Register the DrawBlockHighlight Handler
    proxy.registerDrawBlockHighlightHandler();

    // Initialize mod tile entities
    proxy.registerTileEntities();

    // Initialize custom rendering and pre-load textures (Client only)
    proxy.initRenderingAndTextures();

    // Add in the ability to dye Alchemical Bags
    CraftingManager.getInstance().getRecipeList().add(new RecipesAlchemicalBagDyes());

    // Register the Fuel Handler
    GameRegistry.registerFuelHandler(new FuelHandler());

    // Quick test to see that sending an encoded recipe to be added to the recipe registry works
    FMLInterModComms.sendMessage(
        Reference.MOD_ID,
        InterModComms.ADD_RECIPE,
        NBTHelper.encodeRecipeAsNBT(
            Item.bucketWater, Arrays.asList(Item.bucketEmpty, Block.waterStill)));
    FMLInterModComms.sendMessage(
        Reference.MOD_ID,
        InterModComms.ADD_RECIPE,
        NBTHelper.encodeRecipeAsNBT(
            Item.bucketLava, Arrays.asList(Item.bucketEmpty, Block.lavaStill)));
  }
  @EventHandler
  public static void preInit(FMLPreInitializationEvent event) {
    ConfigHandler.INSTANCE.initialize(event.getSuggestedConfigurationFile());

    NetworkRegistry.INSTANCE.registerGuiHandler(instance, new GuiHandler());

    proxy.preInit();

    itemRegistry.register();
    blockRegistry.register();
    entityRegistry.init();

    proxy.registerRenderers();

    enchantRegistry.init();

    Achievements.initAchievements();

    starRegistry.registerDefaultStars();

    FMLInterModComms.sendMessage(
        "Waila", "register", ModProps.MAIN_PACKAGE + ".common.compat.waila.WailaCompat.load");

    CompatRegistry.INSTANCE.registerCompat(
        RegisterTime.INIT,
        ModProps.MAIN_PACKAGE + ".common.compat.enderio.EnderIOCompat",
        "EnderIO");
  }
	@EventHandler
	public void load(FMLInitializationEvent evt)
	{
		if (!Loader.isModLoaded("Railcraft"))
		{
			return;
		}
		try
		{
			String id = Block.blockRegistry.getNameForObject(MineFactoryReloadedCore.factoryDecorativeStoneBlock);
			FMLInterModComms.sendMessage("Railcraft", "balast", String.format("%s@%s", id, 8));
			FMLInterModComms.sendMessage("Railcraft", "balast", String.format("%s@%s", id, 9));
			// white sand? black sand?

			Object rockCrusher = Class.forName("mods.railcraft.api.crafting.RailcraftCraftingManager").getField("rockCrusher").get(null);
			Method createNewRecipe = Class.forName("mods.railcraft.api.crafting.IRockCrusherCraftingManager").getMethod("createNewRecipe", ItemStack.class, boolean.class, boolean.class);
			Method addOutput = Class.forName("mods.railcraft.api.crafting.IRockCrusherRecipe").getMethod("addOutput", ItemStack.class, float.class);

			Object recipe = createNewRecipe.invoke(rockCrusher, new ItemStack(MineFactoryReloadedCore.factoryDecorativeStoneBlock, 1, 10), true, false);
			addOutput.invoke(recipe, new ItemStack(MineFactoryReloadedCore.factoryDecorativeStoneBlock, 1, 2), 1.0f); // Paved Blackstone -> Cobble 

			recipe = createNewRecipe.invoke(rockCrusher, new ItemStack(MineFactoryReloadedCore.factoryDecorativeStoneBlock, 1, 11), true, false);
			addOutput.invoke(recipe, new ItemStack(MineFactoryReloadedCore.factoryDecorativeStoneBlock, 1, 3), 1.0f); // Paved Whitestone -> Cobble

			recipe = createNewRecipe.invoke(rockCrusher, new ItemStack(MineFactoryReloadedCore.factoryDecorativeStoneBlock, 1, 0), true, false);
			addOutput.invoke(recipe, new ItemStack(MineFactoryReloadedCore.factoryDecorativeStoneBlock, 1, 2), 1.0f); // Smooth Blackstone -> Cobble 

			recipe = createNewRecipe.invoke(rockCrusher, new ItemStack(MineFactoryReloadedCore.factoryDecorativeStoneBlock, 1, 1), true, false);
			addOutput.invoke(recipe, new ItemStack(MineFactoryReloadedCore.factoryDecorativeStoneBlock, 1, 3), 1.0f); // Smooth Whitestone -> Cobble

			recipe = createNewRecipe.invoke(rockCrusher, new ItemStack(MineFactoryReloadedCore.factoryDecorativeStoneBlock, 1, 2), true, false);
			addOutput.invoke(recipe, new ItemStack(MineFactoryReloadedCore.factoryDecorativeStoneBlock, 1, 8), 1.0f); // Cobble Blackstone -> Gravel + flint
			addOutput.invoke(recipe, new ItemStack(Items.flint, 1, 0), 0.05f);

			recipe = createNewRecipe.invoke(rockCrusher, new ItemStack(MineFactoryReloadedCore.factoryDecorativeStoneBlock, 1, 3), true, false);
			addOutput.invoke(recipe, new ItemStack(MineFactoryReloadedCore.factoryDecorativeStoneBlock, 1, 9), 1.0f); // Cobble Whitestone -> Gravel + flint
			addOutput.invoke(recipe, new ItemStack(Items.flint, 1, 0), 0.05f);
		}
		catch (Throwable _)
		{
			ModContainer This = FMLCommonHandler.instance().findContainerFor(this);
			FMLLog.log(This.getModId(), Level.WARN, "There was a problem loading %s.", This.getName());
			_.printStackTrace();
		}
	}
Beispiel #7
0
  public void addPulverizerRecipe(ItemStack input, ItemStack output, int energy) {
    NBTTagCompound nbtTags = new NBTTagCompound();

    nbtTags.setInteger("energy", energy);
    nbtTags.setTag("input", input.writeToNBT(new NBTTagCompound()));
    nbtTags.setTag("primaryOutput", output.writeToNBT(new NBTTagCompound()));

    FMLInterModComms.sendMessage("mekanism", "PulverizerRecipe", nbtTags);
  }
Beispiel #8
0
 @Override
 @Mod.EventHandler
 public void load(FMLInitializationEvent event) {
   super.load(event);
   JaffasFood.printInitialized(ModulesEnum.trees);
   TileFruitCollector.onLoad();
   FMLInterModComms.sendMessage(
       "Waila", "register", "monnef.jaffas.trees.compatibility.WailaCallback.callbackRegister");
 }
  public static void tryLoad() {
    Debug.dbg("FMP carriage: loading");
    hollowCarriage = new ItemCarriageFMP();

    hollowCarriage.setUnlocalizedName("hollowCarriage");
    GameRegistry.registerItem(hollowCarriage, "Hollow Carriage");

    FMLInterModComms.sendMessage(
        "ForgeMicroblock", "microMaterial", new ItemStack(RemIMPluginsCommon.getFrameBlock()));
    // Attempting to fix FMP crashing when trying to set creative tab
  }
  private static void setupCrafting() {
    NBTTagCompound toSend = new NBTTagCompound();
    toSend.setInteger("energy", 4000);
    toSend.setTag("input", new NBTTagCompound());
    toSend.setTag("output", new NBTTagCompound());
    ItemStack carbonDrop = Config.drops.getStackForType(DropType.CARBON);
    carbonDrop.writeToNBT(toSend.getCompoundTag("input"));
    fluidCoal.writeToNBT(toSend.getCompoundTag("output"));
    FMLInterModComms.sendMessage("ThermalExpansion", "CrucibleRecipe", toSend);

    toSend = new NBTTagCompound();
    toSend.setInteger("energy", 4000);
    toSend.setTag("input", new NBTTagCompound());
    toSend.setTag("output", new NBTTagCompound());
    ItemStack destabilizedDrop = Config.drops.getStackForType(DropType.DESTABILIZED);
    destabilizedDrop.writeToNBT(toSend.getCompoundTag("input"));
    fluidRedstone.writeToNBT(toSend.getCompoundTag("output"));
    FMLInterModComms.sendMessage("ThermalExpansion", "CrucibleRecipe", toSend);

    toSend = new NBTTagCompound();
    toSend.setInteger("energy", 4000);
    toSend.setTag("input", new NBTTagCompound());
    toSend.setTag("output", new NBTTagCompound());
    ItemStack endearingDrop = Config.drops.getStackForType(DropType.ENDEARING);
    endearingDrop.writeToNBT(toSend.getCompoundTag("input"));
    fluidEnder.writeToNBT(toSend.getCompoundTag("output"));
    FMLInterModComms.sendMessage("ThermalExpansion", "CrucibleRecipe", toSend);

    toSend = new NBTTagCompound();
    toSend.setInteger("energy", 4000);
    toSend.setTag("input", new NBTTagCompound());
    toSend.setTag("output", new NBTTagCompound());
    ItemStack luxDrop = Config.drops.getStackForType(DropType.LUX);
    luxDrop.writeToNBT(toSend.getCompoundTag("input"));
    fluidGlowstone.writeToNBT(toSend.getCompoundTag("output"));
    FMLInterModComms.sendMessage("ThermalExpansion", "CrucibleRecipe", toSend);
  }
Beispiel #11
0
  public void init(FMLInitializationEvent event) {
    NetworkRegistry.INSTANCE.registerGuiHandler(Botania.instance, new GuiHandler());

    MinecraftForge.TERRAIN_GEN_BUS.register(new BiomeDecorationHandler());
    MinecraftForge.EVENT_BUS.register(ManaNetworkHandler.instance);
    MinecraftForge.EVENT_BUS.register(new PixieHandler());
    MinecraftForge.EVENT_BUS.register(new SheddingHandler());
    MinecraftForge.EVENT_BUS.register(new SpawnerChangingHandler());
    MinecraftForge.EVENT_BUS.register(new SubTileNarslimmus.SpawnIntercepter());
    MinecraftForge.EVENT_BUS.register(TileCorporeaIndex.getInputHandler());

    FMLCommonHandler.instance().bus().register(new CommonTickHandler());

    FMLInterModComms.sendMessage(
        "ProjectE", "interdictionblacklist", EntityManaBurst.class.getCanonicalName());

    if (Botania.bcTriggersLoaded) new StatementAPIPlugin();
  }
  @SubscribeEvent
  public void onTick(TickEvent.ClientTickEvent tick) {
    if (lastWorld != FMLClientHandler.instance().getClient().theWorld
        || thePlayer != FMLClientHandler.instance().getClient().thePlayer) {
      thePlayer = FMLClientHandler.instance().getClient().thePlayer;
      if (thePlayer != null) {
        lastWorld = thePlayer.worldObj;
      } else {
        lastWorld = null;
      }
    }

    if (thePlayer != null && thePlayer.isEntityAlive() && !DynamicLights.globalLightsOff()) {
      List<IMCMessage> messages = FMLInterModComms.fetchRuntimeMessages(this);
      if (messages.size() > 0) {
        // just get the last one
        IMCMessage imcMessage = messages.get(messages.size() - 1);
        if (imcMessage.key.equalsIgnoreCase("forceplayerlighton")) {
          if (!fmlOverrideEnable) {
            fmlOverrideEnable = true;
            if (!enabled) {
              lightLevel = 15;
              enableLight();
            }
          }
        } else if (imcMessage.key.equalsIgnoreCase("forceplayerlightoff")) {
          if (fmlOverrideEnable) {
            fmlOverrideEnable = false;
            if (enabled) {
              disableLight();
            }
          }
        }
      }

      if (!fmlOverrideEnable) {
        int prevLight = lightLevel;

        ItemStack item = thePlayer.getCurrentEquippedItem();
        lightLevel = itemsMap.getLightFromItemStack(item);

        for (ItemStack armor : thePlayer.inventory.armorInventory) {
          lightLevel = DynamicLights.maxLight(lightLevel, itemsMap.getLightFromItemStack(armor));
        }

        if (prevLight != 0 && lightLevel != prevLight) {
          lightLevel = 0;
        } else {
          if (thePlayer.isBurning()) {
            lightLevel = 15;
          } else {
            if (checkPlayerWater(thePlayer)
                && item != null
                && notWaterProofItems.retrieveValue(
                        GameData.getItemRegistry().getNameForObject(item.getItem()),
                        item.getItemDamage())
                    == 1) {
              lightLevel = 0;

              for (ItemStack armor : thePlayer.inventory.armorInventory) {
                if (armor != null
                    && notWaterProofItems.retrieveValue(
                            GameData.getItemRegistry().getNameForObject(armor.getItem()),
                            item.getItemDamage())
                        == 0) {
                  lightLevel =
                      DynamicLights.maxLight(lightLevel, itemsMap.getLightFromItemStack(armor));
                }
              }
            }
          }
        }

        if (!enabled && lightLevel > 0) {
          enableLight();
        } else if (enabled && lightLevel < 1) {
          disableLight();
        }
      }
    }
  }
 public static void addBuildcraftFacade(Block block, int metadata) {
   FMLInterModComms.sendMessage(
       "BuildCraft|Transport",
       "add-facade",
       String.format("%s@%d", Block.blockRegistry.getNameForObject(block), metadata));
 }
 private void addFacade(Block b, int meta) {
   FMLInterModComms.sendMessage("BuildCraft|Transport", "add-facade", new ItemStack(b, 1, meta));
 }
  public static void init() {
    NBTTagCompound tpModCfg = new NBTTagCompound();
    NBTTagList treeList = new NBTTagList();
    NBTTagCompound tree = new NBTTagCompound();

    String nibiruLog = blockName(NibiruBlocks.nibiru_log);
    String ancientDarkLeaves = blockName(NibiruBlocks.ancient_dark_leaves);
    String orangeLeaves = blockName(NibiruBlocks.orange_leaves);

    String koentusLog = blockName(KoentusBlocks.crystal_log);
    String koentusLeaves = blockName(KoentusBlocks.crystal_leaves);

    String fronosLog = blockName(FronosBlocks.fronos_log);
    String fronosColorizedLeaves = blockName(FronosBlocks.fronos_colorized_leaves);
    String fronosLeaves = blockName(FronosBlocks.fronos_leaves);

    String quontoniumAxe = itemName(DionaToolsItems.quontonium_axe);
    String fronisiumAxe = itemName(DionaToolsItems.fronisium_axe);
    String polongniusMeteorAxe = itemName(PolongniusToolsItems.polongnius_meteoric_iron_axe);
    String palladiumAxe = itemName(PolongniusToolsItems.palladium_axe);
    String purpleCrystalAxe = itemName(PolongniusToolsItems.purple_crystal_axe);
    String redGemAxe = itemName(NibiruToolsItems.red_gem_axe);
    String noriumAxe = itemName(NibiruToolsItems.norium_axe);
    String koentusMeteorAxe = itemName(KoentusToolsItems.koentus_meteoric_iron_axe);
    String whiteCrystalAxe = itemName(KoentusToolsItems.white_crystal_axe);
    String blackDiamondAxe = itemName(FronosToolsItems.black_diamond_axe);
    String iridiumAxe = itemName(FronosToolsItems.iridium_axe);
    String candyAxe = itemName(FronosToolsItems.candy_axe);
    String frozenIronAxe = itemName(KapteynBToolsItems.frozen_iron_axe);
    String uraniumAxe = itemName(KapteynBToolsItems.uranium_axe);
    String sulfurAxe = itemName(SiriusBToolsItems.sulfur_axe);

    tpModCfg.setString("modID", "MorePlanet");
    tpModCfg.setString(
        "axeIDList",
        quontoniumAxe
            + "; "
            + fronisiumAxe
            + "; "
            + polongniusMeteorAxe
            + "; "
            + palladiumAxe
            + "; "
            + purpleCrystalAxe
            + "; "
            + redGemAxe
            + "; "
            + noriumAxe
            + "; "
            + koentusMeteorAxe
            + "; "
            + whiteCrystalAxe
            + "; "
            + blackDiamondAxe
            + "; "
            + iridiumAxe
            + "; "
            + candyAxe
            + "; "
            + frozenIronAxe
            + "; "
            + uraniumAxe
            + "; "
            + sulfurAxe);

    // Ancient Dark Tree
    tree.setString("treeName", "ancientdark");
    tree.setString("logs", String.format("%s, 0; %s, 4; %s, 8", nibiruLog, nibiruLog, nibiruLog));
    tree.setString(
        "leaves",
        String.format(
            "%s, 0; %s, 1; %s, 2; %s, 3; %s, 8; %s, 9; %s, 10; %s, 11",
            ancientDarkLeaves,
            ancientDarkLeaves,
            ancientDarkLeaves,
            ancientDarkLeaves,
            ancientDarkLeaves,
            ancientDarkLeaves,
            ancientDarkLeaves,
            ancientDarkLeaves));
    tree.setBoolean("requireLeafDecayCheck", false);
    treeList.appendTag(tree);

    // Orange Tree
    tree.setString("treeName", "orange");
    tree.setString("logs", String.format("%s, 1; %s, 5; %s, 9", nibiruLog, nibiruLog, nibiruLog));
    tree.setString(
        "leaves",
        String.format(
            "%s, 0; %s, 1; %s, 2; %s, 3; %s, 8; %s, 9; %s, 10; %s, 11",
            orangeLeaves,
            orangeLeaves,
            orangeLeaves,
            orangeLeaves,
            orangeLeaves,
            orangeLeaves,
            orangeLeaves,
            orangeLeaves));
    tree.setBoolean("requireLeafDecayCheck", false);
    treeList.appendTag(tree);

    // Coconut Tree
    tree.setString("treeName", "coconut");
    tree.setString("logs", String.format("%s, 0; %s, 4; %s, 8", fronosLog, fronosLog, fronosLog));
    tree.setString(
        "leaves", String.format("%s, 0; %s, 8", fronosColorizedLeaves, fronosColorizedLeaves));
    tree.setBoolean("requireLeafDecayCheck", false);
    treeList.appendTag(tree);

    // Red Maple Tree
    tree.setString("treeName", "redmaple");
    tree.setString("logs", String.format("%s, 1; %s, 5; %s, 9", fronosLog, fronosLog, fronosLog));
    tree.setString("leaves", String.format("%s, 0; %s, 8", fronosLeaves, fronosLeaves));
    tree.setBoolean("requireLeafDecayCheck", false);
    treeList.appendTag(tree);

    // Yellow Maple Tree
    tree.setString("treeName", "yellowmaple");
    tree.setString("logs", String.format("%s, 1; %s, 5; %s, 9", fronosLog, fronosLog, fronosLog));
    tree.setString("leaves", String.format("%s, 1; %s, 9", fronosLeaves, fronosLeaves));
    tree.setBoolean("requireLeafDecayCheck", false);
    treeList.appendTag(tree);

    // Purple Maple Tree
    tree.setString("treeName", "purplemaple");
    tree.setString("logs", String.format("%s, 1; %s, 5; %s, 9", fronosLog, fronosLog, fronosLog));
    tree.setString("leaves", String.format("%s, 2; %s, 10", fronosLeaves, fronosLeaves));
    tree.setBoolean("requireLeafDecayCheck", false);
    treeList.appendTag(tree);

    // Crystal Tree
    tree.setString("treeName", "crystal");
    tree.setString(
        "logs", String.format("%s, 0; %s, 4; %s, 8", koentusLog, koentusLog, koentusLog));
    tree.setString("leaves", String.format("%s, 0; %s, 8", koentusLeaves, koentusLeaves));
    tree.setBoolean("requireLeafDecayCheck", false);
    treeList.appendTag(tree);

    FMLInterModComms.sendMessage("TreeCapitator", "ThirdPartyModConfig", tpModCfg);
    FMLInterModComms.sendMessage("Treecapitator", "ThirdPartyModConfig", tpModCfg);
  }
 protected static void sendInterModMessage(String to, String type, NBTTagCompound message) {
   FMLInterModComms.sendMessage(to, type, message);
 }
Beispiel #17
0
 @Override
 public void init() {
   TSLogger.info("Waila detected. Registering TSteelworks with Waila registry.");
   FMLInterModComms.sendMessage(
       "Waila", "register", "tsteelworks.plugins.waila.WailaRegistrar.wailaCallback");
 }
 public static void registerMFRSeed(Item item) {
   NBTTagCompound compound = new NBTTagCompound();
   compound.setString("seed", Item.itemRegistry.getNameForObject(item));
   compound.setString("crop", Block.blockRegistry.getNameForObject(((ItemSeed) item).plant));
   FMLInterModComms.sendMessage("MineFactoryReloaded", "registerPlantable_Crop", compound);
 }
 public static void addVersionCheck() {
   FMLInterModComms.sendRuntimeMessage(
       R.mod.ID, NAME, ADD_VERSION_CHECK, Strings.url.VERSION_CHECKER);
 }