public class FakeDiamondTools {

  public static Item FakeDiamondPickaxe;
  public static Item FakeDiamondAxe;
  public static Item FakeDiamondHoe;
  public static Item FakeDiamondShovel;
  public static Item FakeDiamondSword;
  static ToolMaterial FakeDiamondToolMaterial =
      EnumHelper.addToolMaterial("FakeDiamondToolMaterial", 3, 1561, 8.0F, 3.0F, 10);

  public static void RegisterFakeDiamondTools() {

    FakeDiamondPickaxe = new ItemFakeDiamondPickaxe(FakeDiamondToolMaterial);
    RegisterHelper.registerItem(FakeDiamondPickaxe);

    FakeDiamondAxe = new ItemFakeDiamondAxe(FakeDiamondToolMaterial);
    RegisterHelper.registerItem(FakeDiamondAxe);

    FakeDiamondHoe = new ItemFakeDiamondHoe(FakeDiamondToolMaterial);
    RegisterHelper.registerItem(FakeDiamondHoe);

    FakeDiamondShovel = new ItemFakeDiamondShovel(FakeDiamondToolMaterial);
    RegisterHelper.registerItem(FakeDiamondShovel);

    FakeDiamondSword = new ItemFakeDiamondSword(FakeDiamondToolMaterial);
    RegisterHelper.registerItem(FakeDiamondSword);
  }
}
Esempio n. 2
0
  @EventHandler
  public static void preinit(FMLPreInitializationEvent PreEvent) {
    // Enum Item ToolMaterials
    ToolMaterial copper = EnumHelper.addToolMaterial("copper", 2, 320, 5.5F, 2.5F, 16);

    // Blocks
    copperOre = new CopperOre();

    // Blocks Language Registry
    LanguageRegistry.addName(copperOre, "Copper Ore");

    // Tools
    copperAxe = new CopperAxe(copper);
    copperPickaxe = new CopperPickaxe(copper);
    copperSpade = new CopperSpade(copper);
    copperSword = new CopperSword(copper);
    copperHoe = new CopperHoe(copper);

    GameRegistry.registerItem(copperAxe = new CopperAxe(copper), "copperAxe");
    GameRegistry.registerItem(copperPickaxe = new CopperPickaxe(copper), "copperPickaxe");
    GameRegistry.registerItem(copperSpade = new CopperSpade(copper), "copperSpade");
    GameRegistry.registerItem(copperSword = new CopperSword(copper), "copperSword");
    GameRegistry.registerItem(copperHoe = new CopperHoe(copper), "copperHoe");

    // Tools Language Registry
    LanguageRegistry.addName(copperAxe, "Copper Axe");
    LanguageRegistry.addName(copperPickaxe, "Copper Pickaxe");
    LanguageRegistry.addName(copperSpade, "Copper Shovel");
    LanguageRegistry.addName(copperHoe, "Copper Hoe");
    LanguageRegistry.addName(copperSword, "Copper Sword");

    // Items
    copperIngot = new CopperIngot();

    // Items Language Registry
    LanguageRegistry.addName(copperIngot, "Copper Ingot");

    // Recipes
    ModRecipes.addRecipes();

    // Event Handler Registry
    proxy.registerRenderInfo();
  }
Esempio n. 3
0
public final class BotaniaAPI {

  private static List<LexiconCategory> categories = new ArrayList<LexiconCategory>();
  private static List<LexiconEntry> allEntries = new ArrayList<LexiconEntry>();

  public static Map<String, KnowledgeType> knowledgeTypes = new HashMap<String, KnowledgeType>();

  public static Map<String, Brew> brewMap = new LinkedHashMap<String, Brew>();

  public static List<RecipePetals> petalRecipes = new ArrayList<RecipePetals>();
  public static List<RecipePureDaisy> pureDaisyRecipes = new ArrayList<RecipePureDaisy>();
  public static List<RecipeManaInfusion> manaInfusionRecipes = new ArrayList<RecipeManaInfusion>();
  public static List<RecipeRuneAltar> runeAltarRecipes = new ArrayList<RecipeRuneAltar>();
  public static List<RecipeElvenTrade> elvenTradeRecipes = new ArrayList<RecipeElvenTrade>();
  public static List<RecipeBrew> brewRecipes = new ArrayList<RecipeBrew>();
  public static List<RecipeManaInfusion> miniFlowerRecipes = new ArrayList<RecipeManaInfusion>();

  private static BiMap<String, Class<? extends SubTileEntity>> subTiles =
      HashBiMap.<String, Class<? extends SubTileEntity>>create();
  private static Map<Class<? extends SubTileEntity>, SubTileSignature> subTileSignatures =
      new HashMap<Class<? extends SubTileEntity>, SubTileSignature>();
  public static Set<String> subtilesForCreativeMenu = new LinkedHashSet();
  public static Map<String, String> subTileMods = new HashMap<String, String>();
  public static BiMap<String, String> miniFlowers = HashBiMap.<String, String>create();

  public static Map<String, Integer> oreWeights = new HashMap<String, Integer>();
  public static Map<String, Integer> oreWeightsNether = new HashMap<String, Integer>();
  public static Map<Item, Block> seeds = new HashMap();
  public static Set<Item> looniumBlacklist = new LinkedHashSet();

  public static ArmorMaterial manasteelArmorMaterial =
      EnumHelper.addArmorMaterial("MANASTEEL", 16, new int[] {2, 6, 5, 2}, 18);
  public static ToolMaterial manasteelToolMaterial =
      EnumHelper.addToolMaterial("MANASTEEL", 3, 300, 6.2F, 2F, 20);

  public static ArmorMaterial elementiumArmorMaterial =
      EnumHelper.addArmorMaterial("B_ELEMENTIUM", 18, new int[] {2, 6, 5, 2}, 18);
  public static ToolMaterial elementiumToolMaterial =
      EnumHelper.addToolMaterial("B_ELEMENTIUM", 3, 720, 6.2F, 2F, 20);

  public static ArmorMaterial terrasteelArmorMaterial =
      EnumHelper.addArmorMaterial("TERRASTEEL", 34, new int[] {3, 8, 6, 3}, 26);
  public static ToolMaterial terrasteelToolMaterial =
      EnumHelper.addToolMaterial("TERRASTEEL", 4, 2300, 9F, 3F, 26);

  public static EnumRarity rarityRelic =
      EnumHelper.addRarity("RELIC", EnumChatFormatting.GOLD, "Relic");

  public static KnowledgeType basicKnowledge, elvenKnowledge;

  // All of these categories are initialized during botania's PreInit stage.
  public static LexiconCategory categoryBasics;
  public static LexiconCategory categoryMana;
  public static LexiconCategory categoryFunctionalFlowers;
  public static LexiconCategory categoryGenerationFlowers;
  public static LexiconCategory categoryDevices;
  public static LexiconCategory categoryTools;
  public static LexiconCategory categoryBaubles;
  public static LexiconCategory categoryEnder;
  public static LexiconCategory categoryAlfhomancy;
  public static LexiconCategory categoryMisc;

  public static Brew fallbackBrew = new Brew("fallback", "botania.brew.fallback", 0, 0);

  static {
    registerSubTile("", DummySubTile.class);

    basicKnowledge = registerKnowledgeType("minecraft", EnumChatFormatting.RESET, true);
    elvenKnowledge = registerKnowledgeType("alfheim", EnumChatFormatting.DARK_GREEN, false);

    addOreWeight("oreAluminum", 3940); // Tinkers' Construct
    addOreWeight("oreAmber", 2075); // Thaumcraft
    addOreWeight("oreApatite", 1595); // Forestry
    addOreWeight("oreBlueTopaz", 3195); // Ars Magica
    addOreWeight("oreCertusQuartz", 3975); // Applied Energistics
    addOreWeight("oreChimerite", 3970); // Ars Magica
    addOreWeight("oreCinnabar", 2585); // Thaumcraft
    addOreWeight("oreCoal", 46525); // Vanilla
    addOreWeight("oreCopper", 8325); // IC2, Thermal Expansion, Tinkers' Construct, etc.
    addOreWeight("oreDark", 1350); // EvilCraft
    addOreWeight("oreDarkIron", 1700); // Factorization (older versions)
    addOreWeight("oreFzDarkIron", 1700); // Factorization (newer versions)
    addOreWeight("oreDiamond", 1265); // Vanilla
    addOreWeight("oreEmerald", 780); // Vanilla
    addOreWeight("oreGalena", 1000); // Factorization
    addOreWeight("oreGold", 2970); // Vanilla
    addOreWeight("oreInfusedAir", 925); // Thaumcraft
    addOreWeight("oreInfusedEarth", 925); // Thaumcraft
    addOreWeight("oreInfusedEntropy", 925); // Thaumcraft
    addOreWeight("oreInfusedFire", 925); // Thaumcraft
    addOreWeight("oreInfusedOrder", 925); // Thaumcraft
    addOreWeight("oreInfusedWater", 925); // Thaumcraft
    addOreWeight("oreIron", 20665); // Vanilla
    addOreWeight("oreLapis", 1285); // Vanilla
    addOreWeight("oreLead", 7985); // IC2, Thermal Expansion, Factorization, etc.
    addOreWeight("oreMCropsEssence", 3085); // Magical Crops
    addOreWeight("oreNickel", 2275); // Thermal Expansion
    addOreWeight("oreOlivine", 1100); // Project RED
    addOreWeight("oreRedstone", 6885); // Vanilla
    addOreWeight("oreRuby", 1100); // Project RED
    addOreWeight("oreSapphire", 1100); // Project RED
    addOreWeight("oreSilver", 6300); // Thermal Expansion, Factorization, etc.
    addOreWeight("oreSulfur", 1105); // Railcraft
    addOreWeight("oreTin", 9450); // IC2, Thermal Expansion, etc.
    addOreWeight("oreUranium", 1337); // IC2
    addOreWeight("oreVinteum", 5925); // Ars Magica
    addOreWeight("oreYellorite", 3520); // Big Reactors
    addOreWeight("oreZinc", 6485); // Flaxbeard's Steam Power
    addOreWeight("oreMythril", 6485); // Simple Ores2
    addOreWeight("oreAdamantium", 2275); // Simple Ores2
    addOreWeight("oreTungsten", 3520); // Simple Tungsten

    addOreWeightNether("oreQuartz", 19600); // Vanilla
    addOreWeightNether("oreCobalt", 500); // Tinker's Construct
    addOreWeightNether("oreArdite", 500); // Tinker's Construct
    addOreWeightNether("oreFirestone", 5); // Railcraft
    addOreWeightNether("oreNetherCoal", 17000); // Nether Ores
    addOreWeightNether("oreNetherCopper", 4700); // Nether Ores
    addOreWeightNether("oreNetherDiamond", 175); // Nether Ores
    addOreWeightNether("oreNetherEssence", 2460); // Magical Crops
    addOreWeightNether("oreNetherGold", 3635); // Nether Ores
    addOreWeightNether("oreNetherIron", 5790); // Nether Ores
    addOreWeightNether("oreNetherLapis", 3250); // Nether Ores
    addOreWeightNether("oreNetherLead", 2790); // Nether Ores
    addOreWeightNether("oreNetherNickel", 1790); // Nether Ores
    addOreWeightNether("oreNetherPlatinum", 170); // Nether Ores
    addOreWeightNether("oreNetherRedstone", 5600); // Nether Ores
    addOreWeightNether("oreNetherSilver", 1550); // Nether Ores
    addOreWeightNether("oreNetherSteel", 1690); // Nether Ores
    addOreWeightNether("oreNetherTin", 3750); // Nether Ores
    addOreWeightNether("oreFyrite", 1000); // Netherrocks
    addOreWeightNether("oreAshstone", 1000); // Netherrocks
    addOreWeightNether("oreDragonstone", 175); // Netherrocks
    addOreWeightNether("oreArgonite", 1000); // Netherrocks
    addOreWeightNether("oreOnyx", 500); // SimpleOres 2
    addOreWeightNether("oreHaditeCoal", 500); // Hadite

    addSeed(Items.wheat_seeds, Blocks.wheat);
    addSeed(Items.potato, Blocks.potatoes);
    addSeed(Items.carrot, Blocks.carrots);
    addSeed(Items.nether_wart, Blocks.nether_wart);
    addSeed(Items.pumpkin_seeds, Blocks.pumpkin_stem);
    addSeed(Items.melon_seeds, Blocks.melon_stem);

    registerModWiki(
        "Minecraft", new SimpleWikiProvider("Minecraft Wiki", "http://minecraft.gamepedia.com/%s"));

    IWikiProvider technicWiki =
        new SimpleWikiProvider("Technic Wiki", "http://wiki.technicpack.net/%s");
    IWikiProvider mekanismWiki =
        new SimpleWikiProvider("Mekanism Wiki", "http://wiki.aidancbrady.com/wiki/%s");
    IWikiProvider buildcraftWiki =
        new SimpleWikiProvider(
            "BuildCraft Wiki", "http://www.mod-buildcraft.com/wiki/doku.php?id=%s");

    registerModWiki("Mekanism", mekanismWiki);
    registerModWiki("MekanismGenerators", mekanismWiki);
    registerModWiki("MekanismTools", mekanismWiki);
    registerModWiki(
        "EnderIO", new SimpleWikiProvider("EnderIO Wiki", "http://wiki.enderio.com/%s"));
    registerModWiki(
        "TropiCraft",
        new SimpleWikiProvider("Tropicraft Wiki", "http://wiki.tropicraft.net/wiki/%s"));
    registerModWiki(
        "RandomThings",
        new SimpleWikiProvider(
            "Random Things Wiki", "http://randomthingsminecraftmod.wikispaces.com/%s"));
    registerModWiki(
        "Witchery",
        new SimpleWikiProvider(
            "Witchery Wiki", "https://sites.google.com/site/witcherymod/%s", "-"));
    registerModWiki(
        "AppliedEnergistics2", new SimpleWikiProvider("AE2 Wiki", "http://ae-mod.info/%s"));
    registerModWiki("BigReactors", technicWiki);
    registerModWiki("BuildCraft|Core", buildcraftWiki);
    registerModWiki("BuildCraft|Builders", buildcraftWiki);
    registerModWiki("BuildCraft|Energy", buildcraftWiki);
    registerModWiki("BuildCraft|Factory", buildcraftWiki);
    registerModWiki("BuildCraft|Silicon", buildcraftWiki);
    registerModWiki("BuildCraft|Transport", buildcraftWiki);
    registerModWiki(
        "ArsMagica2",
        new SimpleWikiProvider("ArsMagica2 Wiki", "http://wiki.arsmagicamod.com/wiki/%s"));
    registerModWiki(
        "PneumaticCraft",
        new SimpleWikiProvider(
            "PneumaticCraft Wiki",
            "http://www.minemaarten.com/wikis/pneumaticcraft-wiki/pneumaticcraft-wiki-%s"));
    registerModWiki(
        "StevesCarts2",
        new SimpleWikiProvider("Steve's Carts Wiki", "http://stevescarts2.wikispaces.com/%s"));
    registerModWiki(
        "GanysSurface",
        new SimpleWikiProvider("Gany's Surface Wiki", "http://ganys-surface.wikia.com/wiki/%s"));
    registerModWiki(
        "GanysNether",
        new SimpleWikiProvider("Gany's Nether Wiki", "http://ganys-nether.wikia.com/wiki/%s"));
    registerModWiki(
        "GanysEnd",
        new SimpleWikiProvider("Gany's End Wiki", "http://ganys-end.wikia.com/wiki/%s"));
  }

