Example #1
0
 public static ItemStack getRecipeElement(String s, int amount, int damage) {
   if (s.equals("doorIron")) {
     return new ItemStack(Item.doorIron, amount);
   }
   if (s.equals("doorWood")) {
     return new ItemStack(Item.doorWood, amount);
   }
   if (s.equals("clayItem")) {
     return new ItemStack(Item.clay, amount);
   }
   for (Item item : Item.itemsList) {
     if (item != null
         && item.getUnlocalizedName() != null
         && (item.getUnlocalizedName().equals("item." + s)
             || item.getUnlocalizedName().equals("tile." + s))) {
       return new ItemStack(item, amount, damage);
     }
   }
   for (InfoType type : infoTypes) {
     if (type.shortName.equals(s)) return new ItemStack(type.item, amount, damage);
   }
   if (s.equals("gunpowder")) {
     return new ItemStack(Item.gunpowder, amount);
   }
   if (s.equals("iron")) {
     return new ItemStack(Item.ingotIron, amount);
   }
   FlansMod.log("Could not find " + s + " when adding recipe");
   return null;
 }
Example #2
0
  @SubscribeEvent
  public void onPlayerOpenContainer(PlayerOpenContainerEvent event) {
    if (event.entityPlayer instanceof EntityPlayerMP) {
      if (event.entityPlayer.openContainer instanceof net.minecraft.inventory.ContainerWorkbench
          && event.entityPlayer.openContainer.inventoryItemStacks.get(0) != null) {
        EntityPlayerMP playerMP = (EntityPlayerMP) event.entityPlayer;
        PlayerData player = PlayerStore.getInstance().getPlayer(playerMP.getUniqueID().toString());
        Item item =
            (Item)
                ((ItemStack) event.entityPlayer.openContainer.inventoryItemStacks.get(0)).getItem();
        ArrayList<ItemPerk> entitylist = PerkStore.getPerksForItem(item.getUnlocalizedName());
        boolean requiresPerk = false;
        if (entitylist != null) {
          requiresPerk = true;
        }
        for (ItemSkill skill : SkillStore.getInstance().getItemSkill()) {
          ArrayList<ItemXP> temp = skill.getExp();
          for (int i = 0; i < temp.size(); i++) {
            Item compareItem = ((ItemXP) temp.get(i)).getItem();
            if (item.equals(compareItem)) {
              if (requiresPerk) {
                if (PlayerHandler.hasPerk(player, entitylist)) {

                } else {
                  PlayerHandler.taskFail((EntityPlayer) playerMP);
                  event.entityPlayer.closeScreen();
                  break;
                }
              }
            }
          }
        }
      }
    }
  }
  @SideOnly(Side.CLIENT)
  private static Pair<String, KnowledgeObject<?>> getObject(char type, String identifier) {
    KnowledgeObject<?> obj = null;
    String text = null;

    boolean isHEE = identifier.charAt(0) == '~' && identifier.length() > 1;
    if (isHEE) identifier = identifier.substring(1);

    switch (type) {
      case 'b':
      case 'i':
        int metaIndex = identifier.indexOf('/'), meta = 0;

        if (metaIndex != -1 && metaIndex + 1 < identifier.length()) {
          meta = DragonUtil.tryParse(identifier.substring(metaIndex + 1), 0);
          identifier = identifier.substring(0, metaIndex);
        }

        Item item =
            GameRegistry.findItem(isHEE ? "HardcoreEnderExpansion" : "minecraft", identifier);

        if (item != null) {
          text =
              StatCollector.translateToLocal(
                  item.getUnlocalizedName(new ItemStack(item, 1, meta)) + ".name");
          obj =
              KnowledgeObject.fromObject(
                  type == 'b'
                      ? (item instanceof ItemBlock
                          ? new BlockInfo(((ItemBlock) item).field_150939_a, meta)
                          : null)
                      : item);
        }

        break;

      case 'e':
        if (isHEE)
          text =
              ItemSpawnEggs.getMobName(
                  (Class<?>)
                      EntityList.stringToClassMapping.get(
                          identifier = ("HardcoreEnderExpansion." + identifier)));
        else text = StatCollector.translateToLocal("entity." + identifier + ".name");

        Class<?> cls = (Class<?>) EntityList.stringToClassMapping.get(identifier);
        if (cls != null) obj = KnowledgeObject.fromObject(cls);
        break;

      case 'd':
        obj = KnowledgeObject.fromObject(identifier);
        if (obj != null) text = obj.getTranslatedTooltip();
        break;
    }

    if (text == null || obj == null) {
      Log.warn("Invalid object type or identifier: $0:$1", type, identifier);
      return Pair.<String, KnowledgeObject<?>>of(text == null ? identifier : text, obj);
    } else return Pair.<String, KnowledgeObject<?>>of(text, obj);
  }
  /**
   * Registeres a piece (called by code or config)
   *
   * @param piece the item to list
   * @param weight the weight of the piece (Kg)
   * @param bulk the bulk of the piece
   * @param alterSpeed if the armour's weight slows you down
   */
  public static void registerItem(Item piece, float efficiency) {
    int id = Item.getIdFromItem(piece);

    MineFantasyAPI.debugMsg(
        "Added Custom hoe: " + piece.getUnlocalizedName() + " Efficiency = " + efficiency);
    entries.put(id, new CustomHoeEntry(id, efficiency));
  }
 private static String upgradeItemId(String id) {
   Matcher match = oldNamePattern.matcher(id);
   if (!match.matches()) return null;
   id = match.group(1);
   for (Item item : GameData.getItemRegistry().typeSafeIterable())
     if (id.equals(item.getUnlocalizedName()))
       return GameData.getItemRegistry().getNameForObject(item).replace(':', '.') + match.group(2);
   return null;
 }
 private void addLoot(LootPool pool, Item item, int weight) {
   pool.addEntry(
       new LootEntryItem(
           item,
           weight,
           0,
           new LootFunction[0],
           new LootCondition[0],
           Reference.MOD_ID + item.getUnlocalizedName()));
 }
