From c0599dc7078dd777799fe5557e5745ee419f28ea Mon Sep 17 00:00:00 2001 From: Progwml6 Date: Tue, 31 Dec 2013 18:05:33 -0500 Subject: [PATCH] soo many errors --- .../util/landmine/behavior/Behavior.java | 31 ++++++++++--------- .../landmine/behavior/BehaviorExplosive.java | 10 +++--- .../landmine/behavior/BehaviorFirecharge.java | 4 +-- .../landmine/behavior/BehaviorPotion.java | 6 ++-- .../landmine/behavior/BehaviorProjectile.java | 7 +++-- .../stackCombo/SpecialStackHandler.java | 2 +- .../SpecialStackHandlerRocketFireball.java | 11 ++++--- .../tconstruct/util/player/ArmorExtended.java | 6 ++-- .../util/player/TPlayerHandler.java | 13 ++++---- 9 files changed, 48 insertions(+), 42 deletions(-) diff --git a/src/main/java/tconstruct/util/landmine/behavior/Behavior.java b/src/main/java/tconstruct/util/landmine/behavior/Behavior.java index 4ef3bcdc..6cd3ff1a 100644 --- a/src/main/java/tconstruct/util/landmine/behavior/Behavior.java +++ b/src/main/java/tconstruct/util/landmine/behavior/Behavior.java @@ -6,16 +6,17 @@ import java.util.Iterator; import java.util.List; import tconstruct.util.landmine.Helper; - import net.minecraft.block.Block; import net.minecraft.block.ITileEntityProvider; import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; import net.minecraft.world.World; -import net.minecraftforge.common.ForgeDirection; +import net.minecraftforge.common.util.ForgeDirection; /** * @@ -44,19 +45,19 @@ public abstract class Behavior { defaultBehavior = new BehaviorDefault(); - addBehavior(new ItemStack(Item.stick), dummy); - addBehavior(new ItemStack(Item.redstone), utilityMode); - addBehavior(new ItemStack(Block.torchWood), blockThrow); - addBehavior(new ItemStack(Item.gunpowder), explosive); - addBehavior(new ItemStack(Block.tnt), explosive); - addBehavior(new ItemStack(Item.firework), firework); - addBehavior(new ItemStack(Item.potion), potion); - addBehavior(new ItemStack(Item.fireballCharge), fireball); - addBehavior(new ItemStack(Item.monsterPlacer), spawn); - addBehavior(new ItemStack(Item.arrow), shoot); - addBehavior(new ItemStack(Item.snowball), shoot); - addBehavior(new ItemStack(Item.enderPearl), shoot); - addBehavior(new ItemStack(Item.shears), shear); + addBehavior(new ItemStack(Items.stick), dummy); + addBehavior(new ItemStack(Items.redstone), utilityMode); + addBehavior(new ItemStack(Blocks.torch), blockThrow); + addBehavior(new ItemStack(Items.gunpowder), explosive); + addBehavior(new ItemStack(Blocks.tnt), explosive); + addBehavior(new ItemStack(Items.firework), firework); + addBehavior(new ItemStack(Items.potion), potion); + addBehavior(new ItemStack(Items.fireballCharge), fireball); + addBehavior(new ItemStack(Items.monsterPlacer), spawn); + addBehavior(new ItemStack(Items.arrow), shoot); + addBehavior(new ItemStack(Items.snowball), shoot); + addBehavior(new ItemStack(Items.ender_pearl), shoot); + addBehavior(new ItemStack(Items.shears), shear); //Make sure the part below this comment is executed last(to avoid conflicts) for (int i = 1; i < Block.blocksList.length; i++) diff --git a/src/main/java/tconstruct/util/landmine/behavior/BehaviorExplosive.java b/src/main/java/tconstruct/util/landmine/behavior/BehaviorExplosive.java index 51c92f11..74bf0f6c 100644 --- a/src/main/java/tconstruct/util/landmine/behavior/BehaviorExplosive.java +++ b/src/main/java/tconstruct/util/landmine/behavior/BehaviorExplosive.java @@ -6,6 +6,8 @@ import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.item.EntityTNTPrimed; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.world.World; @@ -22,11 +24,11 @@ public class BehaviorExplosive extends Behavior public void executeLogic (World par1World, int par2, int par3, int par4, ItemStack par5ItemStack, Entity triggerer, boolean willBlockBeRemoved) { float explodeStrenght = 0; - if (par5ItemStack.itemID == Block.tnt.blockID) + if (par5ItemStack.itemID == Blocks.tnt.blockID) { explodeStrenght = 4.0F * par5ItemStack.stackSize; } - else if (par5ItemStack.itemID == Item.gunpowder.itemID) + else if (par5ItemStack.itemID == Items.gunpowder.itemID) { explodeStrenght = 0.8F * par5ItemStack.stackSize; } @@ -38,11 +40,11 @@ public class BehaviorExplosive extends Behavior public void getInformation (ItemStack par1ItemStack, List par2List) { String str = "UNDEFINED"; - if (par1ItemStack.itemID == Block.tnt.blockID) + if (par1ItemStack.itemID == Blocks.tnt.blockID) { str = "medium"; } - else if (par1ItemStack.itemID == Item.gunpowder.itemID) + else if (par1ItemStack.itemID == Items.gunpowder.itemID) { str = "small"; } diff --git a/src/main/java/tconstruct/util/landmine/behavior/BehaviorFirecharge.java b/src/main/java/tconstruct/util/landmine/behavior/BehaviorFirecharge.java index e78c9390..cca6e299 100644 --- a/src/main/java/tconstruct/util/landmine/behavior/BehaviorFirecharge.java +++ b/src/main/java/tconstruct/util/landmine/behavior/BehaviorFirecharge.java @@ -4,10 +4,10 @@ import java.util.List; import java.util.Random; import tconstruct.items.blocks.ItemBlockLandmine; - import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.projectile.EntitySmallFireball; +import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.util.DamageSource; import net.minecraft.util.EnumFacing; @@ -46,7 +46,7 @@ public class BehaviorFirecharge extends Behavior if ((par1World.getBlockId(i, par3, j) == 0 || (Block.blocksList[par1World.getBlockId(i, par3, j)] != null && Block.blocksList[par1World.getBlockId(i, par3, j)].isBlockReplaceable( par1World, i, par3, j))) && ItemBlockLandmine.getRandom().nextInt(5) == 0 && Block.fire.canPlaceBlockAt(par1World, i, par3, j)) { - par1World.setBlock(i, par3, j, Block.fire.blockID); + par1World.setBlock(i, par3, j, Blocks.fire.blockID); } } } diff --git a/src/main/java/tconstruct/util/landmine/behavior/BehaviorPotion.java b/src/main/java/tconstruct/util/landmine/behavior/BehaviorPotion.java index d265c707..1ce365a1 100644 --- a/src/main/java/tconstruct/util/landmine/behavior/BehaviorPotion.java +++ b/src/main/java/tconstruct/util/landmine/behavior/BehaviorPotion.java @@ -4,11 +4,11 @@ import java.util.Iterator; import java.util.List; import tconstruct.items.blocks.ItemBlockLandmine; - import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntityPotion; +import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemPotion; import net.minecraft.item.ItemStack; @@ -46,13 +46,13 @@ public class BehaviorPotion extends Behavior { if (triggerer instanceof EntityPlayer) { - Item.potion.onEaten(par5ItemStack, par1World, (EntityPlayer) triggerer); + Items.potion.onEaten(par5ItemStack, par1World, (EntityPlayer) triggerer); } else if (triggerer instanceof EntityLivingBase) { if (!par1World.isRemote) { - List list = Item.potion.getEffects(par5ItemStack); + List list = Items.potion.getEffects(par5ItemStack); if (list != null) { diff --git a/src/main/java/tconstruct/util/landmine/behavior/BehaviorProjectile.java b/src/main/java/tconstruct/util/landmine/behavior/BehaviorProjectile.java index da613fbd..3c8d1e43 100644 --- a/src/main/java/tconstruct/util/landmine/behavior/BehaviorProjectile.java +++ b/src/main/java/tconstruct/util/landmine/behavior/BehaviorProjectile.java @@ -6,6 +6,7 @@ import net.minecraft.entity.IProjectile; import net.minecraft.entity.item.EntityEnderPearl; import net.minecraft.entity.projectile.EntityArrow; import net.minecraft.entity.projectile.EntitySnowball; +import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; @@ -26,16 +27,16 @@ public class BehaviorProjectile extends Behavior EnumFacing enumfacing = getFacing(par1World, par2, par3, par4); - if (par5ItemStack.itemID == Item.arrow.itemID) + if (par5ItemStack.itemID == Items.arrow.itemID) { entity = new EntityArrow(par1World, par2, par3, par4); ((EntityArrow) entity).canBePickedUp = 1; } - else if (par5ItemStack.itemID == Item.snowball.itemID) + else if (par5ItemStack.itemID == Items.snowball.itemID) { entity = new EntitySnowball(par1World, par2, par3, par4); } - else if (par5ItemStack.itemID == Item.enderPearl.itemID) + else if (par5ItemStack.itemID == Items.ender_pearl.itemID) { if (triggerer instanceof EntityLivingBase) { diff --git a/src/main/java/tconstruct/util/landmine/behavior/stackCombo/SpecialStackHandler.java b/src/main/java/tconstruct/util/landmine/behavior/stackCombo/SpecialStackHandler.java index f24ffb4f..0157078f 100644 --- a/src/main/java/tconstruct/util/landmine/behavior/stackCombo/SpecialStackHandler.java +++ b/src/main/java/tconstruct/util/landmine/behavior/stackCombo/SpecialStackHandler.java @@ -11,7 +11,7 @@ import net.minecraft.entity.Entity; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; import net.minecraft.world.World; -import net.minecraftforge.common.ForgeDirection; +import net.minecraftforge.common.util.ForgeDirection; /** * diff --git a/src/main/java/tconstruct/util/landmine/behavior/stackCombo/SpecialStackHandlerRocketFireball.java b/src/main/java/tconstruct/util/landmine/behavior/stackCombo/SpecialStackHandlerRocketFireball.java index 3e6c5109..7e1ff294 100644 --- a/src/main/java/tconstruct/util/landmine/behavior/stackCombo/SpecialStackHandlerRocketFireball.java +++ b/src/main/java/tconstruct/util/landmine/behavior/stackCombo/SpecialStackHandlerRocketFireball.java @@ -8,6 +8,7 @@ import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntityFireball; import net.minecraft.entity.projectile.EntityLargeFireball; +import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; @@ -24,10 +25,10 @@ public class SpecialStackHandlerRocketFireball extends SpecialStackHandler return; } - if (this.arrayContainsEqualStack(stacks, new ItemStack(Item.firework)) && this.arrayContainsEqualStack(stacks, new ItemStack(Item.fireballCharge))) + if (this.arrayContainsEqualStack(stacks, new ItemStack(Items.fireworks)) && this.arrayContainsEqualStack(stacks, new ItemStack(Items.fire_charge))) { - int index0 = this.arrayIndexOfStack(stacks, new ItemStack(Item.firework)); - int index1 = this.arrayIndexOfStack(stacks, new ItemStack(Item.fireballCharge)); + int index0 = this.arrayIndexOfStack(stacks, new ItemStack(Items.fireworks)); + int index1 = this.arrayIndexOfStack(stacks, new ItemStack(Items.fire_charge)); EnumFacing face = getFacing(par1World, par2, par3, par4); while (stacks.get(index0).stackSize > 0 && stacks.get(index1).stackSize > 0) @@ -62,9 +63,9 @@ public class SpecialStackHandlerRocketFireball extends SpecialStackHandler } } - this.removeItemFromInventory(par1World, par2, par3, par4, new ItemStack(Item.firework, 1)); + this.removeItemFromInventory(par1World, par2, par3, par4, new ItemStack(Items.fireworks, 1)); stacks.get(index0).stackSize--; - this.removeItemFromInventory(par1World, par2, par3, par4, new ItemStack(Item.fireballCharge, 1)); + this.removeItemFromInventory(par1World, par2, par3, par4, new ItemStack(Items.fire_charge, 1)); stacks.get(index1).stackSize--; } } diff --git a/src/main/java/tconstruct/util/player/ArmorExtended.java b/src/main/java/tconstruct/util/player/ArmorExtended.java index 1abaa727..c3110514 100644 --- a/src/main/java/tconstruct/util/player/ArmorExtended.java +++ b/src/main/java/tconstruct/util/player/ArmorExtended.java @@ -4,8 +4,8 @@ import java.util.UUID; import java.lang.ref.WeakReference; import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.attributes.AttributeInstance; import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.entity.ai.attributes.IAttributeInstance; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; @@ -176,7 +176,7 @@ public class ArmorExtended implements IInventory //TConstruct.logger.info("healthChange: "+healthChange+" on side "+FMLCommonHandler.instance().getEffectiveSide()); if (healthChange != 0) { - AttributeInstance attributeinstance = player.getAttributeMap().getAttributeInstance(SharedMonsterAttributes.maxHealth); + IAttributeInstance attributeinstance = player.getAttributeMap().getAttributeInstance(SharedMonsterAttributes.maxHealth); try { attributeinstance.removeModifier(attributeinstance.getModifier(globalID)); @@ -202,7 +202,7 @@ public class ArmorExtended implements IInventory int healthChange = bonusHP - prevHealth; if (healthChange != 0) { - AttributeInstance attributeinstance = player.getAttributeMap().getAttributeInstance(SharedMonsterAttributes.maxHealth); + IAttributeInstance attributeinstance = player.getAttributeMap().getAttributeInstance(SharedMonsterAttributes.maxHealth); try { attributeinstance.removeModifier(attributeinstance.getModifier(globalID)); diff --git a/src/main/java/tconstruct/util/player/TPlayerHandler.java b/src/main/java/tconstruct/util/player/TPlayerHandler.java index fc919758..54b8aa0c 100644 --- a/src/main/java/tconstruct/util/player/TPlayerHandler.java +++ b/src/main/java/tconstruct/util/player/TPlayerHandler.java @@ -6,8 +6,9 @@ import java.util.Random; import java.util.concurrent.ConcurrentHashMap; import net.minecraft.entity.Entity; -import net.minecraft.entity.EnumEntitySize; +import net.minecraft.entity.Entity.EnumEntitySize; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -41,7 +42,7 @@ public class TPlayerHandler implements IPlayerTracker NBTTagCompound tags = entityplayer.getEntityData(); if (!tags.hasKey("TConstruct")) { - tags.setCompoundTag("TConstruct", new NBTTagCompound()); + tags.setTag("TConstruct", new NBTTagCompound()); } TPlayerStats stats = new TPlayerStats(); stats.player = new WeakReference(entityplayer); @@ -79,7 +80,7 @@ public class TPlayerHandler implements IPlayerTracker ItemStack pattern = new ItemStack(TRepo.woodPattern, 1, 22); NBTTagCompound compound = new NBTTagCompound(); - compound.setCompoundTag("display", new NBTTagCompound()); + compound.setTag("display", new NBTTagCompound()); compound.getCompoundTag("display").setString("Name", "\u00A7f" + "Fudgy_Fetus' Full Guard Pattern"); NBTTagList list = new NBTTagList(); list.appendTag(new NBTTagString("Lore", "\u00A72\u00A7o" + "The creator and the creation")); @@ -92,10 +93,10 @@ public class TPlayerHandler implements IPlayerTracker if (entityplayer.username.toLowerCase().equals("zerokyuuni")) { - ItemStack pattern = new ItemStack(Item.stick); + ItemStack pattern = new ItemStack(Items.stick); NBTTagCompound compound = new NBTTagCompound(); - compound.setCompoundTag("display", new NBTTagCompound()); + compound.setTag("display", new NBTTagCompound()); compound.getCompoundTag("display").setString("Name", "\u00A78" + "Cheaty Inventory"); NBTTagList list = new NBTTagList(); list.appendTag(new NBTTagString("Lore", "\u00A72\u00A7o" + "Nyaa~")); @@ -189,7 +190,7 @@ public class TPlayerHandler implements IPlayerTracker tTag.setBoolean("beginnerManual", stats.beginnerManual); tTag.setBoolean("materialManual", stats.materialManual); tTag.setBoolean("smelteryManual", stats.smelteryManual); - tags.setCompoundTag("TConstruct", tTag); + tags.setTag("TConstruct", tTag); Side side = FMLCommonHandler.instance().getEffectiveSide(); if (side == Side.CLIENT)