  /**
   * The internal method handler in use. Do not overwrite.
   *
   * @see IInternalMethodHandler
   */
  public static IInternalMethodHandler internalHandler = new DummyMethodHandler();

  /**
   * Registers a new Knowledge Type.
   *
   * @param id The ID for this knowledge type.
   * @param color The color to display this knowledge type as.
   */
  public static KnowledgeType registerKnowledgeType(
      String id, EnumChatFormatting color, boolean autoUnlock) {
    KnowledgeType type = new KnowledgeType(id, color, autoUnlock);
    knowledgeTypes.put(id, type);
    return type;
  }

  /** Registers a Brew and returns it. */
  public static Brew registerBrew(Brew brew) {
    brewMap.put(brew.getKey(), brew);
    return brew;
  }

  /** Gets a brew from the key passed in, returns the fallback if it's not in the map. */
  public static Brew getBrewFromKey(String key) {
    if (brewMap.containsKey(key)) return brewMap.get(key);
    return fallbackBrew;
  }

  /**
   * Registers a Petal Recipe.
   *
   * @param output The ItemStack to craft.
   * @param inputs The objects for crafting. Can be ItemStack, MappableStackWrapper or String (case
   *     for Ore Dictionary). The array can't be larger than 16.
   * @return The recipe created.
   */
  public static RecipePetals registerPetalRecipe(ItemStack output, Object... inputs) {
    RecipePetals recipe = new RecipePetals(output, inputs);
    petalRecipes.add(recipe);
    return recipe;
  }

  /**
   * Registers a Pure Daisy Recipe.
   *
   * @param input The block that works as an input for the recipe. Can be a Block or an oredict
   *     String.
   * @param output The block to be placed upon recipe completion.
   * @param outputMeta The metadata to be placed upon recipe completion.
   * @return The recipe created.
   */
  public static RecipePureDaisy registerPureDaisyRecipe(
      Object input, Block output, int outputMeta) {
    RecipePureDaisy recipe = new RecipePureDaisy(input, output, outputMeta);
    pureDaisyRecipes.add(recipe);
    return recipe;
  }

  /**
   * Registers a Rune Altar Recipe.
   *
   * @param output The ItemStack to craft.
   * @param mana The amount of mana required. Don't go over 100000!
   * @param inputs The objects for crafting. Can be ItemStack, MappableStackWrapper or String (case
   *     for Ore Dictionary). The array can't be larger than 16.
   * @return The recipe created.
   */
  public static RecipeRuneAltar registerRuneAltarRecipe(
      ItemStack output, int mana, Object... inputs) {
    RecipeRuneAltar recipe = new RecipeRuneAltar(output, mana, inputs);
    runeAltarRecipes.add(recipe);
    return recipe;
  }

  /**
   * Registers a Mana Infusion Recipe (throw an item in a mana pool)
   *
   * @param output The ItemStack to craft
   * @param input The input item, be it an ItemStack or an ore dictionary entry String.
   * @param mana The amount of mana required. Don't go over 100000!
   * @return The recipe created.
   */
  public static RecipeManaInfusion registerManaInfusionRecipe(
      ItemStack output, Object input, int mana) {
    RecipeManaInfusion recipe = new RecipeManaInfusion(output, input, mana);
    manaInfusionRecipes.add(recipe);
    return recipe;
  }

  /**
   * Register a Mana Infusion Recipe and flags it as an Alchemy recipe (requires an Alchemy Catalyst
   * below the pool).
   *
   * @see BotaniaAPI#registerManaInfusionRecipe
   */
  public static RecipeManaInfusion registerManaAlchemyRecipe(
      ItemStack output, Object input, int mana) {
    RecipeManaInfusion recipe = registerManaInfusionRecipe(output, input, mana);
    recipe.setAlchemy(true);
    return recipe;
  }

  /**
   * Register a Mana Infusion Recipe and flags it as an Conjuration recipe (requires a Conjuration
   * Catalyst below the pool).
   *
   * @see BotaniaAPI#registerManaInfusionRecipe
   */
  public static RecipeManaInfusion registerManaConjurationRecipe(
      ItemStack output, Object input, int mana) {
    RecipeManaInfusion recipe = registerManaInfusionRecipe(output, input, mana);
    recipe.setConjuration(true);
    return recipe;
  }

  /**
   * Registers a Elven Trade recipe (throw an item in an Alfheim Portal).
   *
   * @param output The ItemStack to return.
   * @param inputs The items required, can be ItemStack or ore dictionary entry string.
   * @return The recipe created.
   */
  public static RecipeElvenTrade registerElvenTradeRecipe(ItemStack output, Object... inputs) {
    RecipeElvenTrade recipe = new RecipeElvenTrade(output, inputs);
    elvenTradeRecipes.add(recipe);
    return recipe;
  }

  /**
   * Registers a Brew Recipe (for the Botanical Brewery).
   *
   * @param brew The brew in to be set in this recipe.
   * @inputs The items used in the recipe, no more than 6.
   */
  public static RecipeBrew registerBrewRecipe(Brew brew, Object... inputs) {
    RecipeBrew recipe = new RecipeBrew(brew, inputs);
    brewRecipes.add(recipe);
    return recipe;
  }

  /**
   * Registers a SubTileEntity, a new special flower. Look in the subtile package of the API. If you
   * call this after PostInit you're a failiure and we are very disappointed in you.
   */
  public static void registerSubTile(String key, Class<? extends SubTileEntity> subtileClass) {
    subTiles.put(key, subtileClass);
    subTileMods.put(key, Loader.instance().activeModContainer().getModId());
  }

  /**
   * Register a SubTileEntity and makes it a mini flower. Also adds the recipe and returns it.
   *
   * @see BotaniaAPI#registerSubTile
   */
  public static RecipeManaInfusion registerMiniSubTile(
      String key, Class<? extends SubTileEntity> subtileClass, String original) {
    registerSubTile(key, subtileClass);
    miniFlowers.put(original, key);

    RecipeMiniFlower recipe = new RecipeMiniFlower(key, original, 2500);
    manaInfusionRecipes.add(recipe);
    miniFlowerRecipes.add(recipe);
    return recipe;
  }

  /**
   * Registers a SubTileEntity's signature.
   *
   * @see SubTileSignature
   */
  public static void registerSubTileSignature(
      Class<? extends SubTileEntity> subtileClass, SubTileSignature signature) {
    subTileSignatures.put(subtileClass, signature);
  }

  /**
   * Gets the singleton signature for a SubTileEntity class. Registers a fallback if one wasn't
   * registered before the call.
   */
  public static SubTileSignature getSignatureForClass(Class<? extends SubTileEntity> subtileClass) {
    if (!subTileSignatures.containsKey(subtileClass))
      registerSubTileSignature(
          subtileClass, new BasicSignature(subTiles.inverse().get(subtileClass)));

    return subTileSignatures.get(subtileClass);
  }

  /**
   * Gets the singleton signature for a SubTileEntity's name. Registers a fallback if one wasn't
   * registered before the call.
   */
  public static SubTileSignature getSignatureForName(String name) {
    Class<? extends SubTileEntity> subtileClass = subTiles.get(name);
    return getSignatureForClass(subtileClass);
  }

  /**
   * Adds the key for a SubTileEntity into the creative menu. This goes into the
   * subtilesForCreativeMenu Set. This does not need to be called for mini flowers, those will just
   * use the mini flower map to add themselves next to the source.
   */
  public static void addSubTileToCreativeMenu(String key) {
    subtilesForCreativeMenu.add(key);
  }

  /** Adds a category to the list of registered categories to appear in the Lexicon. */
  public static void addCategory(LexiconCategory category) {
    categories.add(category);
  }

  /** Gets all registered categories. */
  public static List<LexiconCategory> getAllCategories() {
    return categories;
  }

  /** Gets all registered entries. */
  public static List<LexiconEntry> getAllEntries() {
    return allEntries;
  }

  /** Registers a Lexicon Entry and adds it to the category passed in. */
  public static void addEntry(LexiconEntry entry, LexiconCategory category) {
    allEntries.add(entry);
    category.entries.add(entry);
  }

  /**
   * Maps an ore (ore dictionary key) to it's weight on the world generation. This is used for the
   * Orechid flower. Check the static block in the BotaniaAPI class to get the weights for the
   * vanilla blocks.<br>
   * Alternatively get the values with the OreDetector mod:<br>
   * https://gist.github.com/Vazkii/9493322
   */
  public static void addOreWeight(String ore, int weight) {
    oreWeights.put(ore, weight);
  }

  /**
   * Maps an ore (ore dictionary key) to it's weight on the nether world generation. This is used
   * for the Orechid Ignem flower. Check the static block in the BotaniaAPI class to get the weights
   * for the vanilla blocks.<br>
   * Alternatively get the values with the OreDetector mod:<br>
   * https://gist.github.com/Vazkii/9493322
   */
  public static void addOreWeightNether(String ore, int weight) {
    if (ore.contains("Nether") && OreDictionary.getOres(ore.replace("Nether", "")).size() == 0)
      return;

    oreWeightsNether.put(ore, weight);
  }

  public static int getOreWeight(String ore) {
    return oreWeights.get(ore);
  }

  public static int getOreWeightNether(String ore) {
    return oreWeightsNether.get(ore);
  }

  /**
   * Allows an item to be counted as a seed. Any item in this list can be dispensed by a dispenser,
   * the block is the block to be placed.
   */
  public static void addSeed(Item item, Block block) {
    seeds.put(item, block);
  }

  /** Blacklists an item from the Loonium drop table. */
  public static void blackListItemFromLoonium(Item item) {
    looniumBlacklist.add(item);
  }

  /** Gets the last recipe to have been added to the recipe list. */
  public static IRecipe getLatestAddedRecipe() {
    List<IRecipe> list = CraftingManager.getInstance().getRecipeList();
    return list.get(list.size() - 1);
  }

  /** Gets the last x recipes added to the recipe list. */
  public static List<IRecipe> getLatestAddedRecipes(int x) {
    List<IRecipe> list = CraftingManager.getInstance().getRecipeList();
    List<IRecipe> newList = new ArrayList();
    for (int i = x - 1; i >= 0; i--) newList.add(list.get(list.size() - 1 - i));

    return newList;
  }

  /**
   * Registers a Wiki provider for a mod so it uses that instead of the fallback FTB wiki. Make sure
   * to call this on PostInit only!
   */
  public static void registerModWiki(String mod, IWikiProvider provider) {
    WikiHooks.registerModWiki(mod, provider);
  }

  public static Class<? extends SubTileEntity> getSubTileMapping(String key) {
    if (!subTiles.containsKey(key)) key = "";

    return subTiles.get(key);
  }

  public static String getSubTileStringMapping(Class<? extends SubTileEntity> clazz) {
    return subTiles.inverse().get(clazz);
  }

  public static Set<String> getAllSubTiles() {
    return subTiles.keySet();
  }
}
public class OfalenModItemCore {
  // 基本アイテム
  public static Item gemOfalen;
  public static Item fragmentOfalen;
  public static Item coreOfalen;
  /**
   * 0 : Machine Cover Plate<br>
   * 1 : Grade 3 Part<br>
   * 2 : Lump of Stone<br>
   * 3 : Stone Fuel<br>
   * 4 : Ofalen Fuel<br>
   * 5 : Laser Magazine<br>
   * 6 : Shielding Ingot<br>
   * 7 : Teleporting Pearl<br>
   * 8 : Floating Dust<br>
   * 9 : Collecting Lump<br>
   */
  public static Item partsOfalen;
  /** 0 : White Ofalen Stick */
  public static Item partsOfalen3D;
  // 防具G1
  public static Item helmetOfalenG1;
  public static Item chestplateOfalenG1;
  public static Item leggingsOfalenG1;
  public static Item bootsOfalenG1;
  // 防具G2
  public static Item helmetOfalenG2;
  public static Item chestplateOfalenG2;
  public static Item leggingsOfalenG2;
  public static Item bootsOfalenG2;
  // 防具G3
  public static Item helmetOfalenG3;
  public static Item chestplateOfalenG3;
  public static Item leggingsOfalenG3;
  public static Item bootsOfalenG3;
  // 防具P
  public static Item helmetOfalenP;
  public static Item chestplateOfalenP;
  public static Item leggingsOfalenP;
  public static Item bootsOfalenP;
  // 玉
  public static Item ballEmpty;
  // 防御玉
  public static Item ballDefenseG1;
  public static Item ballDefenseG2;
  public static Item ballDefenseG3;
  // 攻撃玉
  public static Item ballAttackG1;
  public static Item ballAttackG2;
  public static Item ballAttackG3;
  // 回復玉
  public static Item ballRecoveryG1;
  public static Item ballRecoveryG2;
  public static Item ballRecoveryG3;
  // その他の玉
  public static Item ballExplosion;
  public static Item ballHungry;
  public static Item ballFood;
  public static Item ballPerfect;
  // 道具G1
  public static Item swordOfalenG1;
  public static Item shovelOfalenG1;
  public static Item pickaxeOfalenG1;
  public static Item axeOfalenG1;
  public static Item hoeOfalenG1;
  // 道具G2
  public static Item swordOfalenG2;
  public static Item shovelOfalenG2;
  public static Item pickaxeOfalenG2;
  public static Item axeOfalenG2;
  public static Item hoeOfalenG2;
  // 道具G3
  public static Item swordOfalenG3;
  public static Item shovelOfalenG3;
  public static Item pickaxeOfalenG3;
  public static Item axeOfalenG3;
  public static Item hoeOfalenG3;
  // その他の道具
  public static Item toolOfalenP;
  public static Item swordCreative;
  // レーザー関連
  public static Item pistolLaser;
  public static Item crystalLaserEnergy;
  public static Item magazineLaserRed;
  public static Item magazineLaserGreen;
  public static Item magazineLaserBlue;
  public static Item magazineLaserWhite;
  // 未来系
  public static Item shieldOfalen;
  public static Item teleporterOfalen;
  public static Item floaterOfalen;
  public static Item collectorOfalen;
  // フィルター
  public static Item filterItem;
  public static Item installerFilter;
  // オファレン草
  public static Item seedOfalen;
  // 測量杖
  public static Item caneSurveying;
  // 経験値の結晶
  public static Item crystalExp;
  // アーマーマテリアル
  public static final ArmorMaterial OFALEN_ARMOR_G2 =
      EnumHelper.addArmorMaterial("OFALEN_ARMOR_G2", 66, new int[] {3, 8, 6, 3}, 20);
  public static final ArmorMaterial OFALEN_ARMOR_G3 =
      EnumHelper.addArmorMaterial("OFALEN_ARMOR_G3", 132, new int[] {3, 8, 6, 3}, 40);
  public static final ArmorMaterial OFALEN_ARMOR_P =
      EnumHelper.addArmorMaterial("OFALEN_ARMOR_P", 264, new int[] {3, 8, 6, 3}, 80);
  // ツールマテリアル
  public static final ToolMaterial OFALEN_TOOL_G2 =
      EnumHelper.addToolMaterial("OFALEN_TOOL_G2", 4, 3123, 16.0F, 6.0F, 20);
  public static final ToolMaterial OFALEN_TOOL_G3 =
      EnumHelper.addToolMaterial("OFALEN_TOOL_G3", 4, 6247, 32.0F, 12.0F, 40);
  public static final ToolMaterial OFALEN_TOOL_P =
      EnumHelper.addToolMaterial("OFALEN_TOOL_P", 5, 12495, 64.0F, 24.0F, 80);

