Changed Jam Values a bit, removed Scuba Armor again (for now!)

This commit is contained in:
Ellpeck 2015-07-11 15:10:04 +02:00
parent 824a86b816
commit 5de08fc41f
7 changed files with 20 additions and 117 deletions

View file

@ -140,11 +140,6 @@ public class CreativeTab extends CreativeTabs{
add(InitItems.itemPantsObsidian); add(InitItems.itemPantsObsidian);
add(InitItems.itemBootsObsidian); add(InitItems.itemBootsObsidian);
add(InitItems.itemScubaHelm);
add(InitItems.itemScubaChest);
add(InitItems.itemScubaPants);
add(InitItems.itemScubaBoots);
add(InitItems.itemJams); add(InitItems.itemJams);
add(InitItems.itemPotionRing); add(InitItems.itemPotionRing);

View file

@ -93,20 +93,9 @@ public class InitItems{
public static Item itemTeleStaff; public static Item itemTeleStaff;
public static Item itemScubaHelm;
public static Item itemScubaChest;
public static Item itemScubaPants;
public static Item itemScubaBoots;
public static void init(){ public static void init(){
ModUtil.LOGGER.info("Initializing Items..."); 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"); itemHelmEmerald = new ItemArmorAA("itemHelmEmerald", InitArmorMaterials.armorMaterialEmerald, 0, new ItemStack(Items.emerald), "armorEmerald");
itemChestEmerald = new ItemArmorAA("itemChestEmerald", InitArmorMaterials.armorMaterialEmerald, 1, 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"); itemPantsEmerald = new ItemArmorAA("itemPantsEmerald", InitArmorMaterials.armorMaterialEmerald, 2, new ItemStack(Items.emerald), "armorEmerald");

View file

@ -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()+".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()+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.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+".hunger.desc")+": "+allJams[stack.getItemDamage()].healAmount);
list.add(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".saturation.desc")+": "+allJams[stack.getItemDamage()].saturation); list.add(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".saturation.desc")+": "+allJams[stack.getItemDamage()].saturation);
} }

View file

@ -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);
}
}
}

View file

@ -5,12 +5,12 @@ import net.minecraft.item.EnumRarity;
public enum TheJams implements INameableItem{ public enum TheJams implements INameableItem{
CU_BA_RA("CuBaRa", 4, 2F, EnumRarity.rare, 5, 12, 12595273), CU_BA_RA("CuBaRa", 6, 0.1F, EnumRarity.rare, 5, 12, 12595273),
GRA_KI_BA("GraKiBa", 4, 2F, EnumRarity.rare, 16, 13, 5492820), GRA_KI_BA("GraKiBa", 6, 0.1F, EnumRarity.rare, 16, 13, 5492820),
PL_AP_LE("PlApLe", 4, 2F, EnumRarity.rare, 15, 3, 13226009), PL_AP_LE("PlApLe", 6, 0.1F, EnumRarity.rare, 15, 3, 13226009),
CH_AP_CI("ChApCi", 4, 2F, EnumRarity.rare, 10, 1, 13189222), CH_AP_CI("ChApCi", 6, 0.1F, EnumRarity.rare, 10, 1, 13189222),
HO_ME_KI("HoMeKi", 4, 2F, EnumRarity.rare, 10, 14, 2031360), HO_ME_KI("HoMeKi", 6, 0.1F, EnumRarity.rare, 10, 14, 2031360),
PI_CO("PiCo", 4, 2F, EnumRarity.rare, 9, 1, 16056203); PI_CO("PiCo", 6, 0.1F, EnumRarity.rare, 9, 1, 16056203);
public final String name; public final String name;
public final int healAmount; public final int healAmount;

View file

@ -23,18 +23,18 @@ public class TreasureChestHandler{
addReturn(new ItemStack(Items.emerald), 3, 1, 1); addReturn(new ItemStack(Items.emerald), 3, 1, 1);
addReturn(new ItemStack(Items.experience_bottle), 5, 3, 6); 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(InitItems.itemSpecialDrop, 1, TheSpecialDrops.SOLIDIFIED_EXPERIENCE.ordinal()), 15, 3, 6);
addReturn(new ItemStack(Items.record_11), 2, 1, 1); addReturn(new ItemStack(Items.record_11), 1, 1, 1);
addReturn(new ItemStack(Items.record_13), 2, 1, 1); addReturn(new ItemStack(Items.record_13), 1, 1, 1);
addReturn(new ItemStack(Items.record_blocks), 2, 1, 1); addReturn(new ItemStack(Items.record_blocks), 1, 1, 1);
addReturn(new ItemStack(Items.record_cat), 2, 1, 1); addReturn(new ItemStack(Items.record_cat), 1, 1, 1);
addReturn(new ItemStack(Items.record_chirp), 2, 1, 1); addReturn(new ItemStack(Items.record_chirp), 1, 1, 1);
addReturn(new ItemStack(Items.record_far), 2, 1, 1); addReturn(new ItemStack(Items.record_far), 1, 1, 1);
addReturn(new ItemStack(Items.record_mall), 2, 1, 1); addReturn(new ItemStack(Items.record_mall), 1, 1, 1);
addReturn(new ItemStack(Items.record_mellohi), 2, 1, 1); addReturn(new ItemStack(Items.record_mellohi), 1, 1, 1);
addReturn(new ItemStack(Items.record_stal), 2, 1, 1); addReturn(new ItemStack(Items.record_stal), 1, 1, 1);
addReturn(new ItemStack(Items.record_strad), 2, 1, 1); addReturn(new ItemStack(Items.record_strad), 1, 1, 1);
addReturn(new ItemStack(Items.record_ward), 2, 1, 1); addReturn(new ItemStack(Items.record_ward), 1, 1, 1);
addReturn(new ItemStack(Items.record_wait), 2, 1, 1); addReturn(new ItemStack(Items.record_wait), 1, 1, 1);
addReturn(new ItemStack(Items.saddle), 5, 1, 1); addReturn(new ItemStack(Items.saddle), 5, 1, 1);
addReturn(new ItemStack(Items.name_tag), 20, 1, 2); addReturn(new ItemStack(Items.name_tag), 20, 1, 2);
addReturn(new ItemStack(InitItems.itemJams, 1, TheJams.CU_BA_RA.ordinal()), 10, 1, 2); addReturn(new ItemStack(InitItems.itemJams, 1, TheJams.CU_BA_RA.ordinal()), 10, 1, 2);

View file

@ -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.1=A delicious Jam consisting of
tooltip.actuallyadditions.itemJam.desc.2=Also gives you some Effects! 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.itemJamCuBaRa.desc=Currant, Banana and Raspberry
tooltip.actuallyadditions.itemJamGraKiBa.desc=Grape, Kiwi and Banana tooltip.actuallyadditions.itemJamGraKiBa.desc=Grape, Kiwi and Banana
tooltip.actuallyadditions.itemJamPlApLe.desc=Plum, Apple and Lemon tooltip.actuallyadditions.itemJamPlApLe.desc=Plum, Apple and Lemon