Main Class Renamed and Instance Method
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.SaberFactions;
|
||||
import com.massivecraft.factions.P;
|
||||
import com.massivecraft.factions.zcore.CommandVisibility;
|
||||
import com.massivecraft.factions.zcore.MCommand;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class CmdAutoHelp extends MCommand<SaberFactions> {
|
||||
public class CmdAutoHelp extends MCommand<P> {
|
||||
|
||||
public CmdAutoHelp() {
|
||||
super(SaberFactions.plugin);
|
||||
super(P.p);
|
||||
this.aliases.add("?");
|
||||
this.aliases.add("h");
|
||||
this.aliases.add("help");
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.FPlayer;
|
||||
import com.massivecraft.factions.SaberFactions;
|
||||
import com.massivecraft.factions.P;
|
||||
import com.massivecraft.factions.event.FPlayerLeaveEvent;
|
||||
import com.massivecraft.factions.struct.BanInfo;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
@@ -81,7 +81,7 @@ public class CmdBan extends FCommand {
|
||||
|
||||
if (event.isCancelled()) {
|
||||
// if someone cancels a ban, we'll get people complaining here. So lets log it.
|
||||
SaberFactions.plugin.log(Level.WARNING, "Attempted to ban {0} but someone cancelled the kick event. This isn't good.", target.getName());
|
||||
P.p.log(Level.WARNING, "Attempted to ban {0} but someone cancelled the kick event. This isn't good.", target.getName());
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.FPlayer;
|
||||
import com.massivecraft.factions.SaberFactions;
|
||||
import com.massivecraft.factions.P;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.util.XMaterial;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
@@ -33,28 +33,28 @@ public class CmdBanner extends FCommand {
|
||||
|
||||
@Override
|
||||
public void perform() {
|
||||
if (!SaberFactions.plugin.getConfig().getBoolean("fbanners.Enabled")) {
|
||||
if (!P.p.getConfig().getBoolean("fbanners.Enabled")) {
|
||||
msg(TL.COMMAND_BANNER_DISABLED);
|
||||
return;
|
||||
}
|
||||
if (!fme.hasMoney(SaberFactions.plugin.getConfig().getInt("fbanners.Banner-Cost", 5000))) {
|
||||
if (!fme.hasMoney(P.p.getConfig().getInt("fbanners.Banner-Cost", 5000))) {
|
||||
msg(TL.COMMAND_BANNER_NOTENOUGHMONEY);
|
||||
return;
|
||||
}
|
||||
takeMoney(fme, SaberFactions.plugin.getConfig().getInt("fbanners.Banner-Cost", 5000));
|
||||
takeMoney(fme, P.p.getConfig().getInt("fbanners.Banner-Cost", 5000));
|
||||
|
||||
//ItemStack warBanner = SaberFactions.plugin.createItem(Material.BANNER, 1, (short) 1, SaberFactions.plugin.getConfig().getString("fbanners.Item.Name"), SaberFactions.plugin.getConfig().getStringList("fbanners.Item.Lore"));
|
||||
//ItemStack warBanner = P.p.createItem(Material.BANNER, 1, (short) 1, P.p.getConfig().getString("fbanners.Item.Name"), P.p.getConfig().getStringList("fbanners.Item.Lore"));
|
||||
//BannerMeta bannerMeta = (BannerMeta) warBanner.getItemMeta();
|
||||
ItemStack warBanner = fme.getFaction().getBanner();
|
||||
if (warBanner != null) {
|
||||
ItemMeta warmeta = warBanner.getItemMeta();
|
||||
warmeta.setDisplayName(SaberFactions.plugin.color(SaberFactions.plugin.getConfig().getString("fbanners.Item.Name")));
|
||||
warmeta.setLore(SaberFactions.plugin.colorList(SaberFactions.plugin.getConfig().getStringList("fbanners.Item.Lore")));
|
||||
warmeta.setDisplayName(P.p.color(P.p.getConfig().getString("fbanners.Item.Name")));
|
||||
warmeta.setLore(P.p.colorList(P.p.getConfig().getStringList("fbanners.Item.Lore")));
|
||||
warBanner.setItemMeta(warmeta);
|
||||
|
||||
|
||||
} else {
|
||||
warBanner = SaberFactions.plugin.createItem(XMaterial.BLACK_BANNER.parseMaterial(), 1, (short) 1, SaberFactions.plugin.getConfig().getString("fbanners.Item.Name"), SaberFactions.plugin.getConfig().getStringList("fbanners.Item.Lore"));
|
||||
warBanner = P.p.createItem(XMaterial.BLACK_BANNER.parseMaterial(), 1, (short) 1, P.p.getConfig().getString("fbanners.Item.Name"), P.p.getConfig().getStringList("fbanners.Item.Lore"));
|
||||
}
|
||||
fme.msg(TL.COMMAND_BANNER_SUCCESS);
|
||||
warBanner.setAmount(1);
|
||||
@@ -63,7 +63,7 @@ public class CmdBanner extends FCommand {
|
||||
|
||||
|
||||
public boolean hasMoney(FPlayer fme, int amt) {
|
||||
Economy econ = SaberFactions.plugin.getEcon();
|
||||
Economy econ = P.p.getEcon();
|
||||
if (econ.getBalance(fme.getPlayer()) >= amt) {
|
||||
return true;
|
||||
} else {
|
||||
@@ -74,7 +74,7 @@ public class CmdBanner extends FCommand {
|
||||
|
||||
public void takeMoney(FPlayer fme, int amt) {
|
||||
if (hasMoney(fme, amt)) {
|
||||
Economy econ = SaberFactions.plugin.getEcon();
|
||||
Economy econ = P.p.getEcon();
|
||||
econ.withdrawPlayer(fme.getPlayer(), amt);
|
||||
fme.sendMessage(TL.COMMAND_BANNER_MONEYTAKE.toString().replace("{amount}", amt + ""));
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.SaberFactions;
|
||||
import com.massivecraft.factions.P;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
|
||||
@@ -30,10 +30,10 @@ public class CmdBypass extends FCommand {
|
||||
// TODO: Move this to a transient field in the model??
|
||||
if (fme.isAdminBypassing()) {
|
||||
fme.msg(TL.COMMAND_BYPASS_ENABLE.toString());
|
||||
SaberFactions.plugin.log(fme.getName() + TL.COMMAND_BYPASS_ENABLELOG.toString());
|
||||
P.p.log(fme.getName() + TL.COMMAND_BYPASS_ENABLELOG.toString());
|
||||
} else {
|
||||
fme.msg(TL.COMMAND_BYPASS_DISABLE.toString());
|
||||
SaberFactions.plugin.log(fme.getName() + TL.COMMAND_BYPASS_DISABLELOG.toString());
|
||||
P.p.log(fme.getName() + TL.COMMAND_BYPASS_DISABLELOG.toString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.SaberFactions;
|
||||
import com.massivecraft.factions.P;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
|
||||
@@ -28,10 +28,10 @@ public class CmdChatSpy extends FCommand {
|
||||
|
||||
if (fme.isSpyingChat()) {
|
||||
fme.msg(TL.COMMAND_CHATSPY_ENABLE);
|
||||
SaberFactions.plugin.log(fme.getName() + TL.COMMAND_CHATSPY_ENABLELOG.toString());
|
||||
P.p.log(fme.getName() + TL.COMMAND_CHATSPY_ENABLELOG.toString());
|
||||
} else {
|
||||
fme.msg(TL.COMMAND_CHATSPY_DISABLE);
|
||||
SaberFactions.plugin.log(fme.getName() + TL.COMMAND_CHATSPY_DISABLELOG.toString());
|
||||
P.p.log(fme.getName() + TL.COMMAND_CHATSPY_DISABLELOG.toString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ public class CmdCheckpoint extends FCommand {
|
||||
|
||||
@Override
|
||||
public void perform() {
|
||||
if (!SaberFactions.plugin.getConfig().getBoolean("checkpoints.Enabled")) {
|
||||
if (!P.p.getConfig().getBoolean("checkpoints.Enabled")) {
|
||||
fme.msg(TL.COMMAND_CHECKPOINT_DISABLED);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.SaberFactions;
|
||||
import com.massivecraft.factions.P;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.struct.Role;
|
||||
import com.massivecraft.factions.zcore.fperms.Access;
|
||||
@@ -30,7 +30,7 @@ public class CmdChest extends FCommand {
|
||||
public void perform() {
|
||||
|
||||
|
||||
if (!SaberFactions.plugin.getConfig().getBoolean("fchest.Enabled")) {
|
||||
if (!P.p.getConfig().getBoolean("fchest.Enabled")) {
|
||||
fme.sendMessage("This command is disabled!");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.SaberFactions;
|
||||
import com.massivecraft.factions.P;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
import org.bukkit.ChatColor;
|
||||
@@ -231,10 +231,10 @@ public class CmdConfig extends FCommand {
|
||||
if (!success.isEmpty()) {
|
||||
if (sender instanceof Player) {
|
||||
sendMessage(success);
|
||||
SaberFactions.plugin.log(success + TL.COMMAND_CONFIG_LOG.format((Player) sender));
|
||||
} else // using SaberFactions.plugin.log() instead of sendMessage if run from server console so that "[Factions v#.#.#]" is prepended in server log
|
||||
P.p.log(success + TL.COMMAND_CONFIG_LOG.format((Player) sender));
|
||||
} else // using P.p.log() instead of sendMessage if run from server console so that "[Factions v#.#.#]" is prepended in server log
|
||||
{
|
||||
SaberFactions.plugin.log(success);
|
||||
P.p.log(success);
|
||||
}
|
||||
}
|
||||
// save change to disk
|
||||
|
||||
@@ -97,7 +97,7 @@ public class CmdCreate extends FCommand {
|
||||
// That way we don't have to mess up deleting more stuff.
|
||||
// And prevent the user from being returned to NORMAL after deleting his old faction.
|
||||
fme.setRole(Role.LEADER);
|
||||
if (SaberFactions.plugin.getConfig().getBoolean("faction-creation-broadcast", true)) {
|
||||
if (P.p.getConfig().getBoolean("faction-creation-broadcast", true)) {
|
||||
for (FPlayer follower : FPlayers.getInstance().getOnlinePlayers()) {
|
||||
follower.msg(TL.COMMAND_CREATE_CREATED, fme.describeTo(follower, true), faction.getTag(follower));
|
||||
}
|
||||
@@ -110,16 +110,16 @@ public class CmdCreate extends FCommand {
|
||||
|
||||
|
||||
if (Conf.logFactionCreate)
|
||||
SaberFactions.plugin.log(fme.getName() + TL.COMMAND_CREATE_CREATEDLOG.toString() + tag);
|
||||
P.p.log(fme.getName() + TL.COMMAND_CREATE_CREATEDLOG.toString() + tag);
|
||||
|
||||
if (SaberFactions.plugin.getConfig().getBoolean("fpaypal.Enabled"))
|
||||
if (P.p.getConfig().getBoolean("fpaypal.Enabled"))
|
||||
this.fme.msg(TL.COMMAND_PAYPALSET_CREATED);
|
||||
|
||||
if (Conf.useCustomDefaultPermissions) faction.setDefaultPerms();
|
||||
if (Conf.usePermissionHints) fme.msg(TL.COMMAND_HINT_PERMISSION);
|
||||
|
||||
|
||||
fme.setCooldown("create", System.currentTimeMillis() + (SaberFactions.plugin.getConfig().getInt("fcooldowns.f-create") * 1000));
|
||||
fme.setCooldown("create", System.currentTimeMillis() + (P.p.getConfig().getInt("fcooldowns.f-create") * 1000));
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.FPlayer;
|
||||
import com.massivecraft.factions.SaberFactions;
|
||||
import com.massivecraft.factions.P;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
|
||||
@@ -35,7 +35,7 @@ public class CmdDelFWarp extends FCommand {
|
||||
}
|
||||
|
||||
private boolean transact(FPlayer player) {
|
||||
return !SaberFactions.plugin.getConfig().getBoolean("warp-cost.enabled", false) || player.isAdminBypassing() || payForCommand(SaberFactions.plugin.getConfig().getDouble("warp-cost.delwarp", 5), TL.COMMAND_DELFWARP_TODELETE.toString(), TL.COMMAND_DELFWARP_FORDELETE.toString());
|
||||
return !P.p.getConfig().getBoolean("warp-cost.enabled", false) || player.isAdminBypassing() || payForCommand(P.p.getConfig().getDouble("warp-cost.delwarp", 5), TL.COMMAND_DELFWARP_TODELETE.toString(), TL.COMMAND_DELFWARP_FORDELETE.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -87,15 +87,15 @@ public class CmdDisband extends FCommand {
|
||||
if ((fme!= null && !disbandMap.containsKey(me.getUniqueId().toString())) && faction.getTnt() > 0) {
|
||||
msg(TL.COMMAND_DISBAND_CONFIRM.toString().replace("{tnt}", faction.getTnt() + ""));
|
||||
disbandMap.put(me.getUniqueId().toString(), faction.getId());
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(SaberFactions.plugin, () -> disbandMap.remove(me.getUniqueId().toString()), 200L);
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(P.p, () -> disbandMap.remove(me.getUniqueId().toString()), 200L);
|
||||
} else if (faction.getId().equals(disbandMap.get(me.getUniqueId().toString())) || faction.getTnt() == 0) {
|
||||
if (SaberFactions.plugin.getConfig().getBoolean("faction-disband-broadcast", true)) {
|
||||
if (P.p.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);
|
||||
fme.setCooldown("disband", System.currentTimeMillis() + (SaberFactions.plugin.getConfig().getInt("fcooldowns.f-disband") * 1000));
|
||||
fme.setCooldown("disband", System.currentTimeMillis() + (P.p.getConfig().getInt("fcooldowns.f-disband") * 1000));
|
||||
} else {
|
||||
follower.msg(TL.COMMAND_DISBAND_BROADCAST_NOTYOURS, amountString, faction.getTag(follower));
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.FPlayer;
|
||||
import com.massivecraft.factions.SaberFactions;
|
||||
import com.massivecraft.factions.P;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.struct.Role;
|
||||
import com.massivecraft.factions.util.WarmUpUtil;
|
||||
@@ -80,7 +80,7 @@ public class CmdFWarp extends FCommand {
|
||||
}
|
||||
|
||||
private boolean transact(FPlayer player) {
|
||||
return !SaberFactions.plugin.getConfig().getBoolean("warp-cost.enabled", false) || player.isAdminBypassing() || payForCommand(SaberFactions.plugin.getConfig().getDouble("warp-cost.warp", 5), TL.COMMAND_FWARP_TOWARP.toString(), TL.COMMAND_FWARP_FORWARPING.toString());
|
||||
return !P.p.getConfig().getBoolean("warp-cost.enabled", false) || player.isAdminBypassing() || payForCommand(P.p.getConfig().getDouble("warp-cost.warp", 5), TL.COMMAND_FWARP_TOWARP.toString(), TL.COMMAND_FWARP_FORWARPING.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -39,11 +39,11 @@ public class CmdFly extends FCommand {
|
||||
|
||||
public static void startParticles() {
|
||||
// Just a secondary check.
|
||||
if (!SaberFactions.plugin.getConfig().getBoolean("ffly.Particles.Enabled")) {
|
||||
if (!P.p.getConfig().getBoolean("ffly.Particles.Enabled")) {
|
||||
return;
|
||||
}
|
||||
|
||||
id = Bukkit.getScheduler().scheduleSyncRepeatingTask(SaberFactions.plugin, () -> {
|
||||
id = Bukkit.getScheduler().scheduleSyncRepeatingTask(P.p, () -> {
|
||||
for (String name : flyMap.keySet()) {
|
||||
Player player = Bukkit.getPlayer(name);
|
||||
if (player == null) {
|
||||
@@ -52,7 +52,7 @@ public class CmdFly extends FCommand {
|
||||
if (!player.isFlying()) {
|
||||
continue;
|
||||
}
|
||||
if (!SaberFactions.plugin.mc17) {
|
||||
if (!P.p.mc17) {
|
||||
if (player.getGameMode() == GameMode.SPECTATOR) {
|
||||
continue;
|
||||
}
|
||||
@@ -61,12 +61,12 @@ public class CmdFly extends FCommand {
|
||||
if (FPlayers.getInstance().getByPlayer(player).isVanished()) {
|
||||
// Actually, vanished players (such as admins) should not display particles to prevent others from knowing their vanished assistance for moderation.
|
||||
// But we can keep it as a config.
|
||||
if (SaberFactions.plugin.getConfig().getBoolean("ffly.Particles.Enable-While-Vanished")) {
|
||||
if (P.p.getConfig().getBoolean("ffly.Particles.Enable-While-Vanished")) {
|
||||
return;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (SaberFactions.plugin.useNonPacketParticles) {
|
||||
if (P.p.useNonPacketParticles) {
|
||||
// 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
|
||||
@@ -84,7 +84,7 @@ public class CmdFly extends FCommand {
|
||||
}
|
||||
|
||||
public static void startFlyCheck() {
|
||||
flyid = Bukkit.getScheduler().scheduleSyncRepeatingTask(SaberFactions.plugin, () -> { //threw the exception for now, until I recode fly :( Cringe.
|
||||
flyid = Bukkit.getScheduler().scheduleSyncRepeatingTask(P.p, () -> { //threw the exception for now, until I recode fly :( Cringe.
|
||||
checkTaskState();
|
||||
if (flyMap.keySet().size() != 0) {
|
||||
for (String name : flyMap.keySet()) {
|
||||
@@ -95,7 +95,7 @@ public class CmdFly extends FCommand {
|
||||
if (player == null
|
||||
|| !player.isFlying()
|
||||
|| player.getGameMode() == GameMode.CREATIVE
|
||||
|| !SaberFactions.plugin.mc17 && player.getGameMode() == GameMode.SPECTATOR) {
|
||||
|| !P.p.mc17 && player.getGameMode() == GameMode.SPECTATOR) {
|
||||
continue;
|
||||
}
|
||||
FPlayer fPlayer = FPlayers.getInstance().getByPlayer(player);
|
||||
@@ -171,7 +171,7 @@ public class CmdFly extends FCommand {
|
||||
@Override
|
||||
public void perform() {
|
||||
// Disabled by default.
|
||||
if (!SaberFactions.plugin.getConfig().getBoolean("enable-faction-flight", false)) {
|
||||
if (!P.p.getConfig().getBoolean("enable-faction-flight", false)) {
|
||||
fme.msg(TL.COMMAND_FLY_DISABLED);
|
||||
return;
|
||||
}
|
||||
@@ -212,7 +212,7 @@ public class CmdFly extends FCommand {
|
||||
fme.setFlying(true);
|
||||
flyMap.put(player.getName(), true);
|
||||
if (id == -1) {
|
||||
if (SaberFactions.plugin.getConfig().getBoolean("ffly.Particles.Enabled")) {
|
||||
if (P.p.getConfig().getBoolean("ffly.Particles.Enabled")) {
|
||||
startParticles();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.FPlayer;
|
||||
import com.massivecraft.factions.SaberFactions;
|
||||
import com.massivecraft.factions.P;
|
||||
import com.massivecraft.factions.scoreboards.FTeamWrapper;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
@@ -24,7 +24,7 @@ public class CmdFocus
|
||||
}
|
||||
|
||||
public void perform() {
|
||||
if (!SaberFactions.plugin.getConfig().getBoolean("ffocus.Enabled")) {
|
||||
if (!P.p.getConfig().getBoolean("ffocus.Enabled")) {
|
||||
fme.msg(TL.GENERIC_DISABLED);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.SaberFactions;
|
||||
import com.massivecraft.factions.P;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
import org.bukkit.Location;
|
||||
@@ -27,12 +27,12 @@ public class CmdGetVault extends FCommand {
|
||||
|
||||
@Override
|
||||
public void perform() {
|
||||
if (!SaberFactions.plugin.getConfig().getBoolean("fvault.Enabled")) {
|
||||
if (!P.p.getConfig().getBoolean("fvault.Enabled")) {
|
||||
fme.sendMessage("This command is disabled!");
|
||||
return;
|
||||
}
|
||||
Location vaultLocation = fme.getFaction().getVault();
|
||||
ItemStack vault = SaberFactions.plugin.createItem(Material.CHEST, 1, (short) 0, SaberFactions.plugin.color(SaberFactions.plugin.getConfig().getString("fvault.Item.Name")), SaberFactions.plugin.colorList(SaberFactions.plugin.getConfig().getStringList("fvault.Item.Lore")));
|
||||
ItemStack vault = P.p.createItem(Material.CHEST, 1, (short) 0, P.p.color(P.p.getConfig().getString("fvault.Item.Name")), P.p.colorList(P.p.getConfig().getStringList("fvault.Item.Lore")));
|
||||
|
||||
|
||||
//check if vault is set
|
||||
@@ -43,7 +43,7 @@ public class CmdGetVault extends FCommand {
|
||||
|
||||
|
||||
//has enough money?
|
||||
int amount = SaberFactions.plugin.getConfig().getInt("fvault.Price");
|
||||
int amount = P.p.getConfig().getInt("fvault.Price");
|
||||
if (!fme.hasMoney(amount)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.SaberFactions;
|
||||
import com.massivecraft.factions.P;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
|
||||
@@ -24,7 +24,7 @@ public class CmdGrace extends FCommand {
|
||||
|
||||
@Override
|
||||
public void perform() {
|
||||
if (!SaberFactions.plugin.getConfig().getBoolean("f-grace.Enabled")) {
|
||||
if (!P.p.getConfig().getBoolean("f-grace.Enabled")) {
|
||||
fme.msg(TL.GENERIC_DISABLED);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.SaberFactions;
|
||||
import com.massivecraft.factions.P;
|
||||
import com.massivecraft.factions.integration.Econ;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
@@ -40,7 +40,7 @@ public class CmdHelp extends FCommand {
|
||||
|
||||
@Override
|
||||
public void perform() {
|
||||
if (SaberFactions.plugin.getConfig().getBoolean("use-old-help", true)) {
|
||||
if (P.p.getConfig().getBoolean("use-old-help", true)) {
|
||||
if (helpPages == null) {
|
||||
updateHelp();
|
||||
}
|
||||
@@ -57,9 +57,9 @@ public class CmdHelp extends FCommand {
|
||||
sendMessage(helpPages.get(page));
|
||||
return;
|
||||
}
|
||||
ConfigurationSection help = SaberFactions.plugin.getConfig().getConfigurationSection("help");
|
||||
ConfigurationSection help = P.p.getConfig().getConfigurationSection("help");
|
||||
if (help == null) {
|
||||
help = SaberFactions.plugin.getConfig().createSection("help"); // create new help section
|
||||
help = P.p.getConfig().createSection("help"); // create new help section
|
||||
List<String> error = new ArrayList<>();
|
||||
error.add("&cUpdate help messages in config.yml!");
|
||||
error.add("&cSet use-old-help for legacy help messages");
|
||||
@@ -72,7 +72,7 @@ public class CmdHelp extends FCommand {
|
||||
return;
|
||||
}
|
||||
for (String helpLine : page) {
|
||||
sendMessage(SaberFactions.plugin.txt.parse(helpLine));
|
||||
sendMessage(P.p.txt.parse(helpLine));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -189,7 +189,7 @@ public class CmdHelp extends FCommand {
|
||||
pageLines.add(p.cmdBase.cmdSafeunclaimall.getUseageTemplate(true));
|
||||
pageLines.add(p.cmdBase.cmdWarunclaimall.getUseageTemplate(true));
|
||||
//TODO:TL
|
||||
pageLines.add(p.txt.parse("<i>Note: " + p.cmdBase.cmdUnclaim.getUseageTemplate(false) + SaberFactions.plugin.txt.parse("<i>") + " works on safe/war zones as well."));
|
||||
pageLines.add(p.txt.parse("<i>Note: " + p.cmdBase.cmdUnclaim.getUseageTemplate(false) + P.p.txt.parse("<i>") + " works on safe/war zones as well."));
|
||||
pageLines.add(p.cmdBase.cmdPeaceful.getUseageTemplate(true));
|
||||
helpPages.add(pageLines);
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.FPlayer;
|
||||
import com.massivecraft.factions.SaberFactions;
|
||||
import com.massivecraft.factions.P;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.struct.Role;
|
||||
import com.massivecraft.factions.zcore.fperms.Access;
|
||||
@@ -37,7 +37,7 @@ public class CmdInventorySee extends FCommand {
|
||||
|
||||
@Override
|
||||
public void perform() {
|
||||
if (SaberFactions.plugin.getConfig().getBoolean("f-inventory-see.Enabled")) {
|
||||
if (P.p.getConfig().getBoolean("f-inventory-see.Enabled")) {
|
||||
fme.msg(TL.GENERIC_DISABLED);
|
||||
}
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ public class CmdJoin extends FCommand {
|
||||
if (level == 0) {
|
||||
limit = Conf.factionMemberLimit;
|
||||
} else {
|
||||
limit = SaberFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Members.Members-Limit.level-" + level);
|
||||
limit = P.p.getConfig().getInt("fupgrades.MainMenu.Members.Members-Limit.level-" + level);
|
||||
}
|
||||
|
||||
if (limit > 0 && faction.getFPlayers().size() >= limit && !faction.altInvited(fme)) {
|
||||
@@ -145,9 +145,9 @@ public class CmdJoin extends FCommand {
|
||||
|
||||
if (Conf.logFactionJoin) {
|
||||
if (samePlayer) {
|
||||
SaberFactions.plugin.log(TL.COMMAND_JOIN_JOINEDLOG.toString(), fplayer.getName(), faction.getTag());
|
||||
P.p.log(TL.COMMAND_JOIN_JOINEDLOG.toString(), fplayer.getName(), faction.getTag());
|
||||
} else {
|
||||
SaberFactions.plugin.log(TL.COMMAND_JOIN_MOVEDLOG.toString(), fme.getName(), fplayer.getName(), faction.getTag());
|
||||
P.p.log(TL.COMMAND_JOIN_MOVEDLOG.toString(), fme.getName(), fplayer.getName(), faction.getTag());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.massivecraft.factions.cmd;
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.FPlayer;
|
||||
import com.massivecraft.factions.Faction;
|
||||
import com.massivecraft.factions.SaberFactions;
|
||||
import com.massivecraft.factions.P;
|
||||
import com.massivecraft.factions.event.FPlayerLeaveEvent;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.struct.Role;
|
||||
@@ -68,8 +68,8 @@ public class CmdKick extends FCommand {
|
||||
}
|
||||
|
||||
if(toKick.isAlt()){
|
||||
msg(SaberFactions.plugin.color("&cToo few arguments, &eUse like this:"));
|
||||
msg(SaberFactions.plugin.color("&b/f alts,alt kick &3<player name>"));
|
||||
msg(P.p.color("&cToo few arguments, &eUse like this:"));
|
||||
msg(P.p.color("&b/f alts,alt kick &3<player name>"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@ public class CmdKick extends FCommand {
|
||||
fme.msg(TL.COMMAND_KICK_KICKS, toKick.describeTo(fme), toKickFaction.describeTo(fme));
|
||||
}
|
||||
if (Conf.logFactionKick) {
|
||||
SaberFactions.plugin.log((senderIsConsole ? "A console command" : fme.getName()) + " kicked " + toKick.getName() + " from the faction: " + toKickFaction.getTag());
|
||||
P.p.log((senderIsConsole ? "A console command" : fme.getName()) + " kicked " + toKick.getName() + " from the faction: " + toKickFaction.getTag());
|
||||
}
|
||||
if (toKick.getRole() == Role.LEADER) {
|
||||
toKickFaction.promoteNewLeader();
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.massivecraft.factions.cmd;
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.Faction;
|
||||
import com.massivecraft.factions.Factions;
|
||||
import com.massivecraft.factions.SaberFactions;
|
||||
import com.massivecraft.factions.P;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
import com.massivecraft.factions.zcore.util.TagUtil;
|
||||
@@ -51,7 +51,7 @@ public class CmdList extends FCommand {
|
||||
|
||||
// remove exempt factions
|
||||
if (fme != null && fme.getPlayer() != null && !fme.getPlayer().hasPermission("factions.show.bypassexempt")) {
|
||||
List<String> exemptFactions = SaberFactions.plugin.getConfig().getStringList("show-exempt");
|
||||
List<String> exemptFactions = P.p.getConfig().getStringList("show-exempt");
|
||||
|
||||
factionList.removeIf(next -> exemptFactions.contains(next.getTag()));
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.FPlayer;
|
||||
import com.massivecraft.factions.FPlayers;
|
||||
import com.massivecraft.factions.SaberFactions;
|
||||
import com.massivecraft.factions.P;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -26,12 +26,12 @@ public class CmdNear extends FCommand {
|
||||
|
||||
@Override
|
||||
public void perform() {
|
||||
if (!SaberFactions.plugin.getConfig().getBoolean("fnear.Enabled")) {
|
||||
if (!P.p.getConfig().getBoolean("fnear.Enabled")) {
|
||||
fme.msg(TL.COMMAND_NEAR_DISABLED_MSG);
|
||||
return;
|
||||
}
|
||||
|
||||
double range = SaberFactions.plugin.getConfig().getInt("fnear.Radius");
|
||||
double range = P.p.getConfig().getInt("fnear.Radius");
|
||||
String format = TL.COMMAND_NEAR_FORMAT.toString();
|
||||
fme.msg(TL.COMMAND_NEAR_USE_MSG);
|
||||
for (Entity e : me.getNearbyEntities(range, 255, range)) {
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.massivecraft.factions.cmd;
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.FPlayer;
|
||||
import com.massivecraft.factions.FPlayers;
|
||||
import com.massivecraft.factions.SaberFactions;
|
||||
import com.massivecraft.factions.P;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
|
||||
@@ -52,7 +52,7 @@ public class CmdOpen extends FCommand {
|
||||
}
|
||||
fplayer.msg(TL.COMMAND_OPEN_CHANGED, myFaction.getTag(fplayer.getFaction()), open);
|
||||
}
|
||||
fme.setCooldown("open", System.currentTimeMillis() + (SaberFactions.plugin.getConfig().getInt("fcooldowns.f-open") * 1000));
|
||||
fme.setCooldown("open", System.currentTimeMillis() + (P.p.getConfig().getInt("fcooldowns.f-open") * 1000));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.Faction;
|
||||
import com.massivecraft.factions.SaberFactions;
|
||||
import com.massivecraft.factions.P;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
|
||||
@@ -25,7 +25,7 @@ public class CmdPaypalSee extends FCommand {
|
||||
}
|
||||
@Override
|
||||
public void perform() {
|
||||
if (!SaberFactions.plugin.getConfig().getBoolean("fpaypal.Enabled")) {
|
||||
if (!P.p.getConfig().getBoolean("fpaypal.Enabled")) {
|
||||
fme.msg(TL.GENERIC_DISABLED);
|
||||
return;
|
||||
}
|
||||
@@ -50,7 +50,7 @@ public class CmdPaypalSee extends FCommand {
|
||||
msg(TL.GENERIC_NOPERMISSION, "see another factions paypal.");
|
||||
}
|
||||
} else {
|
||||
msg(SaberFactions.plugin.cmdBase.cmdPaypalSee.getUseageTemplate());
|
||||
msg(P.p.cmdBase.cmdPaypalSee.getUseageTemplate());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.Faction;
|
||||
import com.massivecraft.factions.SaberFactions;
|
||||
import com.massivecraft.factions.P;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
|
||||
@@ -27,7 +27,7 @@ public class CmdPaypalSet extends FCommand {
|
||||
|
||||
@Override
|
||||
public void perform() {
|
||||
if (!SaberFactions.plugin.getConfig().getBoolean("fpaypal.Enabled")) {
|
||||
if (!P.p.getConfig().getBoolean("fpaypal.Enabled")) {
|
||||
fme.msg(TL.GENERIC_DISABLED);
|
||||
return;
|
||||
}
|
||||
@@ -54,7 +54,7 @@ public class CmdPaypalSet extends FCommand {
|
||||
msg(TL.GENERIC_NOPERMISSION, "set another factions paypal!");
|
||||
}
|
||||
} else {
|
||||
msg(SaberFactions.plugin.cmdBase.cmdPaypalSet.getUseageTemplate());
|
||||
msg(P.p.cmdBase.cmdPaypalSet.getUseageTemplate());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.SaberFactions;
|
||||
import com.massivecraft.factions.P;
|
||||
import com.massivecraft.factions.struct.Relation;
|
||||
import com.massivecraft.factions.struct.Role;
|
||||
import com.massivecraft.factions.zcore.fperms.Access;
|
||||
@@ -105,7 +105,7 @@ public class CmdPerm extends FCommand {
|
||||
}
|
||||
|
||||
fme.msg(TL.COMMAND_PERM_SET, argAsString(1), access.name(), argAsString(0));
|
||||
SaberFactions.plugin.log(String.format(TL.COMMAND_PERM_SET.toString(), argAsString(1), access.name(), argAsString(0)) + " for faction " + fme.getTag());
|
||||
P.p.log(String.format(TL.COMMAND_PERM_SET.toString(), argAsString(1), access.name(), argAsString(0)) + " for faction " + fme.getTag());
|
||||
}
|
||||
|
||||
private Permissable getPermissable(String name) {
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.massivecraft.factions.cmd;
|
||||
import com.massivecraft.factions.FPlayer;
|
||||
import com.massivecraft.factions.FPlayers;
|
||||
import com.massivecraft.factions.Faction;
|
||||
import com.massivecraft.factions.SaberFactions;
|
||||
import com.massivecraft.factions.P;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
|
||||
@@ -43,7 +43,7 @@ public class CmdPermanent extends FCommand {
|
||||
faction.setPermanent(true);
|
||||
}
|
||||
|
||||
SaberFactions.plugin.log((fme == null ? "A server admin" : fme.getName()) + " " + change + " the faction \"" + faction.getTag() + "\".");
|
||||
P.p.log((fme == null ? "A server admin" : fme.getName()) + " " + change + " the faction \"" + faction.getTag() + "\".");
|
||||
|
||||
// Inform all players
|
||||
for (FPlayer fplayer : FPlayers.getInstance().getOnlinePlayers()) {
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.FPlayer;
|
||||
import com.massivecraft.factions.Faction;
|
||||
import com.massivecraft.factions.SaberFactions;
|
||||
import com.massivecraft.factions.P;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
|
||||
@@ -77,7 +77,7 @@ public class CmdPowerBoost extends FCommand {
|
||||
int roundedPower = (int) Math.round(targetPower);
|
||||
msg(TL.COMMAND_POWERBOOST_BOOST, target, roundedPower);
|
||||
if (!senderIsConsole) {
|
||||
SaberFactions.plugin.log(TL.COMMAND_POWERBOOST_BOOSTLOG.toString(), fme.getName(), target, roundedPower);
|
||||
P.p.log(TL.COMMAND_POWERBOOST_BOOSTLOG.toString(), fme.getName(), target, roundedPower);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.SaberFactions;
|
||||
import com.massivecraft.factions.P;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
|
||||
@@ -26,12 +26,12 @@ public class CmdReload extends FCommand {
|
||||
long timeInitStart = System.currentTimeMillis();
|
||||
Conf.load();
|
||||
Conf.save();
|
||||
SaberFactions.plugin.reloadConfig();
|
||||
SaberFactions.plugin.loadLang();
|
||||
P.p.reloadConfig();
|
||||
P.p.loadLang();
|
||||
|
||||
|
||||
if (SaberFactions.plugin.getConfig().getBoolean("enable-faction-flight")) {
|
||||
SaberFactions.plugin.factionsFlight = true;
|
||||
if (P.p.getConfig().getBoolean("enable-faction-flight")) {
|
||||
P.p.factionsFlight = true;
|
||||
}
|
||||
long timeReload = (System.currentTimeMillis() - timeInitStart);
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.SaberFactions;
|
||||
import com.massivecraft.factions.P;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
|
||||
@@ -29,19 +29,19 @@ public class CmdRules extends FCommand {
|
||||
|
||||
@Override
|
||||
public void perform() {
|
||||
if (!SaberFactions.plugin.getConfig().getBoolean("frules.Enabled")) {
|
||||
if (!P.p.getConfig().getBoolean("frules.Enabled")) {
|
||||
fme.msg(TL.COMMAND_RULES_DISABLED_MSG);
|
||||
return;
|
||||
}
|
||||
if (this.args.size() == 0) {
|
||||
HashMap<Integer, String> rules = fme.getFaction().getRulesMap();
|
||||
if (rules.size() == 0) {
|
||||
List<String> ruleList = SaberFactions.plugin.getConfig().getStringList("frules.default-rules");
|
||||
fme.sendMessage(SaberFactions.plugin.colorList(ruleList));
|
||||
List<String> ruleList = P.p.getConfig().getStringList("frules.default-rules");
|
||||
fme.sendMessage(P.p.colorList(ruleList));
|
||||
|
||||
} else {
|
||||
for (int i = 0; i <= rules.size() - 1; i++) {
|
||||
fme.sendMessage(SaberFactions.plugin.color(rules.get(i)));
|
||||
fme.sendMessage(P.p.color(rules.get(i)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd;
|
||||
|
||||
|
||||
import com.massivecraft.factions.FLocation;
|
||||
import com.massivecraft.factions.SaberFactions;
|
||||
import com.massivecraft.factions.P;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.util.Particles.ParticleEffect;
|
||||
import com.massivecraft.factions.util.VisualizeUtil;
|
||||
@@ -12,7 +12,6 @@ import org.bukkit.*;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
|
||||
public class CmdSeeChunk extends FCommand {
|
||||
|
||||
@@ -41,7 +40,7 @@ public class CmdSeeChunk extends FCommand {
|
||||
|
||||
|
||||
this.useParticles = p.getConfig().getBoolean("see-chunk.particles", true);
|
||||
interval = SaberFactions.plugin.getConfig().getLong("see-chunk.interval", 10L);
|
||||
interval = P.p.getConfig().getLong("see-chunk.interval", 10L);
|
||||
if (effect == null) {
|
||||
effect = ParticleEffect.REDSTONE;
|
||||
}
|
||||
@@ -72,7 +71,7 @@ public class CmdSeeChunk extends FCommand {
|
||||
}
|
||||
|
||||
private void startTask() {
|
||||
taskID = Bukkit.getScheduler().scheduleSyncRepeatingTask(SaberFactions.plugin, () -> {
|
||||
taskID = Bukkit.getScheduler().scheduleSyncRepeatingTask(P.p, () -> {
|
||||
for (Object nameObject : seeChunkMap.keySet()) {
|
||||
String name = nameObject + "";
|
||||
Player player = Bukkit.getPlayer(name);
|
||||
@@ -116,10 +115,10 @@ public class CmdSeeChunk extends FCommand {
|
||||
continue;
|
||||
}
|
||||
if (useParticles) {
|
||||
if (SaberFactions.plugin.useNonPacketParticles) {
|
||||
if (P.p.useNonPacketParticles) {
|
||||
// Dust options only exists in the 1.13 API, so we use an
|
||||
// alternative method to achieve this in lower versions.
|
||||
if (SaberFactions.plugin.mc113) {
|
||||
if (P.p.mc113) {
|
||||
player.spawnParticle(Particle.REDSTONE, loc, 0, new Particle.DustOptions(Color.RED, 1));
|
||||
} else {
|
||||
player.getWorld().spawnParticle(Particle.REDSTONE, loc, 0, 255, 0, 0, 1);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.FPlayer;
|
||||
import com.massivecraft.factions.SaberFactions;
|
||||
import com.massivecraft.factions.P;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.struct.Relation;
|
||||
import com.massivecraft.factions.struct.Role;
|
||||
@@ -51,7 +51,7 @@ public class CmdSetFWarp extends FCommand {
|
||||
// Checks if warp with same name already exists and ignores maxWarp check if it does.
|
||||
boolean warpExists = myFaction.isWarp(warp);
|
||||
|
||||
int maxWarps = SaberFactions.plugin.getConfig().getInt("max-warps", 5);
|
||||
int maxWarps = P.p.getConfig().getInt("max-warps", 5);
|
||||
boolean tooManyWarps = maxWarps <= myFaction.getWarps().size();
|
||||
if (tooManyWarps && !warpExists) {
|
||||
fme.msg(TL.COMMAND_SETFWARP_LIMIT, maxWarps);
|
||||
@@ -73,7 +73,7 @@ public class CmdSetFWarp extends FCommand {
|
||||
}
|
||||
|
||||
private boolean transact(FPlayer player) {
|
||||
return !SaberFactions.plugin.getConfig().getBoolean("warp-cost.enabled", false) || player.isAdminBypassing() || payForCommand(SaberFactions.plugin.getConfig().getDouble("warp-cost.setwarp", 5), TL.COMMAND_SETFWARP_TOSET.toString(), TL.COMMAND_SETFWARP_FORSET.toString());
|
||||
return !P.p.getConfig().getBoolean("warp-cost.enabled", false) || player.isAdminBypassing() || payForCommand(P.p.getConfig().getDouble("warp-cost.setwarp", 5), TL.COMMAND_SETFWARP_TOSET.toString(), TL.COMMAND_SETFWARP_FORSET.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.Faction;
|
||||
import com.massivecraft.factions.SaberFactions;
|
||||
import com.massivecraft.factions.P;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
import com.massivecraft.factions.zcore.util.TagReplacer;
|
||||
@@ -57,7 +57,7 @@ public class CmdShow extends FCommand {
|
||||
return;
|
||||
|
||||
if (fme != null && !fme.getPlayer().hasPermission("factions.show.bypassexempt")
|
||||
&& SaberFactions.plugin.getConfig().getStringList("show-exempt").contains(faction.getTag())) {
|
||||
&& P.p.getConfig().getStringList("show-exempt").contains(faction.getTag())) {
|
||||
msg(TL.COMMAND_SHOW_EXEMPT);
|
||||
return;
|
||||
}
|
||||
@@ -67,7 +67,7 @@ public class CmdShow extends FCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
List<String> show = SaberFactions.plugin.getConfig().getStringList("show");
|
||||
List<String> show = P.p.getConfig().getStringList("show");
|
||||
if (show == null || show.isEmpty())
|
||||
show = defaults;
|
||||
|
||||
|
||||
@@ -35,11 +35,11 @@ public class CmdStuck extends FCommand {
|
||||
final Player player = fme.getPlayer();
|
||||
final Location sentAt = player.getLocation();
|
||||
final FLocation chunk = fme.getLastStoodAt();
|
||||
final long delay = SaberFactions.plugin.getConfig().getLong("hcf.stuck.delay", 30);
|
||||
final int radius = SaberFactions.plugin.getConfig().getInt("hcf.stuck.radius", 10);
|
||||
final long delay = P.p.getConfig().getLong("hcf.stuck.delay", 30);
|
||||
final int radius = P.p.getConfig().getInt("hcf.stuck.radius", 10);
|
||||
|
||||
if (SaberFactions.plugin.getStuckMap().containsKey(player.getUniqueId())) {
|
||||
long wait = SaberFactions.plugin.getTimers().get(player.getUniqueId()) - System.currentTimeMillis();
|
||||
if (P.p.getStuckMap().containsKey(player.getUniqueId())) {
|
||||
long wait = P.p.getTimers().get(player.getUniqueId()) - System.currentTimeMillis();
|
||||
String time = DurationFormatUtils.formatDuration(wait, TL.COMMAND_STUCK_TIMEFORMAT.toString(), true);
|
||||
msg(TL.COMMAND_STUCK_EXISTS, time);
|
||||
} else {
|
||||
@@ -49,11 +49,11 @@ public class CmdStuck extends FCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
final int id = Bukkit.getScheduler().runTaskLater(SaberFactions.plugin, new BukkitRunnable() {
|
||||
final int id = Bukkit.getScheduler().runTaskLater(P.p, new BukkitRunnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
if (!SaberFactions.plugin.getStuckMap().containsKey(player.getUniqueId())) {
|
||||
if (!P.p.getStuckMap().containsKey(player.getUniqueId())) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -61,8 +61,8 @@ public class CmdStuck extends FCommand {
|
||||
final World world = chunk.getWorld();
|
||||
if (world.getUID() != player.getWorld().getUID() || sentAt.distance(player.getLocation()) > radius) {
|
||||
msg(TL.COMMAND_STUCK_OUTSIDE.format(radius));
|
||||
SaberFactions.plugin.getTimers().remove(player.getUniqueId());
|
||||
SaberFactions.plugin.getStuckMap().remove(player.getUniqueId());
|
||||
P.p.getTimers().remove(player.getUniqueId());
|
||||
P.p.getStuckMap().remove(player.getUniqueId());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -74,18 +74,18 @@ public class CmdStuck extends FCommand {
|
||||
public boolean work() {
|
||||
FLocation chunk = currentFLocation();
|
||||
Faction faction = board.getFactionAt(chunk);
|
||||
int buffer = SaberFactions.plugin.getConfig().getInt("world-border.buffer", 0);
|
||||
int buffer = P.p.getConfig().getInt("world-border.buffer", 0);
|
||||
if (faction.isWilderness() && !chunk.isOutsideWorldBorder(buffer)) {
|
||||
int cx = FLocation.chunkToBlock((int) chunk.getX());
|
||||
int cz = FLocation.chunkToBlock((int) chunk.getZ());
|
||||
int y = world.getHighestBlockYAt(cx, cz);
|
||||
Location tp = new Location(world, cx, y, cz);
|
||||
msg(TL.COMMAND_STUCK_TELEPORT, tp.getBlockX(), tp.getBlockY(), tp.getBlockZ());
|
||||
SaberFactions.plugin.getTimers().remove(player.getUniqueId());
|
||||
SaberFactions.plugin.getStuckMap().remove(player.getUniqueId());
|
||||
P.p.getTimers().remove(player.getUniqueId());
|
||||
P.p.getStuckMap().remove(player.getUniqueId());
|
||||
if (!Essentials.handleTeleport(player, tp)) {
|
||||
player.teleport(tp);
|
||||
SaberFactions.plugin.debug("/f stuck used regular teleport, not essentials!");
|
||||
P.p.debug("/f stuck used regular teleport, not essentials!");
|
||||
}
|
||||
this.stop();
|
||||
return false;
|
||||
@@ -96,11 +96,11 @@ public class CmdStuck extends FCommand {
|
||||
}
|
||||
}, delay * 20).getTaskId();
|
||||
|
||||
SaberFactions.plugin.getTimers().put(player.getUniqueId(), System.currentTimeMillis() + (delay * 1000));
|
||||
long wait = SaberFactions.plugin.getTimers().get(player.getUniqueId()) - System.currentTimeMillis();
|
||||
P.p.getTimers().put(player.getUniqueId(), System.currentTimeMillis() + (delay * 1000));
|
||||
long wait = P.p.getTimers().get(player.getUniqueId()) - System.currentTimeMillis();
|
||||
String time = DurationFormatUtils.formatDuration(wait, TL.COMMAND_STUCK_TIMEFORMAT.toString(), true);
|
||||
msg(TL.COMMAND_STUCK_START, time);
|
||||
SaberFactions.plugin.getStuckMap().put(player.getUniqueId(), id);
|
||||
P.p.getStuckMap().put(player.getUniqueId(), id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ public class CmdTag extends FCommand {
|
||||
fplayer.msg(TL.COMMAND_TAG_CHANGED, fme.getColorTo(faction) + oldtag, myFaction.getTag(faction));
|
||||
}
|
||||
}
|
||||
fme.setCooldown("tag", System.currentTimeMillis() + (SaberFactions.plugin.getConfig().getInt("fcooldowns.f-tag") * 1000));
|
||||
fme.setCooldown("tag", System.currentTimeMillis() + (P.p.getConfig().getInt("fcooldowns.f-tag") * 1000));
|
||||
FTeamWrapper.updatePrefixes(myFaction);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.SaberFactions;
|
||||
import com.massivecraft.factions.P;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.struct.Role;
|
||||
import com.massivecraft.factions.zcore.fperms.Access;
|
||||
@@ -32,7 +32,7 @@ public class CmdTnt extends FCommand {
|
||||
|
||||
@Override
|
||||
public void perform() {
|
||||
if (!SaberFactions.plugin.getConfig().getBoolean("ftnt.Enabled")) {
|
||||
if (!P.p.getConfig().getBoolean("ftnt.Enabled")) {
|
||||
fme.msg(TL.COMMAND_TNT_DISABLED_MSG);
|
||||
return;
|
||||
}
|
||||
@@ -73,7 +73,7 @@ public class CmdTnt extends FCommand {
|
||||
return;
|
||||
}
|
||||
ItemStack tnt = new ItemStack(Material.TNT, amount);
|
||||
if (fme.getFaction().getTnt() + amount > SaberFactions.plugin.getConfig().getInt("ftnt.Bank-Limit")) {
|
||||
if (fme.getFaction().getTnt() + amount > P.p.getConfig().getInt("ftnt.Bank-Limit")) {
|
||||
msg(TL.COMMAND_TNT_EXCEEDLIMIT);
|
||||
return;
|
||||
}
|
||||
@@ -82,7 +82,7 @@ public class CmdTnt extends FCommand {
|
||||
|
||||
fme.getFaction().addTnt(amount);
|
||||
fme.msg(TL.COMMAND_TNT_DEPOSIT_SUCCESS);
|
||||
fme.sendMessage(SaberFactions.plugin.color(TL.COMMAND_TNT_AMOUNT.toString().replace("{amount}", fme.getFaction().getTnt() + "")));
|
||||
fme.sendMessage(P.p.color(TL.COMMAND_TNT_AMOUNT.toString().replace("{amount}", fme.getFaction().getTnt() + "")));
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.SaberFactions;
|
||||
import com.massivecraft.factions.P;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.struct.Role;
|
||||
import com.massivecraft.factions.zcore.fperms.Access;
|
||||
@@ -35,7 +35,7 @@ public class CmdTntFill extends FCommand {
|
||||
|
||||
@Override
|
||||
public void perform() {
|
||||
if (!SaberFactions.plugin.getConfig().getBoolean("Tntfill.enabled")) {
|
||||
if (!P.p.getConfig().getBoolean("Tntfill.enabled")) {
|
||||
this.fme.msg(TL.GENERIC_DISABLED);
|
||||
return;
|
||||
}
|
||||
@@ -51,12 +51,12 @@ public class CmdTntFill extends FCommand {
|
||||
msg(TL.COMMAND_TNTFILL_HEADER);
|
||||
int radius = argAsInt(0, 16);
|
||||
int amount = argAsInt(1, 16);
|
||||
if (radius > SaberFactions.plugin.getConfig().getInt("Tntfill.max-radius")) {
|
||||
fme.msg(TL.COMMAND_TNTFILL_RADIUSMAX.toString().replace("{max}", SaberFactions.plugin.getConfig().getInt("Tntfill.max-radius") + ""));
|
||||
if (radius > P.p.getConfig().getInt("Tntfill.max-radius")) {
|
||||
fme.msg(TL.COMMAND_TNTFILL_RADIUSMAX.toString().replace("{max}", P.p.getConfig().getInt("Tntfill.max-radius") + ""));
|
||||
return;
|
||||
}
|
||||
if (amount > SaberFactions.plugin.getConfig().getInt("Tntfill.max-amount")) {
|
||||
fme.msg(TL.COMMAND_TNTFILL_AMOUNTMAX.toString().replace("{max}", SaberFactions.plugin.getConfig().getInt("Tntfill.max-amount") + ""));
|
||||
if (amount > P.p.getConfig().getInt("Tntfill.max-amount")) {
|
||||
fme.msg(TL.COMMAND_TNTFILL_AMOUNTMAX.toString().replace("{max}", P.p.getConfig().getInt("Tntfill.max-amount") + ""));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -181,7 +181,7 @@ public class CmdTntFill extends FCommand {
|
||||
return;
|
||||
}
|
||||
ItemStack tnt = new ItemStack(Material.TNT, amount);
|
||||
if (fme.getFaction().getTnt() + amount > SaberFactions.plugin.getConfig().getInt("ftnt.Bank-Limit")) {
|
||||
if (fme.getFaction().getTnt() + amount > P.p.getConfig().getInt("ftnt.Bank-Limit")) {
|
||||
msg(TL.COMMAND_TNT_EXCEEDLIMIT);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.SaberFactions;
|
||||
import com.massivecraft.factions.P;
|
||||
import com.massivecraft.factions.listeners.FactionsBlockListener;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.util.WarmUpUtil;
|
||||
@@ -25,7 +25,7 @@ public class CmdTpBanner extends FCommand {
|
||||
|
||||
@Override
|
||||
public void perform() {
|
||||
if (!SaberFactions.plugin.getConfig().getBoolean("fbanners.Enabled")) {
|
||||
if (!P.p.getConfig().getBoolean("fbanners.Enabled")) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.SaberFactions;
|
||||
import com.massivecraft.factions.P;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.zcore.fupgrades.FUpgradesGUI;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
@@ -26,7 +26,7 @@ public class CmdUpgrades extends FCommand {
|
||||
|
||||
@Override
|
||||
public void perform() {
|
||||
if (!SaberFactions.plugin.getConfig().getBoolean("fupgrades.Enabled")) {
|
||||
if (!P.p.getConfig().getBoolean("fupgrades.Enabled")) {
|
||||
fme.sendMessage("This command is disabled!");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.Board;
|
||||
import com.massivecraft.factions.FLocation;
|
||||
import com.massivecraft.factions.SaberFactions;
|
||||
import com.massivecraft.factions.P;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.zcore.fperms.Access;
|
||||
import com.massivecraft.factions.zcore.fperms.PermissableAction;
|
||||
@@ -33,7 +33,7 @@ public class CmdVault extends FCommand {
|
||||
@Override
|
||||
public void perform() {
|
||||
|
||||
if (!SaberFactions.plugin.getConfig().getBoolean("fvault.Enabled")) {
|
||||
if (!P.p.getConfig().getBoolean("fvault.Enabled")) {
|
||||
fme.sendMessage("This command is disabled!");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.SaberFactions;
|
||||
import com.massivecraft.factions.P;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
|
||||
@@ -25,8 +25,8 @@ public class CmdVersion extends FCommand {
|
||||
|
||||
@Override
|
||||
public void perform() {
|
||||
msg(TL.COMMAND_VERSION_NAME); // Did this so people can differentiate between SaberFactions and FactionsUUID (( Requested Feature ))
|
||||
msg(TL.COMMAND_VERSION_VERSION, SaberFactions.plugin.getDescription().getFullName());
|
||||
msg(TL.COMMAND_VERSION_NAME); // Did this so people can differentiate between P and FactionsUUID (( Requested Feature ))
|
||||
msg(TL.COMMAND_VERSION_VERSION, P.p.getDescription().getFullName());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.Faction;
|
||||
import com.massivecraft.factions.SaberFactions;
|
||||
import com.massivecraft.factions.P;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
|
||||
@@ -25,7 +25,7 @@ public class CmdViewChest extends FCommand {
|
||||
|
||||
@Override
|
||||
public void perform() {
|
||||
if (!SaberFactions.plugin.getConfig().getBoolean("fchest.Enabled")) {
|
||||
if (!P.p.getConfig().getBoolean("fchest.Enabled")) {
|
||||
fme.msg(TL.GENERIC_DISABLED);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.SaberFactions;
|
||||
import com.massivecraft.factions.P;
|
||||
import com.massivecraft.factions.cmd.alts.CmdAlts;
|
||||
import com.massivecraft.factions.cmd.claim.*;
|
||||
import com.massivecraft.factions.cmd.econ.CmdMoney;
|
||||
@@ -248,43 +248,43 @@ public class FCmdRoot extends FCommand {
|
||||
this.addSubCommand(this.cmdFGlobal);
|
||||
this.addSubCommand(this.cmdViewChest);
|
||||
|
||||
if (SaberFactions.plugin.getConfig().getBoolean("f-inventory-see.Enabled")) {
|
||||
if (P.p.getConfig().getBoolean("f-inventory-see.Enabled")) {
|
||||
this.addSubCommand(this.cmdInventorySee);
|
||||
}
|
||||
|
||||
if(SaberFactions.plugin.getConfig().getBoolean("f-points.Enabled")){
|
||||
if(P.p.getConfig().getBoolean("f-points.Enabled")){
|
||||
this.addSubCommand(this.cmdPoints);
|
||||
}
|
||||
|
||||
if(SaberFactions.plugin.getConfig().getBoolean("f-alts.Enabled")){
|
||||
if(P.p.getConfig().getBoolean("f-alts.Enabled")){
|
||||
this.addSubCommand(this.cmdAlts);
|
||||
}
|
||||
|
||||
if (SaberFactions.plugin.getConfig().getBoolean("f-grace.Enabled")) {
|
||||
if (P.p.getConfig().getBoolean("f-grace.Enabled")) {
|
||||
this.addSubCommand(this.cmdGrace);
|
||||
}
|
||||
|
||||
|
||||
if (Bukkit.getServer().getPluginManager().getPlugin("CoreProtect") != null) {
|
||||
SaberFactions.plugin.log("Found CoreProtect, enabling Inspect");
|
||||
P.p.log("Found CoreProtect, enabling Inspect");
|
||||
this.addSubCommand(this.cmdInspect);
|
||||
} else {
|
||||
SaberFactions.plugin.log("CoreProtect not found, disabling Inspect");
|
||||
P.p.log("CoreProtect not found, disabling Inspect");
|
||||
}
|
||||
if (SaberFactions.plugin.getConfig().getBoolean("ffocus.Enabled")) {
|
||||
if (P.p.getConfig().getBoolean("ffocus.Enabled")) {
|
||||
addSubCommand(this.cmdFocus);
|
||||
}
|
||||
|
||||
if (SaberFactions.plugin.getConfig().getBoolean("enable-faction-flight", false)) {
|
||||
if (P.p.getConfig().getBoolean("enable-faction-flight", false)) {
|
||||
this.addSubCommand(this.cmdFly);
|
||||
}
|
||||
if (Bukkit.getServer().getPluginManager().getPlugin("FactionsTop") != null || Bukkit.getServer().getPluginManager().getPlugin("SavageFTOP") != null) {
|
||||
SaberFactions.plugin.log(Level.INFO, "Found FactionsTop plugin. Disabling our own /f top command.");
|
||||
P.p.log(Level.INFO, "Found FactionsTop plugin. Disabling our own /f top command.");
|
||||
} else {
|
||||
SaberFactions.plugin.log(Level.INFO, "Enabling FactionsTop command, this is a very basic /f top please get a dedicated /f top resource if you want land calculation etc.");
|
||||
P.p.log(Level.INFO, "Enabling FactionsTop command, this is a very basic /f top please get a dedicated /f top resource if you want land calculation etc.");
|
||||
this.addSubCommand(this.cmdTop);
|
||||
}
|
||||
if (SaberFactions.plugin.getConfig().getBoolean("fpaypal.Enabled")) {
|
||||
if (P.p.getConfig().getBoolean("fpaypal.Enabled")) {
|
||||
this.addSubCommand(this.cmdPaypalSet);
|
||||
this.addSubCommand(this.cmdPaypalSee);
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ import java.text.SimpleDateFormat;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public abstract class FCommand extends MCommand<SaberFactions> {
|
||||
public abstract class FCommand extends MCommand<P> {
|
||||
|
||||
public static final SimpleDateFormat sdf = new SimpleDateFormat(TL.DATE_FORMAT.toString());
|
||||
|
||||
@@ -31,7 +31,7 @@ public abstract class FCommand extends MCommand<SaberFactions> {
|
||||
public boolean isMoneyCommand;
|
||||
|
||||
public FCommand() {
|
||||
super(SaberFactions.plugin);
|
||||
super(P.p);
|
||||
|
||||
// Due to safety reasons it defaults to disable on lock.
|
||||
disableOnLock = true;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.massivecraft.factions.cmd.alts;
|
||||
|
||||
import com.massivecraft.factions.SaberFactions;
|
||||
import com.massivecraft.factions.P;
|
||||
import com.massivecraft.factions.cmd.FCommand;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
@@ -34,13 +34,13 @@ public class CmdAlts extends FCommand {
|
||||
|
||||
@Override
|
||||
public void perform() {
|
||||
if (!SaberFactions.plugin.getConfig().getBoolean("f-alts.Enabled", false)) {
|
||||
if (!P.p.getConfig().getBoolean("f-alts.Enabled", false)) {
|
||||
fme.msg(TL.GENERIC_DISABLED);
|
||||
return;
|
||||
}
|
||||
|
||||
this.commandChain.add(this);
|
||||
SaberFactions.plugin.cmdAutoHelp.execute(this.sender, this.args, this.commandChain);
|
||||
P.p.cmdAutoHelp.execute(this.sender, this.args, this.commandChain);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -48,8 +48,8 @@ public class CmdAltsList extends FCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
msg("<a>There are " + faction.getAltPlayers().size() + " alts in " + faction.getTag() + ":");
|
||||
msg("<i>" + Joiner.on(", ").join(faction.getAltPlayers().stream().map(FPlayer::getName).collect(Collectors.toList())));
|
||||
msg("There are " + faction.getAltPlayers().size() + " alts in " + faction.getTag() + ":");
|
||||
msg(Joiner.on(", ").join(faction.getAltPlayers().stream().map(FPlayer::getName).collect(Collectors.toList())));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd.alts;
|
||||
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.FPlayer;
|
||||
import com.massivecraft.factions.SaberFactions;
|
||||
import com.massivecraft.factions.P;
|
||||
import com.massivecraft.factions.cmd.FCommand;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.struct.Role;
|
||||
@@ -33,7 +33,7 @@ public class CmdInviteAlt extends FCommand {
|
||||
|
||||
@Override
|
||||
public void perform() {
|
||||
if(!SaberFactions.plugin.getConfig().getBoolean("f-alts.Enabled", false)){
|
||||
if(!P.p.getConfig().getBoolean("f-alts.Enabled", false)){
|
||||
fme.msg(TL.GENERIC_DISABLED);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ public class CmdCorner extends FCommand {
|
||||
@Override
|
||||
public void perform() {
|
||||
FLocation to = new FLocation(me.getLocation());
|
||||
if (SaberFactions.plugin.getFactionsPlayerListener().getCorners().contains(to)) {
|
||||
if (P.p.getFactionsPlayerListener().getCorners().contains(to)) {
|
||||
Faction cornerAt = Board.getInstance().getFactionAt(to);
|
||||
if (cornerAt != null && cornerAt.isNormal() && !cornerAt.equals(fme.getFaction())) {
|
||||
msg(TL.COMMAND_CORNER_CANT_CLAIM);
|
||||
@@ -49,7 +49,7 @@ public class CmdCorner extends FCommand {
|
||||
if (surrounding.isEmpty()) {
|
||||
msg(TL.COMMAND_CORNER_CANT_CLAIM);
|
||||
} else {
|
||||
new CornerTask(fme, surrounding).runTaskTimer(SaberFactions.plugin, 1L, 1L);
|
||||
new CornerTask(fme, surrounding).runTaskTimer(P.p, 1L, 1L);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.massivecraft.factions.cmd.claim;
|
||||
import com.massivecraft.factions.Board;
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.Factions;
|
||||
import com.massivecraft.factions.SaberFactions;
|
||||
import com.massivecraft.factions.P;
|
||||
import com.massivecraft.factions.cmd.FCommand;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
@@ -51,7 +51,7 @@ public class CmdSafeunclaimall extends FCommand {
|
||||
msg(TL.COMMAND_SAFEUNCLAIMALL_UNCLAIMED);
|
||||
|
||||
if (Conf.logLandUnclaims) {
|
||||
SaberFactions.plugin.log(TL.COMMAND_SAFEUNCLAIMALL_UNCLAIMEDLOG.format(sender.getName()));
|
||||
P.p.log(TL.COMMAND_SAFEUNCLAIMALL_UNCLAIMEDLOG.format(sender.getName()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ public class CmdUnclaim extends FCommand {
|
||||
msg(TL.COMMAND_UNCLAIM_SAFEZONE_SUCCESS);
|
||||
|
||||
if (Conf.logLandUnclaims) {
|
||||
SaberFactions.plugin.log(TL.COMMAND_UNCLAIM_LOG.format(fme.getName(), target.getCoordString(), targetFaction.getTag()));
|
||||
P.p.log(TL.COMMAND_UNCLAIM_LOG.format(fme.getName(), target.getCoordString(), targetFaction.getTag()));
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
@@ -98,7 +98,7 @@ public class CmdUnclaim extends FCommand {
|
||||
msg(TL.COMMAND_UNCLAIM_WARZONE_SUCCESS);
|
||||
|
||||
if (Conf.logLandUnclaims) {
|
||||
SaberFactions.plugin.log(TL.COMMAND_UNCLAIM_LOG.format(fme.getName(), target.getCoordString(), targetFaction.getTag()));
|
||||
P.p.log(TL.COMMAND_UNCLAIM_LOG.format(fme.getName(), target.getCoordString(), targetFaction.getTag()));
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
@@ -109,7 +109,7 @@ public class CmdUnclaim extends FCommand {
|
||||
|
||||
if (fme.isAdminBypassing()) {
|
||||
LandUnclaimEvent unclaimEvent = new LandUnclaimEvent(target, targetFaction, fme);
|
||||
Bukkit.getScheduler().runTask(SaberFactions.plugin, () -> Bukkit.getServer().getPluginManager().callEvent(unclaimEvent));
|
||||
Bukkit.getScheduler().runTask(P.p, () -> Bukkit.getServer().getPluginManager().callEvent(unclaimEvent));
|
||||
if (unclaimEvent.isCancelled()) {
|
||||
return false;
|
||||
}
|
||||
@@ -120,7 +120,7 @@ public class CmdUnclaim extends FCommand {
|
||||
msg(TL.COMMAND_UNCLAIM_UNCLAIMS);
|
||||
|
||||
if (Conf.logLandUnclaims) {
|
||||
SaberFactions.plugin.log(TL.COMMAND_UNCLAIM_LOG.format(fme.getName(), target.getCoordString(), targetFaction.getTag()));
|
||||
P.p.log(TL.COMMAND_UNCLAIM_LOG.format(fme.getName(), target.getCoordString(), targetFaction.getTag()));
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -171,7 +171,7 @@ public class CmdUnclaim extends FCommand {
|
||||
myFaction.msg(TL.COMMAND_UNCLAIM_FACTIONUNCLAIMED, fme.describeTo(myFaction, true));
|
||||
|
||||
if (Conf.logLandUnclaims) {
|
||||
SaberFactions.plugin.log(TL.COMMAND_UNCLAIM_LOG.format(fme.getName(), target.getCoordString(), targetFaction.getTag()));
|
||||
P.p.log(TL.COMMAND_UNCLAIM_LOG.format(fme.getName(), target.getCoordString(), targetFaction.getTag()));
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd.claim;
|
||||
|
||||
import com.massivecraft.factions.Board;
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.SaberFactions;
|
||||
import com.massivecraft.factions.P;
|
||||
import com.massivecraft.factions.cmd.FCommand;
|
||||
import com.massivecraft.factions.event.LandUnclaimAllEvent;
|
||||
import com.massivecraft.factions.integration.Econ;
|
||||
@@ -45,7 +45,7 @@ public class CmdUnclaimall extends FCommand {
|
||||
}
|
||||
|
||||
LandUnclaimAllEvent unclaimAllEvent = new LandUnclaimAllEvent(myFaction, fme);
|
||||
Bukkit.getScheduler().runTask(SaberFactions.plugin, () -> Bukkit.getServer().getPluginManager().callEvent(unclaimAllEvent));
|
||||
Bukkit.getScheduler().runTask(P.p, () -> Bukkit.getServer().getPluginManager().callEvent(unclaimAllEvent));
|
||||
if (unclaimAllEvent.isCancelled()) {
|
||||
return;
|
||||
}
|
||||
@@ -54,7 +54,7 @@ public class CmdUnclaimall extends FCommand {
|
||||
myFaction.msg(TL.COMMAND_UNCLAIMALL_UNCLAIMED, fme.describeTo(myFaction, true));
|
||||
|
||||
if (Conf.logLandUnclaims) {
|
||||
SaberFactions.plugin.log(TL.COMMAND_UNCLAIMALL_LOG.format(fme.getName(), myFaction.getTag()));
|
||||
P.p.log(TL.COMMAND_UNCLAIMALL_LOG.format(fme.getName(), myFaction.getTag()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.massivecraft.factions.cmd.claim;
|
||||
import com.massivecraft.factions.Board;
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.Factions;
|
||||
import com.massivecraft.factions.SaberFactions;
|
||||
import com.massivecraft.factions.P;
|
||||
import com.massivecraft.factions.cmd.FCommand;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
@@ -50,7 +50,7 @@ public class CmdWarunclaimall extends FCommand {
|
||||
|
||||
|
||||
if (Conf.logLandUnclaims) {
|
||||
SaberFactions.plugin.log(TL.COMMAND_WARUNCLAIMALL_LOG.format(fme.getName()));
|
||||
P.p.log(TL.COMMAND_WARUNCLAIMALL_LOG.format(fme.getName()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.massivecraft.factions.cmd.econ;
|
||||
|
||||
import com.massivecraft.factions.SaberFactions;
|
||||
import com.massivecraft.factions.P;
|
||||
import com.massivecraft.factions.cmd.FCommand;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
|
||||
@@ -42,7 +42,7 @@ public class CmdMoney extends FCommand {
|
||||
@Override
|
||||
public void perform() {
|
||||
this.commandChain.add(this);
|
||||
SaberFactions.plugin.cmdAutoHelp.execute(this.sender, this.args, this.commandChain);
|
||||
P.p.cmdAutoHelp.execute(this.sender, this.args, this.commandChain);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.massivecraft.factions.cmd.econ;
|
||||
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.SaberFactions;
|
||||
import com.massivecraft.factions.P;
|
||||
import com.massivecraft.factions.cmd.FCommand;
|
||||
import com.massivecraft.factions.iface.EconomyParticipator;
|
||||
import com.massivecraft.factions.integration.Econ;
|
||||
@@ -40,7 +40,7 @@ public class CmdMoneyDeposit extends FCommand {
|
||||
boolean success = Econ.transferMoney(fme, fme, faction, amount);
|
||||
|
||||
if (success && Conf.logMoneyTransactions) {
|
||||
SaberFactions.plugin.log(ChatColor.stripColor(SaberFactions.plugin.txt.parse(TL.COMMAND_MONEYDEPOSIT_DEPOSITED.toString(), fme.getName(), Econ.moneyString(amount), faction.describeTo(null))));
|
||||
P.p.log(ChatColor.stripColor(P.p.txt.parse(TL.COMMAND_MONEYDEPOSIT_DEPOSITED.toString(), fme.getName(), Econ.moneyString(amount), faction.describeTo(null))));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.massivecraft.factions.cmd.econ;
|
||||
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.SaberFactions;
|
||||
import com.massivecraft.factions.P;
|
||||
import com.massivecraft.factions.cmd.FCommand;
|
||||
import com.massivecraft.factions.iface.EconomyParticipator;
|
||||
import com.massivecraft.factions.integration.Econ;
|
||||
@@ -51,7 +51,7 @@ public class CmdMoneyTransferFf extends FCommand {
|
||||
|
||||
if (success && Conf.logMoneyTransactions) {
|
||||
String name = sender instanceof Player ? fme.getName() : sender.getName();
|
||||
SaberFactions.plugin.log(ChatColor.stripColor(SaberFactions.plugin.txt.parse(TL.COMMAND_MONEYTRANSFERFF_TRANSFER.toString(), name, Econ.moneyString(amount), from.describeTo(null), to.describeTo(null))));
|
||||
P.p.log(ChatColor.stripColor(P.p.txt.parse(TL.COMMAND_MONEYTRANSFERFF_TRANSFER.toString(), name, Econ.moneyString(amount), from.describeTo(null), to.describeTo(null))));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.massivecraft.factions.cmd.econ;
|
||||
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.SaberFactions;
|
||||
import com.massivecraft.factions.P;
|
||||
import com.massivecraft.factions.cmd.FCommand;
|
||||
import com.massivecraft.factions.iface.EconomyParticipator;
|
||||
import com.massivecraft.factions.integration.Econ;
|
||||
@@ -50,7 +50,7 @@ public class CmdMoneyTransferFp extends FCommand {
|
||||
boolean success = Econ.transferMoney(fme, from, to, amount);
|
||||
|
||||
if (success && Conf.logMoneyTransactions) {
|
||||
SaberFactions.plugin.log(ChatColor.stripColor(SaberFactions.plugin.txt.parse(TL.COMMAND_MONEYTRANSFERFP_TRANSFER.toString(), fme.getName(), Econ.moneyString(amount), from.describeTo(null), to.describeTo(null))));
|
||||
P.p.log(ChatColor.stripColor(P.p.txt.parse(TL.COMMAND_MONEYTRANSFERFP_TRANSFER.toString(), fme.getName(), Econ.moneyString(amount), from.describeTo(null), to.describeTo(null))));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.massivecraft.factions.cmd.econ;
|
||||
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.SaberFactions;
|
||||
import com.massivecraft.factions.P;
|
||||
import com.massivecraft.factions.cmd.FCommand;
|
||||
import com.massivecraft.factions.iface.EconomyParticipator;
|
||||
import com.massivecraft.factions.integration.Econ;
|
||||
@@ -50,7 +50,7 @@ public class CmdMoneyTransferPf extends FCommand {
|
||||
boolean success = Econ.transferMoney(fme, from, to, amount);
|
||||
|
||||
if (success && Conf.logMoneyTransactions) {
|
||||
SaberFactions.plugin.log(ChatColor.stripColor(SaberFactions.plugin.txt.parse(TL.COMMAND_MONEYTRANSFERPF_TRANSFER.toString(), fme.getName(), Econ.moneyString(amount), from.describeTo(null), to.describeTo(null))));
|
||||
P.p.log(ChatColor.stripColor(P.p.txt.parse(TL.COMMAND_MONEYTRANSFERPF_TRANSFER.toString(), fme.getName(), Econ.moneyString(amount), from.describeTo(null), to.describeTo(null))));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.massivecraft.factions.cmd.econ;
|
||||
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.SaberFactions;
|
||||
import com.massivecraft.factions.P;
|
||||
import com.massivecraft.factions.cmd.FCommand;
|
||||
import com.massivecraft.factions.iface.EconomyParticipator;
|
||||
import com.massivecraft.factions.integration.Econ;
|
||||
@@ -54,7 +54,7 @@ public class CmdMoneyWithdraw extends FCommand {
|
||||
boolean success = Econ.transferMoney(fme, faction, fme, amount);
|
||||
|
||||
if (success && Conf.logMoneyTransactions) {
|
||||
SaberFactions.plugin.log(ChatColor.stripColor(SaberFactions.plugin.txt.parse(TL.COMMAND_MONEYWITHDRAW_WITHDRAW.toString(), fme.getName(), Econ.moneyString(amount), faction.describeTo(null))));
|
||||
P.p.log(ChatColor.stripColor(P.p.txt.parse(TL.COMMAND_MONEYWITHDRAW_WITHDRAW.toString(), fme.getName(), Econ.moneyString(amount), faction.describeTo(null))));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.massivecraft.factions.cmd.logout;
|
||||
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.SaberFactions;
|
||||
import com.massivecraft.factions.P;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -35,9 +35,9 @@ public class LogoutHandler {
|
||||
public void applyLogoutCooldown(Player player) {
|
||||
logoutCooldown.put(player.getUniqueId(), System.currentTimeMillis() + (30 * 1000));
|
||||
|
||||
Bukkit.getScheduler().runTaskLater(SaberFactions.plugin, () -> {
|
||||
Bukkit.getScheduler().runTaskLater(P.p, () -> {
|
||||
if(isLogoutActive(player)) {
|
||||
player.setMetadata("Logout", new FixedMetadataValue(SaberFactions.plugin, true));
|
||||
player.setMetadata("Logout", new FixedMetadataValue(P.p, true));
|
||||
player.kickPlayer(String.valueOf(TL.COMMAND_LOGOUT_KICK_MESSAGE));
|
||||
cancelLogout(player);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.massivecraft.factions.cmd.points;
|
||||
|
||||
import com.massivecraft.factions.SaberFactions;
|
||||
import com.massivecraft.factions.P;
|
||||
import com.massivecraft.factions.cmd.FCommand;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
|
||||
@@ -31,12 +31,12 @@ public class CmdPoints extends FCommand {
|
||||
|
||||
@Override
|
||||
public void perform() {
|
||||
if (!SaberFactions.plugin.getConfig().getBoolean("f-points.Enabled", true)) {
|
||||
if (!P.p.getConfig().getBoolean("f-points.Enabled", true)) {
|
||||
fme.msg(TL.GENERIC_DISABLED);
|
||||
return;
|
||||
}
|
||||
this.commandChain.add(this);
|
||||
SaberFactions.plugin.cmdAutoHelp.execute(this.sender, this.args, this.commandChain);
|
||||
P.p.cmdAutoHelp.execute(this.sender, this.args, this.commandChain);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd.relational;
|
||||
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.Faction;
|
||||
import com.massivecraft.factions.SaberFactions;
|
||||
import com.massivecraft.factions.P;
|
||||
import com.massivecraft.factions.cmd.FCommand;
|
||||
import com.massivecraft.factions.event.FactionRelationEvent;
|
||||
import com.massivecraft.factions.event.FactionRelationWishEvent;
|
||||
@@ -104,8 +104,8 @@ public abstract class FRelationCommand extends FCommand {
|
||||
}
|
||||
|
||||
private boolean hasMaxRelations(Faction them, Relation targetRelation) {
|
||||
int max = SaberFactions.plugin.getConfig().getInt("max-relations." + targetRelation.toString(), -1);
|
||||
if (SaberFactions.plugin.getConfig().getBoolean("max-relations.enabled", false)) {
|
||||
int max = P.p.getConfig().getInt("max-relations." + targetRelation.toString(), -1);
|
||||
if (P.p.getConfig().getBoolean("max-relations.enabled", false)) {
|
||||
if (max != -1) {
|
||||
if (myFaction.getRelationCount(targetRelation) >= max) {
|
||||
msg(TL.COMMAND_RELATIONS_EXCEEDS_ME, max, targetRelation.getPluralTranslation());
|
||||
|
||||
Reference in New Issue
Block a user