  /** アイテムを登録する。 */
  public static void registerItem() {
    CreativeTabs tab = OfalenModCore.TAB_OFALEN;
    // オファレン
    gemOfalen = new ItemOfalen().setUnlocalizedName("ofalen.gem").setTextureName("ofalenmod:gem");
    GameRegistry.registerItem(gemOfalen, "ofalen");
    OreDictionary.registerOre("gemOfalenRed", new ItemStack(gemOfalen, 1, 0));
    OreDictionary.registerOre("gemOfalenGreen", new ItemStack(gemOfalen, 1, 1));
    OreDictionary.registerOre("gemOfalenBlue", new ItemStack(gemOfalen, 1, 2));
    OreDictionary.registerOre("gemOfalenWhite", new ItemStack(gemOfalen, 1, 3));
    OreDictionary.registerOre("gemOfalenOrange", new ItemStack(gemOfalen, 1, 4));
    OreDictionary.registerOre("gemOfalenViridian", new ItemStack(gemOfalen, 1, 5));
    OreDictionary.registerOre("gemOfalenPurple", new ItemStack(gemOfalen, 1, 6));
    OreDictionary.registerOre("gemOfalenDark", new ItemStack(gemOfalen, 1, 7));
    OreDictionary.registerOre(
        "gemOfalen", new ItemStack(gemOfalen, 1, OreDictionary.WILDCARD_VALUE));
    // オファレンの欠片
    fragmentOfalen =
        new ItemOfalen().setUnlocalizedName("ofalen.fragment").setTextureName("ofalenmod:fragment");
    GameRegistry.registerItem(fragmentOfalen, "fragmentOfalen");
    OreDictionary.registerOre("fragmentOfalenRed", new ItemStack(fragmentOfalen, 1, 0));
    OreDictionary.registerOre("fragmentOfalenGreen", new ItemStack(fragmentOfalen, 1, 1));
    OreDictionary.registerOre("fragmentOfalenBlue", new ItemStack(fragmentOfalen, 1, 2));
    OreDictionary.registerOre("fragmentOfalenWhite", new ItemStack(fragmentOfalen, 1, 3));
    OreDictionary.registerOre("fragmentOfalenOrange", new ItemStack(fragmentOfalen, 1, 4));
    OreDictionary.registerOre("fragmentOfalenViridian", new ItemStack(fragmentOfalen, 1, 5));
    OreDictionary.registerOre("fragmentOfalenPurple", new ItemStack(fragmentOfalen, 1, 6));
    OreDictionary.registerOre("fragmentOfalenDark", new ItemStack(fragmentOfalen, 1, 7));
    OreDictionary.registerOre(
        "fragmentOfalen", new ItemStack(fragmentOfalen, 1, OreDictionary.WILDCARD_VALUE));
    // オファレンコア
    coreOfalen =
        new ItemOfalen().setUnlocalizedName("ofalen.core").setTextureName("ofalenmod:core");
    GameRegistry.registerItem(coreOfalen, "coreOfalen");
    OreDictionary.registerOre("coreOfalenRed", new ItemStack(coreOfalen, 1, 0));
    OreDictionary.registerOre("coreOfalenGreen", new ItemStack(coreOfalen, 1, 1));
    OreDictionary.registerOre("coreOfalenBlue", new ItemStack(coreOfalen, 1, 2));
    OreDictionary.registerOre("coreOfalenWhite", new ItemStack(coreOfalen, 1, 3));
    OreDictionary.registerOre("coreOfalenOrange", new ItemStack(coreOfalen, 1, 4));
    OreDictionary.registerOre("coreOfalenViridian", new ItemStack(coreOfalen, 1, 5));
    OreDictionary.registerOre("coreOfalenPurple", new ItemStack(coreOfalen, 1, 6));
    OreDictionary.registerOre("coreOfalenDark", new ItemStack(coreOfalen, 1, 7));
    OreDictionary.registerOre(
        "coreOfalen", new ItemStack(coreOfalen, 1, OreDictionary.WILDCARD_VALUE));
    // 中間素材
    partsOfalen =
        new ItemParts((byte) 10)
            .setUnlocalizedName("ofalen.parts")
            .setTextureName("ofalenmod:parts");
    GameRegistry.registerItem(partsOfalen, "partsOfalen");
    partsOfalen3D =
        new ItemParts((byte) 1)
            .setUnlocalizedName("ofalen.parts3D")
            .setTextureName("ofalenmod:parts3D")
            .setFull3D();
    GameRegistry.registerItem(partsOfalen3D, "partsOfalen3D");
    // 防具G1
    helmetOfalenG1 =
        new ItemOfalenArmor(ArmorMaterial.DIAMOND, 0, 1)
            .setUnlocalizedName("ofalen.armor.G1.0")
            .setTextureName("ofalenmod:armor-1-0");
    GameRegistry.registerItem(helmetOfalenG1, "helmetOfalen");
    chestplateOfalenG1 =
        new ItemOfalenArmor(ArmorMaterial.DIAMOND, 1, 1)
            .setUnlocalizedName("ofalen.armor.G1.1")
            .setTextureName("ofalenmod:armor-1-1");
    GameRegistry.registerItem(chestplateOfalenG1, "chestplateOfalen");
    leggingsOfalenG1 =
        new ItemOfalenArmor(ArmorMaterial.DIAMOND, 2, 1)
            .setUnlocalizedName("ofalen.armor.G1.2")
            .setTextureName("ofalenmod:armor-1-2");
    GameRegistry.registerItem(leggingsOfalenG1, "leggingsOfalen");
    bootsOfalenG1 =
        new ItemOfalenArmor(ArmorMaterial.DIAMOND, 3, 1)
            .setUnlocalizedName("ofalen.armor.G1.3")
            .setTextureName("ofalenmod:armor-1-3");
    GameRegistry.registerItem(bootsOfalenG1, "bootsOfalen");
    // 防具G2
    helmetOfalenG2 =
        new ItemOfalenArmor(OFALEN_ARMOR_G2, 0, 2)
            .setUnlocalizedName("ofalen.armor.G2.0")
            .setTextureName("ofalenmod:armor-2-0");
    GameRegistry.registerItem(helmetOfalenG2, "helmetOfalenG2");
    chestplateOfalenG2 =
        new ItemOfalenArmor(OFALEN_ARMOR_G2, 1, 2)
            .setUnlocalizedName("ofalen.armor.G2.1")
            .setTextureName("ofalenmod:armor-2-1");
    GameRegistry.registerItem(chestplateOfalenG2, "chestplateOfalenG2");
    leggingsOfalenG2 =
        new ItemOfalenArmor(OFALEN_ARMOR_G2, 2, 2)
            .setUnlocalizedName("ofalen.armor.G2.2")
            .setTextureName("ofalenmod:armor-2-2");
    GameRegistry.registerItem(leggingsOfalenG2, "leggingsOfalenG2");
    bootsOfalenG2 =
        new ItemOfalenArmor(OFALEN_ARMOR_G2, 3, 2)
            .setUnlocalizedName("ofalen.armor.G2.3")
            .setTextureName("ofalenmod:armor-2-3");
    GameRegistry.registerItem(bootsOfalenG2, "bootsOfalenG2");
    // 防具G3
    helmetOfalenG3 =
        new ItemOfalenArmor(OFALEN_ARMOR_G3, 0, 3)
            .setUnlocalizedName("ofalen.armor.G3.0")
            .setTextureName("ofalenmod:armor-3-0");
    GameRegistry.registerItem(helmetOfalenG3, "helmetOfalenG3");
    chestplateOfalenG3 =
        new ItemOfalenArmor(OFALEN_ARMOR_G3, 1, 3)
            .setUnlocalizedName("ofalen.armor.G3.1")
            .setTextureName("ofalenmod:armor-3-1");
    GameRegistry.registerItem(chestplateOfalenG3, "chestplateOfalenG3");
    leggingsOfalenG3 =
        new ItemOfalenArmor(OFALEN_ARMOR_G3, 2, 3)
            .setUnlocalizedName("ofalen.armor.G3.2")
            .setTextureName("ofalenmod:armor-3-2");
    GameRegistry.registerItem(leggingsOfalenG3, "leggingsOfalenG3");
    bootsOfalenG3 =
        new ItemOfalenArmor(OFALEN_ARMOR_G3, 3, 3)
            .setUnlocalizedName("ofalen.armor.G3.3")
            .setTextureName("ofalenmod:armor-3-3");
    GameRegistry.registerItem(bootsOfalenG3, "bootsOfalenG3");
    // 防具P
    helmetOfalenP =
        new ItemOfalenArmor(OFALEN_ARMOR_P, 0, 4)
            .setUnlocalizedName("ofalen.armor.P.0")
            .setTextureName("ofalenmod:armor-P-0");
    GameRegistry.registerItem(helmetOfalenP, "helmetPerfectOfalen");
    chestplateOfalenP =
        new ItemOfalenArmor(OFALEN_ARMOR_P, 1, 4)
            .setUnlocalizedName("ofalen.armor.P.1")
            .setTextureName("ofalenmod:armor-P-1");
    GameRegistry.registerItem(chestplateOfalenP, "chestplatePerfectOfalen");
    leggingsOfalenP =
        new ItemOfalenArmor(OFALEN_ARMOR_P, 2, 4)
            .setUnlocalizedName("ofalen.armor.P.2")
            .setTextureName("ofalenmod:armor-P-2");
    GameRegistry.registerItem(leggingsOfalenP, "leggingsPerfectOfalen");
    bootsOfalenP =
        new ItemOfalenArmor(OFALEN_ARMOR_P, 3, 4)
            .setUnlocalizedName("ofalen.armor.P.3")
            .setTextureName("ofalenmod:armor-P-3");
    GameRegistry.registerItem(bootsOfalenP, "bootsPerfectOfalen");
    // 玉
    ballEmpty =
        new ItemEmptyBall()
            .setUnlocalizedName("ofalen.ball.empty")
            .setTextureName("ofalenmod:empty_ball");
    GameRegistry.registerItem(ballEmpty, "ballEmpty");
    // 防御玉
    ballDefenseG1 =
        new ItemOfalenBall(new PotionEffect[] {new PotionEffect(Potion.resistance.id, 2400, 0)})
            .setUnlocalizedName("ofalen.ball.defense.G1")
            .setTextureName("ofalenmod:defense_ball-1");
    GameRegistry.registerItem(ballDefenseG1, "ballDefense");
    ballDefenseG2 =
        new ItemOfalenBall(new PotionEffect[] {new PotionEffect(Potion.resistance.id, 2400, 1)})
            .setUnlocalizedName("ofalen.ball.defense.G2")
            .setTextureName("ofalenmod:defense_ball-2");
    GameRegistry.registerItem(ballDefenseG2, "ballDefenseG2");
    ballDefenseG3 =
        new ItemOfalenBall(new PotionEffect[] {new PotionEffect(Potion.resistance.id, 2400, 3)})
            .setUnlocalizedName("ofalen.ball.defense.G3")
            .setTextureName("ofalenmod:defense_ball-3");
    GameRegistry.registerItem(ballDefenseG3, "ballDefenseG3");
    // 攻撃玉
    ballAttackG1 =
        new ItemOfalenBall(new PotionEffect[] {new PotionEffect(Potion.damageBoost.id, 2400, 0)})
            .setUnlocalizedName("ofalen.ball.attack.G1")
            .setTextureName("ofalenmod:attack_ball-1");
    GameRegistry.registerItem(ballAttackG1, "ballAttack");
    ballAttackG2 =
        new ItemOfalenBall(new PotionEffect[] {new PotionEffect(Potion.damageBoost.id, 2400, 1)})
            .setUnlocalizedName("ofalen.ball.attack.G2")
            .setTextureName("ofalenmod:attack_ball-2");
    GameRegistry.registerItem(ballAttackG2, "ballAttackG2");
    ballAttackG3 =
        new ItemOfalenBall(new PotionEffect[] {new PotionEffect(Potion.damageBoost.id, 2400, 3)})
            .setUnlocalizedName("ofalen.ball.attack.G3")
            .setTextureName("ofalenmod:attack_ball-3");
    GameRegistry.registerItem(ballAttackG3, "ballAttackG3");
    // 回復玉
    ballRecoveryG1 =
        new ItemOfalenBall(new PotionEffect[] {new PotionEffect(Potion.heal.id, 1, 0)})
            .setUnlocalizedName("ofalen.ball.recovery.G1")
            .setTextureName("ofalenmod:recovery_ball-1");
    GameRegistry.registerItem(ballRecoveryG1, "ballRecovery");
    ballRecoveryG2 =
        new ItemOfalenBall(new PotionEffect[] {new PotionEffect(Potion.heal.id, 1, 1)})
            .setUnlocalizedName("ofalen.ball.recovery.G2")
            .setTextureName("ofalenmod:recovery_ball-2");
    GameRegistry.registerItem(ballRecoveryG2, "ballRecoveryG2");
    ballRecoveryG3 =
        new ItemOfalenBall(new PotionEffect[] {new PotionEffect(Potion.heal.id, 1, 3)})
            .setUnlocalizedName("ofalen.ball.recovery.G3")
            .setTextureName("ofalenmod:recovery_ball-3");
    GameRegistry.registerItem(ballRecoveryG3, "ballRecoveryG3");
    // その他の玉
    ballExplosion =
        new ItemExplosionBall()
            .setUnlocalizedName("ofalen.ball.explosion")
            .setTextureName("ofalenmod:explosion_ball");
    GameRegistry.registerItem(ballExplosion, "ballExplosion");
    ballHungry =
        new ItemOfalenBall(new PotionEffect[] {new PotionEffect(Potion.hunger.id, 40, 1599)})
            .setUnlocalizedName("ofalen.ball.hungry")
            .setTextureName("ofalenmod:hungry_ball");
    GameRegistry.registerItem(ballHungry, "ballHungry");
    ballFood =
        new ItemOfalenBall(new PotionEffect[] {new PotionEffect(23, 20, 0)})
            .setUnlocalizedName("ofalen.ball.food")
            .setTextureName("ofalenmod:food_ball");
    GameRegistry.registerItem(ballFood, "ballFood");
    ballPerfect =
        new ItemPerfectBall(
                new PotionEffect[] {
                  new PotionEffect(Potion.heal.id, 1, 7),
                  new PotionEffect(Potion.damageBoost.id, 2400, 7),
                  new PotionEffect(Potion.resistance.id, 2400, 7)
                })
            .setUnlocalizedName("ofalen.ball.perfect")
            .setTextureName("ofalenmod:empty_ball-3");
    GameRegistry.registerItem(ballPerfect, "ballPerfectOfalen");
    // 道具G1
    swordOfalenG1 =
        new ItemSword(ToolMaterial.EMERALD)
            .setCreativeTab(tab)
            .setUnlocalizedName("ofalen.sword.1")
            .setTextureName("ofalenmod:tool-sword-1");
    GameRegistry.registerItem(swordOfalenG1, "swordOfalen");
    shovelOfalenG1 =
        new ItemSpade(ToolMaterial.EMERALD)
            .setCreativeTab(tab)
            .setUnlocalizedName("ofalen.shovel.1")
            .setTextureName("ofalenmod:tool-shovel-1");
    GameRegistry.registerItem(shovelOfalenG1, "shovelOfalen");
    pickaxeOfalenG1 =
        new ItemOfalenPickaxe(ToolMaterial.EMERALD)
            .setUnlocalizedName("ofalen.pickaxe.1")
            .setTextureName("ofalenmod:tool-pickaxe-1");
    GameRegistry.registerItem(pickaxeOfalenG1, "pickaxeOfalen");
    axeOfalenG1 =
        new ItemOfalenAxe(ToolMaterial.EMERALD)
            .setUnlocalizedName("ofalen.axe.1")
            .setTextureName("ofalenmod:tool-axe-1");
    GameRegistry.registerItem(axeOfalenG1, "axeOfalen");
    hoeOfalenG1 =
        new ItemHoe(ToolMaterial.EMERALD)
            .setCreativeTab(tab)
            .setUnlocalizedName("ofalen.hoe.1")
            .setTextureName("ofalenmod:tool-hoe-1");
    GameRegistry.registerItem(hoeOfalenG1, "hoeOfalen");
    // 道具G2
    swordOfalenG2 =
        new ItemSword(OFALEN_TOOL_G2)
            .setCreativeTab(tab)
            .setUnlocalizedName("ofalen.sword.2")
            .setTextureName("ofalenmod:tool-sword-2");
    GameRegistry.registerItem(swordOfalenG2, "swordOfalenG2");
    shovelOfalenG2 =
        new ItemSpade(OFALEN_TOOL_G2)
            .setCreativeTab(tab)
            .setUnlocalizedName("ofalen.shovel.2")
            .setTextureName("ofalenmod:tool-shovel-2");
    GameRegistry.registerItem(shovelOfalenG2, "shovelOfalenG2");
    pickaxeOfalenG2 =
        new ItemOfalenPickaxe(OFALEN_TOOL_G2)
            .setUnlocalizedName("ofalen.pickaxe.2")
            .setTextureName("ofalenmod:tool-pickaxe-2");
    GameRegistry.registerItem(pickaxeOfalenG2, "pickaxeOfalenG2");
    axeOfalenG2 =
        new ItemOfalenAxe(OFALEN_TOOL_G2)
            .setUnlocalizedName("ofalen.axe.2")
            .setTextureName("ofalenmod:tool-axe-2");
    GameRegistry.registerItem(axeOfalenG2, "axeOfalenG2");
    hoeOfalenG2 =
        new ItemHoe(OFALEN_TOOL_G2)
            .setCreativeTab(tab)
            .setUnlocalizedName("ofalen.hoe.2")
            .setTextureName("ofalenmod:tool-hoe-2");
    GameRegistry.registerItem(hoeOfalenG2, "hoeOfalenG2");
    // 道具G3
    swordOfalenG3 =
        new ItemSword(OFALEN_TOOL_G3)
            .setCreativeTab(tab)
            .setUnlocalizedName("ofalen.sword.3")
            .setTextureName("ofalenmod:tool-sword-3");
    GameRegistry.registerItem(swordOfalenG3, "swordOfalenG3");
    shovelOfalenG3 =
        new ItemSpade(OFALEN_TOOL_G3)
            .setCreativeTab(tab)
            .setUnlocalizedName("ofalen.shovel.3")
            .setTextureName("ofalenmod:tool-shovel-3");
    GameRegistry.registerItem(shovelOfalenG3, "shovelOfalenG3");
    pickaxeOfalenG3 =
        new ItemOfalenPickaxe(OFALEN_TOOL_G3)
            .setUnlocalizedName("ofalen.pickaxe.3")
            .setTextureName("ofalenmod:tool-pickaxe-3");
    GameRegistry.registerItem(pickaxeOfalenG3, "pickaxeOfalenG3");
    axeOfalenG3 =
        new ItemOfalenAxe(OFALEN_TOOL_G3)
            .setUnlocalizedName("ofalen.axe.3")
            .setTextureName("ofalenmod:tool-axe-3");
    GameRegistry.registerItem(axeOfalenG3, "axeOfalenG3");
    hoeOfalenG3 =
        new ItemHoe(OFALEN_TOOL_G3)
            .setCreativeTab(tab)
            .setUnlocalizedName("ofalen.hoe.3")
            .setTextureName("ofalenmod:tool-hoe-3");
    GameRegistry.registerItem(hoeOfalenG3, "hoeOfalenG3");
    // その他の道具
    toolOfalenP =
        new ItemOfalenPerfectTool(OFALEN_TOOL_P)
            .setUnlocalizedName("ofalen.tool.P")
            .setTextureName("ofalenmod:tool-perfect");
    GameRegistry.registerItem(toolOfalenP, "toolPerfectOfalen");
    swordCreative =
        new ItemCreativeSword()
            .setUnlocalizedName("ofalen.sword.creative")
            .setTextureName("ofalenmod:creative_sword");
    GameRegistry.registerItem(swordCreative, "swordSp");
    // レーザー関連
    pistolLaser =
        new ItemLaserPistol()
            .setUnlocalizedName("ofalen.pistolLaser")
            .setTextureName("ofalenmod:laser_pistol");
    GameRegistry.registerItem(pistolLaser, "pistolLaser");
    crystalLaserEnergy =
        new ItemParts((byte) 4)
            .setUnlocalizedName("ofalen.crystalLaserEnergy")
            .setTextureName("ofalenmod:laser_energy_crystal");
    GameRegistry.registerItem(crystalLaserEnergy, "crystalEnergyLaser");
    magazineLaserRed =
        new ItemLaserMagazine()
            .setUnlocalizedName("ofalen.magazineLaserRed")
            .setTextureName("ofalenmod:laser_magazine_red");
    GameRegistry.registerItem(magazineLaserRed, "magazineLaserRed");
    magazineLaserGreen =
        new ItemLaserMagazine()
            .setUnlocalizedName("ofalen.magazineLaserGreen")
            .setTextureName("ofalenmod:laser_magazine_green");
    GameRegistry.registerItem(magazineLaserGreen, "magazineLaserGreen");
    magazineLaserBlue =
        new ItemLaserMagazine()
            .setUnlocalizedName("ofalen.magazineLaserBlue")
            .setTextureName("ofalenmod:laser_magazine_blue");
    GameRegistry.registerItem(magazineLaserBlue, "magazineLaserBlue");
    magazineLaserWhite =
        new ItemLaserMagazine()
            .setUnlocalizedName("ofalen.magazineLaserWhite")
            .setTextureName("ofalenmod:laser_magazine_white");
    GameRegistry.registerItem(magazineLaserWhite, "magazineLaserWhite");
    // 未来系
    shieldOfalen =
        new ItemShield()
            .setUnlocalizedName("ofalen.shield")
            .setTextureName("ofalenmod:future-shield");
    GameRegistry.registerItem(shieldOfalen, "shieldOfalen");
    teleporterOfalen =
        new ItemTeleporter()
            .setUnlocalizedName("ofalen.teleporter")
            .setTextureName("ofalenmod:future-teleporter");
    GameRegistry.registerItem(teleporterOfalen, "teleporterOfalen");
    floaterOfalen =
        new ItemFloater()
            .setUnlocalizedName("ofalen.floater")
            .setTextureName("ofalenmod:future-floater");
    GameRegistry.registerItem(floaterOfalen, "floaterOfalen");
    collectorOfalen =
        new ItemCollector()
            .setUnlocalizedName("ofalen.collector")
            .setTextureName("ofalenmod:future-collector");
    GameRegistry.registerItem(collectorOfalen, "collector");
    // フィルター
    filterItem =
        new ItemFilter()
            .setUnlocalizedName("ofalen.filterItem")
            .setTextureName("ofalenmod:item_filter");
    GameRegistry.registerItem(filterItem, "item_filter");
    installerFilter =
        new ItemFilterInstaller()
            .setUnlocalizedName("ofalen.installerFilter")
            .setTextureName("ofalenmod:filter_installer");
    GameRegistry.registerItem(installerFilter, "filter_installer");
    // オファレン草
    seedOfalen =
        new ItemOfalenSeed(OfalenModBlockCore.grassOfalen)
            .setUnlocalizedName("ofalen.seed")
            .setTextureName("ofalenmod:seed");
    GameRegistry.registerItem(seedOfalen, "seedOfalen");
    // 測量杖
    caneSurveying =
        new ItemSurveyingCane()
            .setUnlocalizedName("ofalen.caneSurveying")
            .setTextureName("ofalenmod:surveying_cane");
    GameRegistry.registerItem(caneSurveying, "caneSurveying");
    // 経験値の結晶
    crystalExp =
        new ItemExpCrystal()
            .setUnlocalizedName("ofalen.crystalExp")
            .setTextureName("ofalenmod:exp_crystal");
    GameRegistry.registerItem(crystalExp, "crystalExp");
  }
}
 public static void init() {
   // EnumTools
   toolAquamarine = EnumHelper.addToolMaterial("AQUAMARINE", 3, 3644, 6.5F, 3, 23);
   toolTin = EnumHelper.addToolMaterial("TIN", 1, 150, 2.5F, 1, 9);
   toolCopper = EnumHelper.addToolMaterial("COPPER", 1, 150, 2.5F, 1, 9);
   toolChromite = EnumHelper.addToolMaterial("CHROMITE", 3, 1524, 20.0F, 3, 23);
   toolTanzanite = EnumHelper.addToolMaterial("TANZANITE", 3, 1648, 7.5F, 3, 23);
   toolBronze = EnumHelper.addToolMaterial("BRONZE", 2, 408, 5.0F, 2, 14);
   toolSilver = EnumHelper.addToolMaterial("SILVER", 3, 230, 10.0F, 3, 20);
   toolSteel = EnumHelper.addToolMaterial("STEEL", 4, 2104, 11.5F, 4, 15);
   toolCobalt = EnumHelper.addToolMaterial("COBALT", 4, 2040, 11.0F, 4, 13);
   toolFyrised = EnumHelper.addToolMaterial("FYRISED", 5, 3216, 14.0F, 5, 12);
   // EnumArmors
   Bronze_Armor = EnumHelper.addArmorMaterial("BRONZE", 10, new int[] {2, 6, 3, 1}, 16);
   Slime_Armor = EnumHelper.addArmorMaterial("SLIME", 8, new int[] {2, 4, 3, 2}, 5);
   Silver_Armor = EnumHelper.addArmorMaterial("SILVER", 12, new int[] {3, 7, 4, 2}, 23);
   Steel_Armor = EnumHelper.addArmorMaterial("STEEL", 38, new int[] {4, 8, 6, 3}, 9);
   Cobalt_Armor = EnumHelper.addArmorMaterial("COBALT", 38, new int[] {4, 8, 5, 3}, 9);
   Fyrised_Armor = EnumHelper.addArmorMaterial("FYRISED", 45, new int[] {5, 9, 6, 4}, 10);
   // EnumTools for War Axes
   toolWaraxe = EnumHelper.addToolMaterial("Waraxe", 4, 2144, 12.0F, 8, 10);
   System.out.println("[Soul Forest] Materials initialized");
 }
