public void setLock(ItemStack lock) { if (lock != null && !isItemStackLock(lock)) throw new InvalidParameterException("lock is not an ItemStack of ItemLock."); TileEntityReinforcedChest chest = getMainChest(); chest.lock = lock; worldObj.markBlockForUpdate(chest.xCoord, chest.yCoord, chest.zCoord); }