mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-20 12:19:48 +00:00
Really Remove all ItemStack == ItemStack and ComparisonHelper references.
This commit is contained in:
1 parent
4399b4f26e
commit
ca00652ad7
12 files changed
+23
-36
No files matched your search
@@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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,
|
||||
|
||||
@@ -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 ()
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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";
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user