BiomesOPlenty/common/biomesoplenty/configuration/BOPItems.java

159 lines
10 KiB
Java
Raw Normal View History

2013-05-03 13:00:44 +00:00
package biomesoplenty.configuration;
import java.util.Map;
import java.util.logging.Level;
import net.minecraft.item.EnumArmorMaterial;
import net.minecraft.item.EnumToolMaterial;
import net.minecraft.item.Item;
import net.minecraftforge.common.EnumHelper;
import net.minecraftforge.common.MinecraftForge;
import biomesoplenty.BiomesOPlenty;
import biomesoplenty.api.Items;
import biomesoplenty.armor.ArmorAmethyst;
2013-09-14 02:18:07 +00:00
import biomesoplenty.armor.ArmorFlippers;
import biomesoplenty.armor.ArmorFlowerBand;
2013-05-03 13:00:44 +00:00
import biomesoplenty.armor.ArmorMuddy;
2013-09-13 23:28:11 +00:00
import biomesoplenty.armor.ArmorWadingBoots;
2013-09-14 10:16:39 +00:00
import biomesoplenty.configuration.configfile.BOPConfigurationIDs;
2013-05-03 13:00:44 +00:00
import biomesoplenty.items.ItemBOP;
import biomesoplenty.items.ItemBOPAncientStaff;
import biomesoplenty.items.ItemBOPAxe;
import biomesoplenty.items.ItemBOPFood;
2013-05-03 13:00:44 +00:00
import biomesoplenty.items.ItemBOPHoe;
import biomesoplenty.items.ItemBOPMudball;
import biomesoplenty.items.ItemBOPPickaxe;
import biomesoplenty.items.ItemBOPRecord;
import biomesoplenty.items.ItemBOPRecordMud;
2013-06-18 08:59:00 +00:00
import biomesoplenty.items.ItemBOPScythe;
2013-05-03 13:00:44 +00:00
import biomesoplenty.items.ItemBOPSpade;
import biomesoplenty.items.ItemBOPSword;
import biomesoplenty.items.ItemDart;
import biomesoplenty.items.ItemDartBlower;
2013-05-03 13:00:44 +00:00
import biomesoplenty.items.ItemEnderporter;
import biomesoplenty.items.ItemGems;
2013-11-15 02:56:00 +00:00
import biomesoplenty.items.ItemJarEmpty;
import biomesoplenty.items.ItemJarFilled;
2013-05-03 13:00:44 +00:00
import com.google.common.base.Optional;
import cpw.mods.fml.common.FMLLog;
import cpw.mods.fml.common.registry.GameData;
import cpw.mods.fml.relauncher.ReflectionHelper;
public class BOPItems {
public static Item shears;
2013-05-31 10:34:02 +00:00
2013-05-03 13:00:44 +00:00
// Material declaration
public static EnumArmorMaterial EnumArmorMaterialMud;
public static EnumToolMaterial EnumToolMaterialMud;
public static EnumArmorMaterial EnumArmorMaterialAmethyst;
public static EnumToolMaterial EnumToolMaterialAmethyst;
public static EnumArmorMaterial EnumArmorMaterialFlowerBand;
2013-09-13 23:28:11 +00:00
public static EnumArmorMaterial EnumArmorMaterialWadingBoots;
2013-09-14 02:18:07 +00:00
public static EnumArmorMaterial EnumArmorMaterialFlippers;
2013-05-31 10:34:02 +00:00
public static int clearItem(Item var1)
{
return clearItem(var1.itemID);
}
public static int clearItem(Item var1, boolean var2)
{
return clearItem(var1.itemID, var2);
}
public static int clearItem(int var1)
{
return clearItem(var1, true);
}
public static int clearItem(int var1, boolean var2)
{
if (var1 < 0 || var1 >= Item.itemsList.length)
{
FMLLog.log(Level.SEVERE, "BiomesOPlenty has an invalid item ID (%i)", new Object[] {Integer.valueOf(var1)});
}
if (var2 && Item.itemsList[var1] == null)
{
FMLLog.log(Level.WARNING, "BiomesOPlenty tried clearing an already cleared item (%i)", new Object[] {Integer.valueOf(var1)});
}
Item.itemsList[var1] = null;
Map var3 = (Map)ReflectionHelper.getPrivateValue(GameData.class, null, new String[] {"idMap"});
var3.remove(Integer.valueOf(var1));
return var1 - 256;
}
2013-05-03 13:00:44 +00:00
public static void init()
{
// Material declaration
EnumArmorMaterialMud = EnumHelper.addArmorMaterial("MUD", 2, new int[]{1, 1, 1, 1}, 5);
EnumToolMaterialMud = EnumHelper.addToolMaterial("MUD", 0, 32, 0.5F, 0, 1);
2013-05-03 13:00:44 +00:00
EnumArmorMaterialAmethyst = EnumHelper.addArmorMaterial("AMETHYST", 40, new int[]{6, 12, 10, 6}, 20);
EnumToolMaterialAmethyst = EnumHelper.addToolMaterial("AMETHYST", 4, 2013, 15.0F, 5, 16);
2013-05-31 10:34:02 +00:00
EnumArmorMaterialFlowerBand = EnumHelper.addArmorMaterial("FLOWERBAND", -1, new int[]{0, 0, 0, 0}, 0);
2013-09-13 23:28:11 +00:00
EnumArmorMaterialWadingBoots = EnumHelper.addArmorMaterial("WADINGBOOTS", -1, new int[]{0, 0, 0, 0}, 0);
2013-09-14 02:18:07 +00:00
EnumArmorMaterialFlippers = EnumHelper.addArmorMaterial("FLIPPERS", -1, new int[]{0, 0, 0, 0}, 0);
2013-05-31 10:34:02 +00:00
initializeItems();
MinecraftForge.setToolClass(Items.shovelAmethyst.get(), "shovel", 4);
MinecraftForge.setToolClass(Items.pickaxeAmethyst.get(), "pickaxe", 4);
MinecraftForge.setToolClass(Items.axeAmethyst.get(), "axe", 4);
2013-05-03 13:00:44 +00:00
}
2013-05-31 10:34:02 +00:00
2013-05-03 13:00:44 +00:00
private static void initializeItems()
{
2013-05-31 10:34:02 +00:00
// Item declaration
2013-09-14 10:16:39 +00:00
Items.food = Optional.of(new ItemBOPFood(BOPConfigurationIDs.foodID).setUnlocalizedName("bop.food"));
Items.miscItems = Optional.of(new ItemBOP(BOPConfigurationIDs.miscItemsID).setUnlocalizedName("bop.miscItems"));
2013-11-15 02:56:00 +00:00
Items.jarEmpty = Optional.of(new ItemJarEmpty(BOPConfigurationIDs.jarEmptyID).setUnlocalizedName("bop.jarEmpty"));
Items.jarFilled = Optional.of(new ItemJarFilled(BOPConfigurationIDs.jarFilledID).setUnlocalizedName("bop.jarFilled").setContainerItem(Items.jarEmpty.get()));
Items.gems = Optional.of(new ItemGems(BOPConfigurationIDs.gemsID).setUnlocalizedName("bop.gems"));
2013-09-14 10:16:39 +00:00
Items.mudball = Optional.of(new ItemBOPMudball(BOPConfigurationIDs.mudballID).setUnlocalizedName("bop.mudball"));
Items.dartBlower = Optional.of(new ItemDartBlower(BOPConfigurationIDs.dartBlowerID).setUnlocalizedName("bop.dartblower"));
Items.dart = Optional.of(new ItemDart(BOPConfigurationIDs.dartID).setUnlocalizedName("bop.dart"));
Items.ancientStaff = Optional.of(new ItemBOPAncientStaff(BOPConfigurationIDs.ancientStaffID).setUnlocalizedName("bop.ancientStaff"));
Items.enderporter = Optional.of(new ItemEnderporter(BOPConfigurationIDs.enderporterID).setUnlocalizedName("bop.enderporter"));
Items.bopDisc = Optional.of(new ItemBOPRecord(BOPConfigurationIDs.bopDiscID, "bopdisc").setUnlocalizedName("bop.bopDisc"));
Items.bopDiscMud = Optional.of(new ItemBOPRecordMud(BOPConfigurationIDs.bopDiscMudID, "bopdiscmud").setUnlocalizedName("bop.bopDiscMud"));
Items.swordMud = Optional.of((new ItemBOPSword(BOPConfigurationIDs.swordMudID, EnumToolMaterialMud, 0)).setUnlocalizedName("bop.swordMud"));
Items.shovelMud = Optional.of((new ItemBOPSpade(BOPConfigurationIDs.shovelMudID, EnumToolMaterialMud, 0)).setUnlocalizedName("bop.shovelMud"));
Items.pickaxeMud = Optional.of((new ItemBOPPickaxe(BOPConfigurationIDs.pickaxeMudID, EnumToolMaterialMud, 0)).setUnlocalizedName("bop.pickaxeMud"));
Items.axeMud = Optional.of((new ItemBOPAxe(BOPConfigurationIDs.axeMudID, EnumToolMaterialMud, 0)).setUnlocalizedName("bop.hatchetMud"));
Items.hoeMud = Optional.of((new ItemBOPHoe(BOPConfigurationIDs.hoeMudID, EnumToolMaterialMud, 0)).setUnlocalizedName("bop.hoeMud"));
Items.helmetMud = Optional.of((new ArmorMuddy(BOPConfigurationIDs.helmetMudID, EnumArmorMaterialMud, BiomesOPlenty.proxy.addArmor("mud"), 0)).setUnlocalizedName("bop.helmetMud"));
Items.chestplateMud = Optional.of((new ArmorMuddy(BOPConfigurationIDs.chestplateMudID, EnumArmorMaterialMud, BiomesOPlenty.proxy.addArmor("mud"), 1)).setUnlocalizedName("bop.chestplateMud"));
Items.leggingsMud = Optional.of((new ArmorMuddy(BOPConfigurationIDs.leggingsMudID, EnumArmorMaterialMud, BiomesOPlenty.proxy.addArmor("mud"), 2)).setUnlocalizedName("bop.leggingsMud"));
Items.bootsMud = Optional.of((new ArmorMuddy(BOPConfigurationIDs.bootsMudID, EnumArmorMaterialMud, BiomesOPlenty.proxy.addArmor("mud"), 3)).setUnlocalizedName("bop.bootsMud"));
Items.swordAmethyst = Optional.of((new ItemBOPSword(BOPConfigurationIDs.swordAmethystID, EnumToolMaterialAmethyst, 1)).setUnlocalizedName("bop.swordAmethyst"));
Items.shovelAmethyst = Optional.of((new ItemBOPSpade(BOPConfigurationIDs.shovelAmethystID, EnumToolMaterialAmethyst, 1)).setUnlocalizedName("bop.shovelAmethyst"));
Items.pickaxeAmethyst = Optional.of((new ItemBOPPickaxe(BOPConfigurationIDs.pickaxeAmethystID, EnumToolMaterialAmethyst, 1)).setUnlocalizedName("bop.pickaxeAmethyst"));
Items.axeAmethyst = Optional.of((new ItemBOPAxe(BOPConfigurationIDs.axeAmethystID, EnumToolMaterialAmethyst, 1)).setUnlocalizedName("bop.hatchetAmethyst"));
Items.hoeAmethyst = Optional.of((new ItemBOPHoe(BOPConfigurationIDs.hoeAmethystID, EnumToolMaterialAmethyst, 1)).setUnlocalizedName("bop.hoeAmethyst"));
Items.helmetAmethyst = Optional.of((new ArmorAmethyst(BOPConfigurationIDs.helmetAmethystID, EnumArmorMaterialAmethyst, BiomesOPlenty.proxy.addArmor("amethyst"), 0)).setUnlocalizedName("bop.helmetAmethyst"));
Items.chestplateAmethyst = Optional.of((new ArmorAmethyst(BOPConfigurationIDs.chestplateAmethystID, EnumArmorMaterialAmethyst, BiomesOPlenty.proxy.addArmor("amethyst"), 1)).setUnlocalizedName("bop.chestplateAmethyst"));
Items.leggingsAmethyst = Optional.of((new ArmorAmethyst(BOPConfigurationIDs.leggingsAmethystID, EnumArmorMaterialAmethyst, BiomesOPlenty.proxy.addArmor("amethyst"), 2)).setUnlocalizedName("bop.leggingsAmethyst"));
Items.bootsAmethyst = Optional.of((new ArmorAmethyst(BOPConfigurationIDs.bootsAmethystID, EnumArmorMaterialAmethyst, BiomesOPlenty.proxy.addArmor("amethyst"), 3)).setUnlocalizedName("bop.bootsAmethyst"));
2013-06-18 08:59:00 +00:00
2013-09-14 10:16:39 +00:00
Items.scytheWood = Optional.of((new ItemBOPScythe(BOPConfigurationIDs.scytheWoodID, 2, EnumToolMaterial.WOOD, 0).setUnlocalizedName("bop.scytheWood")));
Items.scytheStone = Optional.of((new ItemBOPScythe(BOPConfigurationIDs.scytheStoneID, 2, EnumToolMaterial.STONE, 1).setUnlocalizedName("bop.scytheStone")));
Items.scytheIron = Optional.of((new ItemBOPScythe(BOPConfigurationIDs.scytheIronID, 2, EnumToolMaterial.IRON, 2).setUnlocalizedName("bop.scytheIron")));
Items.scytheGold = Optional.of((new ItemBOPScythe(BOPConfigurationIDs.scytheGoldID, 2, EnumToolMaterial.GOLD, 3).setUnlocalizedName("bop.scytheGold")));
Items.scytheDiamond = Optional.of((new ItemBOPScythe(BOPConfigurationIDs.scytheDiamondID, 2, EnumToolMaterial.EMERALD, 4).setUnlocalizedName("bop.scytheDiamond")));
Items.scytheMud = Optional.of((new ItemBOPScythe(BOPConfigurationIDs.scytheMudID, 2, EnumToolMaterialMud, 5).setUnlocalizedName("bop.scytheMud")));
Items.scytheAmethyst = Optional.of((new ItemBOPScythe(BOPConfigurationIDs.scytheAmethystID, 2, EnumToolMaterialAmethyst, 6).setUnlocalizedName("bop.scytheAmethyst")));
Items.flowerBand = Optional.of((new ArmorFlowerBand(BOPConfigurationIDs.flowerBandID, EnumArmorMaterialFlowerBand, BiomesOPlenty.proxy.addArmor("flowerBand"), 0)).setCreativeTab(BiomesOPlenty.tabBiomesOPlenty).setUnlocalizedName("bop.flowerBand"));
Items.wadingBoots = Optional.of((new ArmorWadingBoots(BOPConfigurationIDs.wadingBootsID, EnumArmorMaterialWadingBoots, BiomesOPlenty.proxy.addArmor("wadingBoots"), 3)).setCreativeTab(BiomesOPlenty.tabBiomesOPlenty).setUnlocalizedName("bop.wadingBoots"));
Items.flippers = Optional.of((new ArmorFlippers(BOPConfigurationIDs.flippersID, EnumArmorMaterialFlippers, BiomesOPlenty.proxy.addArmor("flippers"), 3)).setCreativeTab(BiomesOPlenty.tabBiomesOPlenty).setUnlocalizedName("bop.flippers"));
2013-05-03 13:00:44 +00:00
}
}