Try moving some core configuration over to UConf.
This commit is contained in:
@@ -48,7 +48,7 @@ public class CmdFactionsCreate extends FCommand
|
||||
return;
|
||||
}
|
||||
|
||||
ArrayList<String> tagValidationErrors = FactionColl.validateTag(newTag);
|
||||
ArrayList<String> tagValidationErrors = coll.validateTag(newTag);
|
||||
if (tagValidationErrors.size() > 0)
|
||||
{
|
||||
sendMessage(tagValidationErrors);
|
||||
|
@@ -1,6 +1,5 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.ConfServer;
|
||||
import com.massivecraft.factions.Factions;
|
||||
import com.massivecraft.factions.Perm;
|
||||
import com.massivecraft.factions.cmd.arg.ARFPlayer;
|
||||
@@ -8,6 +7,7 @@ import com.massivecraft.factions.cmd.arg.ARFaction;
|
||||
import com.massivecraft.factions.entity.FPlayer;
|
||||
import com.massivecraft.factions.entity.Faction;
|
||||
import com.massivecraft.factions.entity.MConf;
|
||||
import com.massivecraft.factions.entity.UConf;
|
||||
import com.massivecraft.factions.event.FactionsEventMembershipChange;
|
||||
import com.massivecraft.factions.event.FactionsEventMembershipChange.MembershipChangeReason;
|
||||
import com.massivecraft.mcore.cmd.req.ReqHasPerm;
|
||||
@@ -49,9 +49,9 @@ public class CmdFactionsJoin extends FCommand
|
||||
return;
|
||||
}
|
||||
|
||||
if (ConfServer.factionMemberLimit > 0 && faction.getFPlayers().size() >= ConfServer.factionMemberLimit)
|
||||
if (UConf.get(faction).factionMemberLimit > 0 && faction.getFPlayers().size() >= UConf.get(faction).factionMemberLimit)
|
||||
{
|
||||
msg(" <b>!<white> The faction %s is at the limit of %d members, so %s cannot currently join.", faction.getTag(fme), ConfServer.factionMemberLimit, fplayer.describeTo(fme, false));
|
||||
msg(" <b>!<white> The faction %s is at the limit of %d members, so %s cannot currently join.", faction.getTag(fme), UConf.get(faction).factionMemberLimit, fplayer.describeTo(fme, false));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ public class CmdFactionsJoin extends FCommand
|
||||
return;
|
||||
}
|
||||
|
||||
if (!ConfServer.canLeaveWithNegativePower && fplayer.getPower() < 0)
|
||||
if (!UConf.get(faction).canLeaveWithNegativePower && fplayer.getPower() < 0)
|
||||
{
|
||||
msg("<b>%s cannot join a faction with a negative power level.", fplayer.describeTo(fme, true));
|
||||
return;
|
||||
@@ -93,7 +93,6 @@ public class CmdFactionsJoin extends FCommand
|
||||
// Apply
|
||||
fplayer.resetFactionData();
|
||||
fplayer.setFaction(faction);
|
||||
fme.setRole(ConfServer.factionRankDefault); // They have just joined a faction, start them out on the lowest rank (default config).
|
||||
|
||||
faction.setInvited(fplayer, false);
|
||||
|
||||
|
@@ -1,6 +1,5 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.ConfServer;
|
||||
import com.massivecraft.factions.FPerm;
|
||||
import com.massivecraft.factions.Factions;
|
||||
import com.massivecraft.factions.Perm;
|
||||
@@ -10,6 +9,7 @@ import com.massivecraft.factions.entity.FPlayer;
|
||||
import com.massivecraft.factions.entity.Faction;
|
||||
import com.massivecraft.factions.entity.FactionColls;
|
||||
import com.massivecraft.factions.entity.MConf;
|
||||
import com.massivecraft.factions.entity.UConf;
|
||||
import com.massivecraft.factions.event.FactionsEventMembershipChange;
|
||||
import com.massivecraft.factions.event.FactionsEventMembershipChange.MembershipChangeReason;
|
||||
import com.massivecraft.mcore.cmd.req.ReqHasPerm;
|
||||
@@ -47,7 +47,7 @@ public class CmdFactionsKick extends FCommand
|
||||
return;
|
||||
}
|
||||
|
||||
if ( ! ConfServer.canLeaveWithNegativePower && fplayer.getPower() < 0)
|
||||
if ( ! UConf.get(fplayer).canLeaveWithNegativePower && fplayer.getPower() < 0)
|
||||
{
|
||||
msg("<b>You cannot kick that member until their power is positive.");
|
||||
return;
|
||||
|
@@ -67,7 +67,7 @@ public class CmdFactionsPerm extends FCommand
|
||||
faction.setRelationPermitted(perm, rel, val);
|
||||
|
||||
// The following is to make sure the leader always has the right to change perms if that is our goal.
|
||||
if (perm == FPerm.PERMS && FPerm.PERMS.getDefault().contains(Rel.LEADER))
|
||||
if (perm == FPerm.PERMS && FPerm.PERMS.getDefault(faction).contains(Rel.LEADER))
|
||||
{
|
||||
faction.setRelationPermitted(FPerm.PERMS, Rel.LEADER, true);
|
||||
}
|
||||
|
@@ -34,14 +34,16 @@ public class CmdFactionsTag extends FCommand
|
||||
String newTag = this.arg(0);
|
||||
|
||||
// TODO does not first test cover selfcase?
|
||||
if (FactionColls.get().get(myFaction).isTagTaken(newTag) && ! MiscUtil.getComparisonString(newTag).equals(myFaction.getComparisonTag()))
|
||||
|
||||
FactionColl factionColl = FactionColls.get().get(myFaction);
|
||||
if (factionColl.isTagTaken(newTag) && ! MiscUtil.getComparisonString(newTag).equals(myFaction.getComparisonTag()))
|
||||
{
|
||||
msg("<b>That tag is already taken");
|
||||
return;
|
||||
}
|
||||
|
||||
ArrayList<String> errors = new ArrayList<String>();
|
||||
errors.addAll(FactionColl.validateTag(newTag));
|
||||
errors.addAll(factionColl.validateTag(newTag));
|
||||
if (errors.size() > 0)
|
||||
{
|
||||
sendMessage(errors);
|
||||
|
Reference in New Issue
Block a user