Tweaking requirements, removing declaim aliases and shortening the author list by using minecraft name only.
This commit is contained in:
parent
5047439756
commit
7a99005f7b
@ -2,7 +2,7 @@ main: com.massivecraft.factions.Factions
|
||||
name: Factions
|
||||
version: 2.0.0_dev
|
||||
website: http://massivecraft.com/factions
|
||||
authors: [Olof "Cayorion" Larsson, Brett Flannigan]
|
||||
authors: [Cayorion, Brettflan]
|
||||
depend: [mcore]
|
||||
softdepend: [PermissionsEx, Permissions, Essentials, EssentialsChat, HeroChat, iChat, LocalAreaChat, LWC, nChat, ChatManager, AuthMe, Vault, Spout, WorldEdit, WorldGuard, AuthDB, CaptureThePoints, CombatTag]
|
||||
permissions:
|
||||
|
@ -6,6 +6,7 @@ import com.massivecraft.factions.Factions;
|
||||
import com.massivecraft.factions.Perm;
|
||||
import com.massivecraft.factions.Rel;
|
||||
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.UPlayerColls;
|
||||
import com.massivecraft.factions.entity.Faction;
|
||||
@ -26,6 +27,7 @@ public class CmdFactionsCreate extends FCommand
|
||||
this.addRequiredArg("name");
|
||||
|
||||
this.addRequirements(ReqFactionsEnabled.get());
|
||||
this.addRequirements(ReqHasntFaction.get());
|
||||
this.addRequirements(ReqHasPerm.get(Perm.CREATE.node));
|
||||
}
|
||||
|
||||
@ -36,12 +38,6 @@ public class CmdFactionsCreate extends FCommand
|
||||
String newName = this.arg(0);
|
||||
|
||||
// Verify
|
||||
if (usender.getFaction().isNormal())
|
||||
{
|
||||
msg("<b>You must leave your current faction first.");
|
||||
return;
|
||||
}
|
||||
|
||||
FactionColl coll = FactionColls.get().get(usender);
|
||||
|
||||
if (coll.isNameTaken(newName))
|
||||
|
@ -3,6 +3,7 @@ package com.massivecraft.factions.cmd;
|
||||
import com.massivecraft.factions.Perm;
|
||||
import com.massivecraft.factions.Rel;
|
||||
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.event.FactionsEventDescriptionChange;
|
||||
import com.massivecraft.mcore.cmd.req.ReqHasPerm;
|
||||
@ -19,6 +20,7 @@ public class CmdFactionsDescription extends FCommand
|
||||
|
||||
this.addRequirements(ReqFactionsEnabled.get());
|
||||
this.addRequirements(ReqHasPerm.get(Perm.DESCRIPTION.node));
|
||||
this.addRequirements(ReqHasFaction.get());
|
||||
this.addRequirements(ReqRoleIsAtLeast.get(Rel.OFFICER));
|
||||
}
|
||||
|
||||
|
@ -9,7 +9,7 @@ import com.massivecraft.factions.Factions;
|
||||
import com.massivecraft.factions.Perm;
|
||||
import com.massivecraft.factions.Rel;
|
||||
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.UConf;
|
||||
import com.massivecraft.factions.entity.UPlayer;
|
||||
@ -28,10 +28,10 @@ public class CmdFactionsHome extends FCommand
|
||||
{
|
||||
this.addAliases("home");
|
||||
|
||||
this.addRequirements(ReqHasPerm.get(Perm.HOME.node));
|
||||
this.addRequirements(ReqFactionsEnabled.get());
|
||||
this.addRequirements(ReqHasPerm.get(Perm.HOME.node));
|
||||
this.addRequirements(ReqHasFaction.get());
|
||||
this.addRequirements(ReqIsPlayer.get());
|
||||
this.addRequirements(ReqRoleIsAtLeast.get(Rel.RECRUIT));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -5,6 +5,7 @@ import com.massivecraft.factions.Factions;
|
||||
import com.massivecraft.factions.Perm;
|
||||
import com.massivecraft.factions.cmd.arg.ARUPlayer;
|
||||
import com.massivecraft.factions.cmd.req.ReqFactionsEnabled;
|
||||
import com.massivecraft.factions.cmd.req.ReqHasFaction;
|
||||
import com.massivecraft.factions.entity.UPlayer;
|
||||
import com.massivecraft.factions.event.FactionsEventInvitedChange;
|
||||
import com.massivecraft.mcore.cmd.arg.ARBoolean;
|
||||
@ -22,6 +23,7 @@ public class CmdFactionsInvite extends FCommand
|
||||
|
||||
this.addRequirements(ReqFactionsEnabled.get());
|
||||
this.addRequirements(ReqHasPerm.get(Perm.INVITE.node));
|
||||
this.addRequirements(ReqHasFaction.get());
|
||||
this.addRequirements(ReqIsPlayer.get());
|
||||
}
|
||||
|
||||
|
@ -1,9 +1,8 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.Perm;
|
||||
import com.massivecraft.factions.Rel;
|
||||
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;
|
||||
|
||||
public class CmdFactionsLeave extends FCommand {
|
||||
@ -14,7 +13,7 @@ public class CmdFactionsLeave extends FCommand {
|
||||
|
||||
this.addRequirements(ReqFactionsEnabled.get());
|
||||
this.addRequirements(ReqHasPerm.get(Perm.LEAVE.node));
|
||||
this.addRequirements(ReqRoleIsAtLeast.get(Rel.RECRUIT));
|
||||
this.addRequirements(ReqHasFaction.get());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -5,6 +5,7 @@ import java.util.ArrayList;
|
||||
import com.massivecraft.factions.Perm;
|
||||
import com.massivecraft.factions.Rel;
|
||||
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.entity.Faction;
|
||||
import com.massivecraft.factions.entity.FactionColl;
|
||||
@ -23,6 +24,7 @@ public class CmdFactionsName extends FCommand
|
||||
|
||||
this.addRequirements(ReqFactionsEnabled.get());
|
||||
this.addRequirements(ReqHasPerm.get(Perm.NAME.node));
|
||||
this.addRequirements(ReqHasFaction.get());
|
||||
this.addRequirements(ReqRoleIsAtLeast.get(Rel.OFFICER));
|
||||
}
|
||||
|
||||
|
@ -3,6 +3,7 @@ package com.massivecraft.factions.cmd;
|
||||
import com.massivecraft.factions.Perm;
|
||||
import com.massivecraft.factions.Rel;
|
||||
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.event.FactionsEventOpenChange;
|
||||
import com.massivecraft.mcore.cmd.arg.ARBoolean;
|
||||
@ -18,6 +19,7 @@ public class CmdFactionsOpen extends FCommand
|
||||
|
||||
this.addRequirements(ReqFactionsEnabled.get());
|
||||
this.addRequirements(ReqHasPerm.get(Perm.OPEN.node));
|
||||
this.addRequirements(ReqHasFaction.get());
|
||||
this.addRequirements(ReqRoleIsAtLeast.get(Rel.OFFICER));
|
||||
}
|
||||
|
||||
|
@ -6,6 +6,7 @@ import com.massivecraft.factions.Perm;
|
||||
import com.massivecraft.factions.Rel;
|
||||
import com.massivecraft.factions.cmd.arg.ARFaction;
|
||||
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.entity.Faction;
|
||||
import com.massivecraft.factions.event.FactionsEventRelationChange;
|
||||
@ -19,6 +20,7 @@ public abstract class CmdFactionsRelationAbstract extends FCommand
|
||||
{
|
||||
this.addRequirements(ReqFactionsEnabled.get());
|
||||
this.addRequirements(ReqHasPerm.get(Perm.RELATION.node));
|
||||
this.addRequirements(ReqHasFaction.get());
|
||||
this.addRequirements(ReqRoleIsAtLeast.get(Rel.OFFICER));
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
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.FactionColls;
|
||||
import com.massivecraft.factions.FPerm;
|
||||
@ -13,10 +14,11 @@ public class CmdFactionsUnclaim extends FCommand
|
||||
{
|
||||
public CmdFactionsUnclaim()
|
||||
{
|
||||
this.addAliases("unclaim", "declaim");
|
||||
this.addAliases("unclaim");
|
||||
|
||||
this.addRequirements(ReqFactionsEnabled.get());
|
||||
this.addRequirements(ReqHasPerm.get(Perm.UNCLAIM.node));
|
||||
this.addRequirements(ReqHasFaction.get());
|
||||
this.addRequirements(ReqIsPlayer.get());
|
||||
}
|
||||
|
||||
|
@ -7,6 +7,7 @@ import com.massivecraft.factions.Factions;
|
||||
import com.massivecraft.factions.Perm;
|
||||
import com.massivecraft.factions.Rel;
|
||||
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.entity.BoardColl;
|
||||
import com.massivecraft.factions.entity.BoardColls;
|
||||
@ -21,10 +22,11 @@ public class CmdFactionsUnclaimall extends FCommand
|
||||
{
|
||||
public CmdFactionsUnclaimall()
|
||||
{
|
||||
this.addAliases("unclaimall", "declaimall");
|
||||
this.addAliases("unclaimall");
|
||||
|
||||
this.addRequirements(ReqFactionsEnabled.get());
|
||||
this.addRequirements(ReqHasPerm.get(Perm.UNCLAIM_ALL.node));
|
||||
this.addRequirements(ReqHasFaction.get());
|
||||
this.addRequirements(ReqRoleIsAtLeast.get(Rel.OFFICER));
|
||||
}
|
||||
|
||||
|
37
src/com/massivecraft/factions/cmd/req/ReqHasFaction.java
Normal file
37
src/com/massivecraft/factions/cmd/req/ReqHasFaction.java
Normal 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())+".");
|
||||
}
|
||||
|
||||
}
|
37
src/com/massivecraft/factions/cmd/req/ReqHasntFaction.java
Normal file
37
src/com/massivecraft/factions/cmd/req/ReqHasntFaction.java
Normal 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())+".");
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user