Esempio n. 6
0
/**
 * @author Azanor
 *     <p>IMPORTANT: If you are adding your own aspects to items it is a good idea to do it AFTER
 *     Thaumcraft adds its aspects, otherwise odd things may happen.
 */
public class ThaumcraftApi {

  // Materials
  public static ToolMaterial toolMatThaumium =
      EnumHelper.addToolMaterial("THAUMIUM", 3, 400, 7F, 2, 22);
  public static ToolMaterial toolMatElemental =
      EnumHelper.addToolMaterial("THAUMIUM_ELEMENTAL", 3, 1500, 10F, 3, 18);
  public static ArmorMaterial armorMatThaumium =
      EnumHelper.addArmorMaterial("THAUMIUM", 25, new int[] {2, 6, 5, 2}, 25);
  public static ArmorMaterial armorMatSpecial =
      EnumHelper.addArmorMaterial("SPECIAL", 25, new int[] {1, 3, 2, 1}, 25);

  // Enchantment references
  public static int enchantFrugal;
  public static int enchantPotency;
  public static int enchantWandFortune;
  public static int enchantHaste;
  public static int enchantRepair;

  // Miscellaneous
  /**
   * Portable Hole Block-id Blacklist. Simply add the block-id's of blocks you don't want the
   * portable hole to go through.
   */
  public static ArrayList<Block> portableHoleBlackList = new ArrayList<Block>();

  // RESEARCH/////////////////////////////////////////
  public static ArrayList<IScanEventHandler> scanEventhandlers = new ArrayList<IScanEventHandler>();
  public static ArrayList<EntityTags> scanEntities = new ArrayList<EntityTags>();

  public static class EntityTagsNBT {
    public EntityTagsNBT(String name, Object value) {
      this.name = name;
      this.value = value;
    }

    public String name;
    public Object value;
  }

  public static class EntityTags {
    public EntityTags(String entityName, AspectList aspects, EntityTagsNBT... nbts) {
      this.entityName = entityName;
      this.nbts = nbts;
      this.aspects = aspects;
    }

    public String entityName;
    public EntityTagsNBT[] nbts;
    public AspectList aspects;
  }

  /**
   * not really working atm, so ignore it for now
   *
   * @param scanEventHandler
   */
  public static void registerScanEventhandler(IScanEventHandler scanEventHandler) {
    scanEventhandlers.add(scanEventHandler);
  }

  /**
   * This is used to add aspects to entities which you can then scan using a thaumometer. Also used
   * to calculate vis drops from mobs.
   *
   * @param entityName
   * @param aspects
   * @param nbt you can specify certain nbt keys and their values to differentiate between mobs.
   *     <br>
   *     For example the normal and wither skeleton: <br>
   *     ThaumcraftApi.registerEntityTag("Skeleton", (new AspectList()).add(Aspect.DEATH, 5)); <br>
   *     ThaumcraftApi.registerEntityTag("Skeleton", (new AspectList()).add(Aspect.DEATH, 8), new
   *     NBTTagByte("SkeletonType",(byte) 1));
   */
  public static void registerEntityTag(
      String entityName, AspectList aspects, EntityTagsNBT... nbt) {
    scanEntities.add(new EntityTags(entityName, aspects, nbt));
  }

  // RECIPES/////////////////////////////////////////
  private static ArrayList craftingRecipes = new ArrayList();
  private static HashMap<Object, ItemStack> smeltingBonus = new HashMap<Object, ItemStack>();

  /**
   * This method is used to determine what bonus items are generated when the infernal furnace
   * smelts items
   *
   * @param in The input of the smelting operation. e.g. new ItemStack(Block.oreGold)
   * @param out The bonus item that can be produced from the smelting operation e.g. new
   *     ItemStack(nuggetGold,0,0). Stacksize should be 0 unless you want to guarantee that at least
   *     1 item is always produced.
   */
  public static void addSmeltingBonus(ItemStack in, ItemStack out) {
    smeltingBonus.put(
        Arrays.asList(Item.getIdFromItem(in.getItem()), in.getItemDamage()),
        new ItemStack(out.getItem(), 0, out.getItemDamage()));
  }

  /**
   * This method is used to determine what bonus items are generated when the infernal furnace
   * smelts items
   *
   * @param in The ore dictionary input of the smelting operation. e.g. "oreGold"
   * @param out The bonus item that can be produced from the smelting operation e.g. new
   *     ItemStack(nuggetGold,0,0). Stacksize should be 0 unless you want to guarantee that at least
   *     1 item is always produced.
   */
  public static void addSmeltingBonus(String in, ItemStack out) {
    smeltingBonus.put(in, new ItemStack(out.getItem(), 0, out.getItemDamage()));
  }

  /**
   * Returns the bonus item produced from a smelting operation in the infernal furnace
   *
   * @param in The input of the smelting operation. e.g. new ItemStack(oreGold)
   * @return the The bonus item that can be produced
   */
  public static ItemStack getSmeltingBonus(ItemStack in) {
    ItemStack out =
        smeltingBonus.get(Arrays.asList(Item.getIdFromItem(in.getItem()), in.getItemDamage()));
    if (out == null) {
      out =
          smeltingBonus.get(
              Arrays.asList(Item.getIdFromItem(in.getItem()), OreDictionary.WILDCARD_VALUE));
    }
    if (out == null) {
      String od = OreDictionary.getOreName(OreDictionary.getOreID(in));
      out = smeltingBonus.get(od);
    }
    return out;
  }

