Tweaking requirements, removing declaim aliases and shortening the author list by using minecraft name only.

This commit is contained in:
Olof Larsson 2013-04-25 13:53:22 +02:00
parent 5047439756
commit 7a99005f7b
13 changed files with 98 additions and 15 deletions

View File

@ -2,7 +2,7 @@ main: com.massivecraft.factions.Factions
name: Factions name: Factions
version: 2.0.0_dev version: 2.0.0_dev
website: http://massivecraft.com/factions website: http://massivecraft.com/factions
authors: [Olof "Cayorion" Larsson, Brett Flannigan] authors: [Cayorion, Brettflan]
depend: [mcore] depend: [mcore]
softdepend: [PermissionsEx, Permissions, Essentials, EssentialsChat, HeroChat, iChat, LocalAreaChat, LWC, nChat, ChatManager, AuthMe, Vault, Spout, WorldEdit, WorldGuard, AuthDB, CaptureThePoints, CombatTag] softdepend: [PermissionsEx, Permissions, Essentials, EssentialsChat, HeroChat, iChat, LocalAreaChat, LWC, nChat, ChatManager, AuthMe, Vault, Spout, WorldEdit, WorldGuard, AuthDB, CaptureThePoints, CombatTag]
permissions: permissions:

View File

@ -6,6 +6,7 @@ import com.massivecraft.factions.Factions;
import com.massivecraft.factions.Perm; import com.massivecraft.factions.Perm;
import com.massivecraft.factions.Rel; import com.massivecraft.factions.Rel;
import com.massivecraft.factions.cmd.req.ReqFactionsEnabled; import com.massivecraft.factions.cmd.req.ReqFactionsEnabled;
import com.massivecraft.factions.cmd.req.ReqHasntFaction;
import com.massivecraft.factions.entity.UPlayer; import com.massivecraft.factions.entity.UPlayer;
import com.massivecraft.factions.entity.UPlayerColls; import com.massivecraft.factions.entity.UPlayerColls;
import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.Faction;
@ -26,6 +27,7 @@ public class CmdFactionsCreate extends FCommand
this.addRequiredArg("name"); this.addRequiredArg("name");
this.addRequirements(ReqFactionsEnabled.get()); this.addRequirements(ReqFactionsEnabled.get());
this.addRequirements(ReqHasntFaction.get());
this.addRequirements(ReqHasPerm.get(Perm.CREATE.node)); this.addRequirements(ReqHasPerm.get(Perm.CREATE.node));
} }
@ -36,12 +38,6 @@ public class CmdFactionsCreate extends FCommand
String newName = this.arg(0); String newName = this.arg(0);
// Verify // Verify
if (usender.getFaction().isNormal())
{
msg("<b>You must leave your current faction first.");
return;
}
FactionColl coll = FactionColls.get().get(usender); FactionColl coll = FactionColls.get().get(usender);
if (coll.isNameTaken(newName)) if (coll.isNameTaken(newName))

View File

@ -3,6 +3,7 @@ package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Perm; import com.massivecraft.factions.Perm;
import com.massivecraft.factions.Rel; import com.massivecraft.factions.Rel;
import com.massivecraft.factions.cmd.req.ReqFactionsEnabled; import com.massivecraft.factions.cmd.req.ReqFactionsEnabled;
import com.massivecraft.factions.cmd.req.ReqHasFaction;
import com.massivecraft.factions.cmd.req.ReqRoleIsAtLeast; import com.massivecraft.factions.cmd.req.ReqRoleIsAtLeast;
import com.massivecraft.factions.event.FactionsEventDescriptionChange; import com.massivecraft.factions.event.FactionsEventDescriptionChange;
import com.massivecraft.mcore.cmd.req.ReqHasPerm; import com.massivecraft.mcore.cmd.req.ReqHasPerm;
@ -19,6 +20,7 @@ public class CmdFactionsDescription extends FCommand
this.addRequirements(ReqFactionsEnabled.get()); this.addRequirements(ReqFactionsEnabled.get());
this.addRequirements(ReqHasPerm.get(Perm.DESCRIPTION.node)); this.addRequirements(ReqHasPerm.get(Perm.DESCRIPTION.node));
this.addRequirements(ReqHasFaction.get());
this.addRequirements(ReqRoleIsAtLeast.get(Rel.OFFICER)); this.addRequirements(ReqRoleIsAtLeast.get(Rel.OFFICER));
} }

View File

