Fixed QE teleporting when binding vec
This commit is contained in:
parent
17f29aeb7c
commit
1d9f4ab627
1 changed files with 6 additions and 1 deletions
|
@ -23,6 +23,8 @@ public class ItemQuantumEntangler extends ItemBase
|
||||||
{
|
{
|
||||||
public static int WILDCARD = 1337; /* :) */
|
public static int WILDCARD = 1337; /* :) */
|
||||||
|
|
||||||
|
private static boolean didBindThisTick = false;
|
||||||
|
|
||||||
public ItemQuantumEntangler(int id)
|
public ItemQuantumEntangler(int id)
|
||||||
{
|
{
|
||||||
super("entangler", id);
|
super("entangler", id);
|
||||||
|
@ -66,6 +68,7 @@ public class ItemQuantumEntangler extends ItemBase
|
||||||
|
|
||||||
entityplayer.addChatMessage("Bound Entangler to block [" + x + ", " + y + ", " + z + "], dimension '" + dimID + "'");
|
entityplayer.addChatMessage("Bound Entangler to block [" + x + ", " + y + ", " + z + "], dimension '" + dimID + "'");
|
||||||
setBindVec(itemstack, new Vector3(x, y, z), dimID);
|
setBindVec(itemstack, new Vector3(x, y, z), dimID);
|
||||||
|
didBindThisTick = true;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -79,7 +82,7 @@ public class ItemQuantumEntangler extends ItemBase
|
||||||
@Override
|
@Override
|
||||||
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer)
|
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer)
|
||||||
{
|
{
|
||||||
if (!world.isRemote)
|
if (!world.isRemote && !didBindThisTick)
|
||||||
{
|
{
|
||||||
if (!hasBind(itemstack))
|
if (!hasBind(itemstack))
|
||||||
{
|
{
|
||||||
|
@ -104,6 +107,8 @@ public class ItemQuantumEntangler extends ItemBase
|
||||||
world.playSoundAtEntity(entityplayer, "mob.endermen.portal", 1.0F, 1.0F);
|
world.playSoundAtEntity(entityplayer, "mob.endermen.portal", 1.0F, 1.0F);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
didBindThisTick = false;
|
||||||
|
|
||||||
return itemstack;
|
return itemstack;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue