From 3ac4aa7e6dc132538ce5ba769aa8e521a49f1490 Mon Sep 17 00:00:00 2001 From: Rires_Magica Date: Thu, 20 Aug 2020 08:48:47 +0900 Subject: [PATCH] =?UTF-8?q?unset=E3=81=AE=E3=81=A8=E3=81=8D=E3=82=82?= =?UTF-8?q?=E5=AD=98=E5=9C=A8=E3=81=97=E3=81=AA=E3=81=84=E3=83=AF=E3=83=BC?= =?UTF-8?q?=E3=83=AB=E3=83=89=E3=82=92=E3=83=81=E3=82=A7=E3=83=83=E3=82=AF?= =?UTF-8?q?=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../city/genkoku/mainmaphoruna/MMHCommand.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/main/java/city/genkoku/mainmaphoruna/MMHCommand.java b/src/main/java/city/genkoku/mainmaphoruna/MMHCommand.java index cdd5764..e574c15 100644 --- a/src/main/java/city/genkoku/mainmaphoruna/MMHCommand.java +++ b/src/main/java/city/genkoku/mainmaphoruna/MMHCommand.java @@ -112,13 +112,20 @@ public boolean onCommand(CommandSender sender, Command command, String label, St } } else { // world is specified + if (Bukkit.getServer().getWorlds().stream().map(World::getName).noneMatch(w -> w.equals(args[1]))) { + // specified world is not found + TextComponent msgWorldNotFound = new TextComponent("The world you specified is not found."); + msgWorldNotFound.setColor(ChatColor.DARK_RED); + sender.sendMessage(msgWorldNotFound); + return true; + } worldName = args[1]; } if (MainMapHoruna.getThresholds().keySet().stream().noneMatch(w -> w.equals(args[1]))) { - // specified world is not found - TextComponent msgWorldNotFound = new TextComponent("The world has no restriction."); - msgWorldNotFound.setColor(ChatColor.GRAY); - sender.sendMessage(msgWorldNotFound); + // specified world has no restriction + TextComponent msgNoRestrictionFound = new TextComponent("The world has no restriction."); + msgNoRestrictionFound.setColor(ChatColor.GRAY); + sender.sendMessage(msgNoRestrictionFound); return true; } MainMapHoruna.unsetThreshold(worldName);