Add WorldGameRuleChangeEvent

This commit is contained in:
Jake Potrebic
2020-12-20 16:41:44 -08:00
parent e793c7d8be
commit 1e05072232
3 changed files with 59 additions and 14 deletions

View File

@@ -1,14 +1,17 @@
--- a/net/minecraft/server/commands/GameRuleCommand.java
+++ b/net/minecraft/server/commands/GameRuleCommand.java
@@ -34,7 +34,7 @@
@@ -34,9 +34,9 @@
static <T extends GameRules.Value<T>> int setRule(CommandContext<CommandSourceStack> context, GameRules.Key<T> key) {
CommandSourceStack commandlistenerwrapper = (CommandSourceStack) context.getSource();
- T t0 = commandlistenerwrapper.getServer().getGameRules().getRule(key);
+ T t0 = commandlistenerwrapper.getLevel().getGameRules().getRule(key); // CraftBukkit
t0.setFromArgument(context, "value");
- t0.setFromArgument(context, "value");
+ t0.setFromArgument(context, "value", key); // Paper - Add WorldGameRuleChangeEvent
commandlistenerwrapper.sendSuccess(() -> {
return Component.translatable("commands.gamerule.set", key.getId(), t0.toString());
}, true);
@@ -44,7 +44,7 @@
}