Fix an issue when CommandEvents were never called (#1542)

Somebody forgot to actually call the this event.
This commit is contained in:
BONNe 2020-10-09 17:36:21 +03:00 committed by GitHub
parent f25e4d9c8d
commit 6b852e0368
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,6 @@
package world.bentobox.bentobox.api.events.command;
import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.event.Cancellable;
@ -60,7 +61,9 @@ public class CommandEvent extends BentoBoxEvent implements Cancellable {
}
public CommandEvent build() {
return new CommandEvent(sender, command, label, args);
CommandEvent event = new CommandEvent(sender, command, label, args);
Bukkit.getPluginManager().callEvent(event);
return event;
}
}