aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-spigotflower-stripped/net/minecraft/server/commands/GameRuleCommand.java.patch
blob: f87d54ce97a859f14ff2210cda02f8eee1070746 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
--- a/net/minecraft/server/commands/GameRuleCommand.java
+++ b/net/minecraft/server/commands/GameRuleCommand.java
@@ -31,9 +29,9 @@
         commanddispatcher.register(literalargumentbuilder);
     }
 
-    static <T extends GameRules.Value<T>> int setRule(CommandContext<CommandSourceStack> commandcontext, GameRules.Key<T> gamerules_key) {
-        CommandSourceStack commandsourcestack = (CommandSourceStack) commandcontext.getSource();
-        T t0 = commandsourcestack.getServer().getGameRules().getRule(gamerules_key);
+    static <T extends GameRules.Value<T>> int setRule(CommandContext<CommandSourceStack> source, GameRules.Key<T> gameRule) {
+        CommandSourceStack commandlistenerwrapper = (CommandSourceStack) source.getSource();
+        T t0 = commandlistenerwrapper.getLevel().getGameRules().getRule(gameRule); // CraftBukkit
 
         t0.setFromArgument(commandcontext, "value");
         commandsourcestack.sendSuccess(() -> {
@@ -42,8 +40,8 @@
         return t0.getCommandResult();
     }
 
-    static <T extends GameRules.Value<T>> int queryRule(CommandSourceStack commandsourcestack, GameRules.Key<T> gamerules_key) {
-        T t0 = commandsourcestack.getServer().getGameRules().getRule(gamerules_key);
+    static <T extends GameRules.Value<T>> int queryRule(CommandSourceStack source, GameRules.Key<T> gameRule) {
+        T t0 = source.getLevel().getGameRules().getRule(gameRule); // CraftBukkit
 
         commandsourcestack.sendSuccess(() -> {
             return Component.translatable("commands.gamerule.query", gamerules_key.getId(), t0.toString());