Example #7
0
 public static void reg(Item item) {
   Minecraft.getMinecraft()
       .getRenderItem()
       .getItemModelMesher()
       .register(
           item,
           0,
           new ModelResourceLocation(
               modid + ":" + item.getUnlocalizedName().substring(5), "inventory"));
 }
Example #8
0
 public static void registerRender(Block block) {
   Item item = Item.getItemFromBlock(block);
   Minecraft.getMinecraft()
       .getRenderItem()
       .getItemModelMesher()
       .register(
           item,
           0,
           new ModelResourceLocation(
               strings.MOD_ID + ":" + item.getUnlocalizedName().substring(5), "inventory"));
 }
Example #9
0
 /**
  * Adds a mapping for an ItemArmor to a ModelBase for rendering
  *
  * @param armor The armor Item
  * @param model The model should not be null and must extend ModelBiped
  */
 private void addArmorModel(Item armor, ModelBiped model) {
   if (model == null) {
     // technically, you CAN add a null model, but the default is already to return null, so it
     // would be redundant
     ArmorTutorial.logger.log(
         Level.WARNING,
         String.format(
             "Error adding model for %s: Cannot add a NULL armor model!",
             armor.getUnlocalizedName()));
     return;
   }
   // better let yourself / users know when overwriting an entry, as it is likely to be a mistake!
   if (armorModels.containsKey(armor)) {
     ArmorTutorial.logger.log(
         Level.WARNING,
         String.format(
             "A model for %s has already been registered! It will now be overwritten.",
             armor.getUnlocalizedName()));
   }
   armorModels.put(armor, model);
 }
  private static Item createItem(
      int defaultID,
      Class<? extends ABOItem> clazz,
      String descr,
      Object ingredient1,
      Object ingredient2,
      Object ingredient3) {
    String name =
        Character.toLowerCase(clazz.getSimpleName().charAt(0)) + clazz.getSimpleName().substring(1);

    Property prop = aboConfiguration.getItem(name + ".id", defaultID);

    int id = prop.getInt(defaultID);

    while (id < Item.itemsList.length && Item.itemsList[id] != null) id++;

    if (id >= Item.itemsList.length) {
      aboLog.log(
          Level.SEVERE, "Cannot find free ID for Item + " + name + " starting from " + defaultID);
      return null;
    }

    prop.set(id);

    Item item = null;
    try {
      item = clazz.getConstructor(int.class).newInstance(id);
    } catch (Throwable t) {
      t.printStackTrace();
    }

    if (item == null) return item;

    item.setUnlocalizedName(clazz.getSimpleName());
    GameRegistry.registerItem(item, item.getUnlocalizedName().replace("item.", ""));
    LanguageRegistry.addName(item, descr);

    addReceipe(item, 1, ingredient1, ingredient2, ingredient3);

    return item;
  }
Example #11
0
 @SubscribeEvent // Assumed that crafting wasn't blocked
 public void onItemCraftedEvent(ItemCraftedEvent event) {
   if (event.player instanceof EntityPlayerMP) {
     EntityPlayerMP playerMP = (EntityPlayerMP) event.player;
     PlayerData player = PlayerStore.getInstance().getPlayer(playerMP.getUniqueID().toString());
     Item item =
         (Item) ((ItemStack) event.player.openContainer.inventoryItemStacks.get(0)).getItem();
     ArrayList<ItemPerk> entitylist = PerkStore.getPerksForItem(item.getUnlocalizedName());
     boolean requiresPerk = false;
     if (entitylist != null) {
       requiresPerk = true;
     }
     for (ItemSkill skill : SkillStore.getInstance().getItemSkill()) {
       ArrayList<ItemXP> temp = skill.getExp();
       for (int i = 0; i < temp.size(); i++) {
         Item compareItem = ((ItemXP) temp.get(i)).getItem();
         if (item.equals(compareItem)) {
           if (requiresPerk) {
             if (PlayerHandler.hasPerk(player, entitylist)) {
               //    								if (event.entity.isDead){
               PlayerHandler.awardXP(player, skill.name, temp.get(i).getXp(), playerMP);
               //    								}
             }
             //    							else
             //    							{
             //    								PlayerHandler.taskFail((EntityPlayer) playerMP);
             //    								event.player.closeScreen();
             //    							}
           } else {
             //    							if (event.entity.isDead){
             PlayerHandler.awardXP(player, skill.name, temp.get(i).getXp(), playerMP);
             //    							}
           }
         }
       }
     }
   }
 }
 public void registerItem(Item item) {
   GameRegistry.registerItem(item, item.getUnlocalizedName().replace("item.", ""));
 }
Example #13
0
 public String getUnlocName(Item me) {
   return this == BASIC ? me.getUnlocalizedName() : me.getUnlocalizedName() + ".hardened";
 }
Example #14
0
 public static void register() {
   GameRegistry.registerItem(titanium_ingot, titanium_ingot.getUnlocalizedName().substring(5));
 }
