From 45bf4890475cbd64d1bcb568df4214dc168c5a9b Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Fri, 3 Aug 2018 21:03:21 +1000 Subject: [PATCH] Fix gamerules in secondary worlds By: md_5 --- .../nms-patches/CommandGamerule.patch | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 paper-server/nms-patches/CommandGamerule.patch diff --git a/paper-server/nms-patches/CommandGamerule.patch b/paper-server/nms-patches/CommandGamerule.patch new file mode 100644 index 0000000000..228c301311 --- /dev/null +++ b/paper-server/nms-patches/CommandGamerule.patch @@ -0,0 +1,20 @@ +--- a/net/minecraft/server/CommandGamerule.java ++++ b/net/minecraft/server/CommandGamerule.java +@@ -29,7 +29,7 @@ + } + + private static int a(CommandListenerWrapper commandlistenerwrapper, String s, CommandContext commandcontext) { +- GameRules.GameRuleValue gamerules_gamerulevalue = commandlistenerwrapper.getServer().aQ().get(s); ++ GameRules.GameRuleValue gamerules_gamerulevalue = commandlistenerwrapper.getWorld().getGameRules().get(s); // CraftBukkit + + gamerules_gamerulevalue.e().a(commandcontext, "value", gamerules_gamerulevalue); + commandlistenerwrapper.sendMessage(new ChatMessage("commands.gamerule.set", new Object[] { s, gamerules_gamerulevalue.a()}), true); +@@ -37,7 +37,7 @@ + } + + private static int a(CommandListenerWrapper commandlistenerwrapper, String s) { +- GameRules.GameRuleValue gamerules_gamerulevalue = commandlistenerwrapper.getServer().aQ().get(s); ++ GameRules.GameRuleValue gamerules_gamerulevalue = commandlistenerwrapper.getWorld().getGameRules().get(s); // CraftBukkit + + commandlistenerwrapper.sendMessage(new ChatMessage("commands.gamerule.query", new Object[] { s, gamerules_gamerulevalue.a()}), false); + return gamerules_gamerulevalue.c();