  public static List getCraftingRecipes() {
    return craftingRecipes;
  }

  /**
   * @param research the research key required for this recipe to work. Leave blank if it will work
   *     without research
   * @param result the recipe output
   * @param aspects the vis cost per aspect.
   * @param recipe The recipe. Format is exactly the same as vanilla recipes. Input itemstacks are
   *     NBT sensitive.
   */
  public static ShapedArcaneRecipe addArcaneCraftingRecipe(
      String research, ItemStack result, AspectList aspects, Object... recipe) {
    ShapedArcaneRecipe r = new ShapedArcaneRecipe(research, result, aspects, recipe);
    craftingRecipes.add(r);
    return r;
  }

  /**
   * @param research the research key required for this recipe to work. Leave blank if it will work
   *     without research
   * @param result the recipe output
   * @param aspects the vis cost per aspect
   * @param recipe The recipe. Format is exactly the same as vanilla shapeless recipes. Input
   *     itemstacks are NBT sensitive.
   */
  public static ShapelessArcaneRecipe addShapelessArcaneCraftingRecipe(
      String research, ItemStack result, AspectList aspects, Object... recipe) {
    ShapelessArcaneRecipe r = new ShapelessArcaneRecipe(research, result, aspects, recipe);
    craftingRecipes.add(r);
    return r;
  }

  /**
   * @param research the research key required for this recipe to work. Leave blank if it will work
   *     without research
   * @param result the recipe output. It can either be an itemstack or an nbt compound tag that will
   *     be added to the central item
   * @param instability a number that represents the N in 1000 chance for the infusion altar to
   *     spawn an instability effect each second while the crafting is in progress
   * @param aspects the essentia cost per aspect.
   * @param aspects input the central item to be infused
   * @param recipe An array of items required to craft this. Input itemstacks are NBT sensitive.
   *     Infusion crafting components are automatically "fuzzy" and the oredict will be checked for
   *     possible matches.
   */
  public static InfusionRecipe addInfusionCraftingRecipe(
      String research,
      Object result,
      int instability,
      AspectList aspects,
      ItemStack input,
      ItemStack[] recipe) {
    if (!(result instanceof ItemStack || result instanceof Object[])) return null;
    InfusionRecipe r = new InfusionRecipe(research, result, instability, aspects, input, recipe);
    craftingRecipes.add(r);
    return r;
  }

  /**
   * @param research the research key required for this recipe to work. Leave blank if it will work
   *     without research
   * @param enchantment the enchantment that will be applied to the item
   * @param instability a number that represents the N in 1000 chance for the infusion altar to
   *     spawn an instability effect each second while the crafting is in progress
   * @param aspects the essentia cost per aspect.
   * @param recipe An array of items required to craft this. Input itemstacks are NBT sensitive.
   *     Infusion crafting components are automatically "fuzzy" and the oredict will be checked for
   *     possible matches.
   */
  public static InfusionEnchantmentRecipe addInfusionEnchantmentRecipe(
      String research,
      Enchantment enchantment,
      int instability,
      AspectList aspects,
      ItemStack[] recipe) {
    InfusionEnchantmentRecipe r =
        new InfusionEnchantmentRecipe(research, enchantment, instability, aspects, recipe);
    craftingRecipes.add(r);
    return r;
  }

  /**
   * @param stack the recipe result
   * @return the recipe
   */
  public static InfusionRecipe getInfusionRecipe(ItemStack res) {
    for (Object r : getCraftingRecipes()) {
      if (r instanceof InfusionRecipe) {
        if (((InfusionRecipe) r).getRecipeOutput() instanceof ItemStack) {
          if (((ItemStack) ((InfusionRecipe) r).getRecipeOutput()).isItemEqual(res))
            return (InfusionRecipe) r;
        }
      }
    }
    return null;
  }

  /**
   * @param key the research key required for this recipe to work.
   * @param result the output result
   * @param cost the vis cost
   * @param tags the aspects required to craft this
   */
  public static CrucibleRecipe addCrucibleRecipe(
      String key, ItemStack result, Object catalyst, AspectList tags) {
    CrucibleRecipe rc = new CrucibleRecipe(key, result, catalyst, tags);
    getCraftingRecipes().add(rc);
    return rc;
  }

  /**
   * @param stack the recipe result
   * @return the recipe
   */
  public static CrucibleRecipe getCrucibleRecipe(ItemStack stack) {
    for (Object r : getCraftingRecipes()) {
      if (r instanceof CrucibleRecipe) {
        if (((CrucibleRecipe) r).getRecipeOutput().isItemEqual(stack)) return (CrucibleRecipe) r;
      }
    }
    return null;
  }

  /**
   * Used by the thaumonomicon drilldown feature.
   *
   * @param stack the item
   * @return the thaumcraft recipe key that produces that item.
   */
  private static HashMap<int[], Object[]> keyCache = new HashMap<int[], Object[]>();

  public static Object[] getCraftingRecipeKey(EntityPlayer player, ItemStack stack) {
    int[] key = new int[] {Item.getIdFromItem(stack.getItem()), stack.getItemDamage()};
    if (keyCache.containsKey(key)) {
      if (keyCache.get(key) == null) return null;
      if (ThaumcraftApiHelper.isResearchComplete(
          player.getCommandSenderName(), (String) (keyCache.get(key))[0])) return keyCache.get(key);
      else return null;
    }
    for (ResearchCategoryList rcl : ResearchCategories.researchCategories.values()) {
      for (ResearchItem ri : rcl.research.values()) {
        if (ri.getPages() == null) continue;
        for (int a = 0; a < ri.getPages().length; a++) {
          ResearchPage page = ri.getPages()[a];
          if (page.recipeOutput != null && stack != null && page.recipeOutput.isItemEqual(stack)) {
            keyCache.put(key, new Object[] {ri.key, a});
            if (ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), ri.key))
              return new Object[] {ri.key, a};
            else return null;
          }
        }
      }
    }
    keyCache.put(key, null);
    return null;
  }

  // ASPECTS////////////////////////////////////////

  public static ConcurrentHashMap<List, AspectList> objectTags =
      new ConcurrentHashMap<List, AspectList>();

  /**
   * Checks to see if the passed item/block already has aspects associated with it.
   *
   * @param id
   * @param meta
   * @return
   */
  public static boolean exists(Item item, int meta) {
    AspectList tmp = ThaumcraftApi.objectTags.get(Arrays.asList(item, meta));
    if (tmp == null) {
      tmp = ThaumcraftApi.objectTags.get(Arrays.asList(item, OreDictionary.WILDCARD_VALUE));
      if (meta == OreDictionary.WILDCARD_VALUE && tmp == null) {
        int index = 0;
        do {
          tmp = ThaumcraftApi.objectTags.get(Arrays.asList(item, index));
          index++;
        } while (index < 16 && tmp == null);
      }
      if (tmp == null) return false;
    }

    return true;
  }

  /**
   * Used to assign apsects to the given item/block. Here is an example of the declaration for
   * cobblestone:
   *
   * <p><i>ThaumcraftApi.registerObjectTag(new ItemStack(Blocks.cobblestone), (new
   * AspectList()).add(Aspect.ENTROPY, 1).add(Aspect.EARTH, 1));</i>
   *
   * @param item the item passed. Pass OreDictionary.WILDCARD_VALUE if all damage values of this
   *     item/block should have the same aspects
   * @param aspects A ObjectTags object of the associated aspects
   */
  public static void registerObjectTag(ItemStack item, AspectList aspects) {
    if (aspects == null) aspects = new AspectList();
    try {
      objectTags.put(Arrays.asList(item.getItem(), item.getItemDamage()), aspects);
    } catch (Exception e) {
    }
  }

  /**
   * Used to assign apsects to the given item/block. Here is an example of the declaration for
   * cobblestone:
   *
   * <p><i>ThaumcraftApi.registerObjectTag(new ItemStack(Blocks.cobblestone), new int[]{0,1}, (new
   * AspectList()).add(Aspect.ENTROPY, 1).add(Aspect.EARTH, 1));</i>
   *
   * @param item
   * @param meta A range of meta values if you wish to lump several item meta's together as being
   *     the "same" item (i.e. stair orientations)
   * @param aspects A ObjectTags object of the associated aspects
   */
  public static void registerObjectTag(ItemStack item, int[] meta, AspectList aspects) {
    if (aspects == null) aspects = new AspectList();
    try {
      objectTags.put(Arrays.asList(item.getItem(), meta), aspects);
    } catch (Exception e) {
    }
  }

  /**
   * Used to assign apsects to the given ore dictionary item.
   *
   * @param oreDict the ore dictionary name
   * @param aspects A ObjectTags object of the associated aspects
   */
  public static void registerObjectTag(String oreDict, AspectList aspects) {
    if (aspects == null) aspects = new AspectList();
    ArrayList<ItemStack> ores = OreDictionary.getOres(oreDict);
    if (ores != null && ores.size() > 0) {
      for (ItemStack ore : ores) {
        try {
          objectTags.put(Arrays.asList(ore.getItem(), ore.getItemDamage()), aspects);
        } catch (Exception e) {
        }
      }
    }
  }

  /**
   * Used to assign aspects to the given item/block. Attempts to automatically generate aspect tags
   * by checking registered recipes. Here is an example of the declaration for pistons:
   *
   * <p><i>ThaumcraftApi.registerComplexObjectTag(new ItemStack(Blocks.cobblestone), (new
   * AspectList()).add(Aspect.MECHANISM, 2).add(Aspect.MOTION, 4));</i>
   *
   * @param item, pass OreDictionary.WILDCARD_VALUE to meta if all damage values of this item/block
   *     should have the same aspects
   * @param aspects A ObjectTags object of the associated aspects
   */
  public static void registerComplexObjectTag(ItemStack item, AspectList aspects) {
    if (!exists(item.getItem(), item.getItemDamage())) {
      AspectList tmp = ThaumcraftApiHelper.generateTags(item.getItem(), item.getItemDamage());
      if (tmp != null && tmp.size() > 0) {
        for (Aspect tag : tmp.getAspects()) {
          aspects.add(tag, tmp.getAmount(tag));
        }
      }
      registerObjectTag(item, aspects);
    } else {
      AspectList tmp = ThaumcraftApiHelper.getObjectAspects(item);
      for (Aspect tag : aspects.getAspects()) {
        tmp.merge(tag, tmp.getAmount(tag));
      }
      registerObjectTag(item, tmp);
    }
  }

  // CROPS
  // //////////////////////////////////////////////////////////////////////////////////////////

  /**
   * To define mod crops you need to use FMLInterModComms in your @Mod.Init method. There are two
   * 'types' of crops you can add. Standard crops and clickable crops.
   *
   * <p>Standard crops work like normal vanilla crops - they grow until a certain metadata value is
   * reached and you harvest them by destroying the block and collecting the blocks. You need to
   * create and ItemStack that tells the golem what block id and metadata represents the crop when
   * fully grown. Sending a metadata of [OreDictionary.WILDCARD_VALUE] will mean the metadata won't
   * get checked. Example for vanilla wheat: FMLInterModComms.sendMessage("Thaumcraft",
   * "harvestStandardCrop", new ItemStack(Block.crops,1,7));
   *
   * <p>Clickable crops are crops that you right click to gather their bounty instead of destroying
   * them. As for standard crops, you need to create and ItemStack that tells the golem what block
   * id and metadata represents the crop when fully grown. The golem will trigger the blocks
   * onBlockActivated method. Sending a metadata of [OreDictionary.WILDCARD_VALUE] will mean the
   * metadata won't get checked. Example (this will technically do nothing since clicking wheat does
   * nothing, but you get the idea): FMLInterModComms.sendMessage("Thaumcraft",
   * "harvestClickableCrop", new ItemStack(Block.crops,1,7));
   *
   * <p>Stacked crops (like reeds) are crops that you wish the bottom block should remain after
   * harvesting. As for standard crops, you need to create and ItemStack that tells the golem what
   * block id and metadata represents the crop when fully grown. Sending a metadata of
   * [OreDictionary.WILDCARD_VALUE] will mean the actualy md won't get checked. If it has the order
   * upgrade it will only harvest if the crop is more than one block high. Example:
   * FMLInterModComms.sendMessage("Thaumcraft", "harvestStackedCrop", new
   * ItemStack(Block.reed,1,7));
   */

  // NATIVE CLUSTERS
  // //////////////////////////////////////////////////////////////////////////////////

  /**
   * You can define certain ores that will have a chance to produce native clusters via
   * FMLInterModComms in your @Mod.Init method using the "nativeCluster" string message. The format
   * should be: "[ore item/block id],[ore item/block metadata],[cluster item/block id],[cluster
   * item/block metadata],[chance modifier float]"
   *
   * <p>NOTE: The chance modifier is a multiplier applied to the default chance for that cluster to
   * be produced (default 27.5% for a pickaxe of the core)
   *
   * <p>Example for vanilla iron ore to produce one of my own native iron clusters (assuming default
   * id's) at double the default chance: FMLInterModComms.sendMessage("Thaumcraft",
   * "nativeCluster","15,0,25016,16,2.0");
   */

  // LAMP OF GROWTH BLACKLIST
  // ///////////////////////////////////////////////////////////////////////////
  /**
   * You can blacklist crops that should not be effected by the Lamp of Growth via FMLInterModComms
   * in your @Mod.Init method using the "lampBlacklist" itemstack message. Sending a metadata of
   * [OreDictionary.WILDCARD_VALUE] will mean the metadata won't get checked. Example for vanilla
   * wheat: FMLInterModComms.sendMessage("Thaumcraft", "lampBlacklist", new
   * ItemStack(Block.crops,1,OreDictionary.WILDCARD_VALUE));
   */

  // DIMENSION BLACKLIST ///////////////////////////////////////////////////////////////////////////
  /**
   * You can blacklist a dimension to not spawn certain thaumcraft features in your @Mod.Init method
   * using the "dimensionBlacklist" string message in the format "[dimension]:[level]" The level
   * values are as follows: [0] stop all tc spawning and generation [1] allow ore and node
   * generation [2] allow mob spawning [3] allow ore and node gen + mob spawning Example:
   * FMLInterModComms.sendMessage("Thaumcraft", "dimensionBlacklist", "15:1");
   */

  // BIOME BLACKLIST ///////////////////////////////////////////////////////////////////////////
  /**
   * You can blacklist a biome to not spawn certain thaumcraft features in your @Mod.Init method
   * using the "biomeBlacklist" string message in the format "[biome id]:[level]" The level values
   * are as follows: [0] stop all tc spawning and generation [1] allow ore and node generation [2]
   * allow mob spawning [3] allow ore and node gen + mob spawning Example:
   * FMLInterModComms.sendMessage("Thaumcraft", "biomeBlacklist", "180:2");
   */
}
Esempio n. 7
0
public final class ModItems {

  // Items
  private static final boolean DEBUG = true;

  // Tool Materials
  public static ToolMaterial tutMaterial =
      EnumHelper.addToolMaterial("BloodSteelorial Tool Material", 3, 200, 15.0F, 4.0F, 10);

  // Armour Materials
  public static ArmorMaterial tutArmorMaterial =
      EnumHelper.addArmorMaterial("BloodSteelorial Armor Material", 33, new int[] {2, 5, 4, 2}, 10);

