From d4962ddb669b26077aca58e7888b370ffaf7448e Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sat, 11 Jul 2015 06:45:26 +0200 Subject: [PATCH] Added Emerald and Obsidian Armor, added Info on Scuba Armor --- .../config/values/ConfigIntValues.java | 18 +++++++++++++-- .../creative/CreativeTab.java | 15 ++++++++++++ .../actuallyadditions/items/InitItems.java | 23 +++++++++++++++++++ .../items/ItemScubaArmor.java | 18 +++++++++++++++ .../material/InitArmorMaterials.java | 3 +++ 5 files changed, 75 insertions(+), 2 deletions(-) diff --git a/src/main/java/ellpeck/actuallyadditions/config/values/ConfigIntValues.java b/src/main/java/ellpeck/actuallyadditions/config/values/ConfigIntValues.java index a450f0f48..b78e7304e 100644 --- a/src/main/java/ellpeck/actuallyadditions/config/values/ConfigIntValues.java +++ b/src/main/java/ellpeck/actuallyadditions/config/values/ConfigIntValues.java @@ -35,12 +35,26 @@ public enum ConfigIntValues{ OBSIDIAN_USES("Obsidian: Max Uses", ConfigCategories.TOOL_VALUES, 8000, 50, 20000, "How often Obsidian Tools can be used"), OBSIDIAN_ENCHANTABILITY("Obsidian: Enchantability", ConfigCategories.TOOL_VALUES, 15, 1, 30, "How enchantable an Obsidian Tool is"), - SCUBA_DURABILITY("Scuba Armor: Durability", ConfigCategories.ARMOR_VALUES, 450, 10, 2000, "The Durability of Scuba Armor"), + SCUBA_DURABILITY("Scuba Armor: Durability", ConfigCategories.ARMOR_VALUES, 450, 10, 10000, "The Durability of Scuba Armor"), SCUBA_HEAD_DAMAGE("Scuba Helmets: Damage Reduction", ConfigCategories.ARMOR_VALUES, 2, 0, 10, "The Damage Reduction of Scuba Helmets"), SCUBA_CHEST_DAMAGE("Scuba Chests: Damage Reduction", ConfigCategories.ARMOR_VALUES, 5, 0, 10, "The Damage Reduction of Scuba Chests"), SCUBA_LEGS_DAMAGE("Scuba Legs: Damage Reduction", ConfigCategories.ARMOR_VALUES, 4, 0, 10, "The Damage Reduction of Scuba Legs"), SCUBA_BOOTS_DAMAGE("Scuba Boots: Damage Reduction", ConfigCategories.ARMOR_VALUES, 1, 0, 10, "The Damage Reduction of Scuba Boots"), - SCUBA_ENCHANTABILITY("Scuba Armor: Enchantability", ConfigCategories.ARMOR_VALUES, 15, 1, 100, "The Enchantability of Scuba Armor"), + SCUBA_ENCHANTABILITY("Scuba Armor: Enchantability", ConfigCategories.ARMOR_VALUES, 15, 1, 30, "The Enchantability of Scuba Armor"), + + EMERALD_ARMOR_DURABILITY("Emerald Armor: Durability", ConfigCategories.ARMOR_VALUES, 1500, 10, 10000, "The Durability of Emerald Armor"), + EMERALD_ARMOR_HEAD_DAMAGE("Emerald Helmets: Damage Reduction", ConfigCategories.ARMOR_VALUES, 5, 0, 10, "The Damage Reduction of Emerald Helmets"), + EMERALD_ARMOR_CHEST_DAMAGE("Emerald Chests: Damage Reduction", ConfigCategories.ARMOR_VALUES, 9, 0, 10, "The Damage Reduction of Emerald Chests"), + EMERALD_ARMOR_LEGS_DAMAGE("Emerald Legs: Damage Reduction", ConfigCategories.ARMOR_VALUES, 8, 0, 10, "The Damage Reduction of Emerald Legs"), + EMERALD_ARMOR_BOOTS_DAMAGE("Emerald Boots: Damage Reduction", ConfigCategories.ARMOR_VALUES, 5, 0, 10, "The Damage Reduction of Emerald Boots"), + EMERALD_ARMOR_ENCHANTABILITY("Emerald Armor: Enchantability", ConfigCategories.ARMOR_VALUES, 15, 1, 30, "The Enchantability of Emerald Armor"), + + OBSIDIAN_ARMOR_DURABILITY("Obsidian Armor: Durability", ConfigCategories.ARMOR_VALUES, 7000, 10, 10000, "The Durability of Obsidian Armor"), + OBSIDIAN_ARMOR_HEAD_DAMAGE("Obsidian Helmets: Damage Reduction", ConfigCategories.ARMOR_VALUES, 3, 0, 10, "The Damage Reduction of Obsidian Helmets"), + OBSIDIAN_ARMOR_CHEST_DAMAGE("Obsidian Chests: Damage Reduction", ConfigCategories.ARMOR_VALUES, 4, 0, 10, "The Damage Reduction of Obsidian Chests"), + OBSIDIAN_ARMOR_LEGS_DAMAGE("Obsidian Legs: Damage Reduction", ConfigCategories.ARMOR_VALUES, 3, 0, 10, "The Damage Reduction of Obsidian Legs"), + OBSIDIAN_ARMOR_BOOTS_DAMAGE("Obsidian Boots: Damage Reduction", ConfigCategories.ARMOR_VALUES, 1, 0, 10, "The Damage Reduction of Obsidian Boots"), + OBSIDIAN_ARMOR_ENCHANTABILITY("Obsidian Armor: Enchantability", ConfigCategories.ARMOR_VALUES, 10, 1, 30, "The Enchantability of Obsidian Armor"), GRINDER_CRUSH_TIME("Crusher: Time", ConfigCategories.MACHINE_VALUES, 100, 10, 1000, "How long the Crusher takes to crush an item"), GRINDER_DOUBLE_CRUSH_TIME("Double Crusher: Time", ConfigCategories.MACHINE_VALUES, 150, 10, 1000, "How long the Double Crusher takes to crush an item"), diff --git a/src/main/java/ellpeck/actuallyadditions/creative/CreativeTab.java b/src/main/java/ellpeck/actuallyadditions/creative/CreativeTab.java index a00d221f8..2bff9de25 100644 --- a/src/main/java/ellpeck/actuallyadditions/creative/CreativeTab.java +++ b/src/main/java/ellpeck/actuallyadditions/creative/CreativeTab.java @@ -123,6 +123,11 @@ public class CreativeTab extends CreativeTabs{ add(InitItems.itemAxeEmerald); add(InitItems.itemShovelEmerald); add(InitItems.itemHoeEmerald); + + add(InitItems.itemHelmEmerald); + add(InitItems.itemChestEmerald); + add(InitItems.itemPantsEmerald); + add(InitItems.itemBootsEmerald); add(InitItems.itemPickaxeObsidian); add(InitItems.itemSwordObsidian); @@ -130,6 +135,16 @@ public class CreativeTab extends CreativeTabs{ add(InitItems.itemShovelObsidian); add(InitItems.itemHoeObsidian); + add(InitItems.itemHelmObsidian); + add(InitItems.itemChestObsidian); + add(InitItems.itemPantsObsidian); + add(InitItems.itemBootsObsidian); + + add(InitItems.itemScubaHelm); + add(InitItems.itemScubaChest); + add(InitItems.itemScubaPants); + add(InitItems.itemScubaBoots); + add(InitItems.itemJams); add(InitItems.itemPotionRing); diff --git a/src/main/java/ellpeck/actuallyadditions/items/InitItems.java b/src/main/java/ellpeck/actuallyadditions/items/InitItems.java index 47feefb3e..2d8bc4340 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/InitItems.java +++ b/src/main/java/ellpeck/actuallyadditions/items/InitItems.java @@ -4,6 +4,7 @@ import ellpeck.actuallyadditions.blocks.InitBlocks; import ellpeck.actuallyadditions.items.metalists.TheFoods; import ellpeck.actuallyadditions.items.metalists.TheMiscItems; import ellpeck.actuallyadditions.items.tools.*; +import ellpeck.actuallyadditions.material.InitArmorMaterials; import ellpeck.actuallyadditions.material.InitToolMaterials; import ellpeck.actuallyadditions.util.CompatUtil; import ellpeck.actuallyadditions.util.ItemUtil; @@ -36,6 +37,11 @@ public class InitItems{ public static Item itemShovelEmerald; public static Item itemSwordEmerald; public static Item itemHoeEmerald; + + public static Item itemHelmEmerald; + public static Item itemChestEmerald; + public static Item itemPantsEmerald; + public static Item itemBootsEmerald; public static Item itemPickaxeObsidian; public static Item itemAxeObsidian; @@ -43,6 +49,11 @@ public class InitItems{ public static Item itemSwordObsidian; public static Item itemHoeObsidian; + public static Item itemHelmObsidian; + public static Item itemChestObsidian; + public static Item itemPantsObsidian; + public static Item itemBootsObsidian; + public static Item itemHairyBall; public static Item itemRiceSeed; @@ -96,6 +107,18 @@ public class InitItems{ itemScubaBoots = new ItemScubaArmor("itemScubaBoots", 3); ItemUtil.registerItems(new Item[]{itemScubaHelm, itemScubaChest, itemScubaPants, itemScubaBoots}); + itemHelmEmerald = new ItemArmorAA("itemHelmEmerald", InitArmorMaterials.armorMaterialEmerald, 0, new ItemStack(Items.emerald), "armorEmerald"); + itemChestEmerald = new ItemArmorAA("itemChestEmerald", InitArmorMaterials.armorMaterialEmerald, 1, new ItemStack(Items.emerald), "armorEmerald"); + itemPantsEmerald = new ItemArmorAA("itemPantsEmerald", InitArmorMaterials.armorMaterialEmerald, 2, new ItemStack(Items.emerald), "armorEmerald"); + itemBootsEmerald = new ItemArmorAA("itemBootsEmerald", InitArmorMaterials.armorMaterialEmerald, 3, new ItemStack(Items.emerald), "armorEmerald"); + ItemUtil.registerItems(new Item[]{itemHelmEmerald, itemChestEmerald, itemPantsEmerald, itemBootsEmerald}); + + itemHelmObsidian = new ItemArmorAA("itemHelmObsidian", InitArmorMaterials.armorMaterialObsidian, 0, new ItemStack(Blocks.obsidian), "armorObsidian"); + itemChestObsidian = new ItemArmorAA("itemChestObsidian", InitArmorMaterials.armorMaterialObsidian, 1, new ItemStack(Blocks.obsidian), "armorObsidian"); + itemPantsObsidian = new ItemArmorAA("itemPantsObsidian", InitArmorMaterials.armorMaterialObsidian, 2, new ItemStack(Blocks.obsidian), "armorObsidian"); + itemBootsObsidian = new ItemArmorAA("itemBootsObsidian", InitArmorMaterials.armorMaterialObsidian, 3, new ItemStack(Blocks.obsidian), "armorObsidian"); + ItemUtil.registerItems(new Item[]{itemHelmObsidian, itemChestObsidian, itemPantsObsidian, itemBootsObsidian}); + itemTeleStaff = new ItemTeleStaff(); ItemUtil.register(itemTeleStaff); diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemScubaArmor.java b/src/main/java/ellpeck/actuallyadditions/items/ItemScubaArmor.java index ae44d07bc..575fea0e0 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemScubaArmor.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemScubaArmor.java @@ -1,12 +1,18 @@ package ellpeck.actuallyadditions.items; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.material.InitArmorMaterials; +import ellpeck.actuallyadditions.util.ItemUtil; +import ellpeck.actuallyadditions.util.KeyUtil; import net.minecraft.block.material.Material; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; +import java.util.List; + public class ItemScubaArmor extends ItemArmorAA{ private static final int helmetTime = 500; @@ -39,4 +45,16 @@ public class ItemScubaArmor extends ItemArmorAA{ } } } + + @Override + @SuppressWarnings("unchecked") + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { + ItemUtil.addInformation(this, list, 1, ""); + if(KeyUtil.isShiftPressed() && stack.getItem() == InitItems.itemScubaHelm){ + NBTTagCompound compound = stack.getTagCompound(); + //TODO Localize + list.add("Air: "+(compound == null ? helmetTime : helmetTime-compound.getInteger("waitTime"))+"/"+helmetTime); + } + } } diff --git a/src/main/java/ellpeck/actuallyadditions/material/InitArmorMaterials.java b/src/main/java/ellpeck/actuallyadditions/material/InitArmorMaterials.java index cf764f754..08658c788 100644 --- a/src/main/java/ellpeck/actuallyadditions/material/InitArmorMaterials.java +++ b/src/main/java/ellpeck/actuallyadditions/material/InitArmorMaterials.java @@ -15,5 +15,8 @@ public class InitArmorMaterials{ ModUtil.LOGGER.info("Initializing Armor Materials..."); armorMaterialScuba = EnumHelper.addArmorMaterial("armorMaterialScuba", ConfigIntValues.SCUBA_DURABILITY.getValue(), new int[]{ConfigIntValues.SCUBA_HEAD_DAMAGE.getValue(), ConfigIntValues.SCUBA_CHEST_DAMAGE.getValue(), ConfigIntValues.SCUBA_LEGS_DAMAGE.getValue(), ConfigIntValues.SCUBA_BOOTS_DAMAGE.getValue()}, ConfigIntValues.SCUBA_ENCHANTABILITY.getValue()); + armorMaterialEmerald = EnumHelper.addArmorMaterial("armorMaterialEmerald", ConfigIntValues.EMERALD_ARMOR_DURABILITY.getValue(), new int[]{ConfigIntValues.EMERALD_ARMOR_HEAD_DAMAGE.getValue(), ConfigIntValues.EMERALD_ARMOR_CHEST_DAMAGE.getValue(), ConfigIntValues.EMERALD_ARMOR_LEGS_DAMAGE.getValue(), ConfigIntValues.EMERALD_ARMOR_BOOTS_DAMAGE.getValue()}, ConfigIntValues.EMERALD_ARMOR_ENCHANTABILITY.getValue()); + armorMaterialObsidian = EnumHelper.addArmorMaterial("armorMaterialObsidian", ConfigIntValues.OBSIDIAN_ARMOR_DURABILITY.getValue(), new int[]{ConfigIntValues.OBSIDIAN_ARMOR_HEAD_DAMAGE.getValue(), ConfigIntValues.OBSIDIAN_ARMOR_CHEST_DAMAGE.getValue(), ConfigIntValues.OBSIDIAN_ARMOR_LEGS_DAMAGE.getValue(), ConfigIntValues.OBSIDIAN_ARMOR_BOOTS_DAMAGE.getValue()}, ConfigIntValues.OBSIDIAN_ARMOR_ENCHANTABILITY.getValue()); + } }