port in some fixes from 1.6.x

This commit is contained in:
Progwml6 committed 2014-02-04 20:40:58 -05:00
1 parent cd9e0f6452
commit 9fce66a827
15 files changed
+453 -59

No files matched your search

+4 -4
View File
@@ -19,7 +19,7 @@ public class Jerky extends SpecialFood
public static String[] textureNames = new String[] { "beef", "chicken", "pork", "mutton", "fish", "monster", "blueslime", "blood" };
public static String[] itemNames = new String[] { "jerky.beef", "jerky.chicken", "jerky.pig", "jerky.sheep", "jerky.fish", "jerky.zombie", "jerky.blueslime", "jerky.blood" };
public static int[] hunger = new int[] { 8, 6, 8, 6, 5, 4, 6, 4 };
public static float[] saturation = new float[] { 1.0f, 0.8f, 1.0f, 0.8f, 0.8f, 0.4f, 1.0f, 0.25f };
public static float[] saturation = new float[] { 1.0f, 0.8f, 1.0f, 0.8f, 0.8f, 0.4f, 1.0f, 0.4f };
public static int[] overhaulHunger = new int[] { 1, 1, 1, 1, 1, 1, 1, 1 };
public Jerky(boolean hungerOverhaul)
@@ -51,11 +51,11 @@ public class Jerky extends SpecialFood
{
if (stack.getItemDamage() == 7)
{
int duration = 20 * 30;
PotionEffect potion = player.getActivePotionEffect(Potion.regeneration);
int duration = 0;
PotionEffect potion = player.getActivePotionEffect(Potion.field_76434_w);
if (potion != null)
duration = potion.getDuration();
player.addPotionEffect(new PotionEffect(Potion.field_76434_w.id, duration + 20 * 30, 0));
player.addPotionEffect(new PotionEffect(Potion.field_76434_w.id, duration + 20 * 60, 1));
}
}
@@ -55,7 +55,7 @@ public class OreBerries extends CraftingItem
{
if (stack.getItemDamage() == 5)
{
EntityXPOrb entity = new EntityXPOrb(world, player.posX, player.posY + 1, player.posZ, itemRand.nextInt(4) + 3);
EntityXPOrb entity = new EntityXPOrb(world, player.posX, player.posY + 1, player.posZ, itemRand.nextInt(14) + 6);
spawnEntity(player.posX, player.posY + 1, player.posZ, entity, world, player);
if (!player.capabilities.isCreativeMode)
stack.stackSize--;
@@ -3,16 +3,17 @@ package tconstruct.items.armor;
import java.util.List;
import java.util.UUID;
import com.google.common.collect.Multimap;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.attributes.AttributeModifier;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.*;
import net.minecraft.util.DamageSource;
import tconstruct.library.TConstructRegistry;
import tconstruct.library.armor.ArmorCore;
import tconstruct.library.armor.EnumArmorPart;
@@ -20,17 +21,14 @@ import tconstruct.library.armor.EnumArmorPart;
public class ExoArmor extends ArmorCore
{
String textureName;
protected static final UUID speed = UUID.fromString("CB3F55A9-629C-4F38-A497-9C13A33DB5CF"); //These are temporary. Do not use them in release
protected static final UUID attack = UUID.fromString("CB3F55A9-629C-4F38-A497-9C13A33DB5CE");
protected static final UUID health = UUID.fromString("CB3F55A9-629C-4F38-A497-9C13A33DB5CD");
protected static final UUID knockback = UUID.fromString("CB3F55A9-629C-4F38-A497-9C13A33DB5CC");
public ExoArmor(EnumArmorPart part, String texture)
{
super(0, part);
this.textureName = texture;
this.setCreativeTab(TConstructRegistry.materialTab);
}
@Override
public void registerIcons (IIconRegister par1IconRegister)
{
@@ -43,36 +41,36 @@ public class ExoArmor extends ArmorCore
{
return "tinker:textures/armor/" + textureName + "_" + layer + ".png";
}
@Override
public void damageArmor (EntityLivingBase entity, ItemStack stack, DamageSource source, int damage, int slot)
{
//Deimplemented for now
}
@SideOnly(Side.CLIENT)
public void getSubItems (Block b, CreativeTabs par2CreativeTabs, List par3List)
{
ItemStack armor = new ItemStack(b, 1, 0);
NBTTagCompound baseTag = new NBTTagCompound();
NBTTagList list = new NBTTagList();
//list.appendTag(getAttributeTag("generic.attackDamage", "ExoAttack", 10.0, true, knockback));
//list.appendTag(getAttributeTag("generic.movementSpeed", "ExoSpeed", 1.5, false, speed));
//list.appendTag(getAttributeTag("generic.maxHealth", "ExoHealth", 10.0, true, health));
//list.appendTag(getAttributeTag("generic.knockbackResistance", "ExoKnockback", 0.5, false, knockback));
//baseTag.setTag("AttributeModifiers", list);
NBTTagCompound armorTag = new NBTTagCompound();
armorTag.setInteger("Modifiers", 30);
baseTag.setTag(SET_NAME, armorTag);
armor.setTagCompound(baseTag);
par3List.add(armor);
}
private NBTTagCompound getAttributeTag(String attributeType, String modifierName, double amount, boolean flat, UUID uuid)
@SideOnly(Side.CLIENT)
public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4)
{
NBTTagCompound knockbackTag = new NBTTagCompound();
knockbackTag.setString("AttributeName", attributeType);
knockbackTag.setString("Name", modifierName);
knockbackTag.setDouble("Amount", amount);
knockbackTag.setInteger("Operation", flat ? 0 : 1);//0 = flat increase, 1 = % increase
knockbackTag.setLong("UUIDMost", uuid.getMostSignificantBits());
knockbackTag.setLong("UUIDLeast", uuid.getLeastSignificantBits());
return knockbackTag;
if (!stack.hasTagCompound())
return;
NBTTagCompound tag = stack.getTagCompound().getCompoundTag(SET_NAME);
double protection = tag.getDouble("protection");
if (protection > 0)
list.add("\u00a7aProtection: " + protection + "%");
}
}
@@ -22,8 +22,6 @@ public class LavaTankItemBlock extends MultiItemBlock
setHasSubtypes(true);
}
public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4)
{
if (stack.hasTagCompound())
@@ -31,7 +29,7 @@ public class LavaTankItemBlock extends MultiItemBlock
NBTTagCompound liquidTag = stack.getTagCompound().getCompoundTag("Fluid");
if (liquidTag != null)
{
list.add(StatCollector.translateToLocal("searedtank1.tooltip") + StatCollector.translateToLocal(liquidTag.getString("FluidName")));
list.add(StatCollector.translateToLocal("searedtank1.tooltip") + " " + StatCollector.translateToLocal(liquidTag.getString("FluidName")));
list.add(liquidTag.getInteger("Amount") + " mB");
}
}