if (player.isAttemptLock() || adjacentChest != null && !adjacentChest.isOpen()) {
if (adjacentChest != null && !adjacentChest.isOpen()) {
server.data.chests.giveLock(adjacentChest.owner, coordinate, adjacentChest.name);
} else {
if (adjacentChest != null) {
adjacentChest.lock(player);
adjacentChest.name = player.nextChestName();
}
server.data.chests.giveLock(player, coordinate, player.nextChestName());
}
player.setAttemptedAction(null);