  // Base Classes For Items
  public static Item tutPickaxe;
  public static Item tutAxe;
  public static Item tutSword;
  public static Item tutHoe;
  public static Item tutSpade;

  // Base Classes For Armour
  public static Item tutHelmet;
  public static Item tutPlate;
  public static Item tutPants;
  public static Item tutBoots;

  // EnderIO
  public static Item itemPlateSoularium;
  public static Item itemPlateRedstoneAlloy;
  public static Item itemPlateElectricalSteel;
  public static Item itemPlatePulsatingIron;
  public static Item itemPlateEnergeticAlloy;
  public static Item itemPlateVibrantAlloy;
  public static Item itemPlateConductiveIron;
  public static Item itemPlateDarkSteel;

  // Big Reactors
  public static Item itemPlateBlutonium;
  public static Item itemPlateCyanite;
  public static Item itemPlateLudicrite;

  // Thaumcraft
  public static Item itemPlateVoidMetal;

  // ExtraUtils
  public static Item itemPlateBedrockium;

  // Pneumaticraft
  public static Item itemPlateCompressedIron;

  // SimplyJetpacks
  public static Item itemPlateEnrichedSoularium;

  // rfTools
  public static Item itemPlateDimensionShard;

  // Misc Items
  public static Item itemIngotBloodSteel;
  public static Item itemPlateBloodSteel;

  @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");
  }
}
Esempio n. 8
0
public class Core extends Module {
  public static Block rocks;
  public static Block limestone;
  public static Block metals;
  public static Block pearlBlock;
  public static Block pearlBrick;
  public static Block glass;
  public static Block woods;
  public static Block machines;
  public static Block multiMachines;
  public static Block renderedMachines;
  public static Block renderedMultiMachines;
  public static Block air;
  public static Block tanks;
  public static Block sands;
  public static Block transparent;
  public static Block water;

  public static Fluid moltenAluminum;
  public static Fluid moltenTitanium;
  public static Fluid moltenIron;
  public static Fluid moltenGold;
  public static Fluid moltenCopper;
  public static Fluid moltenTin;
  public static Fluid moltenMagnesium;
  public static Fluid moltenBronze;
  public static Fluid moltenLead;
  public static Fluid moltenSilver;
  public static Fluid moltenSteel;
  public static Fluid moltenNickel;
  public static Fluid moltenRutile;
  public static Fluid moltenGlass;
  public static Fluid moltenSalt;
  public static Fluid moltenElectrum;
  public static Fluid naturalGas;
  public static Fluid quicklime;

  public static Fluid highPressureWater;
  public static Block highPressureWaterBlock;

  public static Item liquidContainers;
  public static Item materials;
  public static Item craftingItem;
  public static Item batteryTitanium;
  public static Item batteryCopper;
  public static Item food;
  public static Item upgrade;
  public static Item pearls;
  public static Item hammer;
  public static Item worked;
  public static Item ladle;
  public static Item can;
  public static Item bucket;

  @Override
  public void registerHandlers() {
    OreDicHandler.registerWildCards();
    MaricultureHandlers.biomeType = new BiomeTypeHandler();
    MaricultureHandlers.smelter = new LiquifierHandler();
    MaricultureHandlers.casting = new IngotCastingHandler();
    MaricultureHandlers.vat = new VatHandler();
    MaricultureHandlers.anvil = new TileAnvil();
    MaricultureHandlers.upgrades = new UpgradeHandler();
    MaricultureHandlers.modules = new ModulesHandler();
    GameRegistry.registerFuelHandler(new FuelHandler());
    GameRegistry.registerWorldGenerator(new WorldGenHandler(), 1);
    MinecraftForge.EVENT_BUS.register(new GuiItemToolTip());
    MinecraftForge.EVENT_BUS.register(new OreDicHandler());
    FMLCommonHandler.instance().bus().register(new ServerFMLEvents());
    FMLCommonHandler.instance().bus().register(new ClientFMLEvents());
    if (RetroGeneration.ENABLED) MinecraftForge.EVENT_BUS.register(new RetroGen());

    // Initalise our Side Helper
    List<Integer> sides = new ArrayList<Integer>();
    for (int i = 0; i < 6; i++) {
      sides.add(i);
    }

    BlockTransferHelper.sides = sides;
  }

  @Override
  public void registerBlocks() {
    rocks =
        new BlockRock().setStepSound(Block.soundTypeStone).setResistance(2F).setBlockName("rocks");
    limestone =
        new BlockLimestone()
            .setStepSound(Block.soundTypeStone)
            .setResistance(1F)
            .setBlockName("limestone");
    metals =
        new BlockMetal()
            .setStepSound(Block.soundTypeMetal)
            .setResistance(5F)
            .setBlockName("metals");
    pearlBlock =
        new BlockPearlBlock("pearlBlock_")
            .setStepSound(Block.soundTypeStone)
            .setResistance(1.5F)
            .setBlockName("pearl.block");
    pearlBrick =
        new BlockPearlBlock("pearlBrick_")
            .setStepSound(Block.soundTypeStone)
            .setResistance(2F)
            .setBlockName("pearl.brick");
    machines =
        new BlockMachine()
            .setStepSound(Block.soundTypeWood)
            .setResistance(10F)
            .setBlockName("machines.single");
    multiMachines =
        new BlockMachineMulti()
            .setStepSound(Block.soundTypeStone)
            .setResistance(20F)
            .setBlockName("machines.multi");

    // TODO: Move Rendered machines over to the block basing
    renderedMachines =
        new BlockSingle()
            .setStepSound(Block.soundTypeMetal)
            .setResistance(1F)
            .setHardness(1F)
            .setBlockName("machines.single.rendered");
    renderedMultiMachines =
        new BlockDouble()
            .setStepSound(Block.soundTypeMetal)
            .setResistance(3F)
            .setHardness(3F)
            .setBlockName("machines.multi.rendered");

    glass =
        new BlockGlass().setStepSound(Block.soundTypeGlass).setResistance(5F).setBlockName("glass");
    air = new BlockAir().setBlockUnbreakable().setBlockName("air");
    woods =
        new BlockWood().setStepSound(Block.soundTypeWood).setBlockName("woods").setHardness(2.0F);
    tanks =
        new BlockTank().setStepSound(Block.soundTypeGlass).setBlockName("tanks").setHardness(1F);
    sands = new BlockGround().setBlockName("sands").setHardness(1F);
    transparent =
        new BlockTransparent()
            .setStepSound(Block.soundTypePiston)
            .setBlockName("transparent")
            .setHardness(1F);
    water =
        new BlockWater().setStepSound(Block.soundTypeSnow).setHardness(10F).setBlockName("water");

    GameRegistry.registerTileEntity(TileAirPump.class, "TileAirPump");
    GameRegistry.registerTileEntity(TileCrucible.class, "TileLiquifier");
    GameRegistry.registerTileEntity(TileBookshelf.class, "TileBookshelf");
    GameRegistry.registerTileEntity(TileTankBlock.class, "TileTankBlock");
    GameRegistry.registerTileEntity(TileVat.class, "TileVat");
    GameRegistry.registerTileEntity(TileAnvil.class, "TileAnvil");
    GameRegistry.registerTileEntity(TileIngotCaster.class, "TileIngotCaster");
    GameRegistry.registerTileEntity(TileVoidBottle.class, "TileVoidBottle");
    GameRegistry.registerTileEntity(TileOyster.class, "TileOyster");

    RegistryHelper.register(
        new Object[] {
          rocks,
          limestone,
          water,
          metals,
          sands,
          woods,
          glass,
          transparent,
          pearlBlock,
          pearlBrick,
          machines,
          multiMachines,
          renderedMultiMachines,
          renderedMachines,
          tanks,
          air
        });
  }

  @Override
  public void registerEntities() {
    EntityRegistry.registerModEntity(
        EntityFakeItem.class, "FakeItem", EntityIds.FAKE_ITEM, Mariculture.instance, 80, 3, false);
  }

  ToolMaterial brick = EnumHelper.addToolMaterial("BRICK", 1, 1000, 3.0F, 1.2F, 12);

  @Override
  public void registerItems() {
    materials = new ItemMaterial().setUnlocalizedName("materials");
    craftingItem = new ItemCrafting().setUnlocalizedName("crafting");
    batteryCopper = new ItemBattery(10000, 100, 250).setUnlocalizedName("battery.copper");
    batteryTitanium = new ItemBattery(100000, 1000, 2500).setUnlocalizedName("battery.titanium");
    food = new ItemFood().setUnlocalizedName("food");
    upgrade = new ItemUpgrade().setUnlocalizedName("upgrade");
    pearls = new ItemPearl().setUnlocalizedName("pearls");
    liquidContainers = new ItemFluidContainer().setUnlocalizedName("fluids");
    hammer = new ItemHammer(brick).setUnlocalizedName("hammer");
    worked = new ItemWorked().setUnlocalizedName("worked");

    ladle = new ItemFluidStorage(MetalRates.INGOT).setUnlocalizedName("ladle");
    bucket = new ItemFluidStorage(8000).setUnlocalizedName("bucket.titanium");

    RegistryHelper.register(
        new Object[] {
          materials,
          craftingItem,
          batteryTitanium,
          food,
          upgrade,
          pearls,
          liquidContainers,
          hammer,
          worked,
          batteryCopper,
          ladle,
          bucket
        });
  }

  @Override
  public void registerOther() {
    registerBiomes();
    registerLiquids();
    addToOreDictionary();
    MaricultureTab.tabMariculture.icon = new ItemStack(pearls, 1, PearlColor.WHITE);
  }

  private void registerLiquids() {
    highPressureWater = new FluidMari(FluidDictionary.hp_water, -1);
    if (!FluidRegistry.registerFluid(highPressureWater))
      highPressureWater = FluidRegistry.getFluid(FluidDictionary.hp_water);
    highPressureWaterBlock =
        new BlockFluidMari(highPressureWater, Material.water).setBlockName("highPressureWater");
    GameRegistry.registerBlock(highPressureWaterBlock, "Mariculture_highPressureWaterBlock");
    highPressureWater.setBlock(highPressureWaterBlock);
    registerHeatBottle(FluidDictionary.hp_water, 1000, FluidContainerMeta.BOTTLE_HP_WATER);
  }

  private void addToOreDictionary() {
    OreDicHelper.add("glass", new ItemStack(Blocks.glass));
    OreDicHelper.add("ingotIron", new ItemStack(Items.iron_ingot));
    OreDicHelper.add("ingotGold", new ItemStack(Items.gold_ingot));
    OreDicHelper.add("blockIron", new ItemStack(Blocks.iron_block));
    OreDicHelper.add("blockGold", new ItemStack(Blocks.gold_block));
    OreDicHelper.add("blockLapis", new ItemStack(Blocks.lapis_block));
    OreDicHelper.add("blockCoal", new ItemStack(Blocks.coal_block));
    OreDicHelper.add("blockRedstone", new ItemStack(Blocks.redstone_block));
    OreDicHelper.add("dustRedstone", new ItemStack(Items.redstone));

    OreDictionary.registerOre("blockLimestone", new ItemStack(limestone, 1, LimestoneMeta.RAW));
    OreDictionary.registerOre("oreCopper", new ItemStack(rocks, 1, RockMeta.COPPER));
    OreDictionary.registerOre("oreAluminum", new ItemStack(rocks, 1, RockMeta.BAUXITE));
    OreDictionary.registerOre("oreRutile", new ItemStack(rocks, 1, RockMeta.RUTILE));

    OreDictionary.registerOre("blockAluminum", new ItemStack(metals, 1, MetalMeta.ALUMINUM_BLOCK));
    OreDictionary.registerOre("blockCopper", new ItemStack(metals, 1, MetalMeta.COPPER_BLOCK));
    OreDictionary.registerOre(
        "blockMagnesium", new ItemStack(metals, 1, MetalMeta.MAGNESIUM_BLOCK));
    OreDictionary.registerOre("blockRutile", new ItemStack(metals, 1, MetalMeta.RUTILE_BLOCK));
    OreDictionary.registerOre("blockTitanium", new ItemStack(metals, 1, MetalMeta.TITANIUM_BLOCK));

    OreDictionary.registerOre("foodSalt", new ItemStack(materials, 1, MaterialsMeta.DUST_SALT));
    OreDictionary.registerOre(
        "ingotAluminum", new ItemStack(materials, 1, MaterialsMeta.INGOT_ALUMINUM));
    OreDictionary.registerOre(
        "ingotCopper", new ItemStack(materials, 1, MaterialsMeta.INGOT_COPPER));
    OreDictionary.registerOre(
        "ingotMagnesium", new ItemStack(materials, 1, MaterialsMeta.INGOT_MAGNESIUM));
    OreDictionary.registerOre(
        "ingotRutile", new ItemStack(materials, 1, MaterialsMeta.INGOT_RUTILE));
    OreDictionary.registerOre(
        "ingotTitanium", new ItemStack(materials, 1, MaterialsMeta.INGOT_TITANIUM));
  }

  private void addFluids() {
    // Normal Fluids
    FluidDictionary.natural_gas =
        addFluid("gas.natural", naturalGas, 2000, FluidContainerMeta.BOTTLE_GAS);

    // Molten Mari + Vanilla Fluids
    FluidDictionary.quicklime =
        addFluid(("quicklime"), quicklime, 1000, FluidContainerMeta.BOTTLE_QUICKLIME);
    FluidDictionary.salt =
        addFluid("salt.molten", moltenSalt, 1000, FluidContainerMeta.BOTTLE_SALT);
    FluidDictionary.glass =
        addFluid("glass.molten", moltenGlass, 1000, FluidContainerMeta.BOTTLE_GLASS);
    FluidDictionary.aluminum =
        addFluid(
            "aluminum.molten", moltenAluminum, MetalRates.ORE, FluidContainerMeta.BOTTLE_ALUMINUM);
    FluidDictionary.magnesium =
        addFluid(
            "magnesium.molten",
            moltenMagnesium,
            MetalRates.ORE,
            FluidContainerMeta.BOTTLE_MAGNESIUM);
    FluidDictionary.titanium =
        addFluid(
            "titanium.molten", moltenTitanium, MetalRates.ORE, FluidContainerMeta.BOTTLE_TITANIUM);
    FluidDictionary.copper =
        addFluid("copper.molten", moltenCopper, MetalRates.ORE, FluidContainerMeta.BOTTLE_COPPER);
    FluidDictionary.rutile =
        addFluid("rutile.molten", moltenRutile, MetalRates.ORE, FluidContainerMeta.BOTTLE_RUTILE);

    // Vanilla Fluids
    FluidDictionary.iron =
        addFluid("iron.molten", moltenIron, MetalRates.ORE, FluidContainerMeta.BOTTLE_IRON);
    FluidDictionary.gold =
        addFluid("gold.molten", moltenGold, MetalRates.ORE, FluidContainerMeta.BOTTLE_GOLD);

    // Modded Fluids
    FluidDictionary.tin =
        addFluid("tin.molten", moltenTin, MetalRates.ORE, FluidContainerMeta.BOTTLE_TIN);
    FluidDictionary.lead =
        addFluid("lead.molten", moltenLead, MetalRates.ORE, FluidContainerMeta.BOTTLE_LEAD);
    FluidDictionary.silver =
        addFluid("silver.molten", moltenSilver, MetalRates.ORE, FluidContainerMeta.BOTTLE_SILVER);
    FluidDictionary.nickel =
        addFluid("nickel.molten", moltenNickel, MetalRates.ORE, FluidContainerMeta.BOTTLE_NICKEL);
    FluidDictionary.bronze =
        addFluid("bronze.molten", moltenBronze, MetalRates.ORE, FluidContainerMeta.BOTTLE_BRONZE);
    FluidDictionary.steel =
        addFluid("steel.molten", moltenSteel, MetalRates.ORE, FluidContainerMeta.BOTTLE_STEEL);
    FluidDictionary.electrum =
        addFluid(
            "electrum.molten", moltenElectrum, MetalRates.ORE, FluidContainerMeta.BOTTLE_ELECTRUM);

    registerVanillaBottle(FluidDictionary.natural_gas, 1000, FluidContainerMeta.BOTTLE_NORMAL_GAS);
    registerHeatBottle("water", 2000, FluidContainerMeta.BOTTLE_WATER);
    registerHeatBottle("lava", 2000, FluidContainerMeta.BOTTLE_LAVA);
  }