Example #15
0
  @Override
  public boolean onBlockActivated(
      World world,
      int x,
      int y,
      int z,
      EntityPlayer entityplayer,
      int facing,
      float playerX,
      float playerY,
      float playerZ) {
    if (ItemAttacher.canAttach(entityplayer.getCurrentEquippedItem())) {
      return false;
    }

    if (world.isRemote) {
      return true;
    }

    TileEntityGasTank tileEntity = (TileEntityGasTank) world.getTileEntity(x, y, z);
    int metadata = world.getBlockMetadata(x, y, z);

    if (entityplayer.getCurrentEquippedItem() != null) {
      Item tool = entityplayer.getCurrentEquippedItem().getItem();

      if (ModAPIManager.INSTANCE.hasAPI("BuildCraftAPI|tools")
          && tool instanceof IToolWrench
          && !tool.getUnlocalizedName().contains("omniwrench")) {
        if (((IToolWrench) tool).canWrench(entityplayer, x, y, z)) {
          if (entityplayer.isSneaking()) {
            dismantleBlock(world, x, y, z, false);
            return true;
          }

          ((IToolWrench) tool).wrenchUsed(entityplayer, x, y, z);

          int change = 0;

          switch (tileEntity.facing) {
            case 3:
              change = 5;
              break;
            case 5:
              change = 2;
              break;
            case 2:
              change = 4;
              break;
            case 4:
              change = 3;
              break;
          }

          tileEntity.setFacing((short) change);
          world.notifyBlocksOfNeighborChange(x, y, z, this);
          return true;
        }
      }
    }

    if (tileEntity != null) {
      if (!entityplayer.isSneaking()) {
        entityplayer.openGui(Mekanism.instance, 10, world, x, y, z);
        return true;
      }
    }
    return false;
  }
Example #16
0
  private static void registerItems() throws ExistingSubstitutionException {
    if (DecorationsMod.isGemsEnabled) {
      GameRegistry.addSubstitutionAlias(
          "terrafirmacraft:" + TFCItems.gemRuby.getUnlocalizedName(),
          GameRegistry.Type.ITEM,
          TFCItems.gemRuby);
      GameRegistry.addSubstitutionAlias(
          "terrafirmacraft:" + TFCItems.gemSapphire.getUnlocalizedName(),
          GameRegistry.Type.ITEM,
          TFCItems.gemSapphire);
      GameRegistry.addSubstitutionAlias(
          "terrafirmacraft:" + TFCItems.gemEmerald.getUnlocalizedName(),
          GameRegistry.Type.ITEM,
          TFCItems.gemEmerald);
      GameRegistry.addSubstitutionAlias(
          "terrafirmacraft:" + TFCItems.gemTopaz.getUnlocalizedName(),
          GameRegistry.Type.ITEM,
          TFCItems.gemTopaz);
      GameRegistry.addSubstitutionAlias(
          "terrafirmacraft:" + TFCItems.gemTourmaline.getUnlocalizedName(),
          GameRegistry.Type.ITEM,
          TFCItems.gemTourmaline);
      GameRegistry.addSubstitutionAlias(
          "terrafirmacraft:" + TFCItems.gemJade.getUnlocalizedName(),
          GameRegistry.Type.ITEM,
          TFCItems.gemJade);
      GameRegistry.addSubstitutionAlias(
          "terrafirmacraft:" + TFCItems.gemBeryl.getUnlocalizedName(),
          GameRegistry.Type.ITEM,
          TFCItems.gemBeryl);
      GameRegistry.addSubstitutionAlias(
          "terrafirmacraft:" + TFCItems.gemAgate.getUnlocalizedName(),
          GameRegistry.Type.ITEM,
          TFCItems.gemAgate);
      GameRegistry.addSubstitutionAlias(
          "terrafirmacraft:" + TFCItems.gemOpal.getUnlocalizedName(),
          GameRegistry.Type.ITEM,
          TFCItems.gemOpal);
      GameRegistry.addSubstitutionAlias(
          "terrafirmacraft:" + TFCItems.gemGarnet.getUnlocalizedName(),
          GameRegistry.Type.ITEM,
          TFCItems.gemGarnet);
      GameRegistry.addSubstitutionAlias(
          "terrafirmacraft:" + TFCItems.gemJasper.getUnlocalizedName(),
          GameRegistry.Type.ITEM,
          TFCItems.gemJasper);
      GameRegistry.addSubstitutionAlias(
          "terrafirmacraft:" + TFCItems.gemAmethyst.getUnlocalizedName(),
          GameRegistry.Type.ITEM,
          TFCItems.gemAmethyst);
      GameRegistry.addSubstitutionAlias(
          "terrafirmacraft:" + TFCItems.gemDiamond.getUnlocalizedName(),
          GameRegistry.Type.ITEM,
          TFCItems.gemDiamond);
    }

    if (DecorationsMod.isLanternsEnabled) {
      for (int i = 0; i < LanternCores.length; i++) {
        Item lanternCore = LanternCores[i];

        GameRegistry.registerItem(lanternCore, lanternCore.getUnlocalizedName());
      }
    }

    GameRegistry.registerItem(Powder, Powder.getUnlocalizedName());
    GameRegistry.registerItem(Plaster, Plaster.getUnlocalizedName());
    GameRegistry.registerItem(LiquidDye, LiquidDye.getUnlocalizedName());
    GameRegistry.registerItem(Brush, Brush.getUnlocalizedName());
  }
