Fix parse results of CommandEvent being disregarded (#7303)
This commit is contained in:
parent
b1247df4dc
commit
e55bd86dff
1 changed files with 4 additions and 2 deletions
|
@ -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<CommandSource> 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;
|
||||
|
|
Loading…
Reference in a new issue