  public static void registerHeatBottle(String fluid, int vol, int meta) {
    FluidContainerRegistry.registerFluidContainer(
        FluidRegistry.getFluidStack(fluid, vol),
        new ItemStack(Core.liquidContainers, 1, meta),
        new ItemStack(Core.liquidContainers, 1, FluidContainerMeta.BOTTLE_EMPTY));
  }

  public static void registerVanillaBottle(String fluid, int vol, int meta) {
    FluidContainerRegistry.registerFluidContainer(
        FluidRegistry.getFluidStack(fluid, vol),
        new ItemStack(Core.liquidContainers, 1, meta),
        new ItemStack(Items.glass_bottle));
  }

  public static String addFluid(String name, Fluid globalFluid, int volume, int bottleMeta) {
    if (!FluidDictionary.instance.fluidExists(name)) {
      globalFluid = new FluidMari(name, bottleMeta).setUnlocalizedName(name);
      FluidRegistry.registerFluid(globalFluid);
      FluidDictionary.instance.addFluid(name, globalFluid);
    }

    Fluid fluid = FluidDictionary.getFluid(name);

    if (volume != -1) {
      registerHeatBottle(fluid.getName(), volume, bottleMeta);
    }

    return FluidDictionary.getFluid(name).getName();
  }

  private void registerBiomes() {
    // Frozen Biomes
    MaricultureHandlers.biomeType.addBiome(BiomeGenBase.iceMountains, EnumBiomeType.FROZEN);
    MaricultureHandlers.biomeType.addBiome(BiomeGenBase.icePlains, EnumBiomeType.FROZEN);
    MaricultureHandlers.biomeType.addBiome(BiomeGenBase.frozenRiver, EnumBiomeType.FROZEN);
    MaricultureHandlers.biomeType.addBiome(BiomeGenBase.coldTaiga, EnumBiomeType.FROZEN);
    MaricultureHandlers.biomeType.addBiome(BiomeGenBase.coldTaigaHills, EnumBiomeType.FROZEN);

    // Frozen Ocean
    MaricultureHandlers.biomeType.addBiome(BiomeGenBase.coldBeach, EnumBiomeType.FROZEN_OCEAN);
    MaricultureHandlers.biomeType.addBiome(BiomeGenBase.frozenOcean, EnumBiomeType.FROZEN_OCEAN);

    // Ocean
    MaricultureHandlers.biomeType.addBiome(BiomeGenBase.beach, EnumBiomeType.OCEAN);
    MaricultureHandlers.biomeType.addBiome(BiomeGenBase.ocean, EnumBiomeType.OCEAN);
    MaricultureHandlers.biomeType.addBiome(BiomeGenBase.deepOcean, EnumBiomeType.OCEAN);
    MaricultureHandlers.biomeType.addBiome(BiomeGenBase.stoneBeach, EnumBiomeType.OCEAN);

    // Cold
    MaricultureHandlers.biomeType.addBiome(BiomeGenBase.extremeHills, EnumBiomeType.COLD);
    MaricultureHandlers.biomeType.addBiome(BiomeGenBase.extremeHillsEdge, EnumBiomeType.COLD);
    MaricultureHandlers.biomeType.addBiome(BiomeGenBase.extremeHillsPlus, EnumBiomeType.COLD);
    MaricultureHandlers.biomeType.addBiome(BiomeGenBase.taiga, EnumBiomeType.COLD);
    MaricultureHandlers.biomeType.addBiome(BiomeGenBase.taigaHills, EnumBiomeType.COLD);
    MaricultureHandlers.biomeType.addBiome(BiomeGenBase.megaTaiga, EnumBiomeType.COLD);
    MaricultureHandlers.biomeType.addBiome(BiomeGenBase.megaTaigaHills, EnumBiomeType.COLD);

    // Normal
    MaricultureHandlers.biomeType.addBiome(BiomeGenBase.forest, EnumBiomeType.NORMAL);
    MaricultureHandlers.biomeType.addBiome(BiomeGenBase.forestHills, EnumBiomeType.NORMAL);
    MaricultureHandlers.biomeType.addBiome(BiomeGenBase.plains, EnumBiomeType.NORMAL);
    MaricultureHandlers.biomeType.addBiome(BiomeGenBase.river, EnumBiomeType.NORMAL);
    MaricultureHandlers.biomeType.addBiome(BiomeGenBase.swampland, EnumBiomeType.NORMAL);
    MaricultureHandlers.biomeType.addBiome(BiomeGenBase.birchForest, EnumBiomeType.NORMAL);
    MaricultureHandlers.biomeType.addBiome(BiomeGenBase.birchForestHills, EnumBiomeType.NORMAL);
    MaricultureHandlers.biomeType.addBiome(BiomeGenBase.roofedForest, EnumBiomeType.NORMAL);

    // Hot
    MaricultureHandlers.biomeType.addBiome(BiomeGenBase.jungle, EnumBiomeType.HOT);
    MaricultureHandlers.biomeType.addBiome(BiomeGenBase.jungleHills, EnumBiomeType.HOT);
    MaricultureHandlers.biomeType.addBiome(BiomeGenBase.savanna, EnumBiomeType.HOT);
    MaricultureHandlers.biomeType.addBiome(BiomeGenBase.savannaPlateau, EnumBiomeType.HOT);
    MaricultureHandlers.biomeType.addBiome(BiomeGenBase.mesa, EnumBiomeType.HOT);
    MaricultureHandlers.biomeType.addBiome(BiomeGenBase.mesaPlateau_F, EnumBiomeType.HOT);
    MaricultureHandlers.biomeType.addBiome(BiomeGenBase.mesaPlateau, EnumBiomeType.HOT);

    // Arid
    MaricultureHandlers.biomeType.addBiome(BiomeGenBase.desert, EnumBiomeType.ARID);
    MaricultureHandlers.biomeType.addBiome(BiomeGenBase.desertHills, EnumBiomeType.ARID);

    // Nether
    MaricultureHandlers.biomeType.addBiome(BiomeGenBase.hell, EnumBiomeType.HELL);

    // End
    MaricultureHandlers.biomeType.addBiome(BiomeGenBase.sky, EnumBiomeType.ENDER);

    // Mushroom
    MaricultureHandlers.biomeType.addBiome(BiomeGenBase.mushroomIsland, EnumBiomeType.MUSHROOM);
    MaricultureHandlers.biomeType.addBiome(
        BiomeGenBase.mushroomIslandShore, EnumBiomeType.MUSHROOM);
  }

  @Override
  public void addRecipes() {
    addFluids();
    Recipes.add();
  }
}
Esempio n. 9
0
public final class BotaniaAPI {

  private static List<LexiconCategory> categories = new ArrayList<LexiconCategory>();
  private static List<LexiconEntry> allEntries = new ArrayList<LexiconEntry>();

  public static List<RecipePetals> petalRecipes = new ArrayList<RecipePetals>();
  public static List<RecipeRuneAltar> runeAltarRecipes = new ArrayList<RecipeRuneAltar>();
  public static List<RecipeManaInfusion> manaInfusionRecipes = new ArrayList<RecipeManaInfusion>();

  private static BiMap<String, Class<? extends SubTileEntity>> subTiles =
      HashBiMap.<String, Class<? extends SubTileEntity>>create();
  public static Set<String> subtilesForCreativeMenu = new LinkedHashSet();

  public static Map<String, Integer> oreWeights = new HashMap<String, Integer>();

  public static Map<Item, Block> seeds = new HashMap();

  public static ArmorMaterial manasteelArmorMaterial =
      EnumHelper.addArmorMaterial("MANASTEEL", 16, new int[] {2, 6, 5, 2}, 18);
  public static ToolMaterial manasteelToolMaterial =
      EnumHelper.addToolMaterial("MANASTEEL", 3, 300, 6.2F, 2F, 20);

  public static ArmorMaterial terrasteelArmorMaterial =
      EnumHelper.addArmorMaterial("TERRASTEEL", 34, new int[] {3, 8, 6, 3}, 26);
  public static ToolMaterial terrasteelToolMaterial =
      EnumHelper.addToolMaterial("TERRASTEEL", 3, 2300, 9F, 3F, 26);

  static {
    registerSubTile("", DummySubTile.class);

    addOreWeight("oreAluminum", 3940); // Tinkers' Construct
    addOreWeight("oreAmber", 2075); // Thaumcraft
    addOreWeight("oreApatite", 1595); // Forestry
    addOreWeight("oreBlueTopaz", 3195); // Ars Magica
    addOreWeight("oreCassiterite", 1634); // GregTech
    addOreWeight("oreCertusQuartz", 3975); // Applied Energistics
    addOreWeight("oreChimerite", 3970); // Ars Magica
    addOreWeight("oreCinnabar", 2585); // Thaumcraft
    addOreWeight("oreCoal", 46525); // Vanilla
    addOreWeight("oreCooperite", 5); // GregTech
    addOreWeight("oreCopper", 8325); // IC2, Thermal Expansion, Tinkers' Construct, etc.
    addOreWeight("oreDarkIron", 1700); // Factorization
    addOreWeight("oreDiamond", 1265); // Vanilla
    addOreWeight("oreEmerald", 780); // Vanilla
    addOreWeight("oreEmery", 415); // GregTech
    addOreWeight("oreGalena", 1000); // Factorization
    addOreWeight("oreGold", 2970); // Vanilla
    addOreWeight("oreInfusedAir", 925); // Thaumcraft
    addOreWeight("oreInfusedEarth", 925); // Thaumcraft
    addOreWeight("oreInfusedEntropy", 925); // Thaumcraft
    addOreWeight("oreInfusedFire", 925); // Thaumcraft
    addOreWeight("oreInfusedOrder", 925); // Thaumcraft
    addOreWeight("oreInfusedWater", 925); // Thaumcraft
    addOreWeight("oreIridium", 30); // GregTech
    addOreWeight("oreIron", 20665); // Vanilla
    addOreWeight("oreLapis", 1285); // Vanilla
    addOreWeight("oreLead", 7985); // IC2, Thermal Expansion, Factorization, etc.
    addOreWeight("oreMCropsEssence", 3085); // Magical Crops
    addOreWeight("oreNickel", 2275); // Thermal Expansion
    addOreWeight("oreOlivine", 1100); // Project RED
    addOreWeight("oreRedstone", 6885); // Vanilla
    addOreWeight("oreRuby", 1100); // Project RED
    addOreWeight("oreSapphire", 1100); // Project RED
    addOreWeight("oreSilver", 6300); // Thermal Expansion, Factorization, etc.
    addOreWeight("oreSphalerite", 25); // GregTech
    addOreWeight("oreSulfur", 1105); // Railcraft
    addOreWeight("oreTetrahedrite", 4040); // GregTech
    addOreWeight("oreTin", 9450); // IC2, Thermal Expansion, etc.
    addOreWeight("oreTungstate", 20); // GregTech
    addOreWeight("oreUranium", 1337); // IC2
    addOreWeight("oreVinteum", 5925); // Ars Magica
    addOreWeight("oreYellorite", 3520); // Big Reactors

    addSeed(Items.wheat_seeds, Blocks.wheat);
    addSeed(Items.potato, Blocks.potatoes);
    addSeed(Items.carrot, Blocks.carrots);
    addSeed(Items.nether_wart, Blocks.nether_wart);
    addSeed(Items.pumpkin_seeds, Blocks.pumpkin_stem);
    addSeed(Items.melon_seeds, Blocks.melon_stem);
  }

  /**
   * The internal method handler in use. Do not overwrite.
   *
   * @see IInternalMethodHandler
   */
  public static IInternalMethodHandler internalHandler = new DummyMethodHandler();

  /**
   * Registers a Petal Recipe.
   *
   * @param output The ItemStack to craft.
   * @param inputs The objects for crafting. Can be ItemStack, MappableStackWrapper or String (case
   *     for Ore Dictionary). The array can't be larger than 16.
   * @return The recipe created.
   */
  public static RecipePetals registerPetalRecipe(ItemStack output, Object... inputs) {
    RecipePetals recipe = new RecipePetals(output, inputs);
    petalRecipes.add(recipe);
    return recipe;
  }

  /**
   * Registers a Rune Altar
   *
   * @param output The ItemStack to craft.
   * @param mana The amount of mana required. Don't go over 100000!
   * @param inputs The objects for crafting. Can be ItemStack, MappableStackWrapper or String (case
   *     for Ore Dictionary). The array can't be larger than 16.
   * @return The recipe created.
   */
  public static RecipeRuneAltar registerRuneAltarRecipe(
      ItemStack output, int mana, Object... inputs) {
    RecipeRuneAltar recipe = new RecipeRuneAltar(output, mana, inputs);
    runeAltarRecipes.add(recipe);
    return recipe;
  }

  /**
   * Registers a Mana Infusion Recipe (throw an item in a mana pool)
   *
   * @param output The ItemStack to craft
   * @param input The input item, be it an ItemStack or an ore dictionary entry String.
   * @param mana The amount of mana required. Don't go over 100000!
   * @return The recipe created.
   */
  public static RecipeManaInfusion registerManaInfusionRecipe(
      ItemStack output, Object input, int mana) {
    RecipeManaInfusion recipe = new RecipeManaInfusion(output, input, mana);
    manaInfusionRecipes.add(recipe);
    return recipe;
  }

  /**
   * Register a Mana Infusion Recipe and flags it as an Alchemy recipe (requires an Alchemy Catalyst
   * below the pool).
   *
   * @see BotaniaAPI#registerManaInfusionRecipe
   */
  public static RecipeManaInfusion registerManaAlchemyRecipe(
      ItemStack output, Object input, int mana) {
    RecipeManaInfusion recipe = registerManaInfusionRecipe(output, input, mana);
    recipe.setAlchemy(true);
    return recipe;
  }

  /** Registers a SubTileEntity, a new special flower. Look in the subtile package of the API. */
  public static void registerSubTile(String key, Class<? extends SubTileEntity> subtileClass) {
    subTiles.put(key, subtileClass);
  }

  /**
   * Adds the key for a SubTileEntity into the creative menu. This goes into the
   * subtilesForCreativeMenu Set.
   */
  public static void addSubTileToCreativeMenu(String key) {
    subtilesForCreativeMenu.add(key);
  }

  /** Adds a category to the list of registered categories to appear in the Lexicon. */
  public static void addCategory(LexiconCategory category) {
    categories.add(category);
  }

  /** Gets all registered categories. */
  public static List<LexiconCategory> getAllCategories() {
    return categories;
  }

  /** Registers a Lexicon Entry and adds it to the category passed in. */
  public static void addEntry(LexiconEntry entry, LexiconCategory category) {
    allEntries.add(entry);
    category.entries.add(entry);
  }

