Rename Conf --> ConfServer.
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.ConfServer;
|
||||
import com.massivecraft.factions.FLocation;
|
||||
import com.massivecraft.factions.Faction;
|
||||
import com.massivecraft.factions.Perm;
|
||||
@ -58,7 +58,7 @@ public class CmdClaim extends FCommand
|
||||
new SpiralTask(new FLocation(me), radius)
|
||||
{
|
||||
private int failCount = 0;
|
||||
private final int limit = Conf.radiusClaimFailureLimit - 1;
|
||||
private final int limit = ConfServer.radiusClaimFailureLimit - 1;
|
||||
|
||||
@Override
|
||||
public boolean work()
|
||||
|
@ -12,7 +12,7 @@ import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.ConfServer;
|
||||
import com.massivecraft.factions.Factions;
|
||||
import com.massivecraft.factions.Perm;
|
||||
import com.massivecraft.factions.integration.SpoutFeatures;
|
||||
@ -49,7 +49,7 @@ public class CmdConfig extends FCommand
|
||||
// that way, if the person using this command messes up the capitalization, we can fix that
|
||||
if (properFieldNames.isEmpty())
|
||||
{
|
||||
Field[] fields = Conf.class.getDeclaredFields();
|
||||
Field[] fields = ConfServer.class.getDeclaredFields();
|
||||
for(int i = 0; i < fields.length; i++)
|
||||
{
|
||||
properFieldNames.put(fields[i].getName().toLowerCase(), fields[i].getName());
|
||||
@ -79,7 +79,7 @@ public class CmdConfig extends FCommand
|
||||
|
||||
try
|
||||
{
|
||||
Field target = Conf.class.getField(fieldName);
|
||||
Field target = ConfServer.class.getField(fieldName);
|
||||
|
||||
// boolean
|
||||
if (target.getType() == boolean.class)
|
||||
@ -390,7 +390,7 @@ public class CmdConfig extends FCommand
|
||||
}
|
||||
}
|
||||
// save change to disk
|
||||
Conf.save();
|
||||
ConfServer.save();
|
||||
|
||||
// in case some Spout related setting was changed
|
||||
SpoutFeatures.updateTitle(null, null);
|
||||
|
@ -4,7 +4,7 @@ import java.util.ArrayList;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.ConfServer;
|
||||
import com.massivecraft.factions.FPlayer;
|
||||
import com.massivecraft.factions.FPlayers;
|
||||
import com.massivecraft.factions.Faction;
|
||||
@ -59,7 +59,7 @@ public class CmdCreate extends FCommand
|
||||
}
|
||||
|
||||
// if economy is enabled, they're not on the bypass list, and this command has a cost set, make sure they can pay
|
||||
if ( ! canAffordCommand(Conf.econCostCreate, "to create a new faction")) return;
|
||||
if ( ! canAffordCommand(ConfServer.econCostCreate, "to create a new faction")) return;
|
||||
|
||||
// trigger the faction creation event (cancellable)
|
||||
FactionCreateEvent createEvent = new FactionCreateEvent(me, tag);
|
||||
@ -67,7 +67,7 @@ public class CmdCreate extends FCommand
|
||||
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;
|
||||
if ( ! payForCommand(ConfServer.econCostCreate, "to create a new faction", "for creating a new faction")) return;
|
||||
|
||||
Faction faction = FactionColl.i.create();
|
||||
|
||||
@ -97,7 +97,7 @@ public class CmdCreate extends FCommand
|
||||
|
||||
msg("<i>You should now: %s", p.cmdBase.cmdDescription.getUseageTemplate());
|
||||
|
||||
if (Conf.logFactionCreate)
|
||||
if (ConfServer.logFactionCreate)
|
||||
Factions.get().log(fme.getName()+" created a new faction: "+tag);
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.ConfServer;
|
||||
import com.massivecraft.factions.FPlayer;
|
||||
import com.massivecraft.factions.FPlayers;
|
||||
import com.massivecraft.factions.Perm;
|
||||
@ -30,11 +30,11 @@ public class CmdDescription extends FCommand
|
||||
public void perform()
|
||||
{
|
||||
// if economy is enabled, they're not on the bypass list, and this command has a cost set, make 'em pay
|
||||
if ( ! payForCommand(Conf.econCostDesc, "to change faction description", "for changing faction description")) return;
|
||||
if ( ! payForCommand(ConfServer.econCostDesc, "to change faction description", "for changing faction description")) return;
|
||||
|
||||
myFaction.setDescription(TextUtil.implode(args, " ").replaceAll("(&([a-f0-9]))", "& $2")); // since "&" color tags seem to work even through plain old FPlayer.sendMessage() for some reason, we need to break those up
|
||||
|
||||
if ( ! Conf.broadcastDescriptionChanges)
|
||||
if ( ! ConfServer.broadcastDescriptionChanges)
|
||||
{
|
||||
fme.msg("You have changed the description for <h>%s<i> to:", myFaction.describeTo(fme));
|
||||
fme.sendMessage(myFaction.getDescription());
|
||||
|
@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.ConfServer;
|
||||
import com.massivecraft.factions.event.FPlayerLeaveEvent;
|
||||
import com.massivecraft.factions.event.FactionDisbandEvent;
|
||||
import com.massivecraft.factions.integration.Econ;
|
||||
@ -72,7 +72,7 @@ public class CmdDisband extends FCommand
|
||||
fplayer.msg("<h>%s<i> disbanded the faction %s.", who, faction.getTag(fplayer));
|
||||
}
|
||||
}
|
||||
if (Conf.logFactionDisband)
|
||||
if (ConfServer.logFactionDisband)
|
||||
Factions.get().log("The faction "+faction.getTag()+" ("+faction.getId()+") was disbanded by "+(senderIsConsole ? "console command" : fme.getName())+".");
|
||||
|
||||
if (Econ.shouldBeUsed() && ! senderIsConsole)
|
||||
|
@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.ConfServer;
|
||||
import com.massivecraft.factions.Factions;
|
||||
import com.massivecraft.factions.Perm;
|
||||
import com.massivecraft.factions.integration.Econ;
|
||||
@ -83,7 +83,7 @@ public class CmdHelp extends FCommand
|
||||
pageLines.add( p.cmdBase.cmdSethome.getUseageTemplate(true) );
|
||||
helpPages.add(pageLines);
|
||||
|
||||
if (Econ.isSetup() && Conf.econEnabled && Conf.bankEnabled)
|
||||
if (Econ.isSetup() && ConfServer.econEnabled && ConfServer.bankEnabled)
|
||||
{
|
||||
pageLines = new ArrayList<String>();
|
||||
pageLines.add( p.txt.parse("<i>Your faction has a bank which is used to pay for certain" ));
|
||||
|
@ -8,7 +8,7 @@ import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.massivecraft.factions.Board;
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.ConfServer;
|
||||
import com.massivecraft.factions.FLocation;
|
||||
import com.massivecraft.factions.FPlayer;
|
||||
import com.massivecraft.factions.FPlayers;
|
||||
@ -44,13 +44,13 @@ public class CmdHome extends FCommand
|
||||
public void perform()
|
||||
{
|
||||
// TODO: Hide this command on help also.
|
||||
if ( ! Conf.homesEnabled)
|
||||
if ( ! ConfServer.homesEnabled)
|
||||
{
|
||||
fme.msg("<b>Sorry, Faction homes are disabled on this server.");
|
||||
return;
|
||||
}
|
||||
|
||||
if ( ! Conf.homesTeleportCommandEnabled)
|
||||
if ( ! ConfServer.homesTeleportCommandEnabled)
|
||||
{
|
||||
fme.msg("<b>Sorry, the ability to teleport to Faction homes is disabled on this server.");
|
||||
return;
|
||||
@ -63,13 +63,13 @@ public class CmdHome extends FCommand
|
||||
return;
|
||||
}
|
||||
|
||||
if ( ! Conf.homesTeleportAllowedFromEnemyTerritory && fme.isInEnemyTerritory())
|
||||
if ( ! ConfServer.homesTeleportAllowedFromEnemyTerritory && fme.isInEnemyTerritory())
|
||||
{
|
||||
fme.msg("<b>You cannot teleport to your faction home while in the territory of an enemy faction.");
|
||||
return;
|
||||
}
|
||||
|
||||
if ( ! Conf.homesTeleportAllowedFromDifferentWorld && me.getWorld().getUID() != myFaction.getHome().getWorld().getUID())
|
||||
if ( ! ConfServer.homesTeleportAllowedFromDifferentWorld && me.getWorld().getUID() != myFaction.getHome().getWorld().getUID())
|
||||
{
|
||||
fme.msg("<b>You cannot teleport to your faction home while in a different world.");
|
||||
return;
|
||||
@ -81,7 +81,7 @@ public class CmdHome extends FCommand
|
||||
// if player is not in a safe zone or their own faction territory, only allow teleport if no enemies are nearby
|
||||
if
|
||||
(
|
||||
Conf.homesTeleportAllowedEnemyDistance > 0
|
||||
ConfServer.homesTeleportAllowedEnemyDistance > 0
|
||||
&&
|
||||
faction.getFlag(FFlag.PVP)
|
||||
&&
|
||||
@ -91,7 +91,7 @@ public class CmdHome extends FCommand
|
||||
(
|
||||
fme.isInOwnTerritory()
|
||||
&&
|
||||
! Conf.homesTeleportIgnoreEnemiesIfInOwnTerritory
|
||||
! ConfServer.homesTeleportIgnoreEnemiesIfInOwnTerritory
|
||||
)
|
||||
)
|
||||
)
|
||||
@ -114,13 +114,13 @@ public class CmdHome extends FCommand
|
||||
double dx = Math.abs(x - l.getX());
|
||||
double dy = Math.abs(y - l.getY());
|
||||
double dz = Math.abs(z - l.getZ());
|
||||
double max = Conf.homesTeleportAllowedEnemyDistance;
|
||||
double max = ConfServer.homesTeleportAllowedEnemyDistance;
|
||||
|
||||
// box-shaped distance check
|
||||
if (dx > max || dy > max || dz > max)
|
||||
continue;
|
||||
|
||||
fme.msg("<b>You cannot teleport to your faction home while an enemy is within " + Conf.homesTeleportAllowedEnemyDistance + " blocks of you.");
|
||||
fme.msg("<b>You cannot teleport to your faction home while an enemy is within " + ConfServer.homesTeleportAllowedEnemyDistance + " blocks of you.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -129,10 +129,10 @@ public class CmdHome extends FCommand
|
||||
if (EssentialsFeatures.handleTeleport(me, myFaction.getHome())) return;
|
||||
|
||||
// if economy is enabled, they're not on the bypass list, and this command has a cost set, make 'em pay
|
||||
if ( ! payForCommand(Conf.econCostHome, "to teleport to your faction home", "for teleporting to your faction home")) return;
|
||||
if ( ! payForCommand(ConfServer.econCostHome, "to teleport to your faction home", "for teleporting to your faction home")) return;
|
||||
|
||||
// Create a smoke effect
|
||||
if (Conf.homesTeleportCommandSmokeEffectEnabled)
|
||||
if (ConfServer.homesTeleportCommandSmokeEffectEnabled)
|
||||
{
|
||||
List<Location> smokeLocations = new ArrayList<Location>();
|
||||
smokeLocations.add(loc);
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.ConfServer;
|
||||
import com.massivecraft.factions.FPlayer;
|
||||
import com.massivecraft.factions.Perm;
|
||||
import com.massivecraft.factions.struct.FPerm;
|
||||
@ -41,7 +41,7 @@ public class CmdInvite extends FCommand
|
||||
if (fme != null && ! FPerm.INVITE.has(fme, myFaction)) return;
|
||||
|
||||
// if economy is enabled, they're not on the bypass list, and this command has a cost set, make 'em pay
|
||||
if ( ! payForCommand(Conf.econCostInvite, "to invite someone", "for inviting someone")) return;
|
||||
if ( ! payForCommand(ConfServer.econCostInvite, "to invite someone", "for inviting someone")) return;
|
||||
|
||||
myFaction.invite(you);
|
||||
|
||||
|
@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.ConfServer;
|
||||
import com.massivecraft.factions.FPlayer;
|
||||
import com.massivecraft.factions.FPlayers;
|
||||
import com.massivecraft.factions.Faction;
|
||||
@ -50,9 +50,9 @@ public class CmdJoin extends FCommand
|
||||
return;
|
||||
}
|
||||
|
||||
if (Conf.factionMemberLimit > 0 && faction.getFPlayers().size() >= Conf.factionMemberLimit)
|
||||
if (ConfServer.factionMemberLimit > 0 && faction.getFPlayers().size() >= ConfServer.factionMemberLimit)
|
||||
{
|
||||
msg(" <b>!<white> The faction %s is at the limit of %d members, so %s cannot currently join.", faction.getTag(fme), Conf.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), ConfServer.factionMemberLimit, fplayer.describeTo(fme, false));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -62,7 +62,7 @@ public class CmdJoin extends FCommand
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Conf.canLeaveWithNegativePower && fplayer.getPower() < 0)
|
||||
if (!ConfServer.canLeaveWithNegativePower && fplayer.getPower() < 0)
|
||||
{
|
||||
msg("<b>%s cannot join a faction with a negative power level.", fplayer.describeTo(fme, true));
|
||||
return;
|
||||
@ -77,7 +77,7 @@ public class CmdJoin extends FCommand
|
||||
}
|
||||
|
||||
// if economy is enabled, they're not on the bypass list, and this command has a cost set, make sure they can pay
|
||||
if (samePlayer && ! canAffordCommand(Conf.econCostJoin, "to join a faction")) return;
|
||||
if (samePlayer && ! canAffordCommand(ConfServer.econCostJoin, "to join a faction")) return;
|
||||
|
||||
// trigger the join event (cancellable)
|
||||
FPlayerJoinEvent joinEvent = new FPlayerJoinEvent(FPlayers.i.get(me),faction,FPlayerJoinEvent.PlayerJoinReason.COMMAND);
|
||||
@ -85,9 +85,9 @@ public class CmdJoin extends FCommand
|
||||
if (joinEvent.isCancelled()) return;
|
||||
|
||||
// then make 'em pay (if applicable)
|
||||
if (samePlayer && ! payForCommand(Conf.econCostJoin, "to join a faction", "for joining a faction")) return;
|
||||
if (samePlayer && ! payForCommand(ConfServer.econCostJoin, "to join a faction", "for joining a faction")) return;
|
||||
|
||||
fme.setRole(Conf.factionRankDefault); // They have just joined a faction, start them out on the lowest rank (default config).
|
||||
fme.setRole(ConfServer.factionRankDefault); // They have just joined a faction, start them out on the lowest rank (default config).
|
||||
|
||||
if (!samePlayer)
|
||||
fplayer.msg("<i>%s moved you into the faction %s.", fme.describeTo(fplayer, true), faction.getTag(fplayer));
|
||||
@ -100,7 +100,7 @@ public class CmdJoin extends FCommand
|
||||
faction.deinvite(fplayer);
|
||||
|
||||
|
||||
if (Conf.logFactionJoin)
|
||||
if (ConfServer.logFactionJoin)
|
||||
{
|
||||
if (samePlayer)
|
||||
Factions.get().log("%s joined the faction %s.", fplayer.getName(), faction.getTag());
|
||||
|
@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.ConfServer;
|
||||
import com.massivecraft.factions.FPlayer;
|
||||
import com.massivecraft.factions.Faction;
|
||||
import com.massivecraft.factions.Factions;
|
||||
@ -50,7 +50,7 @@ public class CmdKick extends FCommand
|
||||
return;
|
||||
}
|
||||
|
||||
if ( ! Conf.canLeaveWithNegativePower && you.getPower() < 0)
|
||||
if ( ! ConfServer.canLeaveWithNegativePower && you.getPower() < 0)
|
||||
{
|
||||
msg("<b>You cannot kick that member until their power is positive.");
|
||||
return;
|
||||
@ -61,7 +61,7 @@ public class CmdKick extends FCommand
|
||||
if (fme != null && ! FPerm.KICK.has(fme, yourFaction)) return;
|
||||
|
||||
// if economy is enabled, they're not on the bypass list, and this command has a cost set, make sure they can pay
|
||||
if ( ! canAffordCommand(Conf.econCostKick, "to kick someone from the faction")) return;
|
||||
if ( ! canAffordCommand(ConfServer.econCostKick, "to kick someone from the faction")) return;
|
||||
|
||||
// trigger the leave event (cancellable) [reason:kicked]
|
||||
FPlayerLeaveEvent event = new FPlayerLeaveEvent(you, you.getFaction(), FPlayerLeaveEvent.PlayerLeaveReason.KICKED);
|
||||
@ -69,7 +69,7 @@ public class CmdKick extends FCommand
|
||||
if (event.isCancelled()) return;
|
||||
|
||||
// then make 'em pay (if applicable)
|
||||
if ( ! payForCommand(Conf.econCostKick, "to kick someone from the faction", "for kicking someone from the faction")) return;
|
||||
if ( ! payForCommand(ConfServer.econCostKick, "to kick someone from the faction", "for kicking someone from the faction")) return;
|
||||
|
||||
yourFaction.msg("%s<i> kicked %s<i> from the faction! :O", fme.describeTo(yourFaction, true), you.describeTo(yourFaction, true));
|
||||
you.msg("%s<i> kicked you from %s<i>! :O", fme.describeTo(you, true), yourFaction.describeTo(you));
|
||||
@ -78,7 +78,7 @@ public class CmdKick extends FCommand
|
||||
fme.msg("<i>You kicked %s<i> from the faction %s<i>!", you.describeTo(fme), yourFaction.describeTo(fme));
|
||||
}
|
||||
|
||||
if (Conf.logFactionKick)
|
||||
if (ConfServer.logFactionKick)
|
||||
Factions.get().log((senderIsConsole ? "A console command" : fme.getName())+" kicked "+you.getName()+" from the faction: "+yourFaction.getTag());
|
||||
|
||||
if (you.getRole() == Rel.LEADER)
|
||||
|
@ -4,7 +4,7 @@ import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.ConfServer;
|
||||
import com.massivecraft.factions.Faction;
|
||||
import com.massivecraft.factions.FactionColl;
|
||||
import com.massivecraft.factions.Perm;
|
||||
@ -35,7 +35,7 @@ public class CmdList extends FCommand
|
||||
public void perform()
|
||||
{
|
||||
// if economy is enabled, they're not on the bypass list, and this command has a cost set, make 'em pay
|
||||
if ( ! payForCommand(Conf.econCostList, "to list the factions", "for listing the factions")) return;
|
||||
if ( ! payForCommand(ConfServer.econCostList, "to list the factions", "for listing the factions")) return;
|
||||
|
||||
ArrayList<Faction> factionList = new ArrayList<Faction>(FactionColl.i.get());
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.Board;
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.ConfServer;
|
||||
import com.massivecraft.factions.FLocation;
|
||||
import com.massivecraft.factions.Perm;
|
||||
|
||||
@ -35,7 +35,7 @@ public class CmdMap extends FCommand
|
||||
// Turn on
|
||||
|
||||
// if economy is enabled, they're not on the bypass list, and this command has a cost set, make 'em pay
|
||||
if ( ! payForCommand(Conf.econCostMap, "to show the map", "for showing the map")) return;
|
||||
if ( ! payForCommand(ConfServer.econCostMap, "to show the map", "for showing the map")) return;
|
||||
|
||||
fme.setMapAutoUpdating(true);
|
||||
msg("<i>Map auto update <green>ENABLED.");
|
||||
@ -53,7 +53,7 @@ public class CmdMap extends FCommand
|
||||
else
|
||||
{
|
||||
// if economy is enabled, they're not on the bypass list, and this command has a cost set, make 'em pay
|
||||
if ( ! payForCommand(Conf.econCostMap, "to show the map", "for showing the map")) return;
|
||||
if ( ! payForCommand(ConfServer.econCostMap, "to show the map", "for showing the map")) return;
|
||||
|
||||
showMap();
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.ConfServer;
|
||||
import com.massivecraft.factions.Factions;
|
||||
import com.massivecraft.factions.Perm;
|
||||
import com.massivecraft.factions.iface.EconomyParticipator;
|
||||
@ -38,7 +38,7 @@ public class CmdMoneyDeposit extends FCommand
|
||||
if (faction == null) return;
|
||||
boolean success = Econ.transferMoney(fme, fme, faction, amount);
|
||||
|
||||
if (success && Conf.logMoneyTransactions)
|
||||
if (success && ConfServer.logMoneyTransactions)
|
||||
Factions.get().log(ChatColor.stripColor(Factions.get().txt.parse("%s deposited %s in the faction bank: %s", fme.getName(), Econ.moneyString(amount), faction.describeTo(null))));
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.ConfServer;
|
||||
import com.massivecraft.factions.Perm;
|
||||
import com.massivecraft.factions.iface.EconomyParticipator;
|
||||
import com.massivecraft.factions.Factions;
|
||||
@ -41,7 +41,7 @@ public class CmdMoneyTransferFf extends FCommand
|
||||
|
||||
boolean success = Econ.transferMoney(fme, from, to, amount);
|
||||
|
||||
if (success && Conf.logMoneyTransactions)
|
||||
if (success && ConfServer.logMoneyTransactions)
|
||||
Factions.get().log(ChatColor.stripColor(Factions.get().txt.parse("%s transferred %s from the faction \"%s\" to the faction \"%s\"", fme.getName(), Econ.moneyString(amount), from.describeTo(null), to.describeTo(null))));
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.ConfServer;
|
||||
import com.massivecraft.factions.Perm;
|
||||
import com.massivecraft.factions.iface.EconomyParticipator;
|
||||
import com.massivecraft.factions.Factions;
|
||||
@ -41,7 +41,7 @@ public class CmdMoneyTransferFp extends FCommand
|
||||
|
||||
boolean success = Econ.transferMoney(fme, from, to, amount);
|
||||
|
||||
if (success && Conf.logMoneyTransactions)
|
||||
if (success && ConfServer.logMoneyTransactions)
|
||||
Factions.get().log(ChatColor.stripColor(Factions.get().txt.parse("%s transferred %s from the faction \"%s\" to the player \"%s\"", fme.getName(), Econ.moneyString(amount), from.describeTo(null), to.describeTo(null))));
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.ConfServer;
|
||||
import com.massivecraft.factions.Perm;
|
||||
import com.massivecraft.factions.iface.EconomyParticipator;
|
||||
import com.massivecraft.factions.Factions;
|
||||
@ -41,7 +41,7 @@ public class CmdMoneyTransferPf extends FCommand
|
||||
|
||||
boolean success = Econ.transferMoney(fme, from, to, amount);
|
||||
|
||||
if (success && Conf.logMoneyTransactions)
|
||||
if (success && ConfServer.logMoneyTransactions)
|
||||
Factions.get().log(ChatColor.stripColor(Factions.get().txt.parse("%s transferred %s from the player \"%s\" to the faction \"%s\"", fme.getName(), Econ.moneyString(amount), from.describeTo(null), to.describeTo(null))));
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.ConfServer;
|
||||
import com.massivecraft.factions.Perm;
|
||||
import com.massivecraft.factions.iface.EconomyParticipator;
|
||||
import com.massivecraft.factions.Factions;
|
||||
@ -36,7 +36,7 @@ public class CmdMoneyWithdraw extends FCommand
|
||||
if (faction == null) return;
|
||||
boolean success = Econ.transferMoney(fme, faction, fme, amount);
|
||||
|
||||
if (success && Conf.logMoneyTransactions)
|
||||
if (success && ConfServer.logMoneyTransactions)
|
||||
Factions.get().log(ChatColor.stripColor(Factions.get().txt.parse("%s withdrew %s from the faction bank: %s", fme.getName(), Econ.moneyString(amount), faction.describeTo(null))));
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.ConfServer;
|
||||
import com.massivecraft.factions.Faction;
|
||||
import com.massivecraft.factions.FactionColl;
|
||||
import com.massivecraft.factions.Perm;
|
||||
@ -28,7 +28,7 @@ public class CmdOpen extends FCommand
|
||||
public void perform()
|
||||
{
|
||||
// if economy is enabled, they're not on the bypass list, and this command has a cost set, make 'em pay
|
||||
if ( ! payForCommand(Conf.econCostOpen, "to open or close the faction", "for opening or closing the faction")) return;
|
||||
if ( ! payForCommand(ConfServer.econCostOpen, "to open or close the faction", "for opening or closing the faction")) return;
|
||||
|
||||
myFaction.setOpen(this.argAsBool(0, ! myFaction.getOpen()));
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.ConfServer;
|
||||
import com.massivecraft.factions.FPlayer;
|
||||
import com.massivecraft.factions.Perm;
|
||||
|
||||
@ -34,7 +34,7 @@ public class CmdPower extends FCommand
|
||||
if (target != fme && ! Perm.POWER_ANY.has(sender, true)) return;
|
||||
|
||||
// if economy is enabled, they're not on the bypass list, and this command has a cost set, make 'em pay
|
||||
if ( ! payForCommand(Conf.econCostPower, "to show player power info", "for showing player power info")) return;
|
||||
if ( ! payForCommand(ConfServer.econCostPower, "to show player power info", "for showing player power info")) return;
|
||||
|
||||
double powerBoost = target.getPowerBoost();
|
||||
String boost = (powerBoost == 0.0) ? "" : (powerBoost > 0.0 ? " (bonus: " : " (penalty: ") + powerBoost + ")";
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.Board;
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.ConfServer;
|
||||
import com.massivecraft.factions.FPlayers;
|
||||
import com.massivecraft.factions.FactionColl;
|
||||
import com.massivecraft.factions.Factions;
|
||||
@ -37,7 +37,7 @@ public class CmdReload extends FCommand
|
||||
|
||||
if (file.startsWith("c"))
|
||||
{
|
||||
Conf.load();
|
||||
ConfServer.load();
|
||||
fileName = "conf.json";
|
||||
}
|
||||
else if (file.startsWith("b"))
|
||||
@ -58,7 +58,7 @@ public class CmdReload extends FCommand
|
||||
else if (file.startsWith("a"))
|
||||
{
|
||||
fileName = "all";
|
||||
Conf.load();
|
||||
ConfServer.load();
|
||||
FPlayers.i.loadFromDisc();
|
||||
FactionColl.i.loadFromDisc();
|
||||
Board.load();
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.Board;
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.ConfServer;
|
||||
import com.massivecraft.factions.FPlayers;
|
||||
import com.massivecraft.factions.FactionColl;
|
||||
import com.massivecraft.factions.Perm;
|
||||
@ -33,7 +33,7 @@ public class CmdSaveAll extends FCommand
|
||||
FPlayers.i.saveToDisc();
|
||||
FactionColl.i.saveToDisc();
|
||||
Board.save();
|
||||
Conf.save();
|
||||
ConfServer.save();
|
||||
msg("<i>Factions saved to disk!");
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.Board;
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.ConfServer;
|
||||
import com.massivecraft.factions.FLocation;
|
||||
import com.massivecraft.factions.Faction;
|
||||
import com.massivecraft.factions.Perm;
|
||||
@ -28,7 +28,7 @@ public class CmdSethome extends FCommand
|
||||
@Override
|
||||
public void perform()
|
||||
{
|
||||
if ( ! Conf.homesEnabled)
|
||||
if ( ! ConfServer.homesEnabled)
|
||||
{
|
||||
fme.msg("<b>Sorry, Faction homes are disabled on this server.");
|
||||
return;
|
||||
@ -45,7 +45,7 @@ public class CmdSethome extends FCommand
|
||||
(
|
||||
! fme.hasAdminMode()
|
||||
&&
|
||||
Conf.homesMustBeInClaimedTerritory
|
||||
ConfServer.homesMustBeInClaimedTerritory
|
||||
&&
|
||||
Board.getFactionAt(new FLocation(me)) != faction
|
||||
)
|
||||
@ -55,7 +55,7 @@ public class CmdSethome extends FCommand
|
||||
}
|
||||
|
||||
// if economy is enabled, they're not on the bypass list, and this command has a cost set, make 'em pay
|
||||
if ( ! payForCommand(Conf.econCostSethome, "to set the faction home", "for setting the faction home")) return;
|
||||
if ( ! payForCommand(ConfServer.econCostSethome, "to set the faction home", "for setting the faction home")) return;
|
||||
|
||||
faction.setHome(me.getLocation());
|
||||
|
||||
|
@ -5,7 +5,7 @@ import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.ConfServer;
|
||||
import com.massivecraft.factions.integration.Econ;
|
||||
import com.massivecraft.factions.FPlayer;
|
||||
import com.massivecraft.factions.Faction;
|
||||
@ -44,7 +44,7 @@ public class CmdShow extends FCommand
|
||||
}
|
||||
|
||||
// if economy is enabled, they're not on the bypass list, and this command has a cost set, make 'em pay
|
||||
if ( ! payForCommand(Conf.econCostShow, "to show faction information", "for showing faction information")) return;
|
||||
if ( ! payForCommand(ConfServer.econCostShow, "to show faction information", "for showing faction information")) return;
|
||||
|
||||
Collection<FPlayer> admins = faction.getFPlayersWhereRole(Rel.LEADER);
|
||||
Collection<FPlayer> mods = faction.getFPlayersWhereRole(Rel.OFFICER);
|
||||
@ -76,7 +76,7 @@ public class CmdShow extends FCommand
|
||||
if (Econ.shouldBeUsed())
|
||||
{
|
||||
double value = Econ.calculateTotalLandValue(faction.getLandRounded());
|
||||
double refund = value * Conf.econClaimRefundMultiplier;
|
||||
double refund = value * ConfServer.econClaimRefundMultiplier;
|
||||
if (value > 0)
|
||||
{
|
||||
String stringValue = Econ.moneyString(value);
|
||||
@ -85,7 +85,7 @@ public class CmdShow extends FCommand
|
||||
}
|
||||
|
||||
//Show bank contents
|
||||
if(Conf.bankEnabled)
|
||||
if(ConfServer.bankEnabled)
|
||||
{
|
||||
msg("<a>Bank contains: <i>"+Econ.moneyString(Econ.getBalance(faction.getAccountId())));
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ import java.util.ArrayList;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.ConfServer;
|
||||
import com.massivecraft.factions.Faction;
|
||||
import com.massivecraft.factions.FactionColl;
|
||||
import com.massivecraft.factions.Perm;
|
||||
@ -52,7 +52,7 @@ public class CmdTag extends FCommand
|
||||
}
|
||||
|
||||
// if economy is enabled, they're not on the bypass list, and this command has a cost set, make sure they can pay
|
||||
if ( ! canAffordCommand(Conf.econCostTag, "to change the faction tag")) return;
|
||||
if ( ! canAffordCommand(ConfServer.econCostTag, "to change the faction tag")) return;
|
||||
|
||||
// trigger the faction rename event (cancellable)
|
||||
FactionRenameEvent renameEvent = new FactionRenameEvent(fme, tag);
|
||||
@ -60,7 +60,7 @@ public class CmdTag extends FCommand
|
||||
if(renameEvent.isCancelled()) return;
|
||||
|
||||
// then make 'em pay (if applicable)
|
||||
if ( ! payForCommand(Conf.econCostTag, "to change the faction tag", "for changing the faction tag")) return;
|
||||
if ( ! payForCommand(ConfServer.econCostTag, "to change the faction tag", "for changing the faction tag")) return;
|
||||
|
||||
String oldtag = myFaction.getTag();
|
||||
myFaction.setTag(tag);
|
||||
@ -76,7 +76,7 @@ public class CmdTag extends FCommand
|
||||
faction.msg("<i>The faction %s<i> changed their name to %s.", fme.getColorTo(faction)+oldtag, myFaction.getTag(faction));
|
||||
}
|
||||
|
||||
if (Conf.spoutFactionTagsOverNames)
|
||||
if (ConfServer.spoutFactionTagsOverNames)
|
||||
{
|
||||
SpoutFeatures.updateTitle(myFaction, null);
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.ConfServer;
|
||||
import com.massivecraft.factions.FPlayer;
|
||||
import com.massivecraft.factions.Perm;
|
||||
import com.massivecraft.factions.integration.SpoutFeatures;
|
||||
@ -36,14 +36,14 @@ public class CmdTitle extends FCommand
|
||||
if ( ! canIAdministerYou(fme, you)) return;
|
||||
|
||||
// if economy is enabled, they're not on the bypass list, and this command has a cost set, make 'em pay
|
||||
if ( ! payForCommand(Conf.econCostTitle, "to change a players title", "for changing a players title")) return;
|
||||
if ( ! payForCommand(ConfServer.econCostTitle, "to change a players title", "for changing a players title")) return;
|
||||
|
||||
you.setTitle(title);
|
||||
|
||||
// Inform
|
||||
myFaction.msg("%s<i> changed a title: %s", fme.describeTo(myFaction, true), you.describeTo(myFaction, true));
|
||||
|
||||
if (Conf.spoutFactionTitlesOverNames)
|
||||
if (ConfServer.spoutFactionTitlesOverNames)
|
||||
{
|
||||
SpoutFeatures.updateTitle(me, null);
|
||||
}
|
||||
|
@ -3,7 +3,7 @@ package com.massivecraft.factions.cmd;
|
||||
import org.bukkit.Bukkit;
|
||||
|
||||
import com.massivecraft.factions.Board;
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.ConfServer;
|
||||
import com.massivecraft.factions.event.LandUnclaimEvent;
|
||||
import com.massivecraft.factions.integration.Econ;
|
||||
import com.massivecraft.factions.integration.SpoutFeatures;
|
||||
@ -49,7 +49,7 @@ public class CmdUnclaim extends FCommand
|
||||
{
|
||||
double refund = Econ.calculateClaimRefund(myFaction.getLandRounded());
|
||||
|
||||
if(Conf.bankEnabled && Conf.bankFactionPaysLandCosts)
|
||||
if(ConfServer.bankEnabled && ConfServer.bankFactionPaysLandCosts)
|
||||
{
|
||||
if ( ! Econ.modifyMoney(myFaction, refund, "to unclaim this land", "for unclaiming this land")) return;
|
||||
}
|
||||
@ -63,7 +63,7 @@ public class CmdUnclaim extends FCommand
|
||||
SpoutFeatures.updateTerritoryDisplayLoc(flocation);
|
||||
myFaction.msg("%s<i> unclaimed some land.", fme.describeTo(myFaction, true));
|
||||
|
||||
if (Conf.logLandUnclaims)
|
||||
if (ConfServer.logLandUnclaims)
|
||||
Factions.get().log(fme.getName()+" unclaimed land at ("+flocation.getCoordString()+") from the faction: "+otherFaction.getTag());
|
||||
}
|
||||
|
||||
|
@ -3,7 +3,7 @@ package com.massivecraft.factions.cmd;
|
||||
import org.bukkit.Bukkit;
|
||||
|
||||
import com.massivecraft.factions.Board;
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.ConfServer;
|
||||
import com.massivecraft.factions.Factions;
|
||||
import com.massivecraft.factions.Perm;
|
||||
import com.massivecraft.factions.event.LandUnclaimAllEvent;
|
||||
@ -35,7 +35,7 @@ public class CmdUnclaimall extends FCommand
|
||||
if (Econ.shouldBeUsed())
|
||||
{
|
||||
double refund = Econ.calculateTotalLandRefund(myFaction.getLandRounded());
|
||||
if(Conf.bankEnabled && Conf.bankFactionPaysLandCosts)
|
||||
if(ConfServer.bankEnabled && ConfServer.bankFactionPaysLandCosts)
|
||||
{
|
||||
if ( ! Econ.modifyMoney(myFaction, refund, "to unclaim all faction land", "for unclaiming all faction land")) return;
|
||||
}
|
||||
@ -53,7 +53,7 @@ public class CmdUnclaimall extends FCommand
|
||||
myFaction.msg("%s<i> unclaimed ALL of your faction's land.", fme.describeTo(myFaction, true));
|
||||
SpoutFeatures.updateTerritoryDisplayLoc(null);
|
||||
|
||||
if (Conf.logLandUnclaims)
|
||||
if (ConfServer.logLandUnclaims)
|
||||
Factions.get().log(fme.getName()+" unclaimed everything for the faction: "+myFaction.getTag());
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.ConfServer;
|
||||
import com.massivecraft.factions.Factions;
|
||||
|
||||
public class FCmdRoot extends FCommand
|
||||
@ -53,7 +53,7 @@ public class FCmdRoot extends FCommand
|
||||
public FCmdRoot()
|
||||
{
|
||||
super();
|
||||
this.aliases.addAll(Conf.baseCommandAliases);
|
||||
this.aliases.addAll(ConfServer.baseCommandAliases);
|
||||
this.aliases.removeAll(Collections.singletonList(null)); // remove any nulls from extra commas
|
||||
|
||||
//this.requiredArgs.add("");
|
||||
|
@ -5,7 +5,7 @@ import java.util.List;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.ConfServer;
|
||||
import com.massivecraft.factions.integration.Econ;
|
||||
import com.massivecraft.factions.FPlayer;
|
||||
import com.massivecraft.factions.FPlayers;
|
||||
@ -70,13 +70,13 @@ public abstract class FCommand extends MCommand<Factions>
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.isMoneyCommand && ! Conf.econEnabled)
|
||||
if (this.isMoneyCommand && ! ConfServer.econEnabled)
|
||||
{
|
||||
msg("<b>Faction economy features are disabled on this server.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.isMoneyCommand && ! Conf.bankEnabled)
|
||||
if (this.isMoneyCommand && ! ConfServer.bankEnabled)
|
||||
{
|
||||
msg("<b>The faction bank system is disabled on this server.");
|
||||
return false;
|
||||
@ -422,7 +422,7 @@ public abstract class FCommand extends MCommand<Factions>
|
||||
{
|
||||
if ( ! Econ.shouldBeUsed() || this.fme == null || cost == 0.0 || fme.hasAdminMode()) return true;
|
||||
|
||||
if(Conf.bankEnabled && Conf.bankFactionPaysCosts && fme.hasFaction())
|
||||
if(ConfServer.bankEnabled && ConfServer.bankFactionPaysCosts && fme.hasFaction())
|
||||
return Econ.modifyMoney(myFaction, -cost, toDoThis, forDoingThis);
|
||||
else
|
||||
return Econ.modifyMoney(fme, -cost, toDoThis, forDoingThis);
|
||||
@ -433,7 +433,7 @@ public abstract class FCommand extends MCommand<Factions>
|
||||
{
|
||||
if ( ! Econ.shouldBeUsed() || this.fme == null || cost == 0.0 || fme.hasAdminMode()) return true;
|
||||
|
||||
if(Conf.bankEnabled && Conf.bankFactionPaysCosts && fme.hasFaction())
|
||||
if(ConfServer.bankEnabled && ConfServer.bankFactionPaysCosts && fme.hasFaction())
|
||||
return Econ.hasAtLeast(myFaction, cost, toDoThis);
|
||||
else
|
||||
return Econ.hasAtLeast(fme, cost, toDoThis);
|
||||
|
@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.ConfServer;
|
||||
import com.massivecraft.factions.Faction;
|
||||
import com.massivecraft.factions.Perm;
|
||||
import com.massivecraft.factions.event.FactionRelationEvent;
|
||||
@ -75,7 +75,7 @@ public abstract class FRelationCommand extends FCommand
|
||||
else
|
||||
{
|
||||
them.msg("%s<i> wishes to be %s.", myFaction.describeTo(them, true), targetRelation.getColor()+targetRelation.getDescFactionOne());
|
||||
them.msg("<i>Type <c>/"+Conf.baseCommandAliases.get(0)+" "+targetRelation+" "+myFaction.getTag()+"<i> to accept.");
|
||||
them.msg("<i>Type <c>/"+ConfServer.baseCommandAliases.get(0)+" "+targetRelation+" "+myFaction.getTag()+"<i> to accept.");
|
||||
myFaction.msg("%s<i> were informed that you wish to be %s<i>.", them.describeTo(myFaction, true), targetRelation.getColor()+targetRelation.getDescFactionOne());
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user