mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2025-01-24 09:11:21 +01:00
Fix NPE for invalid world argument in gamerule cmd
Stumbled upon an NPE when using /mv gamerule. I realised it was because I had specified a nonexistent world. This will fix it.
This commit is contained in:
parent
b4b0940918
commit
9d42a05759
@ -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)) {
|
||||
|
Loading…
Reference in New Issue
Block a user