Moved the last stuff away from ConfServer.
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.ConfServer;
|
||||
import com.massivecraft.factions.Perm;
|
||||
import com.massivecraft.factions.cmd.arg.ARFaction;
|
||||
import com.massivecraft.factions.entity.Faction;
|
||||
import com.massivecraft.factions.entity.UConf;
|
||||
import com.massivecraft.factions.task.SpiralTask;
|
||||
import com.massivecraft.mcore.cmd.arg.ARInteger;
|
||||
import com.massivecraft.mcore.cmd.req.ReqHasPerm;
|
||||
@@ -59,7 +59,7 @@ public class CmdFactionsClaim extends FCommand
|
||||
new SpiralTask(PS.valueOf(me), radius)
|
||||
{
|
||||
private int failCount = 0;
|
||||
private final int limit = ConfServer.radiusClaimFailureLimit - 1;
|
||||
private final int limit = UConf.get(me).radiusClaimFailureLimit - 1;
|
||||
|
||||
@Override
|
||||
public boolean work()
|
||||
|
@@ -18,7 +18,7 @@ public class CmdFactionsLeave extends FCommand {
|
||||
@Override
|
||||
public void perform()
|
||||
{
|
||||
fme.leave(true);
|
||||
fme.leave();
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -5,8 +5,8 @@ import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.massivecraft.factions.ConfServer;
|
||||
import com.massivecraft.factions.cmd.arg.ARFaction;
|
||||
import com.massivecraft.factions.entity.UConf;
|
||||
import com.massivecraft.factions.entity.UPlayer;
|
||||
import com.massivecraft.factions.entity.Faction;
|
||||
import com.massivecraft.factions.integration.Econ;
|
||||
@@ -65,7 +65,8 @@ public class CmdFactionsShow extends FCommand
|
||||
if (Econ.isEnabled(faction))
|
||||
{
|
||||
double value = Econ.calculateTotalLandValue(faction.getLandCount());
|
||||
double refund = value * ConfServer.econClaimRefundMultiplier;
|
||||
|
||||
double refund = value * UConf.get(faction).econClaimRefundMultiplier;
|
||||
if (value > 0)
|
||||
{
|
||||
String stringValue = Money.format(faction, value);
|
||||
@@ -73,8 +74,8 @@ public class CmdFactionsShow extends FCommand
|
||||
msg("<a>Total land value: <i>" + stringValue + stringRefund);
|
||||
}
|
||||
|
||||
//Show bank contents
|
||||
if(ConfServer.bankEnabled)
|
||||
// Show bank contents
|
||||
if(UConf.get(faction).bankEnabled)
|
||||
{
|
||||
msg("<a>Bank contains: <i>"+Money.format(faction, Money.get(faction)));
|
||||
}
|
||||
|
@@ -1,9 +1,9 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.ConfServer;
|
||||
import com.massivecraft.factions.entity.BoardColls;
|
||||
import com.massivecraft.factions.entity.Faction;
|
||||
import com.massivecraft.factions.entity.MConf;
|
||||
import com.massivecraft.factions.entity.UConf;
|
||||
import com.massivecraft.factions.event.FactionsEventLandUnclaim;
|
||||
import com.massivecraft.factions.integration.Econ;
|
||||
import com.massivecraft.factions.FPerm;
|
||||
@@ -43,7 +43,7 @@ public class CmdFactionsUnclaim extends FCommand
|
||||
{
|
||||
double refund = Econ.calculateClaimRefund(myFaction);
|
||||
|
||||
if (ConfServer.bankEnabled && ConfServer.bankFactionPaysLandCosts)
|
||||
if (UConf.get(myFaction).bankEnabled && UConf.get(myFaction).bankFactionPaysLandCosts)
|
||||
{
|
||||
if ( ! Econ.modifyMoney(myFaction, refund, "unclaim this land")) return;
|
||||
}
|
||||
|
@@ -1,12 +1,12 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.ConfServer;
|
||||
import com.massivecraft.factions.Factions;
|
||||
import com.massivecraft.factions.Perm;
|
||||
import com.massivecraft.factions.Rel;
|
||||
import com.massivecraft.factions.cmd.req.ReqRoleIsAtLeast;
|
||||
import com.massivecraft.factions.entity.BoardColls;
|
||||
import com.massivecraft.factions.entity.MConf;
|
||||
import com.massivecraft.factions.entity.UConf;
|
||||
import com.massivecraft.factions.event.FactionsEventLandUnclaimAll;
|
||||
import com.massivecraft.factions.integration.Econ;
|
||||
import com.massivecraft.mcore.cmd.req.ReqHasPerm;
|
||||
@@ -28,7 +28,8 @@ public class CmdFactionsUnclaimall extends FCommand
|
||||
if (Econ.isEnabled(myFaction))
|
||||
{
|
||||
double refund = Econ.calculateTotalLandRefund(myFaction.getLandCount());
|
||||
if(ConfServer.bankEnabled && ConfServer.bankFactionPaysLandCosts)
|
||||
|
||||
if (UConf.get(myFaction).bankEnabled && UConf.get(myFaction).bankFactionPaysLandCosts)
|
||||
{
|
||||
if ( ! Econ.modifyMoney(myFaction, refund, "unclaim all faction land")) return;
|
||||
}
|
||||
|
@@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd.req;
|
||||
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
import com.massivecraft.factions.ConfServer;
|
||||
import com.massivecraft.factions.entity.UConf;
|
||||
import com.massivecraft.mcore.cmd.MCommand;
|
||||
import com.massivecraft.mcore.cmd.req.ReqAbstract;
|
||||
import com.massivecraft.mcore.util.Txt;
|
||||
@@ -25,17 +25,16 @@ public class ReqBankCommandsEnabled extends ReqAbstract
|
||||
@Override
|
||||
public boolean apply(CommandSender sender, MCommand command)
|
||||
{
|
||||
return ConfServer.econEnabled && ConfServer.bankEnabled;
|
||||
return UConf.get(sender).econEnabled && UConf.get(sender).bankEnabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String createErrorMessage(CommandSender sender, MCommand command)
|
||||
{
|
||||
if (!ConfServer.bankEnabled)
|
||||
if (!UConf.get(sender).bankEnabled)
|
||||
{
|
||||
return Txt.parse("<b>The Factions bank system is disabled on this server.");
|
||||
}
|
||||
|
||||
return Txt.parse("<b>The Factions economy features are disabled on this server.");
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user