@ -9,7 +9,7 @@ import com.massivecraft.factions.Factions;
import com.massivecraft.factions.Perm; import com.massivecraft.factions.Perm;
import com.massivecraft.factions.Rel; import com.massivecraft.factions.Rel;
import com.massivecraft.factions.cmd.req.ReqFactionsEnabled; import com.massivecraft.factions.cmd.req.ReqFactionsEnabled;
import com.massivecraft.factions.cmd.req.ReqRoleIsAtLeast; import com.massivecraft.factions.cmd.req.ReqHasFaction;
import com.massivecraft.factions.entity.BoardColls; import com.massivecraft.factions.entity.BoardColls;
import com.massivecraft.factions.entity.UConf; import com.massivecraft.factions.entity.UConf;
import com.massivecraft.factions.entity.UPlayer; import com.massivecraft.factions.entity.UPlayer;
@ -28,10 +28,10 @@ public class CmdFactionsHome extends FCommand
{ {
this.addAliases("home"); this.addAliases("home");
this.addRequirements(ReqHasPerm.get(Perm.HOME.node));
this.addRequirements(ReqFactionsEnabled.get()); this.addRequirements(ReqFactionsEnabled.get());
this.addRequirements(ReqHasPerm.get(Perm.HOME.node));
this.addRequirements(ReqHasFaction.get());
this.addRequirements(ReqIsPlayer.get()); this.addRequirements(ReqIsPlayer.get());
this.addRequirements(ReqRoleIsAtLeast.get(Rel.RECRUIT));
} }
@Override @Override

View File

@ -5,6 +5,7 @@ import com.massivecraft.factions.Factions;
import com.massivecraft.factions.Perm; import com.massivecraft.factions.Perm;
import com.massivecraft.factions.cmd.arg.ARUPlayer; import com.massivecraft.factions.cmd.arg.ARUPlayer;
import com.massivecraft.factions.cmd.req.ReqFactionsEnabled; import com.massivecraft.factions.cmd.req.ReqFactionsEnabled;
import com.massivecraft.factions.cmd.req.ReqHasFaction;
import com.massivecraft.factions.entity.UPlayer; import com.massivecraft.factions.entity.UPlayer;
import com.massivecraft.factions.event.FactionsEventInvitedChange; import com.massivecraft.factions.event.FactionsEventInvitedChange;
import com.massivecraft.mcore.cmd.arg.ARBoolean; import com.massivecraft.mcore.cmd.arg.ARBoolean;
@ -22,6 +23,7 @@ public class CmdFactionsInvite extends FCommand
this.addRequirements(ReqFactionsEnabled.get()); this.addRequirements(ReqFactionsEnabled.get());
this.addRequirements(ReqHasPerm.get(Perm.INVITE.node)); this.addRequirements(ReqHasPerm.get(Perm.INVITE.node));
this.addRequirements(ReqHasFaction.get());
this.addRequirements(ReqIsPlayer.get()); this.addRequirements(ReqIsPlayer.get());
} }

View File

@ -1,9 +1,8 @@
package com.massivecraft.factions.cmd; package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Perm; import com.massivecraft.factions.Perm;
import com.massivecraft.factions.Rel;
import com.massivecraft.factions.cmd.req.ReqFactionsEnabled; import com.massivecraft.factions.cmd.req.ReqFactionsEnabled;
import com.massivecraft.factions.cmd.req.ReqRoleIsAtLeast; import com.massivecraft.factions.cmd.req.ReqHasFaction;
import com.massivecraft.mcore.cmd.req.ReqHasPerm; import com.massivecraft.mcore.cmd.req.ReqHasPerm;
public class CmdFactionsLeave extends FCommand { public class CmdFactionsLeave extends FCommand {
@ -14,7 +13,7 @@ public class CmdFactionsLeave extends FCommand {
this.addRequirements(ReqFactionsEnabled.get()); this.addRequirements(ReqFactionsEnabled.get());
this.addRequirements(ReqHasPerm.get(Perm.LEAVE.node)); this.addRequirements(ReqHasPerm.get(Perm.LEAVE.node));
this.addRequirements(ReqRoleIsAtLeast.get(Rel.RECRUIT)); this.addRequirements(ReqHasFaction.get());
} }
@Override @Override

View File

@ -5,6 +5,7 @@ import java.util.ArrayList;
import com.massivecraft.factions.Perm; import com.massivecraft.factions.Perm;
import com.massivecraft.factions.Rel; import com.massivecraft.factions.Rel;
import com.massivecraft.factions.cmd.req.ReqFactionsEnabled; import com.massivecraft.factions.cmd.req.ReqFactionsEnabled;
import com.massivecraft.factions.cmd.req.ReqHasFaction;
import com.massivecraft.factions.cmd.req.ReqRoleIsAtLeast; import com.massivecraft.factions.cmd.req.ReqRoleIsAtLeast;
import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.Faction;
import com.massivecraft.factions.entity.FactionColl; import com.massivecraft.factions.entity.FactionColl;
@ -23,6 +24,7 @@ public class CmdFactionsName extends FCommand
this.addRequirements(ReqFactionsEnabled.get()); this.addRequirements(ReqFactionsEnabled.get());
this.addRequirements(ReqHasPerm.get(Perm.NAME.node)); this.addRequirements(ReqHasPerm.get(Perm.NAME.node));
this.addRequirements(ReqHasFaction.get());
this.addRequirements(ReqRoleIsAtLeast.get(Rel.OFFICER)); this.addRequirements(ReqRoleIsAtLeast.get(Rel.OFFICER));
} }