  /**
   * Maps an ore (ore dictionary key) to it's weight on the world generation. This is used for the
   * Orechid flower. Check the static block in the BotaniaAPI class to get the weights for the
   * vanilla blocks.<br>
   * Alternatively get the values with the OreDetector mod:<br>
   * https://gist.github.com/Vazkii/9493322
   */
  public static void addOreWeight(String ore, int weight) {
    oreWeights.put(ore, weight);
  }

  public static int getOreWeight(String ore) {
    return oreWeights.get(ore);
  }

  /**
   * Allows an item to be counted as a seed. Any item in this list can be dispensed by a dispenser,
   * the block is the block to be placed.
   */
  public static void addSeed(Item item, Block block) {
    seeds.put(item, block);
  }

  /** Gets the last recipe to have been added to the recipe list. */
  public static IRecipe getLatestAddedRecipe() {
    List<IRecipe> list = CraftingManager.getInstance().getRecipeList();
    return list.get(list.size() - 1);
  }

  /** Gets the last x recipes added to the recipe list. */
  public static List<IRecipe> getLatestAddedRecipes(int x) {
    List<IRecipe> list = CraftingManager.getInstance().getRecipeList();
    List<IRecipe> newList = new ArrayList();
    for (int i = x - 1; i >= 0; i--) newList.add(list.get(list.size() - 1 - i));

    return newList;
  }

  public static Class<? extends SubTileEntity> getSubTileMapping(String key) {
    if (!subTiles.containsKey(key)) key = "";

    return subTiles.get(key);
  }

  public static String getSubTileStringMapping(Class<? extends SubTileEntity> clazz) {
    return subTiles.inverse().get(clazz);
  }
}
 public ItemPickaxeStainlessSteel() {
   super(EnumHelper.addToolMaterial("STAINLESSSTEEL", 3, 8421, 15.0F, 10.0F, 20));
 }
Esempio n. 11
0
public class ModWeapons {

  // Tool Materials
  // ("NAME", harvestLevel, durability, miningSpeed, damageVsEntities, enchantability)
  public static final Item.ToolMaterial XenoriteToolMaterials =
      EnumHelper.addToolMaterial("XenoriteToolMaterials", 4, 780, 8.0F, 1.5F, 22);

  public static final Item.ToolMaterial CoreoriteToolMaterials =
      EnumHelper.addToolMaterial("CoreoriteToolMaterials", 4, 780, 8.0F, 1.5F, 22);

  public static final Item.ToolMaterial FinoriteToolMaterials =
      EnumHelper.addToolMaterial("FinoriteToolMaterials", 4, 780, 8.0F, 1.5F, 22);

  public static final Item.ToolMaterial HeavenlyGlintToolMaterials =
      EnumHelper.addToolMaterial("HeavenlyGlintToolMaterials", 4, 780, 8.0F, 1.5F, 22);

  public static final Item.ToolMaterial ShadowBoronToolMaterials =
      EnumHelper.addToolMaterial("ShadowBoronToolMaterials", 4, 780, 8.0F, 1.5F, 22);

  public static final Item.ToolMaterial XCFMasterToolMaterials =
      EnumHelper.addToolMaterial("XCFMasterToolMaterials", 8, 960, 16.0F, 3.0F, 44);

  public static final Item.ToolMaterial PeacefulGlintingShadowToolMaterials =
      EnumHelper.addToolMaterial("PeacefulGlintingShadowToolMaterials", 8, 960, 16.0F, 3.0F, 44);

  public static final Item.ToolMaterial WorldlyToolMaterials =
      EnumHelper.addToolMaterial("WorldlyToolMaterials", 16, 1920, 32.0F, 6.0F, 88);

  public static final WeaponXenorite xenoriteSword = new XenoriteSword(XenoriteToolMaterials);
  public static final WeaponXenorite coreoriteSword = new CoreoriteSword(CoreoriteToolMaterials);
  public static final WeaponXenorite finoriteSword = new FinoriteSword(FinoriteToolMaterials);
  public static final WeaponXenorite heavenlyglintSword =
      new HeavenlyGlintSword(HeavenlyGlintToolMaterials);
  public static final WeaponXenorite shadowboronSword =
      new ShadowBoronSword(ShadowBoronToolMaterials);
  public static final WeaponXenorite xcfMasterSword = new XCFMasterSword(XCFMasterToolMaterials);
  public static final WeaponXenorite peacefulGlintingShadowSword =
      new PeacefulGlintingShadowSword(PeacefulGlintingShadowToolMaterials);
  public static final WeaponXenorite worldlySword = new WorldlySword(WorldlyToolMaterials);

  public static void init() {
    GameRegistry.registerItem(xenoriteSword, "xenoriteSword");
    OreDictionary.registerOre("swordXenorite", new ItemStack(xenoriteSword));

    GameRegistry.registerItem(coreoriteSword, "coreoriteSword");
    OreDictionary.registerOre("swordCoreorite", new ItemStack(coreoriteSword));

    GameRegistry.registerItem(finoriteSword, "finoriteSword");
    OreDictionary.registerOre("swordFinorite", new ItemStack(finoriteSword));

    GameRegistry.registerItem(heavenlyglintSword, "heavenlyglintSword");
    OreDictionary.registerOre("swordHeavenlyGlint", new ItemStack(heavenlyglintSword));

    GameRegistry.registerItem(shadowboronSword, "shadowboronSword");
    OreDictionary.registerOre("swordShadowBoron", new ItemStack(shadowboronSword));

    GameRegistry.registerItem(xcfMasterSword, "xcfMasterSword");
    OreDictionary.registerOre("swordXCFMaster", new ItemStack(xcfMasterSword));

    GameRegistry.registerItem(peacefulGlintingShadowSword, "peacefulGlintingShadowSword");
    OreDictionary.registerOre(
        "swordPeacefulGlintingShadow", new ItemStack(peacefulGlintingShadowSword));

    GameRegistry.registerItem(worldlySword, "worldlySword");
    OreDictionary.registerOre("swordWorldly", new ItemStack(worldlySword));
  }
}
Esempio n. 12
0
@Mod(modid = Reference.MODID, name = Reference.NAME, version = Reference.VERSION)
public class FirstMod {
  @Mod.Instance("FirstMod")
  public static FirstMod instance;

  public static Block FirstOre;
  public static Item FirstOreGem;

  // WorldGen

  public static FirstOreWorld worldgenore = new FirstOreWorld();

  // Tools
  public static Item firstore_pickaxe;
  public static Item firstore_axe;
  public static Item firstore_shovel;
  public static Item firstore_sword;
  public static Item firstore_hoe;

  // Materials
  static Item.ToolMaterial firstoreMaterial =
      EnumHelper.addToolMaterial("firstoreMaterial", 3, 3250, 10.0F, 3.5F, 15);
  static ItemArmor.ArmorMaterial firstoreArmorMaterial =
      EnumHelper.addArmorMaterial("firstoreArmorMaterial", 45, new int[] {4, 9, 7, 4}, 8);

  // Armor
  public static Item firstore_boots;
  public static Item firstore_chestplate;
  public static Item firstore_helmet;
  public static Item firstore_leggings;

  @Mod.EventHandler
  public void preInit(FMLPreInitializationEvent event) {
    FirstOre = new BlockFirstOre();
    FirstOreGem = new ItemFirstOreGem();
    RegisterHelper.registerItem(FirstOreGem);
    RegisterHelper.registerBlock(FirstOre);

    // Tools

    firstore_pickaxe = new ItemFirstOrePickaxe(firstoreMaterial);
    RegisterHelper.registerItem(firstore_pickaxe);
    GameRegistry.addRecipe(
        new ItemStack(firstore_pickaxe),
        new Object[] {
          "XXX", " Y ", " Z ", 'X', FirstOreGem, 'Y', Items.diamond_pickaxe, 'Z', Items.stick
        });

    firstore_axe = new ItemFirstOreAxe(firstoreMaterial);
    RegisterHelper.registerItem(firstore_axe);
    GameRegistry.addRecipe(
        new ItemStack(firstore_axe),
        new Object[] {
          "XX", "XY", " Z", 'X', FirstOreGem, 'Y', Items.diamond_axe, 'Z', Items.stick
        });
    GameRegistry.addRecipe(
        new ItemStack(firstore_axe),
        new Object[] {
          "XX", "YX", "Z ", 'X', FirstOreGem, 'Y', Items.diamond_axe, 'Z', Items.stick
        });

    firstore_shovel = new ItemFirstOreShovel(firstoreMaterial);
    RegisterHelper.registerItem(firstore_shovel);
    GameRegistry.addRecipe(
        new ItemStack(firstore_shovel),
        new Object[] {
          " X ", " Y ", " Z ", 'X', FirstOreGem, 'Y', Items.diamond_shovel, 'Z', Items.stick
        });

    firstore_hoe = new ItemFirstOrehoe(firstoreMaterial);
    RegisterHelper.registerItem(firstore_hoe);
    GameRegistry.addRecipe(
        new ItemStack(firstore_hoe),
        new Object[] {
          "XX ", " Y ", " Z ", 'X', FirstOreGem, 'Y', Items.diamond_hoe, 'Z', Items.stick
        });

    firstore_sword = new ItemFirstOreSword(firstoreMaterial);
    RegisterHelper.registerItem(firstore_sword);
    GameRegistry.addRecipe(
        new ItemStack(firstore_sword),
        new Object[] {" X ", " X ", " Y ", 'X', FirstOreGem, 'Y', Items.diamond_sword});

    // armor
    firstore_helmet = new ItemFirstOreArmor(firstoreArmorMaterial, 0, "firstore_helmet");
    RegisterHelper.registerItem(firstore_helmet);
    GameRegistry.addRecipe(
        new ItemStack(firstore_helmet),
        new Object[] {"XXX", "XYX", 'X', FirstOreGem, 'Y', Items.diamond_helmet});

    firstore_chestplate = new ItemFirstOreArmor(firstoreArmorMaterial, 1, "firstore_chestplate");
    RegisterHelper.registerItem(firstore_chestplate);
    GameRegistry.addRecipe(
        new ItemStack(firstore_chestplate),
        new Object[] {"XYX", "XXX", "XXX", 'X', FirstOreGem, 'Y', Items.diamond_chestplate});

    firstore_leggings = new ItemFirstOreArmor(firstoreArmorMaterial, 2, "firstore_leggings");
    RegisterHelper.registerItem(firstore_leggings);
    GameRegistry.addRecipe(
        new ItemStack(firstore_leggings),
        new Object[] {"XXX", "XYX", "X X", 'X', FirstOreGem, 'Y', Items.diamond_leggings});

    firstore_boots = new ItemFirstOreArmor(firstoreArmorMaterial, 3, "firstore_boots");
    RegisterHelper.registerItem(firstore_boots);
    GameRegistry.addRecipe(
        new ItemStack(firstore_boots),
        new Object[] {"XYX", "X X", 'X', FirstOreGem, 'Y', Items.diamond_boots});

    GameRegistry.registerWorldGenerator(worldgenore, 1);
  }

  @Mod.EventHandler
  public void init(FMLInitializationEvent event) {}

  @Mod.EventHandler
  public void postInit(FMLPostInitializationEvent event) {}
}
public class ItemSwordInfinity extends ItemSword implements ICosmicRenderItem {

  public static final String[] types = new String[] {"normal", "meow"};
  private static final ToolMaterial opSword =
      EnumHelper.addToolMaterial("INFINITY_SWORD", 32, 9999, 9999F, -3.0F, 200);
  private IIcon cosmicMask;
  private IIcon pommel;

  public static Field stupidMojangProtectedVariable;

  static {
    try {
      stupidMojangProtectedVariable =
          ReflectionHelper.findField(EntityLivingBase.class, "recentlyHit", "field_70718_bc");
    } catch (Exception e) {
      Lumberjack.log(Level.ERROR, e);
    }
  }

  public ItemSwordInfinity() {
    super(opSword);
    this.setHasSubtypes(true);
    setUnlocalizedName("infinity_sword");
    setTextureName("avaritia:infinity_sword");
    setCreativeTab(Avaritia.tab);
  }

  @Override
  public boolean hitEntity(ItemStack stack, EntityLivingBase victim, EntityLivingBase player) {
    if (player.worldObj.isRemote) return true;
    if (victim instanceof EntityPlayer) {
      EntityPlayer pvp = (EntityPlayer) victim;
      if (LudicrousItems.isInfinite(pvp)) {
        victim.attackEntityFrom(
            new DamageSourceInfinitySword(player).setDamageBypassesArmor(), 4.0F);
        return true;
      }
      if (pvp.getHeldItem() != null
          && pvp.getHeldItem().getItem() == LudicrousItems.infinity_sword
          && pvp.isUsingItem()) return true;
    }

    try {
      stupidMojangProtectedVariable.setInt(victim, 60);
    } catch (Exception e) {
      Lumberjack.log(Level.ERROR, e, "The sword isn't reflecting right! Polish it!");
    }
    victim
        .func_110142_aN()
        .func_94547_a(
            new DamageSourceInfinitySword(player), victim.getHealth(), victim.getHealth());
    victim.setHealth(0);
    victim.onDeath(new EntityDamageSource("infinity", player));
    return true;
  }

  @Override
  public String getUnlocalizedName(ItemStack stack) {
    int i = MathHelper.clamp_int(stack.getItemDamage(), 0, types.length);
    return "item.infinity_sword_" + types[i];
  }

  @Override
  public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) {
    if (!entity.worldObj.isRemote && entity instanceof EntityPlayer) {
      EntityPlayer victim = (EntityPlayer) entity;
      if (victim.capabilities.isCreativeMode
          && !victim.isDead
          && victim.getHealth() > 0
          && !LudicrousItems.isInfinite(victim)) {
        victim
            .func_110142_aN()
            .func_94547_a(
                new DamageSourceInfinitySword(player), victim.getHealth(), victim.getHealth());
        victim.setHealth(0);
        victim.onDeath(new EntityDamageSource("infinity", player));
        player.addStat(Achievements.creative_kill, 1);
        return true;
      }
    }
    return false;
  }

  @Override
  public EnumRarity getRarity(ItemStack stack) {
    return LudicrousItems.cosmic;
  }

  @Override
  public void setDamage(ItemStack stack, int damage) {
    super.setDamage(stack, 0);
  }

  @Override
  @SideOnly(Side.CLIENT)
  public IIcon getMaskTexture(ItemStack stack, EntityPlayer player) {
    return cosmicMask;
  }

  @Override
  @SideOnly(Side.CLIENT)
  public float getMaskMultiplier(ItemStack stack, EntityPlayer player) {
    return 1.0f;
  }

  @SideOnly(Side.CLIENT)
  @Override
  public void registerIcons(IIconRegister ir) {
    super.registerIcons(ir);

    this.cosmicMask = ir.registerIcon("avaritia:infinity_sword_mask");
    this.pommel = ir.registerIcon("avaritia:infinity_sword_pommel");
  }

  @Override
  public IIcon getIcon(ItemStack stack, int pass) {
    if (pass == 1) {
      return this.pommel;
    }

    return super.getIcon(stack, pass);
  }

  @SideOnly(Side.CLIENT)
  @Override
  public boolean requiresMultipleRenderPasses() {
    return true;
  }

  @Override
  public boolean hasCustomEntity(ItemStack stack) {
    return true;
  }

  @Override
  public Entity createEntity(World world, Entity location, ItemStack itemstack) {
    return new EntityImmortalItem(world, location, itemstack);
  }

  @Override
  @SideOnly(Side.CLIENT)
  public boolean hasEffect(ItemStack par1ItemStack, int pass) {
    return false;
  }
}