From 5de08fc41f4ff201e7ca5f05fe4320bb274bc055 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sat, 11 Jul 2015 15:10:04 +0200 Subject: [PATCH] Changed Jam Values a bit, removed Scuba Armor again (for now!) --- .../creative/CreativeTab.java | 5 -- .../actuallyadditions/items/InitItems.java | 11 --- .../actuallyadditions/items/ItemJams.java | 1 + .../items/ItemScubaArmor.java | 83 ------------------- .../items/metalists/TheJams.java | 12 +-- .../recipe/TreasureChestHandler.java | 24 +++--- .../assets/actuallyadditions/lang/en_US.lang | 1 + 7 files changed, 20 insertions(+), 117 deletions(-) delete mode 100644 src/main/java/ellpeck/actuallyadditions/items/ItemScubaArmor.java diff --git a/src/main/java/ellpeck/actuallyadditions/creative/CreativeTab.java b/src/main/java/ellpeck/actuallyadditions/creative/CreativeTab.java index 2bff9de25..e19342bbc 100644 --- a/src/main/java/ellpeck/actuallyadditions/creative/CreativeTab.java +++ b/src/main/java/ellpeck/actuallyadditions/creative/CreativeTab.java @@ -140,11 +140,6 @@ public class CreativeTab extends CreativeTabs{ 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 2d8bc4340..687ee20e8 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/InitItems.java +++ b/src/main/java/ellpeck/actuallyadditions/items/InitItems.java @@ -93,20 +93,9 @@ public class InitItems{ public static Item itemTeleStaff; - public static Item itemScubaHelm; - public static Item itemScubaChest; - public static Item itemScubaPants; - public static Item itemScubaBoots; - public static void init(){ ModUtil.LOGGER.info("Initializing Items..."); - itemScubaHelm = new ItemScubaArmor("itemScubaHelm", 0); - itemScubaChest = new ItemScubaArmor("itemScubaChest", 1); - itemScubaPants = new ItemScubaArmor("itemScubaPants", 2); - 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"); diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemJams.java b/src/main/java/ellpeck/actuallyadditions/items/ItemJams.java index e55ac5fb5..3f3e416b5 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemJams.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemJams.java @@ -103,6 +103,7 @@ public class ItemJams extends ItemFood implements INameableItem{ list.add(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+"."+this.getName()+".desc.1")); list.add(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+"."+this.getName()+allJams[stack.getItemDamage()].getName()+".desc")); list.add(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+"."+this.getName()+".desc.2")); + list.add(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+"."+this.getName()+".desc.3")); list.add(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".hunger.desc")+": "+allJams[stack.getItemDamage()].healAmount); list.add(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".saturation.desc")+": "+allJams[stack.getItemDamage()].saturation); } diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemScubaArmor.java b/src/main/java/ellpeck/actuallyadditions/items/ItemScubaArmor.java deleted file mode 100644 index b8dcb86c6..000000000 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemScubaArmor.java +++ /dev/null @@ -1,83 +0,0 @@ -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.KeyUtil; -import net.minecraft.block.material.Material; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.world.World; - -import java.util.List; - -public class ItemScubaArmor extends ItemArmorAA{ - - private static final int chestAirTime = 500; - private static final int chestAirIncreasePerTick = 3; - - public ItemScubaArmor(String name, int type){ - super(name, InitArmorMaterials.armorMaterialScuba, type, null, "armorScuba"); - } - - @Override - public void onArmorTick(World world, EntityPlayer player, ItemStack armor){ - if(!world.isRemote){ - if(this.hasFullArmor(player)){ - NBTTagCompound compound = armor.getTagCompound(); - if(compound == null) compound = new NBTTagCompound(); - - if(armor.getItem() == InitItems.itemScubaChest){ - if(player.isInsideOfMaterial(Material.water)){ - int time = compound.getInteger("waitTime"); - if(time < chestAirTime){ - compound.setInteger("waitTime", time+1); - player.addPotionEffect(new PotionEffect(Potion.waterBreathing.getId(), 1, 0)); - } - } - else{ - this.addAirToChest(compound); - } - } - armor.setTagCompound(compound); - } - } - } - - private boolean hasFullArmor(EntityPlayer player){ - return player.inventory.getStackInSlot(36) != null && player.inventory.getStackInSlot(37) != null && player.inventory.getStackInSlot(38) != null && player.inventory.getStackInSlot(39) != null && player.inventory.getStackInSlot(36).getItem() == InitItems.itemScubaBoots && player.inventory.getStackInSlot(37).getItem() == InitItems.itemScubaPants && player.inventory.getStackInSlot(38).getItem() == InitItems.itemScubaChest && player.inventory.getStackInSlot(39).getItem() == InitItems.itemScubaHelm; - } - - private void addAirToChest(NBTTagCompound compound){ - int time = compound.getInteger("waitTime"); - if(time > 0){ - compound.setInteger("waitTime", time < chestAirIncreasePerTick ? 0 : time-chestAirIncreasePerTick); - } - } - - @Override - public void onUpdate(ItemStack stack, World world, Entity entity, int par4, boolean par5){ - if(!entity.isInsideOfMaterial(Material.water)){ - NBTTagCompound compound = stack.getTagCompound(); - if(compound != null){ - this.addAirToChest(compound); - } - } - } - - @Override - @SuppressWarnings("unchecked") - @SideOnly(Side.CLIENT) - public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld){ - super.addInformation(stack, player, list, isHeld); - if(KeyUtil.isShiftPressed() && stack.getItem() == InitItems.itemScubaChest){ - NBTTagCompound compound = stack.getTagCompound(); - //TODO Localize - list.add("Air: "+(compound == null ? chestAirTime : chestAirTime-compound.getInteger("waitTime"))+"/"+chestAirTime); - } - } -} diff --git a/src/main/java/ellpeck/actuallyadditions/items/metalists/TheJams.java b/src/main/java/ellpeck/actuallyadditions/items/metalists/TheJams.java index a99d9878c..90bce15da 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/metalists/TheJams.java +++ b/src/main/java/ellpeck/actuallyadditions/items/metalists/TheJams.java @@ -5,12 +5,12 @@ import net.minecraft.item.EnumRarity; public enum TheJams implements INameableItem{ - CU_BA_RA("CuBaRa", 4, 2F, EnumRarity.rare, 5, 12, 12595273), - GRA_KI_BA("GraKiBa", 4, 2F, EnumRarity.rare, 16, 13, 5492820), - PL_AP_LE("PlApLe", 4, 2F, EnumRarity.rare, 15, 3, 13226009), - CH_AP_CI("ChApCi", 4, 2F, EnumRarity.rare, 10, 1, 13189222), - HO_ME_KI("HoMeKi", 4, 2F, EnumRarity.rare, 10, 14, 2031360), - PI_CO("PiCo", 4, 2F, EnumRarity.rare, 9, 1, 16056203); + CU_BA_RA("CuBaRa", 6, 0.1F, EnumRarity.rare, 5, 12, 12595273), + GRA_KI_BA("GraKiBa", 6, 0.1F, EnumRarity.rare, 16, 13, 5492820), + PL_AP_LE("PlApLe", 6, 0.1F, EnumRarity.rare, 15, 3, 13226009), + CH_AP_CI("ChApCi", 6, 0.1F, EnumRarity.rare, 10, 1, 13189222), + HO_ME_KI("HoMeKi", 6, 0.1F, EnumRarity.rare, 10, 14, 2031360), + PI_CO("PiCo", 6, 0.1F, EnumRarity.rare, 9, 1, 16056203); public final String name; public final int healAmount; diff --git a/src/main/java/ellpeck/actuallyadditions/recipe/TreasureChestHandler.java b/src/main/java/ellpeck/actuallyadditions/recipe/TreasureChestHandler.java index 40f43680e..18f20bfd8 100644 --- a/src/main/java/ellpeck/actuallyadditions/recipe/TreasureChestHandler.java +++ b/src/main/java/ellpeck/actuallyadditions/recipe/TreasureChestHandler.java @@ -23,18 +23,18 @@ public class TreasureChestHandler{ addReturn(new ItemStack(Items.emerald), 3, 1, 1); addReturn(new ItemStack(Items.experience_bottle), 5, 3, 6); addReturn(new ItemStack(InitItems.itemSpecialDrop, 1, TheSpecialDrops.SOLIDIFIED_EXPERIENCE.ordinal()), 15, 3, 6); - addReturn(new ItemStack(Items.record_11), 2, 1, 1); - addReturn(new ItemStack(Items.record_13), 2, 1, 1); - addReturn(new ItemStack(Items.record_blocks), 2, 1, 1); - addReturn(new ItemStack(Items.record_cat), 2, 1, 1); - addReturn(new ItemStack(Items.record_chirp), 2, 1, 1); - addReturn(new ItemStack(Items.record_far), 2, 1, 1); - addReturn(new ItemStack(Items.record_mall), 2, 1, 1); - addReturn(new ItemStack(Items.record_mellohi), 2, 1, 1); - addReturn(new ItemStack(Items.record_stal), 2, 1, 1); - addReturn(new ItemStack(Items.record_strad), 2, 1, 1); - addReturn(new ItemStack(Items.record_ward), 2, 1, 1); - addReturn(new ItemStack(Items.record_wait), 2, 1, 1); + addReturn(new ItemStack(Items.record_11), 1, 1, 1); + addReturn(new ItemStack(Items.record_13), 1, 1, 1); + addReturn(new ItemStack(Items.record_blocks), 1, 1, 1); + addReturn(new ItemStack(Items.record_cat), 1, 1, 1); + addReturn(new ItemStack(Items.record_chirp), 1, 1, 1); + addReturn(new ItemStack(Items.record_far), 1, 1, 1); + addReturn(new ItemStack(Items.record_mall), 1, 1, 1); + addReturn(new ItemStack(Items.record_mellohi), 1, 1, 1); + addReturn(new ItemStack(Items.record_stal), 1, 1, 1); + addReturn(new ItemStack(Items.record_strad), 1, 1, 1); + addReturn(new ItemStack(Items.record_ward), 1, 1, 1); + addReturn(new ItemStack(Items.record_wait), 1, 1, 1); addReturn(new ItemStack(Items.saddle), 5, 1, 1); addReturn(new ItemStack(Items.name_tag), 20, 1, 2); addReturn(new ItemStack(InitItems.itemJams, 1, TheJams.CU_BA_RA.ordinal()), 10, 1, 2); diff --git a/src/main/resources/assets/actuallyadditions/lang/en_US.lang b/src/main/resources/assets/actuallyadditions/lang/en_US.lang index 64ecc2407..5801a707c 100644 --- a/src/main/resources/assets/actuallyadditions/lang/en_US.lang +++ b/src/main/resources/assets/actuallyadditions/lang/en_US.lang @@ -369,6 +369,7 @@ tooltip.actuallyadditions.noOredictNameAvail.desc=Has No OreDictionary Entries tooltip.actuallyadditions.itemJam.desc.1=A delicious Jam consisting of tooltip.actuallyadditions.itemJam.desc.2=Also gives you some Effects! +tooltip.actuallyadditions.itemJam.desc.3=Can be found in Villages and Treasure Chests! tooltip.actuallyadditions.itemJamCuBaRa.desc=Currant, Banana and Raspberry tooltip.actuallyadditions.itemJamGraKiBa.desc=Grape, Kiwi and Banana tooltip.actuallyadditions.itemJamPlApLe.desc=Plum, Apple and Lemon