diff --git a/src/main/java/world/bentobox/bentobox/api/commands/admin/AdminDeleteCommand.java b/src/main/java/world/bentobox/bentobox/api/commands/admin/AdminDeleteCommand.java index db90ca099..238719542 100644 --- a/src/main/java/world/bentobox/bentobox/api/commands/admin/AdminDeleteCommand.java +++ b/src/main/java/world/bentobox/bentobox/api/commands/admin/AdminDeleteCommand.java @@ -65,8 +65,6 @@ public class AdminDeleteCommand extends ConfirmableCommand { private void deletePlayer(User user, UUID targetUUID) { // Delete player and island - user.sendMessage("commands.admin.delete.deleted-island", "[xyz]", Util.xyz(getIslands().getIsland(getWorld(), targetUUID).getCenter().toVector())); - // Get the target's island Island oldIsland = getIslands().getIsland(getWorld(), targetUUID); if (oldIsland != null) { @@ -89,7 +87,7 @@ public class AdminDeleteCommand extends ConfirmableCommand { getIslands().deleteIsland(oldIsland, true, targetUUID); } getPlayers().clearHomeLocations(getWorld(), targetUUID); - user.sendMessage("general.success"); + user.sendMessage("commands.admin.delete.deleted-island", "[xyz]", Util.xyz(getIslands().getIsland(getWorld(), targetUUID).getCenter().toVector())); } @Override diff --git a/src/main/java/world/bentobox/bentobox/api/commands/admin/AdminEmptyTrashCommand.java b/src/main/java/world/bentobox/bentobox/api/commands/admin/AdminEmptyTrashCommand.java index 4b3e11c23..f5c8970ff 100644 --- a/src/main/java/world/bentobox/bentobox/api/commands/admin/AdminEmptyTrashCommand.java +++ b/src/main/java/world/bentobox/bentobox/api/commands/admin/AdminEmptyTrashCommand.java @@ -53,7 +53,7 @@ public class AdminEmptyTrashCommand extends ConfirmableCommand { } else { this.askConfirmation(user, () -> { getIslands().deleteQuarantinedIslandByUser(getWorld(), targetUUID); - user.sendMessage("general.success"); + user.sendMessage("commands.admin.emptytrash.success"); }); return true; } diff --git a/src/main/java/world/bentobox/bentobox/api/commands/admin/AdminRegisterCommand.java b/src/main/java/world/bentobox/bentobox/api/commands/admin/AdminRegisterCommand.java index 89d55caf0..702345bfb 100644 --- a/src/main/java/world/bentobox/bentobox/api/commands/admin/AdminRegisterCommand.java +++ b/src/main/java/world/bentobox/bentobox/api/commands/admin/AdminRegisterCommand.java @@ -94,7 +94,6 @@ public class AdminRegisterCommand extends ConfirmableCommand { getIslands().setOwner(user, targetUUID, i); getWorld().getBlockAt(i.getCenter()).setType(Material.BEDROCK); user.sendMessage("commands.admin.register.registered-island", "[xyz]", Util.xyz(i.getCenter().toVector())); - user.sendMessage("general.success"); IslandBaseEvent event = IslandEvent.builder() .island(i) .location(i.getCenter()) diff --git a/src/main/java/world/bentobox/bentobox/api/commands/admin/AdminResetFlagsCommand.java b/src/main/java/world/bentobox/bentobox/api/commands/admin/AdminResetFlagsCommand.java index a06e08716..37a0ad99f 100644 --- a/src/main/java/world/bentobox/bentobox/api/commands/admin/AdminResetFlagsCommand.java +++ b/src/main/java/world/bentobox/bentobox/api/commands/admin/AdminResetFlagsCommand.java @@ -29,7 +29,7 @@ public class AdminResetFlagsCommand extends ConfirmableCommand { // Everything's fine, we can set the island as spawn :) askConfirmation(user, () -> { getIslands().resetAllFlags(getWorld()); - user.sendMessage("general.success"); + user.sendMessage("commands.admin.resetflags.success"); }); return true; } diff --git a/src/main/java/world/bentobox/bentobox/api/commands/admin/AdminSetspawnCommand.java b/src/main/java/world/bentobox/bentobox/api/commands/admin/AdminSetspawnCommand.java index c56010fc3..1b08f5f51 100644 --- a/src/main/java/world/bentobox/bentobox/api/commands/admin/AdminSetspawnCommand.java +++ b/src/main/java/world/bentobox/bentobox/api/commands/admin/AdminSetspawnCommand.java @@ -75,7 +75,6 @@ public class AdminSetspawnCommand extends ConfirmableCommand { } getIslands().setSpawn(i); i.setSpawnPoint(World.Environment.NORMAL, user.getLocation()); - user.sendMessage("general.success"); - + user.sendMessage("commands.admin.setspawn.success"); } } diff --git a/src/main/java/world/bentobox/bentobox/api/commands/admin/AdminSwitchtoCommand.java b/src/main/java/world/bentobox/bentobox/api/commands/admin/AdminSwitchtoCommand.java index 5aa7847da..e70152b3b 100644 --- a/src/main/java/world/bentobox/bentobox/api/commands/admin/AdminSwitchtoCommand.java +++ b/src/main/java/world/bentobox/bentobox/api/commands/admin/AdminSwitchtoCommand.java @@ -67,7 +67,7 @@ public class AdminSwitchtoCommand extends ConfirmableCommand { } this.askConfirmation(user, () -> { if (getIslands().switchIsland(getWorld(), targetUUID, islands.get(n -1))) { - user.sendMessage("general.success"); + user.sendMessage("commands.admin.switchto.success"); } else { user.sendMessage("commands.admin.switchto.cannot-switch"); } diff --git a/src/main/java/world/bentobox/bentobox/api/commands/admin/AdminUnregisterCommand.java b/src/main/java/world/bentobox/bentobox/api/commands/admin/AdminUnregisterCommand.java index d8d065164..fcd55ae2e 100644 --- a/src/main/java/world/bentobox/bentobox/api/commands/admin/AdminUnregisterCommand.java +++ b/src/main/java/world/bentobox/bentobox/api/commands/admin/AdminUnregisterCommand.java @@ -63,7 +63,6 @@ public class AdminUnregisterCommand extends ConfirmableCommand { private void unregisterPlayer(User user, UUID targetUUID) { // Unregister island Island oldIsland = getIslands().getIsland(getWorld(), targetUUID); - user.sendMessage("commands.admin.unregister.unregistered-island", "[xyz]", Util.xyz(oldIsland.getCenter().toVector())); IslandBaseEvent event = IslandEvent.builder() .island(oldIsland) .location(oldIsland.getCenter()) @@ -77,7 +76,7 @@ public class AdminUnregisterCommand extends ConfirmableCommand { getIslands().removePlayer(getWorld(), m); getPlayers().clearHomeLocations(getWorld(), m); }); - user.sendMessage("general.success"); + user.sendMessage("commands.admin.unregister.unregistered-island", "[xyz]", Util.xyz(oldIsland.getCenter().toVector())); } @Override diff --git a/src/main/resources/locales/en-US.yml b/src/main/resources/locales/en-US.yml index db1d87b3e..8496516ae 100644 --- a/src/main/resources/locales/en-US.yml +++ b/src/main/resources/locales/en-US.yml @@ -151,7 +151,8 @@ commands: parameters: " " description: "switch player's island to the numbered one in trash" out-of-range: "&cNumber must be between 1 and [number]. Use &l[label] trash [player] &r&cto see island numbers" - cannot-switch: "&cSwitch failed. See console log for error." + cannot-switch: "&cSwitch failed. See console log for error." + success: "&Successfully switched the player's island to the specified one." trash: no-unowned-in-trash: "&cNo unowned islands in trash" no-islands-in-trash: "&cPlayer has no islands in trash" @@ -164,12 +165,13 @@ commands: emptytrash: parameters: "[player]" description: "Clear trash for player, or all unowned islands in trash" + success: "&aTrash successfully emptied." version: description: "display BentoBox and addons versions" setrange: parameters: " " description: "set the range of player's island" - range-updated: "Island range updated to [number]" + range-updated: "&aIsland range updated to &b[number]&a." reload: description: "reload" tp: @@ -186,10 +188,11 @@ commands: unknown-rank: "&cUnknown rank!" rank-set: "&aRank set from [from] to [to]." setspawn: - description: "set an Island as spawn for this world" + description: "set an island as spawn for this world" already-spawn: "&cThis island is already a spawn!" no-island-here: "&cThere is no island here." - confirmation: "&cAre you sure you want to set this Island as the spawn for this world?" + confirmation: "&cAre you sure you want to set this island as the spawn for this world?" + success: "&aSuccessfully set this island as the spawn for this world." blueprint: parameters: "" description: "manipulate blueprints" @@ -279,6 +282,7 @@ commands: &aRight click to decrement resetflags: description: "Reset all islands to default flag settings in config.yml" + success: "&aSuccessfully reset all islands' flags to the default settings." world: description: "Manage world settings" delete: diff --git a/src/test/java/world/bentobox/bentobox/api/commands/island/IslandExpelCommandTest.java b/src/test/java/world/bentobox/bentobox/api/commands/island/IslandExpelCommandTest.java index ac84780d2..6429ac606 100644 --- a/src/test/java/world/bentobox/bentobox/api/commands/island/IslandExpelCommandTest.java +++ b/src/test/java/world/bentobox/bentobox/api/commands/island/IslandExpelCommandTest.java @@ -367,7 +367,7 @@ public class IslandExpelCommandTest { public void testExecuteUserStringListOfStringHasIsland() { testCanExecute(); assertTrue(iec.execute(user, "", Collections.singletonList("tasty"))); - Mockito.verify(user).sendMessage("commands.island.expel.success"); + Mockito.verify(user).sendMessage("commands.island.expel.success", TextVariables.NAME, "target"); Mockito.verify(im).homeTeleport(Mockito.any(), Mockito.any()); } @@ -381,7 +381,7 @@ public class IslandExpelCommandTest { testCanExecute(); when(im.hasIsland(Mockito.any(), Mockito.any(User.class))).thenReturn(false); assertTrue(iec.execute(user, "", Collections.singletonList("tasty"))); - Mockito.verify(user).sendMessage("commands.island.expel.success"); + Mockito.verify(user).sendMessage("commands.island.expel.success", TextVariables.NAME, "target"); Mockito.verify(im).spawnTeleport(Mockito.any(), Mockito.any()); } @@ -401,7 +401,7 @@ public class IslandExpelCommandTest { testCanExecute(); when(im.hasIsland(Mockito.any(), Mockito.any(User.class))).thenReturn(false); assertTrue(iec.execute(user, "", Collections.singletonList("tasty"))); - Mockito.verify(user).sendMessage("commands.island.expel.success"); + Mockito.verify(user).sendMessage("commands.island.expel.success", TextVariables.NAME, "target"); Mockito.verify(addon).logWarning(Mockito.eq("Expel: target had no island, so one was created")); } diff --git a/src/test/java/world/bentobox/bentobox/api/commands/island/team/IslandTeamCoopCommandTest.java b/src/test/java/world/bentobox/bentobox/api/commands/island/team/IslandTeamCoopCommandTest.java index efee7596c..f4c7aded0 100644 --- a/src/test/java/world/bentobox/bentobox/api/commands/island/team/IslandTeamCoopCommandTest.java +++ b/src/test/java/world/bentobox/bentobox/api/commands/island/team/IslandTeamCoopCommandTest.java @@ -32,6 +32,7 @@ import org.powermock.reflect.Whitebox; import world.bentobox.bentobox.BentoBox; import world.bentobox.bentobox.Settings; import world.bentobox.bentobox.api.commands.CompositeCommand; +import world.bentobox.bentobox.api.localization.TextVariables; import world.bentobox.bentobox.api.user.User; import world.bentobox.bentobox.database.objects.Island; import world.bentobox.bentobox.managers.CommandsManager; @@ -298,9 +299,7 @@ public class IslandTeamCoopCommandTest { // Execute when(im.getIsland(any(), Mockito.any(UUID.class))).thenReturn(island); assertTrue(itl.execute(user, itl.getLabel(), Collections.singletonList("tastybento"))); - verify(user).sendMessage(eq("general.success")); + verify(user).sendMessage("commands.island.team.coop.success", TextVariables.NAME, null); verify(island).setRank(target, RanksManager.COOP_RANK); } - - }