Fixed ArrayOutOfBoundsException in admin delete command (#600)

When admins tried to delete island, they got an ArrayOutOfBounds exception.
This will fix it.
This commit is contained in:
BONNe 2019-03-08 21:38:59 +02:00 committed by Florian CUNY
parent e3fbeb1560
commit 07b4e2d30c
7 changed files with 18 additions and 4 deletions

View File

@ -27,6 +27,10 @@ public class AdminDeleteCommand extends ConfirmableCommand {
@Override @Override
public boolean canExecute(User user, String label, List<String> args) { public boolean canExecute(User user, String label, List<String> args) {
if (args.size() != 1) {
showHelp(this, user);
return false;
}
// Get target // Get target
UUID targetUUID = getPlayers().getUUID(args.get(0)); UUID targetUUID = getPlayers().getUUID(args.get(0));
if (targetUUID == null) { if (targetUUID == null) {

View File

@ -223,7 +223,7 @@ commands:
world: world:
description: "Manage world settings" description: "Manage world settings"
delete: delete:
parameters: "" parameters: "<player>"
description: "deletes a player's island" description: "deletes a player's island"
cannot-delete-owner: "&cAll island members have to be kicked from the island before deleting it." cannot-delete-owner: "&cAll island members have to be kicked from the island before deleting it."
deleted-island: "&aIsland at &e[xyz] &ahas been successfully deleted." deleted-island: "&aIsland at &e[xyz] &ahas been successfully deleted."

View File

@ -166,7 +166,7 @@ commands:
world: world:
description: "世界の設定を管理する" description: "世界の設定を管理する"
delete: delete:
parameters: "" parameters: "<player>"
description: "プレイヤーの島を削除します。" description: "プレイヤーの島を削除します。"
cannot-delete-owner: "&cすべての島のメンバーは、それを削除する前に島から追い出される必要があります。" cannot-delete-owner: "&cすべての島のメンバーは、それを削除する前に島から追い出される必要があります。"
deleted-island: "&2[xyz] の島は正常に削除されました。" deleted-island: "&2[xyz] の島は正常に削除されました。"

View File

@ -138,6 +138,11 @@ commands:
look-at-a-block: "&cSpójrz na blok w ciągu 20 bloków, aby ustawić" look-at-a-block: "&cSpójrz na blok w ciągu 20 bloków, aby ustawić"
world: world:
description: "Zarządzaj ustawieniami świata" description: "Zarządzaj ustawieniami świata"
delete:
parameters: "<player>"
description: "deletes a player's island"
cannot-delete-owner: "&cAll island members have to be kicked from the island before deleting it."
deleted-island: "&aIsland at &e[xyz] &ahas been successfully deleted."
island: island:
about: about:
description: "wyświetl informacje o prawach autorskich i licencji" description: "wyświetl informacje o prawach autorskich i licencji"

View File

@ -56,6 +56,11 @@ commands:
parameters: "[player]" parameters: "[player]"
description: "Dịch chuyển đến đảo người chơi" description: "Dịch chuyển đến đảo người chơi"
manual: "&cKhông tìm thấy cổng dịch chuyển an toàn! Hãy tp tới địa điểm &b[location] &cvà kiểm tra" manual: "&cKhông tìm thấy cổng dịch chuyển an toàn! Hãy tp tới địa điểm &b[location] &cvà kiểm tra"
delete:
parameters: "<player>"
description: "deletes a player's island"
cannot-delete-owner: "&cAll island members have to be kicked from the island before deleting it."
deleted-island: "&aIsland at &e[xyz] &ahas been successfully deleted."
island: island:
about: about:
description: "hiện thông tin về BentoBox" description: "hiện thông tin về BentoBox"

View File

@ -186,7 +186,7 @@ commands:
world: world:
description: "管理世界设置" description: "管理世界设置"
delete: delete:
parameters: "" parameters: "<player>"
description: "删除玩家的岛屿" description: "删除玩家的岛屿"
cannot-delete-owner: "&c删除之前必须将所有岛屿成员都踢出岛屿。" cannot-delete-owner: "&c删除之前必须将所有岛屿成员都踢出岛屿。"
deleted-island: "&a位于 &e[xyz] &a的岛屿已经被成功删除。" deleted-island: "&a位于 &e[xyz] &a的岛屿已经被成功删除。"

View File

@ -198,7 +198,7 @@ commands:
world: world:
description: "管理世界設置" description: "管理世界設置"
delete: delete:
parameters: "" parameters: "<player>"
description: "刪除玩家的島嶼" description: "刪除玩家的島嶼"
cannot-delete-owner: "&c刪除之前必須將所有島嶼成員都踢出島嶼。" cannot-delete-owner: "&c刪除之前必須將所有島嶼成員都踢出島嶼。"
deleted-island: "&a位於 &e[xyz] &a的島嶼已經被成功刪除。" deleted-island: "&a位於 &e[xyz] &a的島嶼已經被成功刪除。"