From e55bd86dff99341ac2036123666ed0c07f88d397 Mon Sep 17 00:00:00 2001 From: sciwhiz12 Date: Wed, 23 Sep 2020 03:06:01 +0800 Subject: [PATCH] Fix parse results of CommandEvent being disregarded (#7303) --- patches/minecraft/net/minecraft/command/Commands.java.patch | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/patches/minecraft/net/minecraft/command/Commands.java.patch b/patches/minecraft/net/minecraft/command/Commands.java.patch index 30cf9fbb6..dff564c7a 100644 --- a/patches/minecraft/net/minecraft/command/Commands.java.patch +++ b/patches/minecraft/net/minecraft/command/Commands.java.patch @@ -8,10 +8,11 @@ this.field_197062_b.findAmbiguities((p_201302_1_, p_201302_2_, p_201302_3_, p_201302_4_) -> { field_197061_a.warn("Ambiguity between arguments {} and {} with inputs: {}", this.field_197062_b.getPath(p_201302_2_), this.field_197062_b.getPath(p_201302_3_), p_201302_4_); -@@ -205,6 +206,14 @@ +@@ -205,7 +206,15 @@ try { try { +- return this.field_197062_b.execute(stringreader, p_197059_1_); + ParseResults parse = this.field_197062_b.parse(stringreader, p_197059_1_); + net.minecraftforge.event.CommandEvent event = new net.minecraftforge.event.CommandEvent(parse); + if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) { @@ -20,6 +21,7 @@ + } + return 1; + } - return this.field_197062_b.execute(stringreader, p_197059_1_); ++ return this.field_197062_b.execute(event.getParseResults()); } catch (CommandException commandexception) { p_197059_1_.func_197021_a(commandexception.func_197003_a()); + return 0;