diff --git a/src/main/java/tconstruct/blocks/CastingChannelBlock.java b/src/main/java/tconstruct/blocks/CastingChannelBlock.java index 7f992464..af37b27b 100644 --- a/src/main/java/tconstruct/blocks/CastingChannelBlock.java +++ b/src/main/java/tconstruct/blocks/CastingChannelBlock.java @@ -1,6 +1,5 @@ package tconstruct.blocks; -import mantle.common.ComparisonHelper; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -91,4 +90,4 @@ public class CastingChannelBlock extends BlockContainer return new CastingChannelLogic(); } -} \ No newline at end of file +} diff --git a/src/main/java/tconstruct/blocks/traps/BarricadeBlock.java b/src/main/java/tconstruct/blocks/traps/BarricadeBlock.java index 1cf1efbe..c90a5a6a 100644 --- a/src/main/java/tconstruct/blocks/traps/BarricadeBlock.java +++ b/src/main/java/tconstruct/blocks/traps/BarricadeBlock.java @@ -1,13 +1,13 @@ package tconstruct.blocks.traps; import mantle.blocks.MantleBlock; -import mantle.common.ComparisonHelper; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.IIcon; import net.minecraft.world.Explosion; @@ -93,7 +93,7 @@ public class BarricadeBlock extends MantleBlock public boolean onBlockActivated (World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9) { ItemStack stack = player.getCurrentEquippedItem(); - if ((stack != null) && (ComparisonHelper.areEquivalent(stack.getItem(), this)) && (!player.isSneaking())) + if ((stack != null) && (stack.getItem() == Item.getItemFromBlock(this)) && (!player.isSneaking())) { int meta = world.getBlockMetadata(x, y, z); if (meta % 4 != 3) @@ -136,4 +136,4 @@ public class BarricadeBlock extends MantleBlock { return true; } -} \ No newline at end of file +} diff --git a/src/main/java/tconstruct/blocks/traps/Punji.java b/src/main/java/tconstruct/blocks/traps/Punji.java index 8d1fe296..6e319e35 100644 --- a/src/main/java/tconstruct/blocks/traps/Punji.java +++ b/src/main/java/tconstruct/blocks/traps/Punji.java @@ -10,6 +10,7 @@ import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.util.DamageSource; @@ -58,7 +59,7 @@ public class Punji extends MantleBlock if (meta < 4) { ItemStack stack = player.getCurrentEquippedItem(); - if (stack != null && stack == new ItemStack(TRepo.punji)) + if (stack != null && stack.getItem() == Item.getItemFromBlock(TRepo.punji)) { world.setBlockMetadataWithNotify(x, y, z, meta + 1, 3); world.playSoundEffect((double) ((float) x + 0.5F), (double) ((float) y + 0.5F), (double) ((float) z + 0.5F), this.stepSound.soundName, (this.stepSound.getVolume() + 1.0F) / 2.0F, diff --git a/src/main/java/tconstruct/common/TRecipes.java b/src/main/java/tconstruct/common/TRecipes.java index 4ee28fc2..5d833b61 100644 --- a/src/main/java/tconstruct/common/TRecipes.java +++ b/src/main/java/tconstruct/common/TRecipes.java @@ -886,14 +886,6 @@ public class TRecipes new ItemStack(TRepo.strangeFood, 1, 1), new ItemStack(TRepo.strangeFood, 1, 1), new ItemStack(Items.redstone)); GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(TRepo.slimeChannel, 1, 0), "slimeball", "slimeball", "slimeball", "slimeball", new ItemStack(Items.redstone))); GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(TRepo.slimePad, 1, 0), TRepo.slimeChannel, "slimeball")); - - // Crafting Table detailing - Detailing detail = TConstruct.chiselDetailing; - - for (DetailInput inp : detail.detailing) - { - GameRegistry.addShapelessRecipe(new ItemStack(inp.output.getItem(), inp.outputMeta), new ItemStack(inp.input.getItem(), inp.inputMeta), TRepo.chisel); - } } protected static void addRecipesForDryingRack () diff --git a/src/main/java/tconstruct/entity/projectile/ArrowEntity.java b/src/main/java/tconstruct/entity/projectile/ArrowEntity.java index 4e82cf64..313a68b9 100644 --- a/src/main/java/tconstruct/entity/projectile/ArrowEntity.java +++ b/src/main/java/tconstruct/entity/projectile/ArrowEntity.java @@ -565,8 +565,7 @@ public class ArrowEntity extends EntityArrow implements IEntityAdditionalSpawnDa for (int slotID = 0; slotID < 5; ++slotID) { ItemStack stack = living.getEquipmentInSlot(slotID); - if (stack != null && stack == par1ItemStack && stack.isStackable() && stack.stackSize < stack.getMaxStackSize() && stack.stackSize < 64 - && (!stack.getHasSubtypes() || stack.getItemDamage() == par1ItemStack.getItemDamage()) && ItemStack.areItemStackTagsEqual(stack, par1ItemStack)) + if (stack != null && ItemStack.areItemStacksEqual(stack, par1ItemStack) && stack.isStackable() && stack.stackSize < stack.getMaxStackSize()) { return slotID; } diff --git a/src/main/java/tconstruct/inventory/AdaptiveSmelteryContainer.java b/src/main/java/tconstruct/inventory/AdaptiveSmelteryContainer.java index 00549d76..6dc76941 100644 --- a/src/main/java/tconstruct/inventory/AdaptiveSmelteryContainer.java +++ b/src/main/java/tconstruct/inventory/AdaptiveSmelteryContainer.java @@ -177,8 +177,7 @@ public class AdaptiveSmelteryContainer extends ActiveContainer slot = (Slot) this.inventorySlots.get(slotPos); slotStack = slot.getStack(); - if (slotStack != null && slotStack.getItem() == inputStack.getItem() && (!inputStack.getHasSubtypes() || inputStack.getItemDamage() == slotStack.getItemDamage()) - && ItemStack.areItemStackTagsEqual(inputStack, slotStack)) + if (slotStack != null && ItemStack.areItemStacksEqual(slotStack, inputStack)) { int l = slotStack.stackSize + inputStack.stackSize; @@ -247,4 +246,4 @@ public class AdaptiveSmelteryContainer extends ActiveContainer return merged; } -} \ No newline at end of file +} diff --git a/src/main/java/tconstruct/inventory/ContainerLandmine.java b/src/main/java/tconstruct/inventory/ContainerLandmine.java index 66eff45e..c5744e4e 100644 --- a/src/main/java/tconstruct/inventory/ContainerLandmine.java +++ b/src/main/java/tconstruct/inventory/ContainerLandmine.java @@ -344,7 +344,7 @@ public class ContainerLandmine extends Container } else if (slot2.isItemValid(itemstack4)) { - if (itemstack1 == itemstack4 && itemstack1.getItemDamage() == itemstack4.getItemDamage() && ItemStack.areItemStackTagsEqual(itemstack1, itemstack4)) + if (ItemStack.areItemStacksEqual(itemstack1, itemstack4)) { k1 = par2 == 0 ? itemstack4.stackSize : 1; @@ -373,8 +373,7 @@ public class ContainerLandmine extends Container inventoryplayer.setItemStack(itemstack1); } } - else if (itemstack1 == itemstack4 && itemstack4.getMaxStackSize() > 1 && (!itemstack1.getHasSubtypes() || itemstack1.getItemDamage() == itemstack4.getItemDamage()) - && ItemStack.areItemStackTagsEqual(itemstack1, itemstack4)) + else if (ItemStack.areItemStacksEqual(itemstack1, itemstack4)) { k1 = itemstack1.stackSize; diff --git a/src/main/java/tconstruct/inventory/SmelteryContainer.java b/src/main/java/tconstruct/inventory/SmelteryContainer.java index e73d2b78..a5bc966f 100644 --- a/src/main/java/tconstruct/inventory/SmelteryContainer.java +++ b/src/main/java/tconstruct/inventory/SmelteryContainer.java @@ -202,8 +202,7 @@ public class SmelteryContainer extends ActiveContainer slot = (Slot) this.inventorySlots.get(slotPos); slotStack = slot.getStack(); - if (slotStack != null && slotStack.getItem() == inputStack.getItem() && (!inputStack.getHasSubtypes() || inputStack.getItemDamage() == slotStack.getItemDamage()) - && ItemStack.areItemStackTagsEqual(inputStack, slotStack)) + if (slotStack != null && ItemStack.areItemStacksEqual(slotStack, inputStack)) { int l = slotStack.stackSize + inputStack.stackSize; @@ -272,4 +271,4 @@ public class SmelteryContainer extends ActiveContainer return merged; } -} \ No newline at end of file +} diff --git a/src/main/java/tconstruct/library/crafting/Detailing.java b/src/main/java/tconstruct/library/crafting/Detailing.java index c5377f02..f2ce53d7 100644 --- a/src/main/java/tconstruct/library/crafting/Detailing.java +++ b/src/main/java/tconstruct/library/crafting/Detailing.java @@ -99,7 +99,7 @@ public class Detailing for (int i = 0; i < detailing.size(); i++) { DetailInput detail = (DetailInput) detailing.get(i); - if (new ItemStack(block) == detail.input && inputMeta == detail.inputMeta) + if (Item.getItemFromBlock(block) == detail.input.getItem() && inputMeta == detail.inputMeta) { return detail; } @@ -122,4 +122,4 @@ public class Detailing this.outputMeta = outputMeta; } } -} \ No newline at end of file +} diff --git a/src/main/java/tconstruct/library/crafting/ShapelessToolRecipe.java b/src/main/java/tconstruct/library/crafting/ShapelessToolRecipe.java index bc724a03..796cf3b5 100644 --- a/src/main/java/tconstruct/library/crafting/ShapelessToolRecipe.java +++ b/src/main/java/tconstruct/library/crafting/ShapelessToolRecipe.java @@ -37,10 +37,10 @@ public class ShapelessToolRecipe extends ShapelessRecipes while (iterator.hasNext()) { - ItemStack itemstack1 = (ItemStack) iterator.next(); + ItemStack itemstack1 = (ItemStack)iterator.next(); // TConstruct.logger.info("Rawr! "+itemstack1.getItemDamage()); - if (itemstack == itemstack1 && (itemstack1.getItemDamage() == Short.MAX_VALUE || itemstack.getItemDamage() == itemstack1.getItemDamage())) + if (itemstack.getItem() == itemstack1.getItem() && (itemstack1.getItemDamage() == Short.MAX_VALUE || itemstack.getItemDamage() == itemstack1.getItemDamage())) { if (itemstack.getItem() instanceof ToolCore) { diff --git a/src/main/java/tconstruct/util/TCraftingHandler.java b/src/main/java/tconstruct/util/TCraftingHandler.java index 1f0ba74b..e09e8754 100644 --- a/src/main/java/tconstruct/util/TCraftingHandler.java +++ b/src/main/java/tconstruct/util/TCraftingHandler.java @@ -1,6 +1,5 @@ package tconstruct.util; -import mantle.common.ComparisonHelper; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -23,7 +22,7 @@ public class TCraftingHandler // implements ICraftingHandler Item item = event.crafting.getItem(); if (!event.player.worldObj.isRemote) { - if (ComparisonHelper.areEquivalent(item, TRepo.toolStationWood)) + if (item == Item.getItemFromBlock(TRepo.toolStationWood)) { TPlayerStats stats = TPlayerStats.get(event.player); NBTTagCompound tags = event.player.getEntityData().getCompoundTag("TConstruct"); @@ -34,7 +33,7 @@ public class TCraftingHandler // implements ICraftingHandler AbilityHelper.spawnItemAtPlayer(event.player, new ItemStack(TRepo.manualBook, 1, 1)); } } - if (ComparisonHelper.areEquivalent(item, TRepo.smeltery) || ComparisonHelper.areEquivalent(item, TRepo.lavaTank)) + if (item == Item.getItemFromBlock(TRepo.smeltery) || item == Item.getItemFromBlock(TRepo.lavaTank)) { TPlayerStats stats = TPlayerStats.get(event.player); NBTTagCompound tags = event.player.getEntityData().getCompoundTag("TConstruct"); @@ -47,7 +46,7 @@ public class TCraftingHandler // implements ICraftingHandler event.player.addStat(TAchievements.achievements.get("tconstruct:smelteryMaker"), 1); } - if (ComparisonHelper.areEquivalent(item, TRepo.craftingStationWood)) + if (item == Item.getItemFromBlock(TRepo.craftingStationWood)) { event.player.addStat(TAchievements.achievements.get("tconstruct:betterCrafting"), 1); } diff --git a/src/main/java/tconstruct/util/landmine/behavior/BehaviorExplosive.java b/src/main/java/tconstruct/util/landmine/behavior/BehaviorExplosive.java index 7db1560a..e3880c7c 100644 --- a/src/main/java/tconstruct/util/landmine/behavior/BehaviorExplosive.java +++ b/src/main/java/tconstruct/util/landmine/behavior/BehaviorExplosive.java @@ -2,13 +2,13 @@ package tconstruct.util.landmine.behavior; import java.util.List; -import mantle.common.ComparisonHelper; 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.ItemStack; +import net.minecraft.item.Item; import net.minecraft.world.World; /** @@ -23,7 +23,7 @@ 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 (ComparisonHelper.areEquivalent(par5ItemStack.getItem(), Blocks.tnt)) + if (par5ItemStack.getItem() == Item.getItemFromBlock(Blocks.tnt)) { explodeStrenght = 4.0F * par5ItemStack.stackSize; } @@ -39,7 +39,7 @@ public class BehaviorExplosive extends Behavior public void getInformation (ItemStack par1ItemStack, List par2List) { String str = "UNDEFINED"; - if (ComparisonHelper.areEquivalent(par1ItemStack.getItem(), Blocks.tnt)) + if (par1ItemStack.getItem() == Item.getItemFromBlock(Blocks.tnt)) { str = "medium"; }