mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-04 22:22:18 -07:00
net.minecraft.server.commands
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
--- a/net/minecraft/server/commands/GameRuleCommand.java
|
||||
+++ b/net/minecraft/server/commands/GameRuleCommand.java
|
||||
@@ -30,14 +_,14 @@
|
||||
|
||||
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");
|
||||
+ 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 <T extends GameRules.Value<T>> int queryRule(CommandSourceStack source, GameRules.Key<T> 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();
|
||||
}
|
Reference in New Issue
Block a user