2021-03-15 23:00:00 +01:00
|
|
|
--- a/net/minecraft/server/commands/CommandGamerule.java
|
|
|
|
+++ b/net/minecraft/server/commands/CommandGamerule.java
|
2021-06-11 07:00:00 +02:00
|
|
|
@@ -31,7 +31,7 @@
|
2018-08-03 13:03:21 +02:00
|
|
|
|
2021-11-21 23:00:00 +01:00
|
|
|
static <T extends GameRules.GameRuleValue<T>> int setRule(CommandContext<CommandListenerWrapper> commandcontext, GameRules.GameRuleKey<T> gamerules_gamerulekey) {
|
2019-06-21 12:00:00 +02:00
|
|
|
CommandListenerWrapper commandlistenerwrapper = (CommandListenerWrapper) commandcontext.getSource();
|
2021-11-21 23:00:00 +01:00
|
|
|
- T t0 = commandlistenerwrapper.getServer().getGameRules().getRule(gamerules_gamerulekey);
|
|
|
|
+ T t0 = commandlistenerwrapper.getLevel().getGameRules().getRule(gamerules_gamerulekey); // CraftBukkit
|
2018-08-03 13:03:21 +02:00
|
|
|
|
2021-11-21 23:00:00 +01:00
|
|
|
t0.setFromArgument(commandcontext, "value");
|
2022-06-07 18:00:00 +02:00
|
|
|
commandlistenerwrapper.sendSuccess(IChatBaseComponent.translatable("commands.gamerule.set", gamerules_gamerulekey.getId(), t0.toString()), true);
|
2021-06-11 07:00:00 +02:00
|
|
|
@@ -39,7 +39,7 @@
|
2018-08-03 13:03:21 +02:00
|
|
|
}
|
|
|
|
|
2021-11-21 23:00:00 +01: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 13:03:21 +02:00
|
|
|
|
2022-06-07 18:00:00 +02:00
|
|
|
commandlistenerwrapper.sendSuccess(IChatBaseComponent.translatable("commands.gamerule.query", gamerules_gamerulekey.getId(), t0.toString()), false);
|
2021-11-21 23:00:00 +01:00
|
|
|
return t0.getCommandResult();
|