View File

@ -3,6 +3,7 @@ package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Perm; import com.massivecraft.factions.Perm;
import com.massivecraft.factions.Rel; import com.massivecraft.factions.Rel;
import com.massivecraft.factions.cmd.req.ReqFactionsEnabled; import com.massivecraft.factions.cmd.req.ReqFactionsEnabled;
import com.massivecraft.factions.cmd.req.ReqHasFaction;
import com.massivecraft.factions.cmd.req.ReqRoleIsAtLeast; import com.massivecraft.factions.cmd.req.ReqRoleIsAtLeast;
import com.massivecraft.factions.event.FactionsEventOpenChange; import com.massivecraft.factions.event.FactionsEventOpenChange;
import com.massivecraft.mcore.cmd.arg.ARBoolean; import com.massivecraft.mcore.cmd.arg.ARBoolean;
@ -18,6 +19,7 @@ public class CmdFactionsOpen extends FCommand
this.addRequirements(ReqFactionsEnabled.get()); this.addRequirements(ReqFactionsEnabled.get());
this.addRequirements(ReqHasPerm.get(Perm.OPEN.node)); this.addRequirements(ReqHasPerm.get(Perm.OPEN.node));
this.addRequirements(ReqHasFaction.get());
this.addRequirements(ReqRoleIsAtLeast.get(Rel.OFFICER)); this.addRequirements(ReqRoleIsAtLeast.get(Rel.OFFICER));
} }

View File

@ -6,6 +6,7 @@ import com.massivecraft.factions.Perm;
import com.massivecraft.factions.Rel; import com.massivecraft.factions.Rel;
import com.massivecraft.factions.cmd.arg.ARFaction; import com.massivecraft.factions.cmd.arg.ARFaction;
import com.massivecraft.factions.cmd.req.ReqFactionsEnabled; import com.massivecraft.factions.cmd.req.ReqFactionsEnabled;
import com.massivecraft.factions.cmd.req.ReqHasFaction;
import com.massivecraft.factions.cmd.req.ReqRoleIsAtLeast; import com.massivecraft.factions.cmd.req.ReqRoleIsAtLeast;
import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.Faction;
import com.massivecraft.factions.event.FactionsEventRelationChange; import com.massivecraft.factions.event.FactionsEventRelationChange;
@ -19,6 +20,7 @@ public abstract class CmdFactionsRelationAbstract extends FCommand
{ {
this.addRequirements(ReqFactionsEnabled.get()); this.addRequirements(ReqFactionsEnabled.get());
this.addRequirements(ReqHasPerm.get(Perm.RELATION.node)); this.addRequirements(ReqHasPerm.get(Perm.RELATION.node));
this.addRequirements(ReqHasFaction.get());
this.addRequirements(ReqRoleIsAtLeast.get(Rel.OFFICER)); this.addRequirements(ReqRoleIsAtLeast.get(Rel.OFFICER));
} }

View File

