public boolean blockActivated(EntityPlayer player, int side) {
ItemStack current = player.getCurrentEquippedItem();
if (current != null && current.getItem() instanceof IToolCrowbar) {
IToolCrowbar crowbar = (IToolCrowbar) current.getItem();
if (crowbar.canWhack(player, current, xCoord, yCoord, zCoord)) {
WorldCoordinate target = TileAnchorWorld.getTarget(player);
if (target == null)
TileAnchorWorld.setTarget(this, player);
else if (worldObj.provider.dimensionId != target.dimension)
ChatPlugin.sendLocalizedChatFromServer(player, "railcraft.gui.anchor.pair.fail.dimension", getName());
else if (new WorldCoordinate(this).equals(target)) {
TileAnchorWorld.removeTarget(player);
ChatPlugin.sendLocalizedChatFromServer(player, "railcraft.gui.anchor.pair.cancel", getName());
} else {
TileEntity tile = TileAnchorWorld.getTargetAt(player, this, target);
if (tile instanceof TileAnchorWorld)
((TileAnchorWorld) tile).setSentinel(player, new WorldCoordinate(this));
else if (tile != null)
ChatPlugin.sendLocalizedChatFromServer(player, "railcraft.gui.anchor.pair.fail.invalid", getName());
}
crowbar.onWhack(player, current, xCoord, yCoord, zCoord);
return true;