Example #17
0
  @SuppressWarnings("unused")
  public static final void init() {

    /*
     *
     * Debug Parameters area
     *
     */

    // Logs
    if (!DEBUG) {
      FMLLog.info("Development mode not enabled.");
    } else if (DEBUG) {
      FMLLog.info("Development mode enabled.");
    } else {
      FMLLog.info("Development mode not set.");
    }

    /*
     * End Debug
     */

    // Blood Steel Equipment

    // Item Init
    tutPickaxe =
        new BloodSteelPickaxe(tutMaterial)
            .setUnlocalizedName("BloodSteelPickaxe")
            .setCreativeTab(TMCreativeTabs.tabTools)
            .setTextureName(Strings.MODID + ":BloodSteelPickaxe");
    tutAxe =
        new BloodSteelAxe(tutMaterial)
            .setUnlocalizedName("BloodSteelAxe")
            .setCreativeTab(TMCreativeTabs.tabTools)
            .setTextureName(Strings.MODID + ":BloodSteelAxe");
    tutSword =
        new BloodSteelSword(tutMaterial)
            .setUnlocalizedName("BloodSteelSword")
            .setCreativeTab(TMCreativeTabs.tabCombat)
            .setTextureName(Strings.MODID + ":BloodSteelSword");
    tutHoe =
        new BloodSteelHoe(tutMaterial)
            .setUnlocalizedName("BloodSteelHoe")
            .setCreativeTab(TMCreativeTabs.tabTools)
            .setTextureName(Strings.MODID + ":BloodSteelHoe");
    tutSpade =
        new BloodSteelSpade(tutMaterial)
            .setUnlocalizedName("BloodSteelSpade")
            .setCreativeTab(TMCreativeTabs.tabTools)
            .setTextureName(Strings.MODID + ":BloodSteelSpade");
    tutHelmet =
        new BloodSteelArmor(tutArmorMaterial, MiscUtils.proxy.addArmor("BloodSteelArmor"), 0)
            .setUnlocalizedName("BloodSteelHelmet")
            .setCreativeTab(TMCreativeTabs.tabCombat)
            .setTextureName(Strings.MODID + ":BloodSteelHelmet");
    tutPlate =
        new BloodSteelArmor(tutArmorMaterial, MiscUtils.proxy.addArmor("BloodSteelArmor"), 1)
            .setUnlocalizedName("BloodSteelPlate")
            .setCreativeTab(TMCreativeTabs.tabCombat)
            .setTextureName(Strings.MODID + ":BloodSteelPlate");
    tutPants =
        new BloodSteelArmor(tutArmorMaterial, MiscUtils.proxy.addArmor("BloodSteelArmor"), 2)
            .setUnlocalizedName("BloodSteelPants")
            .setCreativeTab(TMCreativeTabs.tabCombat)
            .setTextureName(Strings.MODID + ":BloodSteelPants");
    tutBoots =
        new BloodSteelArmor(tutArmorMaterial, MiscUtils.proxy.addArmor("BloodSteelArmor"), 3)
            .setUnlocalizedName("BloodSteelBoots")
            .setCreativeTab(TMCreativeTabs.tabCombat)
            .setTextureName(Strings.MODID + ":BloodSteelBoots");

    // Registry
    GameRegistry.registerItem(tutPickaxe, tutPickaxe.getUnlocalizedName());
    GameRegistry.registerItem(tutAxe, tutAxe.getUnlocalizedName());
    GameRegistry.registerItem(tutSword, tutSword.getUnlocalizedName());
    GameRegistry.registerItem(tutHoe, tutHoe.getUnlocalizedName());
    GameRegistry.registerItem(tutSpade, tutSpade.getUnlocalizedName());
    GameRegistry.registerItem(tutHelmet, tutHelmet.getUnlocalizedName());
    GameRegistry.registerItem(tutPlate, tutPlate.getUnlocalizedName());
    GameRegistry.registerItem(tutPants, tutPants.getUnlocalizedName());
    GameRegistry.registerItem(tutBoots, tutBoots.getUnlocalizedName());

    // EnderIO Resources
    if (Loader.isModLoaded("EnderIO") == true || DEBUG) {
      FMLLog.info("EnderIO Found - Loading Resources");
      // Item Init
      itemPlateSoularium =
          new Item()
              .setUnlocalizedName("itemPlateSoularium")
              .setCreativeTab(TMCreativeTabs.tabMisc)
              .setTextureName(Strings.MODID + ":itemPlateSoularium");
      ;
      itemPlateRedstoneAlloy =
          new Item()
              .setUnlocalizedName("itemPlateRedstoneAlloy")
              .setCreativeTab(TMCreativeTabs.tabMisc)
              .setTextureName(Strings.MODID + ":itemPlateRedstoneAlloy");
      ;
      itemPlateElectricalSteel =
          new Item()
              .setUnlocalizedName("itemPlateElectricalSteel")
              .setCreativeTab(TMCreativeTabs.tabMisc)
              .setTextureName(Strings.MODID + ":itemPlateElectricalSteel");
      ;
      itemPlatePulsatingIron =
          new Item()
              .setUnlocalizedName("itemPlatePulsatingIron")
              .setCreativeTab(TMCreativeTabs.tabMisc)
              .setTextureName(Strings.MODID + ":itemPlatePulsatingIron");
      ;
      itemPlateEnergeticAlloy =
          new Item()
              .setUnlocalizedName("itemPlateEnergeticAlloy")
              .setCreativeTab(TMCreativeTabs.tabMisc)
              .setTextureName(Strings.MODID + ":itemPlateEnergeticAlloy");
      ;
      itemPlateVibrantAlloy =
          new Item()
              .setUnlocalizedName("itemPlateVibrantAlloy")
              .setCreativeTab(TMCreativeTabs.tabMisc)
              .setTextureName(Strings.MODID + ":itemPlateVibrantAlloy");
      ;
      itemPlateConductiveIron =
          new Item()
              .setUnlocalizedName("itemPlateConductiveIron")
              .setCreativeTab(TMCreativeTabs.tabMisc)
              .setTextureName(Strings.MODID + ":itemPlateConductiveIron");
      ;
      itemPlateDarkSteel =
          new Item()
              .setUnlocalizedName("itemPlateDarkSteel")
              .setCreativeTab(TMCreativeTabs.tabMisc)
              .setTextureName(Strings.MODID + ":itemPlateDarkSteel");
      ;

      // Registry
      GameRegistry.registerItem(itemPlateSoularium, "itemPlateSoularium");
      GameRegistry.registerItem(itemPlateRedstoneAlloy, "itemPlateRedstoneAlloy");
      GameRegistry.registerItem(itemPlateElectricalSteel, "itemPlateElectricalSteel");
      GameRegistry.registerItem(itemPlatePulsatingIron, "itemPlatePulsatingIron");
      GameRegistry.registerItem(itemPlateEnergeticAlloy, "itemPlateEnergeticAlloy");
      GameRegistry.registerItem(itemPlateVibrantAlloy, "itemPlateVibrantAlloy");
      GameRegistry.registerItem(itemPlateConductiveIron, "itemPlateConductiveIron");
      GameRegistry.registerItem(itemPlateDarkSteel, "itemPlateDarkSteel");
    } else {
      FMLLog.info("EnderIO not Found - Skipping Resources");
    }

    // Big Reactors
    if (Loader.isModLoaded("BigReactors") == true || DEBUG) {
      FMLLog.info("BigReactors Found - Loading Resources");
      // Item Init
      itemPlateBlutonium =
          new Item()
              .setUnlocalizedName("itemPlateBlutonium")
              .setCreativeTab(TMCreativeTabs.tabMisc)
              .setTextureName(Strings.MODID + ":itemPlateBlutonium");
      ;
      itemPlateCyanite =
          new Item()
              .setUnlocalizedName("itemPlateCyanite")
              .setCreativeTab(TMCreativeTabs.tabMisc)
              .setTextureName(Strings.MODID + ":itemPlateCyanite");
      ;
      itemPlateLudicrite =
          new Item()
              .setUnlocalizedName("itemPlateLudicrite")
              .setCreativeTab(TMCreativeTabs.tabMisc)
              .setTextureName(Strings.MODID + ":itemPlateLudicrite");
      ;

      // Registry
      GameRegistry.registerItem(itemPlateBlutonium, "itemPlateBlutonium");
      GameRegistry.registerItem(itemPlateCyanite, "itemPlateCyanite");
      GameRegistry.registerItem(itemPlateLudicrite, "itemPlateLudicrite");

    } else {
      FMLLog.info("BigReactors not Found - Skipping Resources");
    }

    // Thaumcraft
    if (Loader.isModLoaded("Thaumcraft") == true || DEBUG) {
      FMLLog.info("Thaumcraft Found - Loading Resources");
      // Item Init
      itemPlateVoidMetal =
          new Item()
              .setUnlocalizedName("itemPlateVoidMetal")
              .setCreativeTab(TMCreativeTabs.tabMisc)
              .setTextureName(Strings.MODID + ":itemPlateVoidMetal");
      ;

      // Registry
      GameRegistry.registerItem(itemPlateVoidMetal, "itemPlateVoidMetal");

    } else {
      FMLLog.info("Thaumcraft not Found - Skipping Resources");
    }

    // ExtraUtils
    if (Loader.isModLoaded("ExtraUtilities") == true || DEBUG) {
      FMLLog.info("ExtraUtils Found - Loading Resources");
      // Item Init
      itemPlateBedrockium =
          new Item()
              .setUnlocalizedName("itemPlateBedrockium")
              .setCreativeTab(TMCreativeTabs.tabMisc)
              .setTextureName(Strings.MODID + ":itemPlateBedrockium");
      ;

      // Registry
      GameRegistry.registerItem(itemPlateBedrockium, "itemPlateBedrockium");

    } else {
      FMLLog.info("ExtraUtils not Found - Skipping Resources");
    }

    // Pneumaticraft
    if (Loader.isModLoaded("PneumaticCraft") == true || DEBUG) {
      FMLLog.info("Pneumaticraft Found - Loading Resources");
      // Item Init
      itemPlateCompressedIron =
          new Item()
              .setUnlocalizedName("itemPlateCompressedIron")
              .setCreativeTab(TMCreativeTabs.tabMisc)
              .setTextureName(Strings.MODID + ":itemPlateCompressedIron");
      ;

      // Registry
      GameRegistry.registerItem(itemPlateCompressedIron, "itemPlateCompressedIron");

    } else {
      FMLLog.info("Pneumaticraft not Found - Skipping Resources");
    }

    // Simply Jetpacks
    if (Loader.isModLoaded("simplyjetpacks") == true || DEBUG) {
      FMLLog.info("SimplyJetpacks Found - Loading Resources");
      // Item Init
      itemPlateEnrichedSoularium =
          new RarityUncommon()
              .setUnlocalizedName("itemPlateEnrichedSoularium")
              .setCreativeTab(TMCreativeTabs.tabMisc)
              .setTextureName(Strings.MODID + ":itemPlateSoularium");
      ;

      // Registry
      GameRegistry.registerItem(itemPlateEnrichedSoularium, "itemPlateEnrichedSoularium");

    } else {
      FMLLog.info("SimplyJetpacks not Found - Skipping Resources");
    }

    // rfTools
    if (Loader.isModLoaded("rftools") == true || DEBUG) {
      FMLLog.info("rfTools Found - Loading Resources");
      // Item Init
      itemPlateDimensionShard =
          new Item()
              .setUnlocalizedName("itemPlateDimensionShard")
              .setCreativeTab(TMCreativeTabs.tabMisc)
              .setTextureName(Strings.MODID + ":itemPlateDimensionShard");
      ;

      // Registry
      GameRegistry.registerItem(itemPlateDimensionShard, "itemPlateDimensionShard");

    } else {
      FMLLog.info("rfTools not Found - Skipping Resources");
    }

    /*
     * Misc Items
     */

    // Blood Steel Ingot
    itemIngotBloodSteel =
        new Item()
            .setUnlocalizedName("itemIngotBloodSteel")
            .setCreativeTab(TMCreativeTabs.tabMisc)
            .setTextureName(Strings.MODID + ":itemIngotBloodSteel");
    ;
    GameRegistry.registerItem(itemIngotBloodSteel, "itemIngotBloodSteel");
    // Blood Steel Ingot
    itemPlateBloodSteel =
        new Item()
            .setUnlocalizedName("itemPlateBloodSteel")
            .setCreativeTab(TMCreativeTabs.tabMisc)
            .setTextureName(Strings.MODID + ":itemPlateBloodSteel");
    ;
    GameRegistry.registerItem(itemPlateBloodSteel, "itemPlateBloodSteel");
  }
