Faction create event is no longer cancellable, and is called AFTER the faction is made. This allows people to hook into the event and manipulating the Faction without having a delay. And if the event was ever cancelled before, it was silent.
This commit is contained in:
@@ -55,13 +55,6 @@ public class CmdCreate extends FCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
// trigger the faction creation event (cancellable)
|
||||
FactionCreateEvent createEvent = new FactionCreateEvent(me, tag);
|
||||
Bukkit.getServer().getPluginManager().callEvent(createEvent);
|
||||
if (createEvent.isCancelled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// then make 'em pay (if applicable)
|
||||
if (!payForCommand(Conf.econCostCreate, TL.COMMAND_CREATE_TOCREATE, TL.COMMAND_CREATE_FORCREATE)) {
|
||||
return;
|
||||
@@ -87,6 +80,10 @@ public class CmdCreate extends FCommand {
|
||||
fme.setRole(Role.ADMIN);
|
||||
fme.setFaction(faction);
|
||||
|
||||
// trigger the faction creation event
|
||||
FactionCreateEvent createEvent = new FactionCreateEvent(me, tag, faction);
|
||||
Bukkit.getServer().getPluginManager().callEvent(createEvent);
|
||||
|
||||
for (FPlayer follower : FPlayers.getInstance().getOnlinePlayers()) {
|
||||
follower.msg(TL.COMMAND_CREATE_CREATED, fme.describeTo(follower, true), faction.getTag(follower));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user