Skip to content

Commit

Permalink
Don't rename world if world with new name already exists
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasmny committed Feb 14, 2024
1 parent fd0cf7f commit d960c3e
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,10 @@ private List<Player> removePlayersFromWorld(String worldName, String message) {
public void renameWorld(Player player, BuildWorld buildWorld, String newName) {
player.closeInventory();

if (worldExists(player, newName)) {
return;
}

String oldName = buildWorld.getName();
if (oldName.equalsIgnoreCase(newName)) {
Messages.sendMessage(player, "worlds_rename_same_name");
Expand Down

0 comments on commit d960c3e

Please sign in to comment.