Example #18
0
  public static void register() {
    // Blocks without ItemBlock
    GameRegistry.registerBlock(confuseTorch, "interdiction_torch");
    GameRegistry.registerBlock(condenserMk2, "condenser_mk2");
    GameRegistry.registerBlock(rmFurnaceOn, "rm_furnace_lit");
    GameRegistry.registerBlock(dmFurnaceOn, "dm_furnace_lit");
    GameRegistry.registerBlock(dmPedestal, "dm_pedestal");
    GameRegistry.registerBlock(novaCatalyst, "nova_catalyst");
    GameRegistry.registerBlock(novaCataclysm, "nova_cataclysm");

    // Blocks with ItemBlock
    GameRegistry.registerBlock(alchChest, ItemAlchemyChestBlock.class, "alchemical_chest");
    GameRegistry.registerBlock(transmuteStone, ItemTransmutationBlock.class, "transmutation_table");
    GameRegistry.registerBlock(condenser, ItemCondenserBlock.class, "condenser_mk1");
    GameRegistry.registerBlock(rmFurnaceOff, ItemRMFurnaceBlock.class, "rm_furnace");
    GameRegistry.registerBlock(dmFurnaceOff, ItemDMFurnaceBlock.class, "dm_furnace");
    GameRegistry.registerBlock(matterBlock, ItemMatterBlock.class, "matter_block");
    GameRegistry.registerBlock(fuelBlock, ItemFuelBlock.class, "fuel_block");
    GameRegistry.registerBlock(energyCollector, ItemCollectorBlock.class, "collector_mk1");
    GameRegistry.registerBlock(collectorMK2, ItemCollectorBlock.class, "collector_mk2");
    GameRegistry.registerBlock(collectorMK3, ItemCollectorBlock.class, "collector_mk3");
    GameRegistry.registerBlock(relay, ItemRelayBlock.class, "relay_mk1");
    GameRegistry.registerBlock(relayMK2, ItemRelayBlock.class, "relay_mk2");
    GameRegistry.registerBlock(relayMK3, ItemRelayBlock.class, "relay_mk3");

    // Items
    GameRegistry.registerItem(philosStone, philosStone.getUnlocalizedName());
    GameRegistry.registerItem(alchBag, alchBag.getUnlocalizedName());
    GameRegistry.registerItem(repairTalisman, repairTalisman.getUnlocalizedName());
    GameRegistry.registerItem(kleinStars, kleinStars.getUnlocalizedName());
    GameRegistry.registerItem(fuels, fuels.getUnlocalizedName());
    GameRegistry.registerItem(covalence, covalence.getUnlocalizedName());
    GameRegistry.registerItem(matter, matter.getUnlocalizedName());

    GameRegistry.registerItem(dmPick, dmPick.getUnlocalizedName());
    GameRegistry.registerItem(dmAxe, dmAxe.getUnlocalizedName());
    GameRegistry.registerItem(dmShovel, dmShovel.getUnlocalizedName());
    GameRegistry.registerItem(dmSword, dmSword.getUnlocalizedName());
    GameRegistry.registerItem(dmHoe, dmHoe.getUnlocalizedName());
    GameRegistry.registerItem(dmShears, dmShears.getUnlocalizedName());
    GameRegistry.registerItem(dmHammer, dmHammer.getUnlocalizedName());

    GameRegistry.registerItem(rmPick, rmPick.getUnlocalizedName());
    GameRegistry.registerItem(rmAxe, rmAxe.getUnlocalizedName());
    GameRegistry.registerItem(rmShovel, rmShovel.getUnlocalizedName());
    GameRegistry.registerItem(rmSword, rmSword.getUnlocalizedName());
    GameRegistry.registerItem(rmHoe, rmHoe.getUnlocalizedName());
    GameRegistry.registerItem(rmShears, rmShears.getUnlocalizedName());
    GameRegistry.registerItem(rmHammer, rmHammer.getUnlocalizedName());
    GameRegistry.registerItem(rmKatar, rmKatar.getUnlocalizedName());
    GameRegistry.registerItem(rmStar, rmStar.getUnlocalizedName());

    GameRegistry.registerItem(dmHelmet, dmHelmet.getUnlocalizedName());
    GameRegistry.registerItem(dmChest, dmChest.getUnlocalizedName());
    GameRegistry.registerItem(dmLegs, dmLegs.getUnlocalizedName());
    GameRegistry.registerItem(dmFeet, dmFeet.getUnlocalizedName());

    GameRegistry.registerItem(rmHelmet, rmHelmet.getUnlocalizedName());
    GameRegistry.registerItem(rmChest, rmChest.getUnlocalizedName());
    GameRegistry.registerItem(rmLegs, rmLegs.getUnlocalizedName());
    GameRegistry.registerItem(rmFeet, rmFeet.getUnlocalizedName());

    GameRegistry.registerItem(gemHelmet, gemHelmet.getUnlocalizedName());
    GameRegistry.registerItem(gemChest, gemChest.getUnlocalizedName());
    GameRegistry.registerItem(gemLegs, gemLegs.getUnlocalizedName());
    GameRegistry.registerItem(gemFeet, gemFeet.getUnlocalizedName());

    GameRegistry.registerItem(ironBand, ironBand.getUnlocalizedName());
    GameRegistry.registerItem(blackHole, blackHole.getUnlocalizedName());
    GameRegistry.registerItem(angelSmite, angelSmite.getUnlocalizedName());
    GameRegistry.registerItem(harvestGod, harvestGod.getUnlocalizedName());
    GameRegistry.registerItem(ignition, ignition.getUnlocalizedName());
    GameRegistry.registerItem(zero, zero.getUnlocalizedName());
    GameRegistry.registerItem(swrg, swrg.getUnlocalizedName());
    GameRegistry.registerItem(timeWatch, timeWatch.getUnlocalizedName());
    GameRegistry.registerItem(eternalDensity, eternalDensity.getUnlocalizedName());
    GameRegistry.registerItem(dRod1, dRod1.getUnlocalizedName());
    GameRegistry.registerItem(dRod2, dRod2.getUnlocalizedName());
    GameRegistry.registerItem(dRod3, dRod3.getUnlocalizedName());
    GameRegistry.registerItem(mercEye, mercEye.getUnlocalizedName());
    GameRegistry.registerItem(voidRing, voidRing.getUnlocalizedName());
    GameRegistry.registerItem(arcana, arcana.getUnlocalizedName());

    GameRegistry.registerItem(bodyStone, bodyStone.getUnlocalizedName());
    GameRegistry.registerItem(soulStone, soulStone.getUnlocalizedName());
    GameRegistry.registerItem(mindStone, mindStone.getUnlocalizedName());
    GameRegistry.registerItem(lifeStone, lifeStone.getUnlocalizedName());

    GameRegistry.registerItem(everTide, everTide.getUnlocalizedName());
    GameRegistry.registerItem(volcanite, volcanite.getUnlocalizedName());

    GameRegistry.registerItem(waterOrb, waterOrb.getUnlocalizedName());
    GameRegistry.registerItem(lavaOrb, lavaOrb.getUnlocalizedName());
    GameRegistry.registerItem(lootBall, lootBall.getUnlocalizedName());
    GameRegistry.registerItem(mobRandomizer, mobRandomizer.getUnlocalizedName());
    GameRegistry.registerItem(lensExplosive, lensExplosive.getUnlocalizedName());
    GameRegistry.registerItem(fireProjectile, fireProjectile.getUnlocalizedName());
    GameRegistry.registerItem(windProjectile, windProjectile.getUnlocalizedName());

    GameRegistry.registerItem(dCatalyst, dCatalyst.getUnlocalizedName());
    GameRegistry.registerItem(hyperLens, hyperLens.getUnlocalizedName());
    GameRegistry.registerItem(cataliticLens, cataliticLens.getUnlocalizedName());

    GameRegistry.registerItem(tome, tome.getUnlocalizedName());
    GameRegistry.registerItem(transmutationTablet, transmutationTablet.getUnlocalizedName());

    // Tile Entities
    GameRegistry.registerTileEntityWithAlternatives(
        AlchChestTile.class, "AlchChestTile", "Alchemical Chest Tile");
    GameRegistry.registerTileEntityWithAlternatives(
        InterdictionTile.class, "InterdictionTile", "Interdiction Torch Tile");
    GameRegistry.registerTileEntityWithAlternatives(
        CondenserTile.class, "CondenserTile", "Condenser Tile");
    GameRegistry.registerTileEntityWithAlternatives(
        CondenserMK2Tile.class, "CondenserMK2Tile", "Condenser MK2 Tile");
    GameRegistry.registerTileEntityWithAlternatives(
        RMFurnaceTile.class, "RMFurnaceTile", "RM Furnace Tile");
    GameRegistry.registerTileEntityWithAlternatives(
        DMFurnaceTile.class, "DMFurnaceTile", "DM Furnace Tile");
    GameRegistry.registerTileEntityWithAlternatives(
        CollectorMK1Tile.class, "CollectorMK1Tile", "Energy Collector MK1 Tile");
    GameRegistry.registerTileEntityWithAlternatives(
        CollectorMK2Tile.class, "CollectorMK2Tile", "Energy Collector MK2 Tile");
    GameRegistry.registerTileEntityWithAlternatives(
        CollectorMK3Tile.class, "CollectorMK3Tile", "Energy Collector MK3 Tile");
    GameRegistry.registerTileEntityWithAlternatives(
        RelayMK1Tile.class, "RelayMK1Tile", "AM Relay MK1 Tile");
    GameRegistry.registerTileEntityWithAlternatives(
        RelayMK2Tile.class, "RelayMK2Tile", "AM Relay MK2 Tile");
    GameRegistry.registerTileEntityWithAlternatives(
        RelayMK3Tile.class, "RelayMK3Tile", "AM Relay MK3 Tile");
    GameRegistry.registerTileEntityWithAlternatives(
        TransmuteTile.class, "TransmuteTile", "Transmutation Tablet Tile");
    GameRegistry.registerTileEntityWithAlternatives(
        DMPedestalTile.class, "DMPedestalTile", "DM Pedestal Tile");

    // Entities
    EntityRegistry.registerModEntity(
        EntityWaterProjectile.class, "WaterProjectile", 1, PECore.instance, 256, 10, true);
    EntityRegistry.registerModEntity(
        EntityLavaProjectile.class, "LavaProjectile", 2, PECore.instance, 256, 10, true);
    EntityRegistry.registerModEntity(
        EntityLootBall.class, "LootBall", 3, PECore.instance, 64, 10, true);
    EntityRegistry.registerModEntity(
        EntityMobRandomizer.class, "MobRandomizer", 4, PECore.instance, 256, 10, true);
    EntityRegistry.registerModEntity(
        EntityLensProjectile.class, "LensProjectile", 5, PECore.instance, 256, 10, true);
    EntityRegistry.registerModEntity(
        EntityNovaCatalystPrimed.class, "NovaCatalystPrimed", 6, PECore.instance, 256, 10, true);
    EntityRegistry.registerModEntity(
        EntityNovaCataclysmPrimed.class, "NovaCataclysmPrimed", 7, PECore.instance, 256, 10, true);
    EntityRegistry.registerModEntity(
        EntityHomingArrow.class, "HomingArrow", 8, PECore.instance, 256, 10, true);
    EntityRegistry.registerModEntity(
        EntityFireProjectile.class, "FireProjectile", 9, PECore.instance, 256, 10, true);
    EntityRegistry.registerModEntity(
        EntitySWRGProjectile.class, "LightningProjectile", 10, PECore.instance, 256, 10, true);
  }
