@Override /** * Gets the hardness of block at the given coordinates in the given world, relative to the ability * of the given EntityPlayer. */ public float getPlayerRelativeBlockHardness( EntityPlayer entityPlayer, World world, int x, int y, int z) { TEBase TE = getTileEntityStrict(world, x, y, z); if (Safe.isOpen(TE) || !PlayerPermissions.canPlayerEdit(TE, TE.xCoord, TE.yCoord, TE.zCoord, entityPlayer)) { return -1; // Unbreakable } else { return super.getPlayerRelativeBlockHardness(entityPlayer, world, x, y, z); } }
/** Returns whether player is allowed to activate this block. */ @Override protected boolean canPlayerActivate(TEBase TE, EntityPlayer entityPlayer) { return PlayerPermissions.canPlayerEdit(TE, TE.xCoord, TE.yCoord, TE.zCoord, entityPlayer) || !Safe.isLocked(TE); }