aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-vineflower-stripped/net/minecraft/server/commands/GameRuleCommand.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-vineflower-stripped/net/minecraft/server/commands/GameRuleCommand.java.patch')
-rw-r--r--patch-remap/mache-vineflower-stripped/net/minecraft/server/commands/GameRuleCommand.java.patch33
1 files changed, 33 insertions, 0 deletions
diff --git a/patch-remap/mache-vineflower-stripped/net/minecraft/server/commands/GameRuleCommand.java.patch b/patch-remap/mache-vineflower-stripped/net/minecraft/server/commands/GameRuleCommand.java.patch
new file mode 100644
index 0000000000..7c5cf0e4ab
--- /dev/null
+++ b/patch-remap/mache-vineflower-stripped/net/minecraft/server/commands/GameRuleCommand.java.patch
@@ -0,0 +1,33 @@
+--- a/net/minecraft/server/commands/GameRuleCommand.java
++++ b/net/minecraft/server/commands/GameRuleCommand.java
+@@ -27,16 +30,22 @@
+ }
+
+ static <T extends GameRules.Value<T>> int setRule(CommandContext<CommandSourceStack> source, GameRules.Key<T> gameRule) {
+- CommandSourceStack commandSourceStack = source.getSource();
+- T rule = commandSourceStack.getServer().getGameRules().getRule(gameRule);
+- rule.setFromArgument(source, "value");
+- commandSourceStack.sendSuccess(() -> Component.translatable("commands.gamerule.set", gameRule.getId(), rule.toString()), true);
+- return rule.getCommandResult();
++ CommandSourceStack commandlistenerwrapper = (CommandSourceStack) source.getSource();
++ T t0 = commandlistenerwrapper.getLevel().getGameRules().getRule(gameRule); // CraftBukkit
++
++ t0.setFromArgument(source, "value");
++ commandlistenerwrapper.sendSuccess(() -> {
++ return Component.translatable("commands.gamerule.set", gameRule.getId(), t0.toString());
++ }, true);
++ return t0.getCommandResult();
+ }
+
+ static <T extends GameRules.Value<T>> int queryRule(CommandSourceStack source, GameRules.Key<T> gameRule) {
+- T rule = source.getServer().getGameRules().getRule(gameRule);
+- source.sendSuccess(() -> Component.translatable("commands.gamerule.query", gameRule.getId(), rule.toString()), false);
+- return rule.getCommandResult();
++ T t0 = source.getLevel().getGameRules().getRule(gameRule); // CraftBukkit
++
++ source.sendSuccess(() -> {
++ return Component.translatable("commands.gamerule.query", gameRule.getId(), t0.toString());
++ }, false);
++ return t0.getCommandResult();
+ }
+ }