Paper/nms-patches/CommandGamerule.patch

21 lines
1.3 KiB
Diff
Raw Normal View History

2018-08-03 13:03:21 +02:00
--- a/net/minecraft/server/CommandGamerule.java
+++ b/net/minecraft/server/CommandGamerule.java
2019-06-21 12:00:00 +02:00
@@ -25,7 +25,7 @@
2018-08-03 13:03:21 +02:00
2019-06-21 12:00:00 +02:00
private static <T extends GameRules.GameRuleValue<T>> int b(CommandContext<CommandListenerWrapper> commandcontext, GameRules.GameRuleKey<T> gamerules_gamerulekey) {
CommandListenerWrapper commandlistenerwrapper = (CommandListenerWrapper) commandcontext.getSource();
- T t0 = commandlistenerwrapper.getServer().getGameRules().get(gamerules_gamerulekey);
+ T t0 = commandlistenerwrapper.getWorld().getGameRules().get(gamerules_gamerulekey); // CraftBukkit
2018-08-03 13:03:21 +02:00
2019-06-21 12:00:00 +02:00
t0.b(commandcontext, "value");
commandlistenerwrapper.sendMessage(new ChatMessage("commands.gamerule.set", new Object[]{gamerules_gamerulekey.a(), t0.toString()}), true);
@@ -33,7 +33,7 @@
2018-08-03 13:03:21 +02:00
}
2019-06-21 12:00:00 +02:00
private static <T extends GameRules.GameRuleValue<T>> int b(CommandListenerWrapper commandlistenerwrapper, GameRules.GameRuleKey<T> gamerules_gamerulekey) {
- T t0 = commandlistenerwrapper.getServer().getGameRules().get(gamerules_gamerulekey);
+ T t0 = commandlistenerwrapper.getWorld().getGameRules().get(gamerules_gamerulekey); // CraftBukkit
2018-08-03 13:03:21 +02:00
2019-06-21 12:00:00 +02:00
commandlistenerwrapper.sendMessage(new ChatMessage("commands.gamerule.query", new Object[]{gamerules_gamerulekey.a(), t0.toString()}), false);
return t0.getIntValue();