Merge pull request #2227 from A248/patch-1

Fix NPE for invalid world argument in gamerule cmd
This commit is contained in:
Jeremy Wood 2020-05-05 21:19:42 -04:00 committed by GitHub
commit 59cfacf007
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -62,6 +62,11 @@ public class GameruleCommand extends MultiverseCommand {
world = p.getWorld();
} else {
world = Bukkit.getWorld(args.get(2));
if (world == null) {
sender.sendMessage(ChatColor.RED + "Failure!" + ChatColor.WHITE + " World " + ChatColor.AQUA + args.get(2)
+ ChatColor.WHITE + " does not exist.");
return;
}
}
if (world.setGameRuleValue(gameRule, value)) {