@ -1,6 +1,7 @@
package com.massivecraft.factions.cmd; package com.massivecraft.factions.cmd;
import com.massivecraft.factions.cmd.req.ReqFactionsEnabled; import com.massivecraft.factions.cmd.req.ReqFactionsEnabled;
import com.massivecraft.factions.cmd.req.ReqHasFaction;
import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.Faction;
import com.massivecraft.factions.entity.FactionColls; import com.massivecraft.factions.entity.FactionColls;
import com.massivecraft.factions.FPerm; import com.massivecraft.factions.FPerm;
@ -13,10 +14,11 @@ public class CmdFactionsUnclaim extends FCommand
{ {
public CmdFactionsUnclaim() public CmdFactionsUnclaim()
{ {
this.addAliases("unclaim", "declaim"); this.addAliases("unclaim");
this.addRequirements(ReqFactionsEnabled.get()); this.addRequirements(ReqFactionsEnabled.get());
this.addRequirements(ReqHasPerm.get(Perm.UNCLAIM.node)); this.addRequirements(ReqHasPerm.get(Perm.UNCLAIM.node));
this.addRequirements(ReqHasFaction.get());
this.addRequirements(ReqIsPlayer.get()); this.addRequirements(ReqIsPlayer.get());
} }

View File

@ -7,6 +7,7 @@ import com.massivecraft.factions.Factions;
import com.massivecraft.factions.Perm; import com.massivecraft.factions.Perm;
import com.massivecraft.factions.Rel; import com.massivecraft.factions.Rel;
import com.massivecraft.factions.cmd.req.ReqFactionsEnabled; import com.massivecraft.factions.cmd.req.ReqFactionsEnabled;
import com.massivecraft.factions.cmd.req.ReqHasFaction;
import com.massivecraft.factions.cmd.req.ReqRoleIsAtLeast; import com.massivecraft.factions.cmd.req.ReqRoleIsAtLeast;
import com.massivecraft.factions.entity.BoardColl; import com.massivecraft.factions.entity.BoardColl;
import com.massivecraft.factions.entity.BoardColls; import com.massivecraft.factions.entity.BoardColls;
@ -21,10 +22,11 @@ public class CmdFactionsUnclaimall extends FCommand
{ {
public CmdFactionsUnclaimall() public CmdFactionsUnclaimall()
{ {
this.addAliases("unclaimall", "declaimall"); this.addAliases("unclaimall");
this.addRequirements(ReqFactionsEnabled.get()); this.addRequirements(ReqFactionsEnabled.get());
this.addRequirements(ReqHasPerm.get(Perm.UNCLAIM_ALL.node)); this.addRequirements(ReqHasPerm.get(Perm.UNCLAIM_ALL.node));
this.addRequirements(ReqHasFaction.get());
this.addRequirements(ReqRoleIsAtLeast.get(Rel.OFFICER)); this.addRequirements(ReqRoleIsAtLeast.get(Rel.OFFICER));
} }

View File

@ -0,0 +1,37 @@
package com.massivecraft.factions.cmd.req;
import org.bukkit.command.CommandSender;
import com.massivecraft.factions.entity.UPlayer;
import com.massivecraft.mcore.cmd.MCommand;
import com.massivecraft.mcore.cmd.req.ReqAbstract;
import com.massivecraft.mcore.util.Txt;
public class ReqHasFaction extends ReqAbstract
{
private static final long serialVersionUID = 1L;
// -------------------------------------------- //
// INSTANCE & CONSTRUCT
// -------------------------------------------- //
private static ReqHasFaction i = new ReqHasFaction();
public static ReqHasFaction get() { return i; }
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
public boolean apply(CommandSender sender, MCommand command)
{
return UPlayer.get(sender).hasFaction();
}
@Override
public String createErrorMessage(CommandSender sender, MCommand command)
{
return Txt.parse("<b>You must belong to a faction to "+(command == null ? "do that" : command.getDesc())+".");
}
}

View File

@ -0,0 +1,37 @@
package com.massivecraft.factions.cmd.req;
import org.bukkit.command.CommandSender;
import com.massivecraft.factions.entity.UPlayer;
import com.massivecraft.mcore.cmd.MCommand;
import com.massivecraft.mcore.cmd.req.ReqAbstract;
import com.massivecraft.mcore.util.Txt;
public class ReqHasntFaction extends ReqAbstract
{
private static final long serialVersionUID = 1L;
// -------------------------------------------- //
// INSTANCE & CONSTRUCT
// -------------------------------------------- //
private static ReqHasntFaction i = new ReqHasntFaction();
public static ReqHasntFaction get() { return i; }
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
public boolean apply(CommandSender sender, MCommand command)
{
return !UPlayer.get(sender).hasFaction();
}
@Override
public String createErrorMessage(CommandSender sender, MCommand command)
{
return Txt.parse("<b>You must leave your current faction before you "+(command == null ? "do that" : command.getDesc())+".");
}
}