Skip to content

Commit

Permalink
unsetのときも存在しないワールドをチェックするように
Browse files Browse the repository at this point in the history
  • Loading branch information
Rires-Magica committed Aug 19, 2020
1 parent e122322 commit 3ac4aa7
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/main/java/city/genkoku/mainmaphoruna/MMHCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 3ac4aa7

Please sign in to comment.