public boolean canInteractWith(EntityPlayer entityplayer) {
   if (worldObj.getBlockTileEntity(xCoord, yCoord, zCoord) != this) {
     return false;
   }
   return entityplayer.getDistanceSq(
           (double) xCoord + 0.5D, (double) yCoord + 0.5D, (double) zCoord + 0.5D)
       <= 64D;
 }
Ejemplo n.º 2
0
 /** Do not make give this method the name canInteractWith because it clashes with Container */
 public boolean isUseableByPlayer(EntityPlayer par1EntityPlayer) {
   return this.worldObj.getBlockTileEntity(this.xCoord, this.yCoord, this.zCoord) != this
       ? false
       : par1EntityPlayer.getDistanceSq(
               (double) this.xCoord + 0.5D,
               (double) this.yCoord + 0.5D,
               (double) this.zCoord + 0.5D)
           <= 64.0D;
 }