Example #19
0
 private void registerItem(Item item) {
   GameRegistry.registerItem(item, "ant_" + item.getUnlocalizedName());
 }
Example #20
0
 public void createItem(Item anItem) {
   if (anItem instanceof ItemBlock) return;
   GameRegistry.registerItem(anItem, anItem.getUnlocalizedName(), Reference.MOD_ID);
 }
 public static void registerItem() {
   GameRegistry.registerItem(ArmorRegistry.ChocolateHelmet, ChocolateHelmet.getUnlocalizedName());
   GameRegistry.registerItem(
       ArmorRegistry.ChocolateChestplate, ChocolateChestplate.getUnlocalizedName());
   GameRegistry.registerItem(
       ArmorRegistry.ChocolateLeggings, ChocolateLeggings.getUnlocalizedName());
   GameRegistry.registerItem(ArmorRegistry.ChocolateBoots, ChocolateBoots.getUnlocalizedName());
   GameRegistry.registerItem(
       ArmorRegistry.DarkChocolateHelmet, DarkChocolateHelmet.getUnlocalizedName());
   GameRegistry.registerItem(
       ArmorRegistry.DarkChocolateChestplate, DarkChocolateChestplate.getUnlocalizedName());
   GameRegistry.registerItem(
       ArmorRegistry.DarkChocolateLeggings, DarkChocolateLeggings.getUnlocalizedName());
   GameRegistry.registerItem(
       ArmorRegistry.DarkChocolateBoots, DarkChocolateBoots.getUnlocalizedName());
   GameRegistry.registerItem(
       ArmorRegistry.LightChocolateHelmet, LightChocolateHelmet.getUnlocalizedName());
   GameRegistry.registerItem(
       ArmorRegistry.LightChocolateChestplate, LightChocolateChestplate.getUnlocalizedName());
   GameRegistry.registerItem(
       ArmorRegistry.LightChocolateLeggings, LightChocolateLeggings.getUnlocalizedName());
   GameRegistry.registerItem(
       ArmorRegistry.LightChocolateBoots, LightChocolateBoots.getUnlocalizedName());
   GameRegistry.registerItem(
       ArmorRegistry.WhiteChocolateHelmet, WhiteChocolateHelmet.getUnlocalizedName());
   GameRegistry.registerItem(
       ArmorRegistry.WhiteChocolateChestplate, WhiteChocolateChestplate.getUnlocalizedName());
   GameRegistry.registerItem(
       ArmorRegistry.WhiteChocolateLeggings, WhiteChocolateLeggings.getUnlocalizedName());
   GameRegistry.registerItem(
       ArmorRegistry.WhiteChocolateBoots, WhiteChocolateBoots.getUnlocalizedName());
 }
 public static Icon forItem(IconRegister ir, Item item, String s) {
   return forNameRaw(ir, item.getUnlocalizedName().replaceAll("item.", "") + s);
 }