From 4d001997b81489da4bca149e6ba47e7ef08dc4b9 Mon Sep 17 00:00:00 2001 From: OnyxDarkKnight Date: Fri, 27 Dec 2013 01:03:03 +0200 Subject: Fixed and made so you can't teleport in another dimension the coords were set in --- common/darkknight/jewelrycraft/block/BlockDisplayer.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'common/darkknight/jewelrycraft/block/BlockDisplayer.java') diff --git a/common/darkknight/jewelrycraft/block/BlockDisplayer.java b/common/darkknight/jewelrycraft/block/BlockDisplayer.java index e0061ae..d83186a 100644 --- a/common/darkknight/jewelrycraft/block/BlockDisplayer.java +++ b/common/darkknight/jewelrycraft/block/BlockDisplayer.java @@ -13,6 +13,7 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.MathHelper; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import net.minecraftforge.common.FakePlayer; import darkknight.jewelrycraft.tileentity.TileEntityDisplayer; public class BlockDisplayer extends BlockContainer @@ -59,7 +60,7 @@ public class BlockDisplayer extends BlockContainer { TileEntityDisplayer te = (TileEntityDisplayer) world.getBlockTileEntity(i, j, k); ItemStack item = entityPlayer.inventory.getCurrentItem(); - if (te != null && item != null && item != new ItemStack(0, 0, 0) && !world.isRemote) + if (te != null && item != null && item != new ItemStack(0, 0, 0) && world.isRemote) { if(!te.hasObject) { @@ -70,7 +71,7 @@ public class BlockDisplayer extends BlockContainer if (!entityPlayer.capabilities.isCreativeMode) item.stackSize = 0; te.isDirty = true; } - else if(te.object.itemID == item.itemID && te.object.getItemDamage() == item.getItemDamage() && te.object.getTooltip(entityPlayer, false).equals(item.getTooltip(entityPlayer, false))) + else if(te.object.itemID == item.itemID && te.object.getItemDamage() == item.getItemDamage() && te.object.getTooltip(new FakePlayer(te.worldObj, "Player"), true).equals(item.getTooltip(new FakePlayer(te.worldObj, "Player"), true))) { te.quantity += item.stackSize; te.object.stackSize = 1; -- cgit v1.2.3