--- a/net/minecraft/server/commands/GameRuleCommand.java +++ b/net/minecraft/server/commands/GameRuleCommand.java @@ -30,14 +_,14 @@ static > int setRule(CommandContext source, GameRules.Key gameRule) { CommandSourceStack commandSourceStack = source.getSource(); - T rule = commandSourceStack.getServer().getGameRules().getRule(gameRule); - rule.setFromArgument(source, "value"); + T rule = commandSourceStack.getLevel().getGameRules().getRule(gameRule); // CraftBukkit + rule.setFromArgument(source, "value", gameRule); // Paper - Add WorldGameRuleChangeEvent commandSourceStack.sendSuccess(() -> Component.translatable("commands.gamerule.set", gameRule.getId(), rule.toString()), true); return rule.getCommandResult(); } static > int queryRule(CommandSourceStack source, GameRules.Key gameRule) { - T rule = source.getServer().getGameRules().getRule(gameRule); + T rule = source.getLevel().getGameRules().getRule(gameRule); // CraftBukkit source.sendSuccess(() -> Component.translatable("commands.gamerule.query", gameRule.getId(), rule.toString()), false); return rule.getCommandResult(); }