Paper/patch-remap/mache-spigotflower-stripped/net/minecraft/server/commands/GameRuleCommand.java.patch

27 lines
1.5 KiB
Diff

--- 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());