Fixed QE teleporting when binding vec

This commit is contained in:
Aidan Brady 2013-08-02 21:25:25 -04:00
parent 17f29aeb7c
commit 1d9f4ab627

View file

@ -23,6 +23,8 @@ public class ItemQuantumEntangler extends ItemBase
{
public static int WILDCARD = 1337; /* :) */
private static boolean didBindThisTick = false;
public ItemQuantumEntangler(int id)
{
super("entangler", id);
@ -66,6 +68,7 @@ public class ItemQuantumEntangler extends ItemBase
entityplayer.addChatMessage("Bound Entangler to block [" + x + ", " + y + ", " + z + "], dimension '" + dimID + "'");
setBindVec(itemstack, new Vector3(x, y, z), dimID);
didBindThisTick = true;
return true;
}
@ -79,7 +82,7 @@ public class ItemQuantumEntangler extends ItemBase
@Override
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer)
{
if (!world.isRemote)
if (!world.isRemote && !didBindThisTick)
{
if (!hasBind(itemstack))
{
@ -104,6 +107,8 @@ public class ItemQuantumEntangler extends ItemBase
world.playSoundAtEntity(entityplayer, "mob.endermen.portal", 1.0F, 1.0F);
}
didBindThisTick = false;
return itemstack;
}