2021-03-16 09:00:00 +11:00
|
|
|
--- a/net/minecraft/server/commands/CommandGamerule.java
|
|
|
|
+++ b/net/minecraft/server/commands/CommandGamerule.java
|
2021-06-11 15:00:00 +10:00
|
|
|
@@ -31,7 +31,7 @@
|
2018-08-03 21:03:21 +10:00
|
|
|
|
2021-11-22 09:00:00 +11:00
|
|
|
static <T extends GameRules.GameRuleValue<T>> int setRule(CommandContext<CommandListenerWrapper> commandcontext, GameRules.GameRuleKey<T> gamerules_gamerulekey) {
|
2019-06-21 20:00:00 +10:00
|
|
|
CommandListenerWrapper commandlistenerwrapper = (CommandListenerWrapper) commandcontext.getSource();
|
2021-11-22 09:00:00 +11:00
|
|
|
- T t0 = commandlistenerwrapper.getServer().getGameRules().getRule(gamerules_gamerulekey);
|
|
|
|
+ T t0 = commandlistenerwrapper.getLevel().getGameRules().getRule(gamerules_gamerulekey); // CraftBukkit
|
2018-08-03 21:03:21 +10:00
|
|
|
|
2021-11-22 09:00:00 +11:00
|
|
|
t0.setFromArgument(commandcontext, "value");
|
|
|
|
commandlistenerwrapper.sendSuccess(new ChatMessage("commands.gamerule.set", new Object[]{gamerules_gamerulekey.getId(), t0.toString()}), true);
|
2021-06-11 15:00:00 +10:00
|
|
|
@@ -39,7 +39,7 @@
|
2018-08-03 21:03:21 +10:00
|
|
|
}
|
|
|
|
|
2021-11-22 09:00:00 +11:00
|
|
|
static <T extends GameRules.GameRuleValue<T>> int queryRule(CommandListenerWrapper commandlistenerwrapper, GameRules.GameRuleKey<T> gamerules_gamerulekey) {
|
|
|
|
- T t0 = commandlistenerwrapper.getServer().getGameRules().getRule(gamerules_gamerulekey);
|
|
|
|
+ T t0 = commandlistenerwrapper.getLevel().getGameRules().getRule(gamerules_gamerulekey); // CraftBukkit
|
2018-08-03 21:03:21 +10:00
|
|
|
|
2021-11-22 09:00:00 +11:00
|
|
|
commandlistenerwrapper.sendSuccess(new ChatMessage("commands.gamerule.query", new Object[]{gamerules_gamerulekey.getId(), t0.toString()}), false);
|
|
|
|
return t0.getCommandResult();
|