Code Cleanup/Added Configurable option to deny and remove homes in ANY factions land.
More Soon..
This commit is contained in:
@@ -25,7 +25,7 @@ public class CmdAdmin extends FCommand {
|
||||
this.disableOnLock = true;
|
||||
|
||||
|
||||
senderMustBePlayer = false;
|
||||
senderMustBePlayer = false;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeAdmin = false;
|
||||
|
||||
@@ -23,7 +23,7 @@ public class CmdBanner extends FCommand {
|
||||
this.disableOnLock = false;
|
||||
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = true;
|
||||
|
||||
@@ -41,12 +41,10 @@ public class CmdChat extends FCommand {
|
||||
modeString = modeString.toLowerCase();
|
||||
// Only allow Mods and higher rank to switch to this channel.
|
||||
if (modeString.startsWith("m")) {
|
||||
if (!fme.getRole().isAtLeast(Role.MODERATOR))
|
||||
{
|
||||
msg(TL.COMMAND_CHAT_MOD_ONLY);
|
||||
return;
|
||||
}
|
||||
else modeTarget = ChatMode.MOD;
|
||||
if (!fme.getRole().isAtLeast(Role.MODERATOR)) {
|
||||
msg(TL.COMMAND_CHAT_MOD_ONLY);
|
||||
return;
|
||||
} else modeTarget = ChatMode.MOD;
|
||||
} else if (modeString.startsWith("p")) {
|
||||
modeTarget = ChatMode.PUBLIC;
|
||||
} else if (modeString.startsWith("a")) {
|
||||
@@ -63,13 +61,22 @@ public class CmdChat extends FCommand {
|
||||
|
||||
fme.setChatMode(modeTarget);
|
||||
|
||||
switch (fme.getChatMode())
|
||||
{
|
||||
case MOD: msg(TL.COMMAND_CHAT_MODE_MOD); break;
|
||||
case PUBLIC: msg(TL.COMMAND_CHAT_MODE_PUBLIC); break;
|
||||
case ALLIANCE: msg(TL.COMMAND_CHAT_MODE_ALLIANCE); break;
|
||||
case TRUCE: msg(TL.COMMAND_CHAT_MODE_TRUCE); break;
|
||||
default: msg(TL.COMMAND_CHAT_MODE_FACTION); break;
|
||||
switch (fme.getChatMode()) {
|
||||
case MOD:
|
||||
msg(TL.COMMAND_CHAT_MODE_MOD);
|
||||
break;
|
||||
case PUBLIC:
|
||||
msg(TL.COMMAND_CHAT_MODE_PUBLIC);
|
||||
break;
|
||||
case ALLIANCE:
|
||||
msg(TL.COMMAND_CHAT_MODE_ALLIANCE);
|
||||
break;
|
||||
case TRUCE:
|
||||
msg(TL.COMMAND_CHAT_MODE_TRUCE);
|
||||
break;
|
||||
default:
|
||||
msg(TL.COMMAND_CHAT_MODE_FACTION);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ public class CmdChest extends FCommand {
|
||||
this.disableOnLock = false;
|
||||
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = true;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeAdmin = false;
|
||||
|
||||
@@ -46,11 +46,10 @@ public class CmdClaim extends FCommand {
|
||||
}
|
||||
}
|
||||
|
||||
if (forFaction.isWilderness())
|
||||
{
|
||||
CmdUnclaim cmdUnclaim = SavageFactions.plugin.cmdBase.cmdUnclaim;
|
||||
cmdUnclaim.execute(sender, args.size() > 1 ? args.subList(0, 1):args);
|
||||
return;
|
||||
if (forFaction.isWilderness()) {
|
||||
CmdUnclaim cmdUnclaim = SavageFactions.plugin.cmdBase.cmdUnclaim;
|
||||
cmdUnclaim.execute(sender, args.size() > 1 ? args.subList(0, 1) : args);
|
||||
return;
|
||||
}
|
||||
|
||||
if (radius < 1) {
|
||||
|
||||
@@ -18,7 +18,7 @@ public class CmdClaimAt extends FCommand {
|
||||
this.disableOnLock = true;
|
||||
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = true;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = false;
|
||||
|
||||
@@ -26,7 +26,7 @@ public class CmdClaimLine extends FCommand {
|
||||
this.disableOnLock = true;
|
||||
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = false;
|
||||
|
||||
@@ -24,7 +24,7 @@ public class CmdColeader extends FCommand {
|
||||
this.disableOnLock = true;
|
||||
|
||||
|
||||
senderMustBePlayer = false;
|
||||
senderMustBePlayer = false;
|
||||
senderMustBeMember = true;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeAdmin = true;
|
||||
|
||||
@@ -174,7 +174,7 @@ public class CmdConfig extends FCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
@SuppressWarnings ("unchecked") Set<Material> matSet = (Set<Material>) target.get(null);
|
||||
@SuppressWarnings("unchecked") Set<Material> matSet = (Set<Material>) target.get(null);
|
||||
|
||||
// Material already present, so remove it
|
||||
if (matSet.contains(newMat)) {
|
||||
@@ -192,7 +192,7 @@ public class CmdConfig extends FCommand {
|
||||
|
||||
// Set<String>
|
||||
else if (innerType == String.class) {
|
||||
@SuppressWarnings ("unchecked") Set<String> stringSet = (Set<String>) target.get(null);
|
||||
@SuppressWarnings("unchecked") Set<String> stringSet = (Set<String>) target.get(null);
|
||||
|
||||
// String already present, so remove it
|
||||
if (stringSet.contains(value.toString())) {
|
||||
|
||||
@@ -13,7 +13,7 @@ public class CmdConvert extends FCommand {
|
||||
this.aliases.add("convert");
|
||||
|
||||
this.permission = Permission.CONVERT.node;
|
||||
|
||||
|
||||
this.requiredArgs.add("[MYSQL|JSON]");
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ public class CmdCoords extends FCommand {
|
||||
this.disableOnLock = true;
|
||||
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = true;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = false;
|
||||
|
||||
@@ -25,7 +25,7 @@ public class CmdDeinvite extends FCommand {
|
||||
this.disableOnLock = true;
|
||||
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = true;
|
||||
senderMustBeColeader = false;
|
||||
|
||||
@@ -4,6 +4,6 @@ public class CmdDemote extends FPromoteCommand {
|
||||
|
||||
public CmdDemote() {
|
||||
aliases.add("demote");
|
||||
this.relative = - 1;
|
||||
this.relative = -1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ public class CmdDescription extends FCommand {
|
||||
this.disableOnLock = true;
|
||||
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = true;
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.FPlayer;
|
||||
import com.massivecraft.factions.FPlayers;
|
||||
import com.massivecraft.factions.Faction;
|
||||
import com.massivecraft.factions.SavageFactions;
|
||||
import com.massivecraft.factions.*;
|
||||
import com.massivecraft.factions.event.FactionDisbandEvent.PlayerDisbandReason;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.struct.Role;
|
||||
import com.massivecraft.factions.util.UtilFly;
|
||||
import com.massivecraft.factions.zcore.fperms.Access;
|
||||
import com.massivecraft.factions.zcore.fperms.PermissableAction;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
@@ -93,6 +91,7 @@ public class CmdDisband extends FCommand {
|
||||
if (SavageFactions.plugin.getConfig().getBoolean("faction-disband-broadcast", true)) {
|
||||
for (FPlayer follower : FPlayers.getInstance().getOnlinePlayers()) {
|
||||
String amountString = senderIsConsole ? TL.GENERIC_SERVERADMIN.toString() : fme.describeTo(follower);
|
||||
UtilFly.checkFly(this.fme, Board.getInstance().getFactionAt(new FLocation(follower)));
|
||||
if (follower.getFaction() == faction) {
|
||||
follower.msg(TL.COMMAND_DISBAND_BROADCAST_YOURS, amountString);
|
||||
} else {
|
||||
|
||||
@@ -24,7 +24,7 @@ public class CmdFWarp extends FCommand {
|
||||
this.optionalArgs.put("password", "password");
|
||||
|
||||
|
||||
this.permission = Permission.WARP.node;
|
||||
this.permission = Permission.WARP.node;
|
||||
this.senderMustBeMember = true;
|
||||
this.senderMustBeModerator = false;
|
||||
}
|
||||
|
||||
@@ -23,8 +23,8 @@ public class CmdFly extends FCommand {
|
||||
|
||||
|
||||
public static ConcurrentHashMap<String, Boolean> flyMap = new ConcurrentHashMap<String, Boolean>();
|
||||
public static int id = - 1;
|
||||
public static int flyid = - 1;
|
||||
public static int id = -1;
|
||||
public static int flyid = -1;
|
||||
|
||||
public CmdFly() {
|
||||
super();
|
||||
@@ -33,7 +33,7 @@ public class CmdFly extends FCommand {
|
||||
this.optionalArgs.put("on/off", "flip");
|
||||
|
||||
|
||||
this.permission = Permission.FLY.node;
|
||||
this.permission = Permission.FLY.node;
|
||||
this.senderMustBeMember = true;
|
||||
this.senderMustBeModerator = false;
|
||||
}
|
||||
@@ -73,15 +73,15 @@ public class CmdFly extends FCommand {
|
||||
// 1.9+ based servers will use the built in particleAPI instead of packet based.
|
||||
// any particle amount higher than 0 made them go everywhere, and the offset at 0 was not working.
|
||||
// So setting the amount to 0 spawns 1 in the precise location
|
||||
player.getWorld().spawnParticle(Particle.CLOUD, player.getLocation().add(0, - 0.35, 0), 0);
|
||||
player.getWorld().spawnParticle(Particle.CLOUD, player.getLocation().add(0, -0.35, 0), 0);
|
||||
} else {
|
||||
ParticleEffect.CLOUD.display((float) 0, (float) 0, (float) 0, (float) 0, 3, player.getLocation().add(0, - 0.35, 0), 16);
|
||||
ParticleEffect.CLOUD.display((float) 0, (float) 0, (float) 0, (float) 0, 3, player.getLocation().add(0, -0.35, 0), 16);
|
||||
}
|
||||
|
||||
}
|
||||
if (flyMap.keySet().size() == 0) {
|
||||
Bukkit.getScheduler().cancelTask(id);
|
||||
id = - 1;
|
||||
id = -1;
|
||||
}
|
||||
}
|
||||
}, 10L, 3L);
|
||||
@@ -178,7 +178,7 @@ public class CmdFly extends FCommand {
|
||||
public static void checkTaskState() {
|
||||
if (flyMap.keySet().size() == 0) {
|
||||
Bukkit.getScheduler().cancelTask(flyid);
|
||||
flyid = - 1;
|
||||
flyid = -1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -199,7 +199,7 @@ public class CmdFly extends FCommand {
|
||||
if (!checkBypassPerms(fme, me, toFac)) return;
|
||||
List<Entity> entities = this.me.getNearbyEntities(16.0D, 256.0D, 16.0D);
|
||||
|
||||
for (int i = 0; i <= entities.size() - 1; ++ i) {
|
||||
for (int i = 0; i <= entities.size() - 1; ++i) {
|
||||
if (entities.get(i) instanceof Player) {
|
||||
Player eplayer = (Player) entities.get(i);
|
||||
FPlayer efplayer = FPlayers.getInstance().getByPlayer(eplayer);
|
||||
@@ -231,12 +231,12 @@ public class CmdFly extends FCommand {
|
||||
public void run() {
|
||||
fme.setFlying(true);
|
||||
flyMap.put(player.getName(), true);
|
||||
if (id == - 1) {
|
||||
if (id == -1) {
|
||||
if (SavageFactions.plugin.getConfig().getBoolean("ffly.Particles.Enabled")) {
|
||||
startParticles();
|
||||
}
|
||||
}
|
||||
if (flyid == - 1) {
|
||||
if (flyid == -1) {
|
||||
startFlyCheck();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,18 +9,18 @@ import com.massivecraft.factions.zcore.util.TL;
|
||||
public class CmdFocus
|
||||
extends FCommand {
|
||||
public CmdFocus() {
|
||||
aliases.add("focus");
|
||||
aliases.add("focus");
|
||||
|
||||
requiredArgs.add("player");
|
||||
requiredArgs.add("player");
|
||||
|
||||
permission = Permission.FOCUS.node;
|
||||
permission = Permission.FOCUS.node;
|
||||
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = true;
|
||||
senderMustBeColeader = false;
|
||||
senderMustBeAdmin = false;
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = true;
|
||||
senderMustBeColeader = false;
|
||||
senderMustBeAdmin = false;
|
||||
}
|
||||
|
||||
public void perform() {
|
||||
|
||||
@@ -18,7 +18,7 @@ public class CmdGetVault extends FCommand {
|
||||
this.disableOnLock = true;
|
||||
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = true;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = false;
|
||||
|
||||
@@ -31,7 +31,7 @@ public class CmdHome extends FCommand {
|
||||
this.disableOnLock = false;
|
||||
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = true;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = false;
|
||||
|
||||
@@ -13,7 +13,7 @@ public class CmdInspect extends FCommand {
|
||||
this.disableOnLock = true;
|
||||
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = true;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = false;
|
||||
|
||||
@@ -24,7 +24,7 @@ public class CmdInvite extends FCommand {
|
||||
this.disableOnLock = true;
|
||||
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = false;
|
||||
|
||||
@@ -19,7 +19,7 @@ public class CmdJoin extends FCommand {
|
||||
this.disableOnLock = true;
|
||||
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = false;
|
||||
|
||||
@@ -27,7 +27,7 @@ public class CmdKick extends FCommand {
|
||||
this.disableOnLock = false;
|
||||
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeAdmin = false;
|
||||
|
||||
@@ -16,7 +16,7 @@ public class CmdLeave extends FCommand {
|
||||
this.disableOnLock = true;
|
||||
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = true;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = false;
|
||||
|
||||
@@ -53,7 +53,7 @@ public class CmdList extends FCommand {
|
||||
if (fme != null && fme.getPlayer() != null && !fme.getPlayer().hasPermission("factions.show.bypassexempt")) {
|
||||
List<String> exemptFactions = SavageFactions.plugin.getConfig().getStringList("show-exempt");
|
||||
Iterator<Faction> factionIterator = factionList.iterator();
|
||||
|
||||
|
||||
while (factionIterator.hasNext()) {
|
||||
Faction next = factionIterator.next();
|
||||
if (exemptFactions.contains(next.getTag()))
|
||||
@@ -70,7 +70,7 @@ public class CmdList extends FCommand {
|
||||
if (f1Size < f2Size) {
|
||||
return 1;
|
||||
} else if (f1Size > f2Size) {
|
||||
return - 1;
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -85,7 +85,7 @@ public class CmdList extends FCommand {
|
||||
if (f1Size < f2Size) {
|
||||
return 1;
|
||||
} else if (f1Size > f2Size) {
|
||||
return - 1;
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ public class CmdLock extends FCommand {
|
||||
this.disableOnLock = false;
|
||||
|
||||
|
||||
senderMustBePlayer = false;
|
||||
senderMustBePlayer = false;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = false;
|
||||
|
||||
@@ -13,7 +13,7 @@ public class CmdLogins extends FCommand {
|
||||
this.aliases.add("logouts");
|
||||
this.senderMustBePlayer = true;
|
||||
|
||||
this.senderMustBeMember = true;
|
||||
this.senderMustBeMember = true;
|
||||
this.permission = Permission.MONITOR_LOGINS.node;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ public class CmdLowPower extends FCommand {
|
||||
|
||||
senderMustBePlayer = true;
|
||||
|
||||
senderMustBeMember = true;
|
||||
senderMustBeMember = true;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = true;
|
||||
senderMustBeAdmin = false;
|
||||
|
||||
@@ -20,7 +20,7 @@ public class CmdMap extends FCommand {
|
||||
this.disableOnLock = false;
|
||||
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = false;
|
||||
|
||||
@@ -16,7 +16,7 @@ public class CmdMapHeight extends FCommand {
|
||||
this.permission = Permission.MAPHEIGHT.node;
|
||||
|
||||
|
||||
this.senderMustBePlayer = true;
|
||||
this.senderMustBePlayer = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -25,7 +25,7 @@ public class CmdMod extends FCommand {
|
||||
this.disableOnLock = true;
|
||||
|
||||
|
||||
senderMustBePlayer = false;
|
||||
senderMustBePlayer = false;
|
||||
senderMustBeMember = true;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = true;
|
||||
|
||||
@@ -19,7 +19,7 @@ public class CmdMoneyBalance extends FCommand {
|
||||
this.setHelpShort(TL.COMMAND_MONEYBALANCE_SHORT.toString());
|
||||
|
||||
|
||||
senderMustBePlayer = false;
|
||||
senderMustBePlayer = false;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeAdmin = false;
|
||||
|
||||
@@ -22,7 +22,7 @@ public class CmdMoneyDeposit extends FCommand {
|
||||
this.permission = Permission.MONEY_DEPOSIT.node;
|
||||
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = false;
|
||||
|
||||
@@ -24,7 +24,7 @@ public class CmdMoneyTransferFf extends FCommand {
|
||||
this.permission = Permission.MONEY_F2F.node;
|
||||
|
||||
|
||||
senderMustBePlayer = false;
|
||||
senderMustBePlayer = false;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = false;
|
||||
|
||||
@@ -23,7 +23,7 @@ public class CmdMoneyTransferFp extends FCommand {
|
||||
this.permission = Permission.MONEY_F2P.node;
|
||||
|
||||
|
||||
senderMustBePlayer = false;
|
||||
senderMustBePlayer = false;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = false;
|
||||
|
||||
@@ -23,7 +23,7 @@ public class CmdMoneyTransferPf extends FCommand {
|
||||
this.permission = Permission.MONEY_P2F.node;
|
||||
|
||||
|
||||
senderMustBePlayer = false;
|
||||
senderMustBePlayer = false;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = false;
|
||||
|
||||
@@ -23,7 +23,7 @@ public class CmdMoneyWithdraw extends FCommand {
|
||||
this.permission = Permission.MONEY_WITHDRAW.node;
|
||||
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = false;
|
||||
|
||||
@@ -17,7 +17,7 @@ public class CmdNear extends FCommand {
|
||||
this.disableOnLock = true;
|
||||
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = true;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = false;
|
||||
|
||||
@@ -19,7 +19,7 @@ public class CmdOpen extends FCommand {
|
||||
this.disableOnLock = false;
|
||||
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = true;
|
||||
|
||||
@@ -20,7 +20,7 @@ public class CmdOwnerList extends FCommand {
|
||||
this.disableOnLock = false;
|
||||
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = false;
|
||||
|
||||
@@ -26,9 +26,9 @@ public class CmdReload extends FCommand {
|
||||
public void perform() {
|
||||
long timeInitStart = System.currentTimeMillis();
|
||||
Conf.load();
|
||||
Conf.save();
|
||||
SavageFactions.plugin.reloadConfig();
|
||||
SavageFactions.plugin.changeItemIDSInConfig();
|
||||
Conf.save();
|
||||
SavageFactions.plugin.reloadConfig();
|
||||
SavageFactions.plugin.changeItemIDSInConfig();
|
||||
SavageFactions.plugin.loadLang();
|
||||
int version = Integer.parseInt(ReflectionUtils.PackageType.getServerVersion().split("_")[1]);
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ public class CmdSeeChunk extends FCommand {
|
||||
private boolean useParticles;
|
||||
private int length;
|
||||
private ParticleEffect effect;
|
||||
private int taskID = - 1;
|
||||
private int taskID = -1;
|
||||
|
||||
|
||||
//I remade it cause of people getting mad that I had the same seechunk as drtshock
|
||||
@@ -61,10 +61,10 @@ public class CmdSeeChunk extends FCommand {
|
||||
}
|
||||
|
||||
private void manageTask() {
|
||||
if (taskID != - 1) {
|
||||
if (taskID != -1) {
|
||||
if (seeChunkMap.keySet().size() == 0) {
|
||||
Bukkit.getScheduler().cancelTask(taskID);
|
||||
taskID = - 1;
|
||||
taskID = -1;
|
||||
}
|
||||
} else {
|
||||
startTask();
|
||||
|
||||
@@ -20,7 +20,7 @@ public class CmdSetDefaultRole extends FCommand {
|
||||
senderMustBeColeader = false;
|
||||
|
||||
|
||||
this.permission = Permission.DEFAULTRANK.node;
|
||||
this.permission = Permission.DEFAULTRANK.node;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -24,7 +24,7 @@ public class CmdSetFWarp extends FCommand {
|
||||
this.senderMustBeMember = true;
|
||||
this.senderMustBeModerator = false;
|
||||
|
||||
this.senderMustBePlayer = true;
|
||||
this.senderMustBePlayer = true;
|
||||
|
||||
this.permission = Permission.SETWARP.node;
|
||||
}
|
||||
@@ -45,7 +45,7 @@ public class CmdSetFWarp extends FCommand {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
String warp = argAsString(0);
|
||||
|
||||
// Checks if warp with same name already exists and ignores maxWarp check if it does.
|
||||
|
||||
@@ -28,7 +28,7 @@ public class CmdSetMaxVaults extends FCommand {
|
||||
@Override
|
||||
public void perform() {
|
||||
Faction targetFaction = argAsFaction(0);
|
||||
int value = argAsInt(1, - 1);
|
||||
int value = argAsInt(1, -1);
|
||||
if (value < 0) {
|
||||
sender.sendMessage(ChatColor.RED + "Number must be greater than 0.");
|
||||
return;
|
||||
|
||||
@@ -49,7 +49,7 @@ public class CmdShow extends FCommand {
|
||||
Faction faction = myFaction;
|
||||
if (this.argIsSet(0))
|
||||
faction = this.argAsFaction(0);
|
||||
|
||||
|
||||
if (faction == null)
|
||||
return;
|
||||
|
||||
@@ -94,7 +94,7 @@ public class CmdShow extends FCommand {
|
||||
List<FancyMessage> fancy = TagUtil.parseFancy(faction, fme, parsed);
|
||||
if (fancy != null)
|
||||
sendFancyMessage(fancy);
|
||||
|
||||
|
||||
continue;
|
||||
}
|
||||
if (!parsed.contains("{notFrozen}") && !parsed.contains("{notPermanent}")) {
|
||||
|
||||
@@ -21,7 +21,6 @@ public class CmdShowClaims extends FCommand {
|
||||
this.senderMustBePlayer = true;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -35,7 +34,7 @@ public class CmdShowClaims extends FCommand {
|
||||
for (String world : chunkMap.keySet()) {
|
||||
String message = TL.COMMAND_SHOWCLAIMS_FORMAT.toString().replace("{world}", world);
|
||||
sendMessage(message.replace("{chunks}", "")); // made {chunks} blank as I removed the placeholder and people wont update their config :shrug:
|
||||
StringBuilder chunks = new StringBuilder();
|
||||
StringBuilder chunks = new StringBuilder();
|
||||
for (String chunkString : chunkMap.get(world)) {
|
||||
chunks.append(chunkString + ", ");
|
||||
if (chunks.toString().length() >= 2000) {
|
||||
|
||||
@@ -30,7 +30,7 @@ public class CmdStatus extends FCommand {
|
||||
for (FPlayer fp : myFaction.getFPlayers()) {
|
||||
String humanized = DurationFormatUtils.formatDurationWords(System.currentTimeMillis() - fp.getLastLoginTime(), true, true) + TL.COMMAND_STATUS_AGOSUFFIX;
|
||||
String last = fp.isOnline() ? ChatColor.GREEN + TL.COMMAND_STATUS_ONLINE.toString() : (System.currentTimeMillis() - fp.getLastLoginTime() < 432000000 ? ChatColor.YELLOW + humanized : ChatColor.RED + humanized);
|
||||
String power = ChatColor.YELLOW + String.valueOf(fp.getPowerRounded()) + " / " + fp.getPowerMaxRounded() + ChatColor.RESET;
|
||||
String power = ChatColor.YELLOW + String.valueOf(fp.getPowerRounded()) + " / " + fp.getPowerMaxRounded() + ChatColor.RESET;
|
||||
ret.add(String.format(TL.COMMAND_STATUS_FORMAT.toString(), ChatColor.GOLD + fp.getRole().getPrefix() + fp.getName() + ChatColor.RESET, power, last).trim());
|
||||
}
|
||||
fme.sendMessage(ret);
|
||||
|
||||
@@ -99,7 +99,7 @@ public class CmdTnt extends FCommand {
|
||||
return;
|
||||
}
|
||||
if (fme.getFaction().getTnt() < amount) {
|
||||
fme.msg(TL.COMMAND_TNT_WIDTHDRAW_NOTENOUGH);
|
||||
fme.msg(TL.COMMAND_TNT_WIDTHDRAW_NOTENOUGH.toString());
|
||||
return;
|
||||
}
|
||||
int fullStacks = amount / 64;
|
||||
|
||||
@@ -55,7 +55,7 @@ public class CmdTntFill extends FCommand {
|
||||
fme.msg(TL.COMMAND_TNTFILL_AMOUNTMAX.toString().replace("{max}", SavageFactions.plugin.getConfig().getInt("Tntfill.max-amount") + ""));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
Integer.parseInt(args.get(1));
|
||||
} catch (NumberFormatException e) {
|
||||
|
||||
@@ -34,7 +34,7 @@ public class CmdTop extends FCommand {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public void perform() {
|
||||
// Can sort by: money, members, online, allies, enemies, power, land.
|
||||
// Get all Factions and remove non player ones.
|
||||
@@ -55,7 +55,7 @@ public class CmdTop extends FCommand {
|
||||
if (f1Size < f2Size) {
|
||||
return 1;
|
||||
} else if (f1Size > f2Size) {
|
||||
return - 1;
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -70,7 +70,7 @@ public class CmdTop extends FCommand {
|
||||
if (f1start > f2start) {
|
||||
return 1;
|
||||
} else if (f1start < f2start) {
|
||||
return - 1;
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -84,7 +84,7 @@ public class CmdTop extends FCommand {
|
||||
if (f1Size < f2Size) {
|
||||
return 1;
|
||||
} else if (f1Size > f2Size) {
|
||||
return - 1;
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -98,7 +98,7 @@ public class CmdTop extends FCommand {
|
||||
if (f1Size < f2Size) {
|
||||
return 1;
|
||||
} else if (f1Size > f2Size) {
|
||||
return - 1;
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -112,7 +112,7 @@ public class CmdTop extends FCommand {
|
||||
if (f1Size < f2Size) {
|
||||
return 1;
|
||||
} else if (f1Size > f2Size) {
|
||||
return - 1;
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -133,7 +133,7 @@ public class CmdTop extends FCommand {
|
||||
if (f1Size < f2Size) {
|
||||
return 1;
|
||||
} else if (f1Size > f2Size) {
|
||||
return - 1;
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ public class CmdUnban extends FCommand {
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
|
||||
senderMustBeAdmin = false;
|
||||
senderMustBeAdmin = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -45,10 +45,9 @@ public abstract class FCommand extends MCommand<SavageFactions> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCommandSender(CommandSender sender)
|
||||
{
|
||||
super.setCommandSender(sender);
|
||||
if (sender instanceof Player) {
|
||||
public void setCommandSender(CommandSender sender) {
|
||||
super.setCommandSender(sender);
|
||||
if (sender instanceof Player) {
|
||||
this.fme = FPlayers.getInstance().getByPlayer((Player) sender);
|
||||
this.myFaction = this.fme.getFaction();
|
||||
} else {
|
||||
@@ -56,7 +55,7 @@ public abstract class FCommand extends MCommand<SavageFactions> {
|
||||
this.myFaction = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, List<String> args, List<MCommand<?>> commandChain) {
|
||||
setCommandSender(sender);
|
||||
@@ -312,9 +311,9 @@ public abstract class FCommand extends MCommand<SavageFactions> {
|
||||
}
|
||||
|
||||
if (Conf.bankEnabled && Conf.bankFactionPaysCosts && fme.hasFaction()) {
|
||||
return Econ.modifyMoney(myFaction, - cost, toDoThis, forDoingThis);
|
||||
return Econ.modifyMoney(myFaction, -cost, toDoThis, forDoingThis);
|
||||
} else {
|
||||
return Econ.modifyMoney(fme, - cost, toDoThis, forDoingThis);
|
||||
return Econ.modifyMoney(fme, -cost, toDoThis, forDoingThis);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ public class FPromoteCommand extends FCommand {
|
||||
}
|
||||
|
||||
Role current = target.getRole();
|
||||
Role promotion = Role.getRelative(current, + relative);
|
||||
Role promotion = Role.getRelative(current, +relative);
|
||||
|
||||
// Now it ain't that messy
|
||||
if (!fme.isAdminBypassing()) {
|
||||
|
||||
@@ -103,9 +103,9 @@ public abstract class FRelationCommand extends FCommand {
|
||||
}
|
||||
|
||||
private boolean hasMaxRelations(Faction them, Relation targetRelation) {
|
||||
int max = SavageFactions.plugin.getConfig().getInt("max-relations." + targetRelation.toString(), - 1);
|
||||
int max = SavageFactions.plugin.getConfig().getInt("max-relations." + targetRelation.toString(), -1);
|
||||
if (SavageFactions.plugin.getConfig().getBoolean("max-relations.enabled", false)) {
|
||||
if (max != - 1) {
|
||||
if (max != -1) {
|
||||
if (myFaction.getRelationCount(targetRelation) >= max) {
|
||||
msg(TL.COMMAND_RELATIONS_EXCEEDS_ME, max, targetRelation.getPluralTranslation());
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user