More reformatting
This commit is contained in:
@@ -12,19 +12,14 @@ import java.util.ArrayList;
|
||||
|
||||
public class CmdCreate extends FCommand {
|
||||
public CmdCreate() {
|
||||
super();
|
||||
this.aliases.add("create");
|
||||
super(); this.aliases.add("create");
|
||||
|
||||
this.requiredArgs.add("faction tag");
|
||||
//this.optionalArgs.put("", "");
|
||||
|
||||
this.permission = Permission.CREATE.node;
|
||||
this.disableOnLock = true;
|
||||
this.permission = Permission.CREATE.node; this.disableOnLock = true;
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeAdmin = false;
|
||||
senderMustBePlayer = true; senderMustBeMember = false; senderMustBeModerator = false; senderMustBeAdmin = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -32,19 +27,15 @@ public class CmdCreate extends FCommand {
|
||||
String tag = this.argAsString(0);
|
||||
|
||||
if (fme.hasFaction()) {
|
||||
msg("<b>You must leave your current faction first.");
|
||||
return;
|
||||
msg("<b>You must leave your current faction first."); return;
|
||||
}
|
||||
|
||||
if (Factions.i.isTagTaken(tag)) {
|
||||
msg("<b>That tag is already in use.");
|
||||
return;
|
||||
msg("<b>That tag is already in use."); return;
|
||||
}
|
||||
|
||||
ArrayList<String> tagValidationErrors = Factions.validateTag(tag);
|
||||
if (tagValidationErrors.size() > 0) {
|
||||
sendMessage(tagValidationErrors);
|
||||
return;
|
||||
ArrayList<String> tagValidationErrors = Factions.validateTag(tag); if (tagValidationErrors.size() > 0) {
|
||||
sendMessage(tagValidationErrors); return;
|
||||
}
|
||||
|
||||
// if economy is enabled, they're not on the bypass list, and this command has a cost set, make sure they can pay
|
||||
@@ -52,8 +43,7 @@ public class CmdCreate extends FCommand {
|
||||
|
||||
// trigger the faction creation event (cancellable)
|
||||
FactionCreateEvent createEvent = new FactionCreateEvent(me, tag);
|
||||
Bukkit.getServer().getPluginManager().callEvent(createEvent);
|
||||
if (createEvent.isCancelled()) { return; }
|
||||
Bukkit.getServer().getPluginManager().callEvent(createEvent); if (createEvent.isCancelled()) { return; }
|
||||
|
||||
// then make 'em pay (if applicable)
|
||||
if (!payForCommand(Conf.econCostCreate, "to create a new faction", "for creating a new faction")) { return; }
|
||||
@@ -62,8 +52,7 @@ public class CmdCreate extends FCommand {
|
||||
|
||||
// TODO: Why would this even happen??? Auto increment clash??
|
||||
if (faction == null) {
|
||||
msg("<b>There was an internal error while trying to create your faction. Please try again.");
|
||||
return;
|
||||
msg("<b>There was an internal error while trying to create your faction. Please try again."); return;
|
||||
}
|
||||
|
||||
// finish setting up the Faction
|
||||
@@ -75,8 +64,7 @@ public class CmdCreate extends FCommand {
|
||||
// join event cannot be cancelled or you'll have an empty faction
|
||||
|
||||
// finish setting up the FPlayer
|
||||
fme.setRole(Role.ADMIN);
|
||||
fme.setFaction(faction);
|
||||
fme.setRole(Role.ADMIN); fme.setFaction(faction);
|
||||
|
||||
for (FPlayer follower : FPlayers.i.getOnline()) {
|
||||
follower.msg("%s<i> created a new faction %s", fme.describeTo(follower, true), faction.getTag(follower));
|
||||
|
||||
Reference in New Issue
Block a user