Main Class Renamed and Instance Method

This commit is contained in:
Driftay 2019-08-02 17:01:33 -04:00
parent 477041e223
commit f2892fdef3
121 changed files with 665 additions and 675 deletions

View File

@ -108,7 +108,7 @@ var activeTableTab = "activeTableTab";
<li><a href="../../../com/massivecraft/factions/zcore/MPlugin.html" title="class in com.massivecraft.factions.zcore">com.massivecraft.factions.zcore.MPlugin</a></li> <li><a href="../../../com/massivecraft/factions/zcore/MPlugin.html" title="class in com.massivecraft.factions.zcore">com.massivecraft.factions.zcore.MPlugin</a></li>
<li> <li>
<ul class="inheritance"> <ul class="inheritance">
<li>com.massivecraft.factions.SaberFactions</li> <li>com.massivecraft.factions.P</li>
</ul> </ul>
</li> </li>
</ul> </ul>

View File

@ -1,3 +0,0 @@
Manifest-Version: 1.0
Main-Class: com.massivecraft.factions.SaberFactions

View File

@ -377,7 +377,7 @@ public class Conf {
territoryDenyUseageMaterials.add(Material.BUCKET); territoryDenyUseageMaterials.add(Material.BUCKET);
territoryDenyUseageMaterials.add(Material.WATER_BUCKET); territoryDenyUseageMaterials.add(Material.WATER_BUCKET);
territoryDenyUseageMaterials.add(Material.LAVA_BUCKET); territoryDenyUseageMaterials.add(Material.LAVA_BUCKET);
if (!SaberFactions.plugin.mc17) { if (!P.p.mc17) {
territoryDenyUseageMaterials.add(Material.ARMOR_STAND); territoryDenyUseageMaterials.add(Material.ARMOR_STAND);
} }
@ -389,7 +389,7 @@ public class Conf {
territoryDenyUseageMaterialsWhenOffline.add(Material.BUCKET); territoryDenyUseageMaterialsWhenOffline.add(Material.BUCKET);
territoryDenyUseageMaterialsWhenOffline.add(Material.WATER_BUCKET); territoryDenyUseageMaterialsWhenOffline.add(Material.WATER_BUCKET);
territoryDenyUseageMaterialsWhenOffline.add(Material.LAVA_BUCKET); territoryDenyUseageMaterialsWhenOffline.add(Material.LAVA_BUCKET);
if (!SaberFactions.plugin.mc17) { if (!P.p.mc17) {
territoryDenyUseageMaterialsWhenOffline.add(Material.ARMOR_STAND); territoryDenyUseageMaterialsWhenOffline.add(Material.ARMOR_STAND);
} }
safeZoneNerfedCreatureTypes.add(EntityType.BLAZE); safeZoneNerfedCreatureTypes.add(EntityType.BLAZE);
@ -416,11 +416,11 @@ public class Conf {
} }
public static void load() { public static void load() {
SaberFactions.plugin.persist.loadOrSaveDefault(i, Conf.class, "conf"); P.p.persist.loadOrSaveDefault(i, Conf.class, "conf");
} }
public static void save() { public static void save() {
SaberFactions.plugin.persist.save(i); P.p.persist.save(i);
} }
public enum Backend { public enum Backend {

View File

@ -47,11 +47,11 @@ import java.util.logging.Level;
import java.util.stream.Collectors; import java.util.stream.Collectors;
public class SaberFactions extends MPlugin { public class P extends MPlugin {
// Our single plugin instance. // Our single plugin instance.
// Single 4 life. // Single 4 life.
public static SaberFactions plugin; public static P p;
public static Permission perms = null; public static Permission perms = null;
// This plugin sets the boolean true when fully enabled. // This plugin sets the boolean true when fully enabled.
// Plugins can check this boolean while hooking in have // Plugins can check this boolean while hooking in have
@ -80,8 +80,8 @@ public class SaberFactions extends MPlugin {
private Listener[] eventsListener; private Listener[] eventsListener;
public static Economy econ = null; public static Economy econ = null;
public SaberFactions() { public P() {
plugin = this; p = this;
} }
public boolean getLocked() { public boolean getLocked() {
@ -134,26 +134,26 @@ public class SaberFactions extends MPlugin {
// Vault dependency check. // Vault dependency check.
if (getServer().getPluginManager().getPlugin("Vault") == null) { if (getServer().getPluginManager().getPlugin("Vault") == null) {
log("Vault is not present, the plugin will not run properly."); log("Vault is not present, the plugin will not run properly.");
getServer().getPluginManager().disablePlugin(plugin); getServer().getPluginManager().disablePlugin(p);
return; return;
} }
int version = Integer.parseInt(ReflectionUtils.PackageType.getServerVersion().split("_")[1]); int version = Integer.parseInt(ReflectionUtils.PackageType.getServerVersion().split("_")[1]);
switch (version) { switch (version) {
case 7: case 7:
SaberFactions.plugin.log("Minecraft Version 1.7 found, disabling banners, itemflags inside GUIs, and Titles."); P.p.log("Minecraft Version 1.7 found, disabling banners, itemflags inside GUIs, and Titles.");
mc17 = true; mc17 = true;
break; break;
case 8: case 8:
SaberFactions.plugin.log("Minecraft Version 1.8 found, Title Fadeouttime etc will not be configurable."); P.p.log("Minecraft Version 1.8 found, Title Fadeouttime etc will not be configurable.");
mc18 = true; mc18 = true;
break; break;
case 13: case 13:
SaberFactions.plugin.log("Minecraft Version 1.13 found, New Items will be used."); P.p.log("Minecraft Version 1.13 found, New Items will be used.");
mc113 = true; mc113 = true;
break; break;
case 14: case 14:
SaberFactions.plugin.log("Minecraft Version 1.14 found."); P.p.log("Minecraft Version 1.14 found.");
mc114 = true; mc114 = true;
break; break;
} }
@ -220,7 +220,7 @@ public class SaberFactions extends MPlugin {
} }
if (getServer().getPluginManager().getPlugin("Skript") != null) { if (getServer().getPluginManager().getPlugin("Skript") != null) {
log("Skript was found! Registering SaberFactions Addon..."); log("Skript was found! Registering P Addon...");
skriptAddon = Skript.registerAddon(this); skriptAddon = Skript.registerAddon(this);
try { try {
skriptAddon.loadClasses("com.massivecraft.factions.skript", "expressions"); skriptAddon.loadClasses("com.massivecraft.factions.skript", "expressions");
@ -253,8 +253,8 @@ public class SaberFactions extends MPlugin {
getCommand(this.refCommand).setTabCompleter(this); getCommand(this.refCommand).setTabCompleter(this);
RegisteredServiceProvider<Economy> rsp = SaberFactions.this.getServer().getServicesManager().getRegistration(Economy.class); RegisteredServiceProvider<Economy> rsp = P.this.getServer().getServicesManager().getRegistration(Economy.class);
SaberFactions.econ = rsp.getProvider(); P.econ = rsp.getProvider();
if (getDescription().getFullName().contains("BETA")) { if (getDescription().getFullName().contains("BETA")) {
divider(); divider();
@ -268,7 +268,7 @@ public class SaberFactions extends MPlugin {
this.postEnable(); this.postEnable();
this.loadSuccessful = true; this.loadSuccessful = true;
// Set startup finished to true. to give plugins hooking in a greenlight // Set startup finished to true. to give plugins hooking in a greenlight
SaberFactions.startupFinished = true; P.startupFinished = true;
} }
public SkriptAddon getSkriptAddon() { public SkriptAddon getSkriptAddon() {
@ -429,14 +429,14 @@ public class SaberFactions extends MPlugin {
public ItemStack createLazyItem(Material material, int amount, short datavalue, String name, String lore) { public ItemStack createLazyItem(Material material, int amount, short datavalue, String name, String lore) {
ItemStack item = new ItemStack(material, amount, datavalue); ItemStack item = new ItemStack(material, amount, datavalue);
ItemMeta meta = item.getItemMeta(); ItemMeta meta = item.getItemMeta();
meta.setDisplayName(color(SaberFactions.plugin.getConfig().getString(name))); meta.setDisplayName(color(P.p.getConfig().getString(name)));
meta.setLore(colorList(SaberFactions.plugin.getConfig().getStringList(lore))); meta.setLore(colorList(P.p.getConfig().getStringList(lore)));
item.setItemMeta(meta); item.setItemMeta(meta);
return item; return item;
} }
public Economy getEcon() { public Economy getEcon() {
RegisteredServiceProvider<Economy> rsp = SaberFactions.plugin.getServer().getServicesManager().getRegistration(Economy.class); RegisteredServiceProvider<Economy> rsp = P.p.getServer().getServicesManager().getRegistration(Economy.class);
Economy econ = rsp.getProvider(); Economy econ = rsp.getProvider();
return econ; return econ;
} }
@ -512,11 +512,11 @@ public class SaberFactions extends MPlugin {
as.setVisible(false); //Makes the ArmorStand invisible as.setVisible(false); //Makes the ArmorStand invisible
as.setGravity(false); //Make sure it doesn't fall as.setGravity(false); //Make sure it doesn't fall
as.setCanPickupItems(false); //I'm not sure what happens if you leave this as it is, but you might as well disable it as.setCanPickupItems(false); //I'm not sure what happens if you leave this as it is, but you might as well disable it
as.setCustomName(SaberFactions.plugin.color(text)); //Set this to the text you want as.setCustomName(P.p.color(text)); //Set this to the text you want
as.setCustomNameVisible(true); //This makes the text appear no matter if your looking at the entity or not as.setCustomNameVisible(true); //This makes the text appear no matter if your looking at the entity or not
final ArmorStand armorStand = as; final ArmorStand armorStand = as;
Bukkit.getScheduler().scheduleSyncDelayedTask(SaberFactions.plugin, () -> { Bukkit.getScheduler().scheduleSyncDelayedTask(P.p, () -> {
armorStand.remove(); armorStand.remove();
getLogger().info("Removing Hologram."); getLogger().info("Removing Hologram.");
} }

View File

@ -1,16 +1,16 @@
package com.massivecraft.factions.cmd; 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.CommandVisibility;
import com.massivecraft.factions.zcore.MCommand; import com.massivecraft.factions.zcore.MCommand;
import com.massivecraft.factions.zcore.util.TL; import com.massivecraft.factions.zcore.util.TL;
import java.util.ArrayList; import java.util.ArrayList;
public class CmdAutoHelp extends MCommand<SaberFactions> { public class CmdAutoHelp extends MCommand<P> {
public CmdAutoHelp() { public CmdAutoHelp() {
super(SaberFactions.plugin); super(P.p);
this.aliases.add("?"); this.aliases.add("?");
this.aliases.add("h"); this.aliases.add("h");
this.aliases.add("help"); this.aliases.add("help");

View File

@ -1,7 +1,7 @@
package com.massivecraft.factions.cmd; package com.massivecraft.factions.cmd;
import com.massivecraft.factions.FPlayer; 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.event.FPlayerLeaveEvent;
import com.massivecraft.factions.struct.BanInfo; import com.massivecraft.factions.struct.BanInfo;
import com.massivecraft.factions.struct.Permission; import com.massivecraft.factions.struct.Permission;
@ -81,7 +81,7 @@ public class CmdBan extends FCommand {
if (event.isCancelled()) { if (event.isCancelled()) {
// if someone cancels a ban, we'll get people complaining here. So lets log it. // 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; return;
} }

View File

@ -1,7 +1,7 @@
package com.massivecraft.factions.cmd; package com.massivecraft.factions.cmd;
import com.massivecraft.factions.FPlayer; 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.Permission;
import com.massivecraft.factions.util.XMaterial; import com.massivecraft.factions.util.XMaterial;
import com.massivecraft.factions.zcore.util.TL; import com.massivecraft.factions.zcore.util.TL;
@ -33,28 +33,28 @@ public class CmdBanner extends FCommand {
@Override @Override
public void perform() { public void perform() {
if (!SaberFactions.plugin.getConfig().getBoolean("fbanners.Enabled")) { if (!P.p.getConfig().getBoolean("fbanners.Enabled")) {
msg(TL.COMMAND_BANNER_DISABLED); msg(TL.COMMAND_BANNER_DISABLED);
return; 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); msg(TL.COMMAND_BANNER_NOTENOUGHMONEY);
return; 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(); //BannerMeta bannerMeta = (BannerMeta) warBanner.getItemMeta();
ItemStack warBanner = fme.getFaction().getBanner(); ItemStack warBanner = fme.getFaction().getBanner();
if (warBanner != null) { if (warBanner != null) {
ItemMeta warmeta = warBanner.getItemMeta(); ItemMeta warmeta = warBanner.getItemMeta();
warmeta.setDisplayName(SaberFactions.plugin.color(SaberFactions.plugin.getConfig().getString("fbanners.Item.Name"))); warmeta.setDisplayName(P.p.color(P.p.getConfig().getString("fbanners.Item.Name")));
warmeta.setLore(SaberFactions.plugin.colorList(SaberFactions.plugin.getConfig().getStringList("fbanners.Item.Lore"))); warmeta.setLore(P.p.colorList(P.p.getConfig().getStringList("fbanners.Item.Lore")));
warBanner.setItemMeta(warmeta); warBanner.setItemMeta(warmeta);
} else { } 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); fme.msg(TL.COMMAND_BANNER_SUCCESS);
warBanner.setAmount(1); warBanner.setAmount(1);
@ -63,7 +63,7 @@ public class CmdBanner extends FCommand {
public boolean hasMoney(FPlayer fme, int amt) { public boolean hasMoney(FPlayer fme, int amt) {
Economy econ = SaberFactions.plugin.getEcon(); Economy econ = P.p.getEcon();
if (econ.getBalance(fme.getPlayer()) >= amt) { if (econ.getBalance(fme.getPlayer()) >= amt) {
return true; return true;
} else { } else {
@ -74,7 +74,7 @@ public class CmdBanner extends FCommand {
public void takeMoney(FPlayer fme, int amt) { public void takeMoney(FPlayer fme, int amt) {
if (hasMoney(fme, amt)) { if (hasMoney(fme, amt)) {
Economy econ = SaberFactions.plugin.getEcon(); Economy econ = P.p.getEcon();
econ.withdrawPlayer(fme.getPlayer(), amt); econ.withdrawPlayer(fme.getPlayer(), amt);
fme.sendMessage(TL.COMMAND_BANNER_MONEYTAKE.toString().replace("{amount}", amt + "")); fme.sendMessage(TL.COMMAND_BANNER_MONEYTAKE.toString().replace("{amount}", amt + ""));
} }

View File

@ -1,6 +1,6 @@
package com.massivecraft.factions.cmd; 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.Permission;
import com.massivecraft.factions.zcore.util.TL; 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?? // TODO: Move this to a transient field in the model??
if (fme.isAdminBypassing()) { if (fme.isAdminBypassing()) {
fme.msg(TL.COMMAND_BYPASS_ENABLE.toString()); 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 { } else {
fme.msg(TL.COMMAND_BYPASS_DISABLE.toString()); 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());
} }
} }

View File

@ -1,6 +1,6 @@
package com.massivecraft.factions.cmd; 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.Permission;
import com.massivecraft.factions.zcore.util.TL; import com.massivecraft.factions.zcore.util.TL;
@ -28,10 +28,10 @@ public class CmdChatSpy extends FCommand {
if (fme.isSpyingChat()) { if (fme.isSpyingChat()) {
fme.msg(TL.COMMAND_CHATSPY_ENABLE); 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 { } else {
fme.msg(TL.COMMAND_CHATSPY_DISABLE); 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());
} }
} }

View File

@ -26,7 +26,7 @@ public class CmdCheckpoint extends FCommand {
@Override @Override
public void perform() { public void perform() {
if (!SaberFactions.plugin.getConfig().getBoolean("checkpoints.Enabled")) { if (!P.p.getConfig().getBoolean("checkpoints.Enabled")) {
fme.msg(TL.COMMAND_CHECKPOINT_DISABLED); fme.msg(TL.COMMAND_CHECKPOINT_DISABLED);
return; return;
} }

View File

@ -1,6 +1,6 @@
package com.massivecraft.factions.cmd; 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.Permission;
import com.massivecraft.factions.struct.Role; import com.massivecraft.factions.struct.Role;
import com.massivecraft.factions.zcore.fperms.Access; import com.massivecraft.factions.zcore.fperms.Access;
@ -30,7 +30,7 @@ public class CmdChest extends FCommand {
public void perform() { public void perform() {
if (!SaberFactions.plugin.getConfig().getBoolean("fchest.Enabled")) { if (!P.p.getConfig().getBoolean("fchest.Enabled")) {
fme.sendMessage("This command is disabled!"); fme.sendMessage("This command is disabled!");
return; return;
} }

View File

@ -1,7 +1,7 @@
package com.massivecraft.factions.cmd; package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Conf; 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.struct.Permission;
import com.massivecraft.factions.zcore.util.TL; import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
@ -231,10 +231,10 @@ public class CmdConfig extends FCommand {
if (!success.isEmpty()) { if (!success.isEmpty()) {
if (sender instanceof Player) { if (sender instanceof Player) {
sendMessage(success); sendMessage(success);
SaberFactions.plugin.log(success + TL.COMMAND_CONFIG_LOG.format((Player) sender)); P.p.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 } 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 // save change to disk

View File

@ -97,7 +97,7 @@ public class CmdCreate extends FCommand {
// That way we don't have to mess up deleting more stuff. // 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. // And prevent the user from being returned to NORMAL after deleting his old faction.
fme.setRole(Role.LEADER); 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()) { for (FPlayer follower : FPlayers.getInstance().getOnlinePlayers()) {
follower.msg(TL.COMMAND_CREATE_CREATED, fme.describeTo(follower, true), faction.getTag(follower)); 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) 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); this.fme.msg(TL.COMMAND_PAYPALSET_CREATED);
if (Conf.useCustomDefaultPermissions) faction.setDefaultPerms(); if (Conf.useCustomDefaultPermissions) faction.setDefaultPerms();
if (Conf.usePermissionHints) fme.msg(TL.COMMAND_HINT_PERMISSION); 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));
} }

View File

@ -1,7 +1,7 @@
package com.massivecraft.factions.cmd; package com.massivecraft.factions.cmd;
import com.massivecraft.factions.FPlayer; 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.Permission;
import com.massivecraft.factions.zcore.util.TL; import com.massivecraft.factions.zcore.util.TL;
@ -35,7 +35,7 @@ public class CmdDelFWarp extends FCommand {
} }
private boolean transact(FPlayer player) { 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 @Override

View File

@ -87,15 +87,15 @@ public class CmdDisband extends FCommand {
if ((fme!= null && !disbandMap.containsKey(me.getUniqueId().toString())) && faction.getTnt() > 0) { if ((fme!= null && !disbandMap.containsKey(me.getUniqueId().toString())) && faction.getTnt() > 0) {
msg(TL.COMMAND_DISBAND_CONFIRM.toString().replace("{tnt}", faction.getTnt() + "")); msg(TL.COMMAND_DISBAND_CONFIRM.toString().replace("{tnt}", faction.getTnt() + ""));
disbandMap.put(me.getUniqueId().toString(), faction.getId()); 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) { } 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()) { for (FPlayer follower : FPlayers.getInstance().getOnlinePlayers()) {
String amountString = senderIsConsole ? TL.GENERIC_SERVERADMIN.toString() : fme.describeTo(follower); String amountString = senderIsConsole ? TL.GENERIC_SERVERADMIN.toString() : fme.describeTo(follower);
UtilFly.checkFly(this.fme, Board.getInstance().getFactionAt(new FLocation(follower))); UtilFly.checkFly(this.fme, Board.getInstance().getFactionAt(new FLocation(follower)));
if (follower.getFaction() == faction) { if (follower.getFaction() == faction) {
follower.msg(TL.COMMAND_DISBAND_BROADCAST_YOURS, amountString); 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 { } else {
follower.msg(TL.COMMAND_DISBAND_BROADCAST_NOTYOURS, amountString, faction.getTag(follower)); follower.msg(TL.COMMAND_DISBAND_BROADCAST_NOTYOURS, amountString, faction.getTag(follower));
} }

View File

@ -1,7 +1,7 @@
package com.massivecraft.factions.cmd; package com.massivecraft.factions.cmd;
import com.massivecraft.factions.FPlayer; 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.Permission;
import com.massivecraft.factions.struct.Role; import com.massivecraft.factions.struct.Role;
import com.massivecraft.factions.util.WarmUpUtil; import com.massivecraft.factions.util.WarmUpUtil;
@ -80,7 +80,7 @@ public class CmdFWarp extends FCommand {
} }
private boolean transact(FPlayer player) { 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 @Override

View File

@ -39,11 +39,11 @@ public class CmdFly extends FCommand {
public static void startParticles() { public static void startParticles() {
// Just a secondary check. // Just a secondary check.
if (!SaberFactions.plugin.getConfig().getBoolean("ffly.Particles.Enabled")) { if (!P.p.getConfig().getBoolean("ffly.Particles.Enabled")) {
return; return;
} }
id = Bukkit.getScheduler().scheduleSyncRepeatingTask(SaberFactions.plugin, () -> { id = Bukkit.getScheduler().scheduleSyncRepeatingTask(P.p, () -> {
for (String name : flyMap.keySet()) { for (String name : flyMap.keySet()) {
Player player = Bukkit.getPlayer(name); Player player = Bukkit.getPlayer(name);
if (player == null) { if (player == null) {
@ -52,7 +52,7 @@ public class CmdFly extends FCommand {
if (!player.isFlying()) { if (!player.isFlying()) {
continue; continue;
} }
if (!SaberFactions.plugin.mc17) { if (!P.p.mc17) {
if (player.getGameMode() == GameMode.SPECTATOR) { if (player.getGameMode() == GameMode.SPECTATOR) {
continue; continue;
} }
@ -61,12 +61,12 @@ public class CmdFly extends FCommand {
if (FPlayers.getInstance().getByPlayer(player).isVanished()) { 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. // 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. // 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; return;
} }
continue; continue;
} }
if (SaberFactions.plugin.useNonPacketParticles) { if (P.p.useNonPacketParticles) {
// 1.9+ based servers will use the built in particleAPI instead of packet based. // 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. // 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 // 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() { 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(); checkTaskState();
if (flyMap.keySet().size() != 0) { if (flyMap.keySet().size() != 0) {
for (String name : flyMap.keySet()) { for (String name : flyMap.keySet()) {
@ -95,7 +95,7 @@ public class CmdFly extends FCommand {
if (player == null if (player == null
|| !player.isFlying() || !player.isFlying()
|| player.getGameMode() == GameMode.CREATIVE || player.getGameMode() == GameMode.CREATIVE
|| !SaberFactions.plugin.mc17 && player.getGameMode() == GameMode.SPECTATOR) { || !P.p.mc17 && player.getGameMode() == GameMode.SPECTATOR) {
continue; continue;
} }
FPlayer fPlayer = FPlayers.getInstance().getByPlayer(player); FPlayer fPlayer = FPlayers.getInstance().getByPlayer(player);
@ -171,7 +171,7 @@ public class CmdFly extends FCommand {
@Override @Override
public void perform() { public void perform() {
// Disabled by default. // 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); fme.msg(TL.COMMAND_FLY_DISABLED);
return; return;
} }
@ -212,7 +212,7 @@ public class CmdFly extends FCommand {
fme.setFlying(true); fme.setFlying(true);
flyMap.put(player.getName(), true); flyMap.put(player.getName(), true);
if (id == -1) { if (id == -1) {
if (SaberFactions.plugin.getConfig().getBoolean("ffly.Particles.Enabled")) { if (P.p.getConfig().getBoolean("ffly.Particles.Enabled")) {
startParticles(); startParticles();
} }
} }

View File

@ -1,7 +1,7 @@
package com.massivecraft.factions.cmd; package com.massivecraft.factions.cmd;
import com.massivecraft.factions.FPlayer; 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.scoreboards.FTeamWrapper;
import com.massivecraft.factions.struct.Permission; import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.util.TL; import com.massivecraft.factions.zcore.util.TL;
@ -24,7 +24,7 @@ public class CmdFocus
} }
public void perform() { public void perform() {
if (!SaberFactions.plugin.getConfig().getBoolean("ffocus.Enabled")) { if (!P.p.getConfig().getBoolean("ffocus.Enabled")) {
fme.msg(TL.GENERIC_DISABLED); fme.msg(TL.GENERIC_DISABLED);
return; return;
} }

View File

@ -1,6 +1,6 @@
package com.massivecraft.factions.cmd; 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.Permission;
import com.massivecraft.factions.zcore.util.TL; import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.Location; import org.bukkit.Location;
@ -27,12 +27,12 @@ public class CmdGetVault extends FCommand {
@Override @Override
public void perform() { public void perform() {
if (!SaberFactions.plugin.getConfig().getBoolean("fvault.Enabled")) { if (!P.p.getConfig().getBoolean("fvault.Enabled")) {
fme.sendMessage("This command is disabled!"); fme.sendMessage("This command is disabled!");
return; return;
} }
Location vaultLocation = fme.getFaction().getVault(); 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 //check if vault is set
@ -43,7 +43,7 @@ public class CmdGetVault extends FCommand {
//has enough money? //has enough money?
int amount = SaberFactions.plugin.getConfig().getInt("fvault.Price"); int amount = P.p.getConfig().getInt("fvault.Price");
if (!fme.hasMoney(amount)) { if (!fme.hasMoney(amount)) {
return; return;
} }

View File

@ -1,7 +1,7 @@
package com.massivecraft.factions.cmd; package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Conf; 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.struct.Permission;
import com.massivecraft.factions.zcore.util.TL; import com.massivecraft.factions.zcore.util.TL;
@ -24,7 +24,7 @@ public class CmdGrace extends FCommand {
@Override @Override
public void perform() { public void perform() {
if (!SaberFactions.plugin.getConfig().getBoolean("f-grace.Enabled")) { if (!P.p.getConfig().getBoolean("f-grace.Enabled")) {
fme.msg(TL.GENERIC_DISABLED); fme.msg(TL.GENERIC_DISABLED);
return; return;
} }

View File

@ -1,7 +1,7 @@
package com.massivecraft.factions.cmd; package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Conf; 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.integration.Econ;
import com.massivecraft.factions.struct.Permission; import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.util.TL; import com.massivecraft.factions.zcore.util.TL;
@ -40,7 +40,7 @@ public class CmdHelp extends FCommand {
@Override @Override
public void perform() { public void perform() {
if (SaberFactions.plugin.getConfig().getBoolean("use-old-help", true)) { if (P.p.getConfig().getBoolean("use-old-help", true)) {
if (helpPages == null) { if (helpPages == null) {
updateHelp(); updateHelp();
} }
@ -57,9 +57,9 @@ public class CmdHelp extends FCommand {
sendMessage(helpPages.get(page)); sendMessage(helpPages.get(page));
return; return;
} }
ConfigurationSection help = SaberFactions.plugin.getConfig().getConfigurationSection("help"); ConfigurationSection help = P.p.getConfig().getConfigurationSection("help");
if (help == null) { 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<>(); List<String> error = new ArrayList<>();
error.add("&cUpdate help messages in config.yml!"); error.add("&cUpdate help messages in config.yml!");
error.add("&cSet use-old-help for legacy help messages"); error.add("&cSet use-old-help for legacy help messages");
@ -72,7 +72,7 @@ public class CmdHelp extends FCommand {
return; return;
} }
for (String helpLine : page) { 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.cmdSafeunclaimall.getUseageTemplate(true));
pageLines.add(p.cmdBase.cmdWarunclaimall.getUseageTemplate(true)); pageLines.add(p.cmdBase.cmdWarunclaimall.getUseageTemplate(true));
//TODO:TL //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)); pageLines.add(p.cmdBase.cmdPeaceful.getUseageTemplate(true));
helpPages.add(pageLines); helpPages.add(pageLines);

View File

@ -1,7 +1,7 @@
package com.massivecraft.factions.cmd; package com.massivecraft.factions.cmd;
import com.massivecraft.factions.FPlayer; 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.Permission;
import com.massivecraft.factions.struct.Role; import com.massivecraft.factions.struct.Role;
import com.massivecraft.factions.zcore.fperms.Access; import com.massivecraft.factions.zcore.fperms.Access;
@ -37,7 +37,7 @@ public class CmdInventorySee extends FCommand {
@Override @Override
public void perform() { 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); fme.msg(TL.GENERIC_DISABLED);
} }

View File

@ -83,7 +83,7 @@ public class CmdJoin extends FCommand {
if (level == 0) { if (level == 0) {
limit = Conf.factionMemberLimit; limit = Conf.factionMemberLimit;
} else { } 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)) { if (limit > 0 && faction.getFPlayers().size() >= limit && !faction.altInvited(fme)) {
@ -145,9 +145,9 @@ public class CmdJoin extends FCommand {
if (Conf.logFactionJoin) { if (Conf.logFactionJoin) {
if (samePlayer) { 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 { } 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());
} }
} }
} }

View File

@ -3,7 +3,7 @@ package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Conf; import com.massivecraft.factions.Conf;
import com.massivecraft.factions.FPlayer; import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.Faction; 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.event.FPlayerLeaveEvent;
import com.massivecraft.factions.struct.Permission; import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.struct.Role; import com.massivecraft.factions.struct.Role;
@ -68,8 +68,8 @@ public class CmdKick extends FCommand {
} }
if(toKick.isAlt()){ if(toKick.isAlt()){
msg(SaberFactions.plugin.color("&cToo few arguments, &eUse like this:")); msg(P.p.color("&cToo few arguments, &eUse like this:"));
msg(SaberFactions.plugin.color("&b/f alts,alt kick &3<player name>")); msg(P.p.color("&b/f alts,alt kick &3<player name>"));
return; return;
} }
@ -129,7 +129,7 @@ public class CmdKick extends FCommand {
fme.msg(TL.COMMAND_KICK_KICKS, toKick.describeTo(fme), toKickFaction.describeTo(fme)); fme.msg(TL.COMMAND_KICK_KICKS, toKick.describeTo(fme), toKickFaction.describeTo(fme));
} }
if (Conf.logFactionKick) { 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) { if (toKick.getRole() == Role.LEADER) {
toKickFaction.promoteNewLeader(); toKickFaction.promoteNewLeader();

View File

@ -3,7 +3,7 @@ package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Conf; import com.massivecraft.factions.Conf;
import com.massivecraft.factions.Faction; import com.massivecraft.factions.Faction;
import com.massivecraft.factions.Factions; 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.struct.Permission;
import com.massivecraft.factions.zcore.util.TL; import com.massivecraft.factions.zcore.util.TL;
import com.massivecraft.factions.zcore.util.TagUtil; import com.massivecraft.factions.zcore.util.TagUtil;
@ -51,7 +51,7 @@ public class CmdList extends FCommand {
// remove exempt factions // remove exempt factions
if (fme != null && fme.getPlayer() != null && !fme.getPlayer().hasPermission("factions.show.bypassexempt")) { 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())); factionList.removeIf(next -> exemptFactions.contains(next.getTag()));
} }

View File

@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd;
import com.massivecraft.factions.FPlayer; import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.FPlayers; import com.massivecraft.factions.FPlayers;
import com.massivecraft.factions.SaberFactions; import com.massivecraft.factions.P;
import com.massivecraft.factions.zcore.util.TL; import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -26,12 +26,12 @@ public class CmdNear extends FCommand {
@Override @Override
public void perform() { public void perform() {
if (!SaberFactions.plugin.getConfig().getBoolean("fnear.Enabled")) { if (!P.p.getConfig().getBoolean("fnear.Enabled")) {
fme.msg(TL.COMMAND_NEAR_DISABLED_MSG); fme.msg(TL.COMMAND_NEAR_DISABLED_MSG);
return; return;
} }
double range = SaberFactions.plugin.getConfig().getInt("fnear.Radius"); double range = P.p.getConfig().getInt("fnear.Radius");
String format = TL.COMMAND_NEAR_FORMAT.toString(); String format = TL.COMMAND_NEAR_FORMAT.toString();
fme.msg(TL.COMMAND_NEAR_USE_MSG); fme.msg(TL.COMMAND_NEAR_USE_MSG);
for (Entity e : me.getNearbyEntities(range, 255, range)) { for (Entity e : me.getNearbyEntities(range, 255, range)) {

View File

@ -3,7 +3,7 @@ package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Conf; import com.massivecraft.factions.Conf;
import com.massivecraft.factions.FPlayer; import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.FPlayers; 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.struct.Permission;
import com.massivecraft.factions.zcore.util.TL; 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); 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 @Override

View File

@ -1,7 +1,7 @@
package com.massivecraft.factions.cmd; package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Faction; 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.struct.Permission;
import com.massivecraft.factions.zcore.util.TL; import com.massivecraft.factions.zcore.util.TL;
@ -25,7 +25,7 @@ public class CmdPaypalSee extends FCommand {
} }
@Override @Override
public void perform() { public void perform() {
if (!SaberFactions.plugin.getConfig().getBoolean("fpaypal.Enabled")) { if (!P.p.getConfig().getBoolean("fpaypal.Enabled")) {
fme.msg(TL.GENERIC_DISABLED); fme.msg(TL.GENERIC_DISABLED);
return; return;
} }
@ -50,7 +50,7 @@ public class CmdPaypalSee extends FCommand {
msg(TL.GENERIC_NOPERMISSION, "see another factions paypal."); msg(TL.GENERIC_NOPERMISSION, "see another factions paypal.");
} }
} else { } else {
msg(SaberFactions.plugin.cmdBase.cmdPaypalSee.getUseageTemplate()); msg(P.p.cmdBase.cmdPaypalSee.getUseageTemplate());
} }
} }

View File

@ -1,7 +1,7 @@
package com.massivecraft.factions.cmd; package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Faction; 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.struct.Permission;
import com.massivecraft.factions.zcore.util.TL; import com.massivecraft.factions.zcore.util.TL;
@ -27,7 +27,7 @@ public class CmdPaypalSet extends FCommand {
@Override @Override
public void perform() { public void perform() {
if (!SaberFactions.plugin.getConfig().getBoolean("fpaypal.Enabled")) { if (!P.p.getConfig().getBoolean("fpaypal.Enabled")) {
fme.msg(TL.GENERIC_DISABLED); fme.msg(TL.GENERIC_DISABLED);
return; return;
} }
@ -54,7 +54,7 @@ public class CmdPaypalSet extends FCommand {
msg(TL.GENERIC_NOPERMISSION, "set another factions paypal!"); msg(TL.GENERIC_NOPERMISSION, "set another factions paypal!");
} }
} else { } else {
msg(SaberFactions.plugin.cmdBase.cmdPaypalSet.getUseageTemplate()); msg(P.p.cmdBase.cmdPaypalSet.getUseageTemplate());
} }
} }

View File

@ -1,6 +1,6 @@
package com.massivecraft.factions.cmd; 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.Relation;
import com.massivecraft.factions.struct.Role; import com.massivecraft.factions.struct.Role;
import com.massivecraft.factions.zcore.fperms.Access; 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)); 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) { private Permissable getPermissable(String name) {

View File

@ -3,7 +3,7 @@ package com.massivecraft.factions.cmd;
import com.massivecraft.factions.FPlayer; import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.FPlayers; import com.massivecraft.factions.FPlayers;
import com.massivecraft.factions.Faction; 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.struct.Permission;
import com.massivecraft.factions.zcore.util.TL; import com.massivecraft.factions.zcore.util.TL;
@ -43,7 +43,7 @@ public class CmdPermanent extends FCommand {
faction.setPermanent(true); 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 // Inform all players
for (FPlayer fplayer : FPlayers.getInstance().getOnlinePlayers()) { for (FPlayer fplayer : FPlayers.getInstance().getOnlinePlayers()) {

View File

@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd;
import com.massivecraft.factions.FPlayer; import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.Faction; 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.struct.Permission;
import com.massivecraft.factions.zcore.util.TL; import com.massivecraft.factions.zcore.util.TL;
@ -77,7 +77,7 @@ public class CmdPowerBoost extends FCommand {
int roundedPower = (int) Math.round(targetPower); int roundedPower = (int) Math.round(targetPower);
msg(TL.COMMAND_POWERBOOST_BOOST, target, roundedPower); msg(TL.COMMAND_POWERBOOST_BOOST, target, roundedPower);
if (!senderIsConsole) { 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);
} }
} }

View File

@ -1,7 +1,7 @@
package com.massivecraft.factions.cmd; package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Conf; 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.struct.Permission;
import com.massivecraft.factions.zcore.util.TL; import com.massivecraft.factions.zcore.util.TL;
@ -26,12 +26,12 @@ public class CmdReload extends FCommand {
long timeInitStart = System.currentTimeMillis(); long timeInitStart = System.currentTimeMillis();
Conf.load(); Conf.load();
Conf.save(); Conf.save();
SaberFactions.plugin.reloadConfig(); P.p.reloadConfig();
SaberFactions.plugin.loadLang(); P.p.loadLang();
if (SaberFactions.plugin.getConfig().getBoolean("enable-faction-flight")) { if (P.p.getConfig().getBoolean("enable-faction-flight")) {
SaberFactions.plugin.factionsFlight = true; P.p.factionsFlight = true;
} }
long timeReload = (System.currentTimeMillis() - timeInitStart); long timeReload = (System.currentTimeMillis() - timeInitStart);

View File

@ -1,6 +1,6 @@
package com.massivecraft.factions.cmd; 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.Permission;
import com.massivecraft.factions.zcore.util.TL; import com.massivecraft.factions.zcore.util.TL;
@ -29,19 +29,19 @@ public class CmdRules extends FCommand {
@Override @Override
public void perform() { public void perform() {
if (!SaberFactions.plugin.getConfig().getBoolean("frules.Enabled")) { if (!P.p.getConfig().getBoolean("frules.Enabled")) {
fme.msg(TL.COMMAND_RULES_DISABLED_MSG); fme.msg(TL.COMMAND_RULES_DISABLED_MSG);
return; return;
} }
if (this.args.size() == 0) { if (this.args.size() == 0) {
HashMap<Integer, String> rules = fme.getFaction().getRulesMap(); HashMap<Integer, String> rules = fme.getFaction().getRulesMap();
if (rules.size() == 0) { if (rules.size() == 0) {
List<String> ruleList = SaberFactions.plugin.getConfig().getStringList("frules.default-rules"); List<String> ruleList = P.p.getConfig().getStringList("frules.default-rules");
fme.sendMessage(SaberFactions.plugin.colorList(ruleList)); fme.sendMessage(P.p.colorList(ruleList));
} else { } else {
for (int i = 0; i <= rules.size() - 1; i++) { 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)));
} }
} }

View File

@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd;
import com.massivecraft.factions.FLocation; 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.struct.Permission;
import com.massivecraft.factions.util.Particles.ParticleEffect; import com.massivecraft.factions.util.Particles.ParticleEffect;
import com.massivecraft.factions.util.VisualizeUtil; import com.massivecraft.factions.util.VisualizeUtil;
@ -12,7 +12,6 @@ import org.bukkit.*;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator;
public class CmdSeeChunk extends FCommand { public class CmdSeeChunk extends FCommand {
@ -41,7 +40,7 @@ public class CmdSeeChunk extends FCommand {
this.useParticles = p.getConfig().getBoolean("see-chunk.particles", true); 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) { if (effect == null) {
effect = ParticleEffect.REDSTONE; effect = ParticleEffect.REDSTONE;
} }
@ -72,7 +71,7 @@ public class CmdSeeChunk extends FCommand {
} }
private void startTask() { private void startTask() {
taskID = Bukkit.getScheduler().scheduleSyncRepeatingTask(SaberFactions.plugin, () -> { taskID = Bukkit.getScheduler().scheduleSyncRepeatingTask(P.p, () -> {
for (Object nameObject : seeChunkMap.keySet()) { for (Object nameObject : seeChunkMap.keySet()) {
String name = nameObject + ""; String name = nameObject + "";
Player player = Bukkit.getPlayer(name); Player player = Bukkit.getPlayer(name);
@ -116,10 +115,10 @@ public class CmdSeeChunk extends FCommand {
continue; continue;
} }
if (useParticles) { if (useParticles) {
if (SaberFactions.plugin.useNonPacketParticles) { if (P.p.useNonPacketParticles) {
// Dust options only exists in the 1.13 API, so we use an // Dust options only exists in the 1.13 API, so we use an
// alternative method to achieve this in lower versions. // 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)); player.spawnParticle(Particle.REDSTONE, loc, 0, new Particle.DustOptions(Color.RED, 1));
} else { } else {
player.getWorld().spawnParticle(Particle.REDSTONE, loc, 0, 255, 0, 0, 1); player.getWorld().spawnParticle(Particle.REDSTONE, loc, 0, 255, 0, 0, 1);

View File

@ -1,7 +1,7 @@
package com.massivecraft.factions.cmd; package com.massivecraft.factions.cmd;
import com.massivecraft.factions.FPlayer; 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.Permission;
import com.massivecraft.factions.struct.Relation; import com.massivecraft.factions.struct.Relation;
import com.massivecraft.factions.struct.Role; 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. // Checks if warp with same name already exists and ignores maxWarp check if it does.
boolean warpExists = myFaction.isWarp(warp); 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(); boolean tooManyWarps = maxWarps <= myFaction.getWarps().size();
if (tooManyWarps && !warpExists) { if (tooManyWarps && !warpExists) {
fme.msg(TL.COMMAND_SETFWARP_LIMIT, maxWarps); fme.msg(TL.COMMAND_SETFWARP_LIMIT, maxWarps);
@ -73,7 +73,7 @@ public class CmdSetFWarp extends FCommand {
} }
private boolean transact(FPlayer player) { 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 @Override

View File

@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Conf; import com.massivecraft.factions.Conf;
import com.massivecraft.factions.Faction; 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.struct.Permission;
import com.massivecraft.factions.zcore.util.TL; import com.massivecraft.factions.zcore.util.TL;
import com.massivecraft.factions.zcore.util.TagReplacer; import com.massivecraft.factions.zcore.util.TagReplacer;
@ -57,7 +57,7 @@ public class CmdShow extends FCommand {
return; return;
if (fme != null && !fme.getPlayer().hasPermission("factions.show.bypassexempt") 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); msg(TL.COMMAND_SHOW_EXEMPT);
return; return;
} }
@ -67,7 +67,7 @@ public class CmdShow extends FCommand {
return; return;
} }
List<String> show = SaberFactions.plugin.getConfig().getStringList("show"); List<String> show = P.p.getConfig().getStringList("show");
if (show == null || show.isEmpty()) if (show == null || show.isEmpty())
show = defaults; show = defaults;

View File

@ -35,11 +35,11 @@ public class CmdStuck extends FCommand {
final Player player = fme.getPlayer(); final Player player = fme.getPlayer();
final Location sentAt = player.getLocation(); final Location sentAt = player.getLocation();
final FLocation chunk = fme.getLastStoodAt(); final FLocation chunk = fme.getLastStoodAt();
final long delay = SaberFactions.plugin.getConfig().getLong("hcf.stuck.delay", 30); final long delay = P.p.getConfig().getLong("hcf.stuck.delay", 30);
final int radius = SaberFactions.plugin.getConfig().getInt("hcf.stuck.radius", 10); final int radius = P.p.getConfig().getInt("hcf.stuck.radius", 10);
if (SaberFactions.plugin.getStuckMap().containsKey(player.getUniqueId())) { if (P.p.getStuckMap().containsKey(player.getUniqueId())) {
long wait = SaberFactions.plugin.getTimers().get(player.getUniqueId()) - System.currentTimeMillis(); long wait = P.p.getTimers().get(player.getUniqueId()) - System.currentTimeMillis();
String time = DurationFormatUtils.formatDuration(wait, TL.COMMAND_STUCK_TIMEFORMAT.toString(), true); String time = DurationFormatUtils.formatDuration(wait, TL.COMMAND_STUCK_TIMEFORMAT.toString(), true);
msg(TL.COMMAND_STUCK_EXISTS, time); msg(TL.COMMAND_STUCK_EXISTS, time);
} else { } else {
@ -49,11 +49,11 @@ public class CmdStuck extends FCommand {
return; return;
} }
final int id = Bukkit.getScheduler().runTaskLater(SaberFactions.plugin, new BukkitRunnable() { final int id = Bukkit.getScheduler().runTaskLater(P.p, new BukkitRunnable() {
@Override @Override
public void run() { public void run() {
if (!SaberFactions.plugin.getStuckMap().containsKey(player.getUniqueId())) { if (!P.p.getStuckMap().containsKey(player.getUniqueId())) {
return; return;
} }
@ -61,8 +61,8 @@ public class CmdStuck extends FCommand {
final World world = chunk.getWorld(); final World world = chunk.getWorld();
if (world.getUID() != player.getWorld().getUID() || sentAt.distance(player.getLocation()) > radius) { if (world.getUID() != player.getWorld().getUID() || sentAt.distance(player.getLocation()) > radius) {
msg(TL.COMMAND_STUCK_OUTSIDE.format(radius)); msg(TL.COMMAND_STUCK_OUTSIDE.format(radius));
SaberFactions.plugin.getTimers().remove(player.getUniqueId()); P.p.getTimers().remove(player.getUniqueId());
SaberFactions.plugin.getStuckMap().remove(player.getUniqueId()); P.p.getStuckMap().remove(player.getUniqueId());
return; return;
} }
@ -74,18 +74,18 @@ public class CmdStuck extends FCommand {
public boolean work() { public boolean work() {
FLocation chunk = currentFLocation(); FLocation chunk = currentFLocation();
Faction faction = board.getFactionAt(chunk); 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)) { if (faction.isWilderness() && !chunk.isOutsideWorldBorder(buffer)) {
int cx = FLocation.chunkToBlock((int) chunk.getX()); int cx = FLocation.chunkToBlock((int) chunk.getX());
int cz = FLocation.chunkToBlock((int) chunk.getZ()); int cz = FLocation.chunkToBlock((int) chunk.getZ());
int y = world.getHighestBlockYAt(cx, cz); int y = world.getHighestBlockYAt(cx, cz);
Location tp = new Location(world, cx, y, cz); Location tp = new Location(world, cx, y, cz);
msg(TL.COMMAND_STUCK_TELEPORT, tp.getBlockX(), tp.getBlockY(), tp.getBlockZ()); msg(TL.COMMAND_STUCK_TELEPORT, tp.getBlockX(), tp.getBlockY(), tp.getBlockZ());
SaberFactions.plugin.getTimers().remove(player.getUniqueId()); P.p.getTimers().remove(player.getUniqueId());
SaberFactions.plugin.getStuckMap().remove(player.getUniqueId()); P.p.getStuckMap().remove(player.getUniqueId());
if (!Essentials.handleTeleport(player, tp)) { if (!Essentials.handleTeleport(player, tp)) {
player.teleport(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(); this.stop();
return false; return false;
@ -96,11 +96,11 @@ public class CmdStuck extends FCommand {
} }
}, delay * 20).getTaskId(); }, delay * 20).getTaskId();
SaberFactions.plugin.getTimers().put(player.getUniqueId(), System.currentTimeMillis() + (delay * 1000)); P.p.getTimers().put(player.getUniqueId(), System.currentTimeMillis() + (delay * 1000));
long wait = SaberFactions.plugin.getTimers().get(player.getUniqueId()) - System.currentTimeMillis(); long wait = P.p.getTimers().get(player.getUniqueId()) - System.currentTimeMillis();
String time = DurationFormatUtils.formatDuration(wait, TL.COMMAND_STUCK_TIMEFORMAT.toString(), true); String time = DurationFormatUtils.formatDuration(wait, TL.COMMAND_STUCK_TIMEFORMAT.toString(), true);
msg(TL.COMMAND_STUCK_START, time); msg(TL.COMMAND_STUCK_START, time);
SaberFactions.plugin.getStuckMap().put(player.getUniqueId(), id); P.p.getStuckMap().put(player.getUniqueId(), id);
} }
} }

View File

@ -86,7 +86,7 @@ public class CmdTag extends FCommand {
fplayer.msg(TL.COMMAND_TAG_CHANGED, fme.getColorTo(faction) + oldtag, myFaction.getTag(faction)); 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); FTeamWrapper.updatePrefixes(myFaction);
} }

View File

@ -1,6 +1,6 @@
package com.massivecraft.factions.cmd; 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.Permission;
import com.massivecraft.factions.struct.Role; import com.massivecraft.factions.struct.Role;
import com.massivecraft.factions.zcore.fperms.Access; import com.massivecraft.factions.zcore.fperms.Access;
@ -32,7 +32,7 @@ public class CmdTnt extends FCommand {
@Override @Override
public void perform() { public void perform() {
if (!SaberFactions.plugin.getConfig().getBoolean("ftnt.Enabled")) { if (!P.p.getConfig().getBoolean("ftnt.Enabled")) {
fme.msg(TL.COMMAND_TNT_DISABLED_MSG); fme.msg(TL.COMMAND_TNT_DISABLED_MSG);
return; return;
} }
@ -73,7 +73,7 @@ public class CmdTnt extends FCommand {
return; return;
} }
ItemStack tnt = new ItemStack(Material.TNT, amount); 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); msg(TL.COMMAND_TNT_EXCEEDLIMIT);
return; return;
} }
@ -82,7 +82,7 @@ public class CmdTnt extends FCommand {
fme.getFaction().addTnt(amount); fme.getFaction().addTnt(amount);
fme.msg(TL.COMMAND_TNT_DEPOSIT_SUCCESS); 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; return;
} }

View File

@ -1,6 +1,6 @@
package com.massivecraft.factions.cmd; 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.Permission;
import com.massivecraft.factions.struct.Role; import com.massivecraft.factions.struct.Role;
import com.massivecraft.factions.zcore.fperms.Access; import com.massivecraft.factions.zcore.fperms.Access;
@ -35,7 +35,7 @@ public class CmdTntFill extends FCommand {
@Override @Override
public void perform() { public void perform() {
if (!SaberFactions.plugin.getConfig().getBoolean("Tntfill.enabled")) { if (!P.p.getConfig().getBoolean("Tntfill.enabled")) {
this.fme.msg(TL.GENERIC_DISABLED); this.fme.msg(TL.GENERIC_DISABLED);
return; return;
} }
@ -51,12 +51,12 @@ public class CmdTntFill extends FCommand {
msg(TL.COMMAND_TNTFILL_HEADER); msg(TL.COMMAND_TNTFILL_HEADER);
int radius = argAsInt(0, 16); int radius = argAsInt(0, 16);
int amount = argAsInt(1, 16); int amount = argAsInt(1, 16);
if (radius > 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}", SaberFactions.plugin.getConfig().getInt("Tntfill.max-radius") + "")); fme.msg(TL.COMMAND_TNTFILL_RADIUSMAX.toString().replace("{max}", P.p.getConfig().getInt("Tntfill.max-radius") + ""));
return; return;
} }
if (amount > 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}", SaberFactions.plugin.getConfig().getInt("Tntfill.max-amount") + "")); fme.msg(TL.COMMAND_TNTFILL_AMOUNTMAX.toString().replace("{max}", P.p.getConfig().getInt("Tntfill.max-amount") + ""));
return; return;
} }
@ -181,7 +181,7 @@ public class CmdTntFill extends FCommand {
return; return;
} }
ItemStack tnt = new ItemStack(Material.TNT, amount); 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); msg(TL.COMMAND_TNT_EXCEEDLIMIT);
return; return;
} }

View File

@ -1,6 +1,6 @@
package com.massivecraft.factions.cmd; 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.listeners.FactionsBlockListener;
import com.massivecraft.factions.struct.Permission; import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.util.WarmUpUtil; import com.massivecraft.factions.util.WarmUpUtil;
@ -25,7 +25,7 @@ public class CmdTpBanner extends FCommand {
@Override @Override
public void perform() { public void perform() {
if (!SaberFactions.plugin.getConfig().getBoolean("fbanners.Enabled")) { if (!P.p.getConfig().getBoolean("fbanners.Enabled")) {
return; return;
} }

View File

@ -1,6 +1,6 @@
package com.massivecraft.factions.cmd; 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.Permission;
import com.massivecraft.factions.zcore.fupgrades.FUpgradesGUI; import com.massivecraft.factions.zcore.fupgrades.FUpgradesGUI;
import com.massivecraft.factions.zcore.util.TL; import com.massivecraft.factions.zcore.util.TL;
@ -26,7 +26,7 @@ public class CmdUpgrades extends FCommand {
@Override @Override
public void perform() { public void perform() {
if (!SaberFactions.plugin.getConfig().getBoolean("fupgrades.Enabled")) { if (!P.p.getConfig().getBoolean("fupgrades.Enabled")) {
fme.sendMessage("This command is disabled!"); fme.sendMessage("This command is disabled!");
return; return;
} }

View File

@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Board; import com.massivecraft.factions.Board;
import com.massivecraft.factions.FLocation; 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.struct.Permission;
import com.massivecraft.factions.zcore.fperms.Access; import com.massivecraft.factions.zcore.fperms.Access;
import com.massivecraft.factions.zcore.fperms.PermissableAction; import com.massivecraft.factions.zcore.fperms.PermissableAction;
@ -33,7 +33,7 @@ public class CmdVault extends FCommand {
@Override @Override
public void perform() { public void perform() {
if (!SaberFactions.plugin.getConfig().getBoolean("fvault.Enabled")) { if (!P.p.getConfig().getBoolean("fvault.Enabled")) {
fme.sendMessage("This command is disabled!"); fme.sendMessage("This command is disabled!");
return; return;
} }

View File

@ -1,6 +1,6 @@
package com.massivecraft.factions.cmd; 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.Permission;
import com.massivecraft.factions.zcore.util.TL; import com.massivecraft.factions.zcore.util.TL;
@ -25,8 +25,8 @@ public class CmdVersion extends FCommand {
@Override @Override
public void perform() { public void perform() {
msg(TL.COMMAND_VERSION_NAME); // Did this so people can differentiate between SaberFactions and FactionsUUID (( Requested Feature )) msg(TL.COMMAND_VERSION_NAME); // Did this so people can differentiate between P and FactionsUUID (( Requested Feature ))
msg(TL.COMMAND_VERSION_VERSION, SaberFactions.plugin.getDescription().getFullName()); msg(TL.COMMAND_VERSION_VERSION, P.p.getDescription().getFullName());
} }
@Override @Override

View File

@ -1,7 +1,7 @@
package com.massivecraft.factions.cmd; package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Faction; 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.struct.Permission;
import com.massivecraft.factions.zcore.util.TL; import com.massivecraft.factions.zcore.util.TL;
@ -25,7 +25,7 @@ public class CmdViewChest extends FCommand {
@Override @Override
public void perform() { public void perform() {
if (!SaberFactions.plugin.getConfig().getBoolean("fchest.Enabled")) { if (!P.p.getConfig().getBoolean("fchest.Enabled")) {
fme.msg(TL.GENERIC_DISABLED); fme.msg(TL.GENERIC_DISABLED);
return; return;
} }

View File

@ -1,7 +1,7 @@
package com.massivecraft.factions.cmd; package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Conf; 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.alts.CmdAlts;
import com.massivecraft.factions.cmd.claim.*; import com.massivecraft.factions.cmd.claim.*;
import com.massivecraft.factions.cmd.econ.CmdMoney; import com.massivecraft.factions.cmd.econ.CmdMoney;
@ -248,43 +248,43 @@ public class FCmdRoot extends FCommand {
this.addSubCommand(this.cmdFGlobal); this.addSubCommand(this.cmdFGlobal);
this.addSubCommand(this.cmdViewChest); 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); this.addSubCommand(this.cmdInventorySee);
} }
if(SaberFactions.plugin.getConfig().getBoolean("f-points.Enabled")){ if(P.p.getConfig().getBoolean("f-points.Enabled")){
this.addSubCommand(this.cmdPoints); this.addSubCommand(this.cmdPoints);
} }
if(SaberFactions.plugin.getConfig().getBoolean("f-alts.Enabled")){ if(P.p.getConfig().getBoolean("f-alts.Enabled")){
this.addSubCommand(this.cmdAlts); this.addSubCommand(this.cmdAlts);
} }
if (SaberFactions.plugin.getConfig().getBoolean("f-grace.Enabled")) { if (P.p.getConfig().getBoolean("f-grace.Enabled")) {
this.addSubCommand(this.cmdGrace); this.addSubCommand(this.cmdGrace);
} }
if (Bukkit.getServer().getPluginManager().getPlugin("CoreProtect") != null) { 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); this.addSubCommand(this.cmdInspect);
} else { } 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); 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); this.addSubCommand(this.cmdFly);
} }
if (Bukkit.getServer().getPluginManager().getPlugin("FactionsTop") != null || Bukkit.getServer().getPluginManager().getPlugin("SavageFTOP") != null) { 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 { } 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); 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.cmdPaypalSet);
this.addSubCommand(this.cmdPaypalSee); this.addSubCommand(this.cmdPaypalSee);
} }

View File

@ -13,7 +13,7 @@ import java.text.SimpleDateFormat;
import java.util.List; 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()); 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 boolean isMoneyCommand;
public FCommand() { public FCommand() {
super(SaberFactions.plugin); super(P.p);
// Due to safety reasons it defaults to disable on lock. // Due to safety reasons it defaults to disable on lock.
disableOnLock = true; disableOnLock = true;

View File

@ -1,6 +1,6 @@
package com.massivecraft.factions.cmd.alts; 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.cmd.FCommand;
import com.massivecraft.factions.struct.Permission; import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.util.TL; import com.massivecraft.factions.zcore.util.TL;
@ -34,13 +34,13 @@ public class CmdAlts extends FCommand {
@Override @Override
public void perform() { 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); fme.msg(TL.GENERIC_DISABLED);
return; return;
} }
this.commandChain.add(this); 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 @Override

View File

@ -48,8 +48,8 @@ public class CmdAltsList extends FCommand {
return; return;
} }
msg("<a>There are " + faction.getAltPlayers().size() + " alts in " + faction.getTag() + ":"); msg("There are " + faction.getAltPlayers().size() + " alts in " + faction.getTag() + ":");
msg("<i>" + Joiner.on(", ").join(faction.getAltPlayers().stream().map(FPlayer::getName).collect(Collectors.toList()))); msg(Joiner.on(", ").join(faction.getAltPlayers().stream().map(FPlayer::getName).collect(Collectors.toList())));
} }

View File

@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd.alts;
import com.massivecraft.factions.Conf; import com.massivecraft.factions.Conf;
import com.massivecraft.factions.FPlayer; 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.cmd.FCommand;
import com.massivecraft.factions.struct.Permission; import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.struct.Role; import com.massivecraft.factions.struct.Role;
@ -33,7 +33,7 @@ public class CmdInviteAlt extends FCommand {
@Override @Override
public void perform() { 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); fme.msg(TL.GENERIC_DISABLED);
return; return;
} }

View File

@ -27,7 +27,7 @@ public class CmdCorner extends FCommand {
@Override @Override
public void perform() { public void perform() {
FLocation to = new FLocation(me.getLocation()); 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); Faction cornerAt = Board.getInstance().getFactionAt(to);
if (cornerAt != null && cornerAt.isNormal() && !cornerAt.equals(fme.getFaction())) { if (cornerAt != null && cornerAt.isNormal() && !cornerAt.equals(fme.getFaction())) {
msg(TL.COMMAND_CORNER_CANT_CLAIM); msg(TL.COMMAND_CORNER_CANT_CLAIM);
@ -49,7 +49,7 @@ public class CmdCorner extends FCommand {
if (surrounding.isEmpty()) { if (surrounding.isEmpty()) {
msg(TL.COMMAND_CORNER_CANT_CLAIM); msg(TL.COMMAND_CORNER_CANT_CLAIM);
} else { } else {
new CornerTask(fme, surrounding).runTaskTimer(SaberFactions.plugin, 1L, 1L); new CornerTask(fme, surrounding).runTaskTimer(P.p, 1L, 1L);
} }
} }
} else { } else {

View File

@ -3,7 +3,7 @@ package com.massivecraft.factions.cmd.claim;
import com.massivecraft.factions.Board; import com.massivecraft.factions.Board;
import com.massivecraft.factions.Conf; import com.massivecraft.factions.Conf;
import com.massivecraft.factions.Factions; 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.cmd.FCommand;
import com.massivecraft.factions.struct.Permission; import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.util.TL; import com.massivecraft.factions.zcore.util.TL;
@ -51,7 +51,7 @@ public class CmdSafeunclaimall extends FCommand {
msg(TL.COMMAND_SAFEUNCLAIMALL_UNCLAIMED); msg(TL.COMMAND_SAFEUNCLAIMALL_UNCLAIMED);
if (Conf.logLandUnclaims) { if (Conf.logLandUnclaims) {
SaberFactions.plugin.log(TL.COMMAND_SAFEUNCLAIMALL_UNCLAIMEDLOG.format(sender.getName())); P.p.log(TL.COMMAND_SAFEUNCLAIMALL_UNCLAIMEDLOG.format(sender.getName()));
} }
} }

View File

@ -85,7 +85,7 @@ public class CmdUnclaim extends FCommand {
msg(TL.COMMAND_UNCLAIM_SAFEZONE_SUCCESS); msg(TL.COMMAND_UNCLAIM_SAFEZONE_SUCCESS);
if (Conf.logLandUnclaims) { 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; return true;
} else { } else {
@ -98,7 +98,7 @@ public class CmdUnclaim extends FCommand {
msg(TL.COMMAND_UNCLAIM_WARZONE_SUCCESS); msg(TL.COMMAND_UNCLAIM_WARZONE_SUCCESS);
if (Conf.logLandUnclaims) { 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; return true;
} else { } else {
@ -109,7 +109,7 @@ public class CmdUnclaim extends FCommand {
if (fme.isAdminBypassing()) { if (fme.isAdminBypassing()) {
LandUnclaimEvent unclaimEvent = new LandUnclaimEvent(target, targetFaction, fme); 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()) { if (unclaimEvent.isCancelled()) {
return false; return false;
} }
@ -120,7 +120,7 @@ public class CmdUnclaim extends FCommand {
msg(TL.COMMAND_UNCLAIM_UNCLAIMS); msg(TL.COMMAND_UNCLAIM_UNCLAIMS);
if (Conf.logLandUnclaims) { 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; return true;
@ -171,7 +171,7 @@ public class CmdUnclaim extends FCommand {
myFaction.msg(TL.COMMAND_UNCLAIM_FACTIONUNCLAIMED, fme.describeTo(myFaction, true)); myFaction.msg(TL.COMMAND_UNCLAIM_FACTIONUNCLAIMED, fme.describeTo(myFaction, true));
if (Conf.logLandUnclaims) { 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; return true;

View File

@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd.claim;
import com.massivecraft.factions.Board; import com.massivecraft.factions.Board;
import com.massivecraft.factions.Conf; 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.cmd.FCommand;
import com.massivecraft.factions.event.LandUnclaimAllEvent; import com.massivecraft.factions.event.LandUnclaimAllEvent;
import com.massivecraft.factions.integration.Econ; import com.massivecraft.factions.integration.Econ;
@ -45,7 +45,7 @@ public class CmdUnclaimall extends FCommand {
} }
LandUnclaimAllEvent unclaimAllEvent = new LandUnclaimAllEvent(myFaction, fme); 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()) { if (unclaimAllEvent.isCancelled()) {
return; return;
} }
@ -54,7 +54,7 @@ public class CmdUnclaimall extends FCommand {
myFaction.msg(TL.COMMAND_UNCLAIMALL_UNCLAIMED, fme.describeTo(myFaction, true)); myFaction.msg(TL.COMMAND_UNCLAIMALL_UNCLAIMED, fme.describeTo(myFaction, true));
if (Conf.logLandUnclaims) { 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()));
} }
} }

View File

@ -3,7 +3,7 @@ package com.massivecraft.factions.cmd.claim;
import com.massivecraft.factions.Board; import com.massivecraft.factions.Board;
import com.massivecraft.factions.Conf; import com.massivecraft.factions.Conf;
import com.massivecraft.factions.Factions; 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.cmd.FCommand;
import com.massivecraft.factions.struct.Permission; import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.util.TL; import com.massivecraft.factions.zcore.util.TL;
@ -50,7 +50,7 @@ public class CmdWarunclaimall extends FCommand {
if (Conf.logLandUnclaims) { if (Conf.logLandUnclaims) {
SaberFactions.plugin.log(TL.COMMAND_WARUNCLAIMALL_LOG.format(fme.getName())); P.p.log(TL.COMMAND_WARUNCLAIMALL_LOG.format(fme.getName()));
} }
} }

View File

@ -1,6 +1,6 @@
package com.massivecraft.factions.cmd.econ; 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.cmd.FCommand;
import com.massivecraft.factions.zcore.util.TL; import com.massivecraft.factions.zcore.util.TL;
@ -42,7 +42,7 @@ public class CmdMoney extends FCommand {
@Override @Override
public void perform() { public void perform() {
this.commandChain.add(this); 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 @Override

View File

@ -1,7 +1,7 @@
package com.massivecraft.factions.cmd.econ; package com.massivecraft.factions.cmd.econ;
import com.massivecraft.factions.Conf; 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.cmd.FCommand;
import com.massivecraft.factions.iface.EconomyParticipator; import com.massivecraft.factions.iface.EconomyParticipator;
import com.massivecraft.factions.integration.Econ; import com.massivecraft.factions.integration.Econ;
@ -40,7 +40,7 @@ public class CmdMoneyDeposit extends FCommand {
boolean success = Econ.transferMoney(fme, fme, faction, amount); boolean success = Econ.transferMoney(fme, fme, faction, amount);
if (success && Conf.logMoneyTransactions) { 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))));
} }
} }

View File

@ -1,7 +1,7 @@
package com.massivecraft.factions.cmd.econ; package com.massivecraft.factions.cmd.econ;
import com.massivecraft.factions.Conf; 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.cmd.FCommand;
import com.massivecraft.factions.iface.EconomyParticipator; import com.massivecraft.factions.iface.EconomyParticipator;
import com.massivecraft.factions.integration.Econ; import com.massivecraft.factions.integration.Econ;
@ -51,7 +51,7 @@ public class CmdMoneyTransferFf extends FCommand {
if (success && Conf.logMoneyTransactions) { if (success && Conf.logMoneyTransactions) {
String name = sender instanceof Player ? fme.getName() : sender.getName(); 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))));
} }
} }

View File

@ -1,7 +1,7 @@
package com.massivecraft.factions.cmd.econ; package com.massivecraft.factions.cmd.econ;
import com.massivecraft.factions.Conf; 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.cmd.FCommand;
import com.massivecraft.factions.iface.EconomyParticipator; import com.massivecraft.factions.iface.EconomyParticipator;
import com.massivecraft.factions.integration.Econ; import com.massivecraft.factions.integration.Econ;
@ -50,7 +50,7 @@ public class CmdMoneyTransferFp extends FCommand {
boolean success = Econ.transferMoney(fme, from, to, amount); boolean success = Econ.transferMoney(fme, from, to, amount);
if (success && Conf.logMoneyTransactions) { 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))));
} }
} }

View File

@ -1,7 +1,7 @@
package com.massivecraft.factions.cmd.econ; package com.massivecraft.factions.cmd.econ;
import com.massivecraft.factions.Conf; 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.cmd.FCommand;
import com.massivecraft.factions.iface.EconomyParticipator; import com.massivecraft.factions.iface.EconomyParticipator;
import com.massivecraft.factions.integration.Econ; import com.massivecraft.factions.integration.Econ;
@ -50,7 +50,7 @@ public class CmdMoneyTransferPf extends FCommand {
boolean success = Econ.transferMoney(fme, from, to, amount); boolean success = Econ.transferMoney(fme, from, to, amount);
if (success && Conf.logMoneyTransactions) { 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))));
} }
} }

View File

@ -1,7 +1,7 @@
package com.massivecraft.factions.cmd.econ; package com.massivecraft.factions.cmd.econ;
import com.massivecraft.factions.Conf; 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.cmd.FCommand;
import com.massivecraft.factions.iface.EconomyParticipator; import com.massivecraft.factions.iface.EconomyParticipator;
import com.massivecraft.factions.integration.Econ; import com.massivecraft.factions.integration.Econ;
@ -54,7 +54,7 @@ public class CmdMoneyWithdraw extends FCommand {
boolean success = Econ.transferMoney(fme, faction, fme, amount); boolean success = Econ.transferMoney(fme, faction, fme, amount);
if (success && Conf.logMoneyTransactions) { 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))));
} }
} }

View File

@ -1,7 +1,7 @@
package com.massivecraft.factions.cmd.logout; package com.massivecraft.factions.cmd.logout;
import com.massivecraft.factions.Conf; import com.massivecraft.factions.Conf;
import com.massivecraft.factions.SaberFactions; import com.massivecraft.factions.P;
import com.massivecraft.factions.zcore.util.TL; import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -35,9 +35,9 @@ public class LogoutHandler {
public void applyLogoutCooldown(Player player) { public void applyLogoutCooldown(Player player) {
logoutCooldown.put(player.getUniqueId(), System.currentTimeMillis() + (30 * 1000)); logoutCooldown.put(player.getUniqueId(), System.currentTimeMillis() + (30 * 1000));
Bukkit.getScheduler().runTaskLater(SaberFactions.plugin, () -> { Bukkit.getScheduler().runTaskLater(P.p, () -> {
if(isLogoutActive(player)) { 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)); player.kickPlayer(String.valueOf(TL.COMMAND_LOGOUT_KICK_MESSAGE));
cancelLogout(player); cancelLogout(player);
} }

View File

@ -1,6 +1,6 @@
package com.massivecraft.factions.cmd.points; 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.cmd.FCommand;
import com.massivecraft.factions.zcore.util.TL; import com.massivecraft.factions.zcore.util.TL;
@ -31,12 +31,12 @@ public class CmdPoints extends FCommand {
@Override @Override
public void perform() { 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); fme.msg(TL.GENERIC_DISABLED);
return; return;
} }
this.commandChain.add(this); 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 @Override

View File

@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd.relational;
import com.massivecraft.factions.Conf; import com.massivecraft.factions.Conf;
import com.massivecraft.factions.Faction; 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.cmd.FCommand;
import com.massivecraft.factions.event.FactionRelationEvent; import com.massivecraft.factions.event.FactionRelationEvent;
import com.massivecraft.factions.event.FactionRelationWishEvent; import com.massivecraft.factions.event.FactionRelationWishEvent;
@ -104,8 +104,8 @@ public abstract class FRelationCommand extends FCommand {
} }
private boolean hasMaxRelations(Faction them, Relation targetRelation) { private boolean hasMaxRelations(Faction them, Relation targetRelation) {
int max = SaberFactions.plugin.getConfig().getInt("max-relations." + targetRelation.toString(), -1); int max = P.p.getConfig().getInt("max-relations." + targetRelation.toString(), -1);
if (SaberFactions.plugin.getConfig().getBoolean("max-relations.enabled", false)) { if (P.p.getConfig().getBoolean("max-relations.enabled", false)) {
if (max != -1) { if (max != -1) {
if (myFaction.getRelationCount(targetRelation) >= max) { if (myFaction.getRelationCount(targetRelation) >= max) {
msg(TL.COMMAND_RELATIONS_EXCEEDS_ME, max, targetRelation.getPluralTranslation()); msg(TL.COMMAND_RELATIONS_EXCEEDS_ME, max, targetRelation.getPluralTranslation());

View File

@ -3,7 +3,7 @@ package com.massivecraft.factions.integration;
import com.massivecraft.factions.Conf; import com.massivecraft.factions.Conf;
import com.massivecraft.factions.FPlayer; import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.Faction; import com.massivecraft.factions.Faction;
import com.massivecraft.factions.SaberFactions; import com.massivecraft.factions.P;
import com.massivecraft.factions.iface.EconomyParticipator; import com.massivecraft.factions.iface.EconomyParticipator;
import com.massivecraft.factions.struct.Permission; import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.struct.Role; import com.massivecraft.factions.struct.Role;
@ -34,24 +34,24 @@ public class Econ {
String integrationFail = "Economy integration is " + (Conf.econEnabled ? "enabled, but" : "disabled, and") + " the plugin \"Vault\" "; String integrationFail = "Economy integration is " + (Conf.econEnabled ? "enabled, but" : "disabled, and") + " the plugin \"Vault\" ";
if (Bukkit.getServer().getPluginManager().getPlugin("Vault") == null) { if (Bukkit.getServer().getPluginManager().getPlugin("Vault") == null) {
SaberFactions.plugin.log(integrationFail + "is not installed."); P.p.log(integrationFail + "is not installed.");
return; return;
} }
RegisteredServiceProvider<Economy> rsp = Bukkit.getServer().getServicesManager().getRegistration(Economy.class); RegisteredServiceProvider<Economy> rsp = Bukkit.getServer().getServicesManager().getRegistration(Economy.class);
if (rsp == null) { if (rsp == null) {
SaberFactions.plugin.log(integrationFail + "is not hooked into an economy plugin."); P.p.log(integrationFail + "is not hooked into an economy plugin.");
return; return;
} }
econ = rsp.getProvider(); econ = rsp.getProvider();
SaberFactions.plugin.log("Economy integration through Vault plugin successful."); P.p.log("Economy integration through Vault plugin successful.");
if (!Conf.econEnabled) { if (!Conf.econEnabled) {
SaberFactions.plugin.log("NOTE: Economy is disabled. You can enable it with the command: f config econEnabled true"); P.p.log("NOTE: Economy is disabled. You can enable it with the command: f config econEnabled true");
} }
SaberFactions.plugin.cmdBase.cmdHelp.updateHelp(); P.p.cmdBase.cmdHelp.updateHelp();
} }
public static boolean shouldBeUsed() { public static boolean shouldBeUsed() {
@ -82,7 +82,7 @@ public class Econ {
public static void sendBalanceInfo(FPlayer to, EconomyParticipator about) { public static void sendBalanceInfo(FPlayer to, EconomyParticipator about) {
if (!shouldBeUsed()) { if (!shouldBeUsed()) {
SaberFactions.plugin.log(Level.WARNING, "Vault does not appear to be hooked into an economy plugin."); P.p.log(Level.WARNING, "Vault does not appear to be hooked into an economy plugin.");
return; return;
} }
to.msg("<a>%s's<i> balance is <h>%s<i>.", about.describeTo(to, true), Econ.moneyString(econ.getBalance(about.getAccountId()))); to.msg("<a>%s's<i> balance is <h>%s<i>.", about.describeTo(to, true), Econ.moneyString(econ.getBalance(about.getAccountId())));

View File

@ -1,7 +1,7 @@
package com.massivecraft.factions.integration; package com.massivecraft.factions.integration;
import com.massivecraft.factions.FLocation; import com.massivecraft.factions.FLocation;
import com.massivecraft.factions.SaberFactions; import com.massivecraft.factions.P;
import com.sk89q.worldedit.BlockVector; import com.sk89q.worldedit.BlockVector;
import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.Vector;
import com.sk89q.worldguard.bukkit.WorldGuardPlugin; import com.sk89q.worldguard.bukkit.WorldGuardPlugin;
@ -38,11 +38,11 @@ public class Worldguard {
if (wgplug == null || !(wgplug instanceof WorldGuardPlugin)) { if (wgplug == null || !(wgplug instanceof WorldGuardPlugin)) {
enabled = false; enabled = false;
wg = null; wg = null;
SaberFactions.plugin.log("Could not hook to WorldGuard. WorldGuard checks are disabled."); P.p.log("Could not hook to WorldGuard. WorldGuard checks are disabled.");
} else { } else {
wg = (WorldGuardPlugin) wgplug; wg = (WorldGuardPlugin) wgplug;
enabled = true; enabled = true;
SaberFactions.plugin.log("Successfully hooked to WorldGuard."); P.p.log("Successfully hooked to WorldGuard.");
} }
} }

View File

@ -113,7 +113,7 @@ public class EngineDynmap {
} }
// Shedule non thread safe sync at the end! // Shedule non thread safe sync at the end!
Bukkit.getScheduler().scheduleSyncRepeatingTask(SaberFactions.plugin, () -> { Bukkit.getScheduler().scheduleSyncRepeatingTask(P.p, () -> {
final Map<String, TempMarker> homes = createHomes(); final Map<String, TempMarker> homes = createHomes();
final Map<String, TempAreaMarker> areas = createAreas(); final Map<String, TempAreaMarker> areas = createAreas();

View File

@ -87,7 +87,7 @@ public class FactionsBlockListener implements Listener {
return false; return false;
} else if (!otherFaction.getId().equals(myFaction.getId())) { // If the faction target is not my own } else if (!otherFaction.getId().equals(myFaction.getId())) { // If the faction target is not my own
if (SaberFactions.plugin.getConfig().getBoolean("hcf.raidable", false) && otherFaction.getLandRounded() > otherFaction.getPowerRounded()) if (P.p.getConfig().getBoolean("hcf.raidable", false) && otherFaction.getLandRounded() > otherFaction.getPowerRounded())
return true; return true;
// Get faction pain build access relation to me // Get faction pain build access relation to me
boolean pain = !justCheck && otherFaction.getAccess(me, PermissableAction.PAIN_BUILD) == Access.ALLOW; boolean pain = !justCheck && otherFaction.getAccess(me, PermissableAction.PAIN_BUILD) == Access.ALLOW;
@ -174,7 +174,7 @@ public class FactionsBlockListener implements Listener {
@EventHandler @EventHandler
public void onVaultPlace(BlockPlaceEvent e) { public void onVaultPlace(BlockPlaceEvent e) {
if (e.getItemInHand().getType() == Material.CHEST) { if (e.getItemInHand().getType() == Material.CHEST) {
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")));
if (e.getItemInHand().isSimilar(vault)) { if (e.getItemInHand().isSimilar(vault)) {
FPlayer fme = FPlayers.getInstance().getByPlayer(e.getPlayer()); FPlayer fme = FPlayers.getInstance().getByPlayer(e.getPlayer());
if (fme.getFaction().getVault() != null) { if (fme.getFaction().getVault() != null) {
@ -200,7 +200,7 @@ public class FactionsBlockListener implements Listener {
Material blockMaterial = blockLoc.getBlock().getType(); Material blockMaterial = blockLoc.getBlock().getType();
if (blockMaterial == Material.CHEST || (SaberFactions.plugin.getConfig().getBoolean("fvault.No-Hoppers-near-vault") && blockMaterial == Material.HOPPER)) { if (blockMaterial == Material.CHEST || (P.p.getConfig().getBoolean("fvault.No-Hoppers-near-vault") && blockMaterial == Material.HOPPER)) {
e.setCancelled(true); e.setCancelled(true);
fme.msg(TL.COMMAND_GETVAULT_CHESTNEAR); fme.msg(TL.COMMAND_GETVAULT_CHESTNEAR);
return; return;
@ -219,7 +219,7 @@ public class FactionsBlockListener implements Listener {
@EventHandler @EventHandler
public void onHopperPlace(BlockPlaceEvent e) { public void onHopperPlace(BlockPlaceEvent e) {
if (e.getItemInHand().getType() != Material.HOPPER && !SaberFactions.plugin.getConfig().getBoolean("fvault.No-Hoppers-near-vault")) { if (e.getItemInHand().getType() != Material.HOPPER && !P.p.getConfig().getBoolean("fvault.No-Hoppers-near-vault")) {
return; return;
} }
@ -266,7 +266,7 @@ public class FactionsBlockListener implements Listener {
Faction otherFaction = Board.getInstance().getFactionAt(new FLocation(targetLoc)); Faction otherFaction = Board.getInstance().getFactionAt(new FLocation(targetLoc));
// Check if the piston is moving in a faction's territory. This disables pistons entirely in faction territory. // Check if the piston is moving in a faction's territory. This disables pistons entirely in faction territory.
if (otherFaction.isNormal() && SaberFactions.plugin.getConfig().getBoolean("disable-pistons-in-territory", false)) { if (otherFaction.isNormal() && P.p.getConfig().getBoolean("disable-pistons-in-territory", false)) {
event.setCancelled(true); event.setCancelled(true);
return; return;
} }
@ -285,7 +285,7 @@ public class FactionsBlockListener implements Listener {
@EventHandler @EventHandler
public void onBannerPlace(BlockPlaceEvent e) { public void onBannerPlace(BlockPlaceEvent e) {
if (SaberFactions.plugin.mc17) { if (P.p.mc17) {
return; return;
} }
@ -295,11 +295,11 @@ public class FactionsBlockListener implements Listener {
ItemStack warBanner = fme.getFaction().getBanner(); ItemStack warBanner = fme.getFaction().getBanner();
if (warBanner != null) { if (warBanner != null) {
ItemMeta warmeta = warBanner.getItemMeta(); ItemMeta warmeta = warBanner.getItemMeta();
warmeta.setDisplayName(SaberFactions.plugin.color(SaberFactions.plugin.getConfig().getString("fbanners.Item.Name"))); warmeta.setDisplayName(P.p.color(P.p.getConfig().getString("fbanners.Item.Name")));
warmeta.setLore(SaberFactions.plugin.colorList(SaberFactions.plugin.getConfig().getStringList("fbanners.Item.Lore"))); warmeta.setLore(P.p.colorList(P.p.getConfig().getStringList("fbanners.Item.Lore")));
warBanner.setItemMeta(warmeta); warBanner.setItemMeta(warmeta);
} else { } 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"));
} }
if (warBanner.isSimilar(bannerInHand)) { if (warBanner.isSimilar(bannerInHand)) {
@ -308,12 +308,12 @@ public class FactionsBlockListener implements Listener {
e.setCancelled(true); e.setCancelled(true);
return; return;
} }
int bannerTime = SaberFactions.plugin.getConfig().getInt("fbanners.Banner-Time") * 20; int bannerTime = P.p.getConfig().getInt("fbanners.Banner-Time") * 20;
Location placedLoc = e.getBlockPlaced().getLocation(); Location placedLoc = e.getBlockPlaced().getLocation();
FLocation fplacedLoc = new FLocation(placedLoc); FLocation fplacedLoc = new FLocation(placedLoc);
if ((Board.getInstance().getFactionAt(fplacedLoc).isWarZone() && SaberFactions.plugin.getConfig().getBoolean("fbanners.Placeable.Warzone")) if ((Board.getInstance().getFactionAt(fplacedLoc).isWarZone() && P.p.getConfig().getBoolean("fbanners.Placeable.Warzone"))
|| (fme.getFaction().getRelationTo(Board.getInstance().getFactionAt(fplacedLoc)) == Relation.ENEMY) && SaberFactions.plugin.getConfig().getBoolean("fbanners.Placeable.Enemy")) { || (fme.getFaction().getRelationTo(Board.getInstance().getFactionAt(fplacedLoc)) == Relation.ENEMY) && P.p.getConfig().getBoolean("fbanners.Placeable.Enemy")) {
if (bannerCooldownMap.containsKey(fme.getTag())) { if (bannerCooldownMap.containsKey(fme.getTag())) {
fme.msg(TL.WARBANNER_COOLDOWN); fme.msg(TL.WARBANNER_COOLDOWN);
e.setCancelled(true); e.setCancelled(true);
@ -321,29 +321,29 @@ public class FactionsBlockListener implements Listener {
} }
for (FPlayer fplayer : fme.getFaction().getFPlayers()) { for (FPlayer fplayer : fme.getFaction().getFPlayers()) {
// if (fplayer == fme) { continue; } //Idk if I wanna not send the title to the player // if (fplayer == fme) { continue; } //Idk if I wanna not send the title to the player
fplayer.getPlayer().sendTitle(SaberFactions.plugin.color(fme.getTag() + " Placed A WarBanner!"), SaberFactions.plugin.color("&7use &c/f tpbanner&7 to tp to the banner!"), 10, 70, 20); fplayer.getPlayer().sendTitle(P.p.color(fme.getTag() + " Placed A WarBanner!"), P.p.color("&7use &c/f tpbanner&7 to tp to the banner!"), 10, 70, 20);
} }
bannerCooldownMap.put(fme.getTag(), true); bannerCooldownMap.put(fme.getTag(), true);
bannerLocations.put(fme.getTag(), e.getBlockPlaced().getLocation()); bannerLocations.put(fme.getTag(), e.getBlockPlaced().getLocation());
int bannerCooldown = SaberFactions.plugin.getConfig().getInt("fbanners.Banner-Place-Cooldown"); int bannerCooldown = P.p.getConfig().getInt("fbanners.Banner-Place-Cooldown");
ArmorStand as = (ArmorStand) e.getBlockPlaced().getLocation().add(0.5, 1, 0.5).getWorld().spawnEntity(e.getBlockPlaced().getLocation().add(0.5, 1, 0.5), EntityType.ARMOR_STAND); //Spawn the ArmorStand ArmorStand as = (ArmorStand) e.getBlockPlaced().getLocation().add(0.5, 1, 0.5).getWorld().spawnEntity(e.getBlockPlaced().getLocation().add(0.5, 1, 0.5), EntityType.ARMOR_STAND); //Spawn the ArmorStand
as.setVisible(false); //Makes the ArmorStand invisible as.setVisible(false); //Makes the ArmorStand invisible
as.setGravity(false); //Make sure it doesn't fall as.setGravity(false); //Make sure it doesn't fall
as.setCanPickupItems(false); //I'm not sure what happens if you leave this as it is, but you might as well disable it as.setCanPickupItems(false); //I'm not sure what happens if you leave this as it is, but you might as well disable it
as.setCustomName(SaberFactions.plugin.color(SaberFactions.plugin.getConfig().getString("fbanners.BannerHolo").replace("{Faction}", fme.getTag()))); //Set this to the text you want as.setCustomName(P.p.color(P.p.getConfig().getString("fbanners.BannerHolo").replace("{Faction}", fme.getTag()))); //Set this to the text you want
as.setCustomNameVisible(true); //This makes the text appear no matter if your looking at the entity or not as.setCustomNameVisible(true); //This makes the text appear no matter if your looking at the entity or not
ArmorStand armorStand = as; ArmorStand armorStand = as;
String tag = fme.getTag(); String tag = fme.getTag();
Bukkit.getScheduler().scheduleSyncDelayedTask(SaberFactions.plugin, () -> bannerCooldownMap.remove(tag), Long.parseLong(bannerCooldown + "")); Bukkit.getScheduler().scheduleSyncDelayedTask(P.p, () -> bannerCooldownMap.remove(tag), Long.parseLong(bannerCooldown + ""));
Block banner = e.getBlockPlaced(); Block banner = e.getBlockPlaced();
Material bannerType = banner.getType(); Material bannerType = banner.getType();
Faction bannerFaction = fme.getFaction(); Faction bannerFaction = fme.getFaction();
banner.getWorld().strikeLightningEffect(banner.getLocation()); banner.getWorld().strikeLightningEffect(banner.getLocation());
// e.getPlayer().getWorld().playSound(e.getPlayer().getLocation(), Sound.ENTITY_LIGHTNING_IMPACT,2.0F,0.5F); // e.getPlayer().getWorld().playSound(e.getPlayer().getLocation(), Sound.ENTITY_LIGHTNING_IMPACT,2.0F,0.5F);
int radius = SaberFactions.plugin.getConfig().getInt("fbanners.Banner-Effect-Radius"); int radius = P.p.getConfig().getInt("fbanners.Banner-Effect-Radius");
List<String> effects = SaberFactions.plugin.getConfig().getStringList("fbanners.Effects"); List<String> effects = P.p.getConfig().getStringList("fbanners.Effects");
int affectorTask = Bukkit.getScheduler().scheduleSyncRepeatingTask(SaberFactions.plugin, () -> { int affectorTask = Bukkit.getScheduler().scheduleSyncRepeatingTask(P.p, () -> {
for (Entity e1 : banner.getLocation().getWorld().getNearbyEntities(banner.getLocation(), radius, 255, radius)) { for (Entity e1 : banner.getLocation().getWorld().getNearbyEntities(banner.getLocation(), radius, 255, radius)) {
if (e1 instanceof Player) { if (e1 instanceof Player) {
@ -364,7 +364,7 @@ public class FactionsBlockListener implements Listener {
} }
} }
}, 0L, 20L); }, 0L, 20L);
Bukkit.getScheduler().scheduleSyncDelayedTask(SaberFactions.plugin, () -> { Bukkit.getScheduler().scheduleSyncDelayedTask(P.p, () -> {
banner.setType(Material.AIR); banner.setType(Material.AIR);
as.remove(); as.remove();
banner.getWorld().strikeLightningEffect(banner.getLocation()); banner.getWorld().strikeLightningEffect(banner.getLocation());
@ -403,7 +403,7 @@ public class FactionsBlockListener implements Listener {
@EventHandler @EventHandler
public void onFallingBlock(EntityChangeBlockEvent event) { public void onFallingBlock(EntityChangeBlockEvent event) {
if(!SaberFactions.plugin.getConfig().getBoolean("Falling-Block-Fix.Enabled")) if(!P.p.getConfig().getBoolean("Falling-Block-Fix.Enabled"))
return; return;
Faction faction = Board.getInstance().getFactionAt(new FLocation(event.getBlock())); Faction faction = Board.getInstance().getFactionAt(new FLocation(event.getBlock()));
@ -416,7 +416,7 @@ public class FactionsBlockListener implements Listener {
//Grace //Grace
@EventHandler @EventHandler
public void onBreak(EntityExplodeEvent e) { public void onBreak(EntityExplodeEvent e) {
if (!SaberFactions.plugin.getConfig().getBoolean("f-grace.Enabled")) if (!P.p.getConfig().getBoolean("f-grace.Enabled"))
return; return;
if (!graceisEnabled()) { if (!graceisEnabled()) {
@ -426,7 +426,7 @@ public class FactionsBlockListener implements Listener {
@EventHandler @EventHandler
public void entityDamage(EntityDamageEvent e) { public void entityDamage(EntityDamageEvent e) {
if (!SaberFactions.plugin.getConfig().getBoolean("f-grace.Enabled")) if (!P.p.getConfig().getBoolean("f-grace.Enabled"))
return; return;
if (!graceisEnabled()) { if (!graceisEnabled()) {
@ -441,7 +441,7 @@ public class FactionsBlockListener implements Listener {
@EventHandler @EventHandler
public void onTNTPlace(BlockPlaceEvent e1) { public void onTNTPlace(BlockPlaceEvent e1) {
FPlayer fp = FPlayers.getInstance().getByPlayer(e1.getPlayer()); FPlayer fp = FPlayers.getInstance().getByPlayer(e1.getPlayer());
if (!SaberFactions.plugin.getConfig().getBoolean("f-grace.Enabled")) if (!P.p.getConfig().getBoolean("f-grace.Enabled"))
return; return;
if (!graceisEnabled() && !fp.isAdminBypassing()) { if (!graceisEnabled() && !fp.isAdminBypassing()) {

View File

@ -180,9 +180,9 @@ public class FactionsChatListener implements Listener {
listeningPlayer.sendMessage(String.format(yourFormat, talkingPlayer.getDisplayName(), msg)); listeningPlayer.sendMessage(String.format(yourFormat, talkingPlayer.getDisplayName(), msg));
} catch (UnknownFormatConversionException ex) { } catch (UnknownFormatConversionException ex) {
Conf.chatTagInsertIndex = 0; Conf.chatTagInsertIndex = 0;
SaberFactions.plugin.log(Level.SEVERE, "Critical error in chat message formatting!"); P.p.log(Level.SEVERE, "Critical error in chat message formatting!");
SaberFactions.plugin.log(Level.SEVERE, "NOTE: This has been automatically fixed right now by setting chatTagInsertIndex to 0."); P.p.log(Level.SEVERE, "NOTE: This has been automatically fixed right now by setting chatTagInsertIndex to 0.");
SaberFactions.plugin.log(Level.SEVERE, "For a more proper fix, please read this regarding chat configuration: http://massivecraft.com/plugins/factions/config#Chat_configuration"); P.p.log(Level.SEVERE, "For a more proper fix, please read this regarding chat configuration: http://massivecraft.com/plugins/factions/config#Chat_configuration");
return; return;
} }
} }
@ -202,7 +202,7 @@ public class FactionsChatListener implements Listener {
player.teleport(fme.getFaction().getWarp(warp).getLocation()); player.teleport(fme.getFaction().getWarp(warp).getLocation());
fme.msg(TL.COMMAND_FWARP_WARPED, warp); fme.msg(TL.COMMAND_FWARP_WARPED, warp);
} }
}, SaberFactions.plugin.getConfig().getLong("warmups.f-warp", 0)); }, P.p.getConfig().getLong("warmups.f-warp", 0));
} }
} }

View File

@ -19,7 +19,6 @@ import org.bukkit.event.hanging.HangingBreakByEntityEvent;
import org.bukkit.event.hanging.HangingBreakEvent; import org.bukkit.event.hanging.HangingBreakEvent;
import org.bukkit.event.hanging.HangingBreakEvent.RemoveCause; import org.bukkit.event.hanging.HangingBreakEvent.RemoveCause;
import org.bukkit.event.hanging.HangingPlaceEvent; import org.bukkit.event.hanging.HangingPlaceEvent;
import org.bukkit.event.player.PlayerInteractAtEntityEvent;
import org.bukkit.event.player.PlayerInteractEntityEvent; import org.bukkit.event.player.PlayerInteractEntityEvent;
import org.bukkit.event.player.PlayerPortalEvent; import org.bukkit.event.player.PlayerPortalEvent;
import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffect;
@ -227,9 +226,9 @@ public class FactionsEntityListener implements Listener {
return; return;
} }
UUID uuid = player.getUniqueId(); UUID uuid = player.getUniqueId();
if (SaberFactions.plugin.getStuckMap().containsKey(uuid)) { if (P.p.getStuckMap().containsKey(uuid)) {
FPlayers.getInstance().getByPlayer(player).msg(TL.COMMAND_STUCK_CANCELLED); FPlayers.getInstance().getByPlayer(player).msg(TL.COMMAND_STUCK_CANCELLED);
SaberFactions.plugin.getStuckMap().remove(uuid); P.p.getStuckMap().remove(uuid);
} }
} }
@ -645,7 +644,7 @@ public class FactionsEntityListener implements Listener {
@EventHandler @EventHandler
public void onTravel(PlayerPortalEvent event) { public void onTravel(PlayerPortalEvent event) {
if (!SaberFactions.plugin.getConfig().getBoolean("portals.limit", false)) { if (!P.p.getConfig().getBoolean("portals.limit", false)) {
return; // Don't do anything if they don't want us to. return; // Don't do anything if they don't want us to.
} }
@ -664,7 +663,7 @@ public class FactionsEntityListener implements Listener {
} }
FPlayer fp = FPlayers.getInstance().getByPlayer(event.getPlayer()); FPlayer fp = FPlayers.getInstance().getByPlayer(event.getPlayer());
String mininumRelation = SaberFactions.plugin.getConfig().getString("portals.minimum-relation", "MEMBER"); // Defaults to Neutral if typed wrong. String mininumRelation = P.p.getConfig().getString("portals.minimum-relation", "MEMBER"); // Defaults to Neutral if typed wrong.
if (!fp.getFaction().getRelationTo(faction).isAtLeast(Relation.fromString(mininumRelation))) { if (!fp.getFaction().getRelationTo(faction).isAtLeast(Relation.fromString(mininumRelation))) {
event.setCancelled(true); event.setCancelled(true);
} }

View File

@ -1,7 +1,7 @@
package com.massivecraft.factions.listeners; package com.massivecraft.factions.listeners;
import com.massivecraft.factions.Conf; import com.massivecraft.factions.Conf;
import com.massivecraft.factions.SaberFactions; import com.massivecraft.factions.P;
import com.massivecraft.factions.util.XMaterial; import com.massivecraft.factions.util.XMaterial;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.Material; import org.bukkit.Material;
@ -30,7 +30,7 @@ public class FactionsExploitListener implements Listener {
Block block = event.getToBlock(); Block block = event.getToBlock();
// Added this so it wont die on 1.14 :) // Added this so it wont die on 1.14 :)
if (SaberFactions.plugin.mc114) { if (P.p.mc114) {
Material source = event.getBlock().getType(); Material source = event.getBlock().getType();
Material target = block.getType(); Material target = block.getType();
if ((target == Material.REDSTONE_WIRE || target == Material.TRIPWIRE) && (source == Material.AIR || source == Material.LEGACY_STATIONARY_LAVA || source == Material.LEGACY_LAVA)) { if ((target == Material.REDSTONE_WIRE || target == Material.TRIPWIRE) && (source == Material.AIR || source == Material.LEGACY_STATIONARY_LAVA || source == Material.LEGACY_LAVA)) {

View File

@ -56,10 +56,10 @@ public class FactionsPlayerListener implements Listener {
public FactionsPlayerListener() { public FactionsPlayerListener() {
this.corners = new HashSet<>(); this.corners = new HashSet<>();
for (Player player : SaberFactions.plugin.getServer().getOnlinePlayers()) { for (Player player : P.p.getServer().getOnlinePlayers()) {
initPlayer(player); initPlayer(player);
} }
for (World world : SaberFactions.plugin.getServer().getWorlds()) { for (World world : P.p.getServer().getWorlds()) {
WorldBorder border = world.getWorldBorder(); WorldBorder border = world.getWorldBorder();
if (border != null) { if (border != null) {
int cornerCoord = (int) ((border.getSize() - 1.0) / 2.0); int cornerCoord = (int) ((border.getSize() - 1.0) / 2.0);
@ -102,7 +102,7 @@ public class FactionsPlayerListener implements Listener {
return false; return false;
} }
if (SaberFactions.plugin.getConfig().getBoolean("hcf.raidable", false) && otherFaction.getLandRounded() > otherFaction.getPowerRounded()) { if (P.p.getConfig().getBoolean("hcf.raidable", false) && otherFaction.getLandRounded() > otherFaction.getPowerRounded()) {
return true; return true;
} }
@ -184,7 +184,7 @@ public class FactionsPlayerListener implements Listener {
return false; return false;
} }
if (SaberFactions.plugin.getConfig().getBoolean("hcf.raidable", false) && otherFaction.getLandRounded() > otherFaction.getPowerRounded()) if (P.p.getConfig().getBoolean("hcf.raidable", false) && otherFaction.getLandRounded() > otherFaction.getPowerRounded())
return true; return true;
if (otherFaction.getId().equals(myFaction.getId()) && me.getRole() == Role.LEADER) return true; if (otherFaction.getId().equals(myFaction.getId()) && me.getRole() == Role.LEADER) return true;
@ -306,15 +306,15 @@ public class FactionsPlayerListener implements Listener {
me.login(); // set kills / deaths me.login(); // set kills / deaths
// Check for Faction announcements. Let's delay this so they actually see it. // Check for Faction announcements. Let's delay this so they actually see it.
Bukkit.getScheduler().runTaskLater(SaberFactions.plugin, () -> { Bukkit.getScheduler().runTaskLater(P.p, () -> {
if (me.isOnline()) { if (me.isOnline()) {
me.getFaction().sendUnreadAnnouncements(me); me.getFaction().sendUnreadAnnouncements(me);
} }
}, 33L); // Don't ask me why. }, 33L); // Don't ask me why.
if (SaberFactions.plugin.getConfig().getBoolean("scoreboard.default-enabled", false)) { if (P.p.getConfig().getBoolean("scoreboard.default-enabled", false)) {
FScoreboard.init(me); FScoreboard.init(me);
FScoreboard.get(me).setDefaultSidebar(new FDefaultSidebar(), SaberFactions.plugin.getConfig().getInt("scoreboard.default-update-interval", 20)); FScoreboard.get(me).setDefaultSidebar(new FDefaultSidebar(), P.p.getConfig().getInt("scoreboard.default-update-interval", 20));
FScoreboard.get(me).setSidebarVisibility(me.showScoreboard()); FScoreboard.get(me).setSidebarVisibility(me.showScoreboard());
} }
@ -329,17 +329,17 @@ public class FactionsPlayerListener implements Listener {
fallMap.put(me.getPlayer(), false); fallMap.put(me.getPlayer(), false);
Bukkit.getScheduler().scheduleSyncDelayedTask(SaberFactions.plugin, () -> fallMap.remove(me.getPlayer()), 180L); Bukkit.getScheduler().scheduleSyncDelayedTask(P.p, () -> fallMap.remove(me.getPlayer()), 180L);
if (me.isSpyingChat() && !player.hasPermission(Permission.CHATSPY.node)) { if (me.isSpyingChat() && !player.hasPermission(Permission.CHATSPY.node)) {
me.setSpyingChat(false); me.setSpyingChat(false);
SaberFactions.plugin.log(Level.INFO, "Found %s spying chat without permission on login. Disabled their chat spying.", player.getName()); P.p.log(Level.INFO, "Found %s spying chat without permission on login. Disabled their chat spying.", player.getName());
} }
if (me.isAdminBypassing() && !player.hasPermission(Permission.BYPASS.node)) { if (me.isAdminBypassing() && !player.hasPermission(Permission.BYPASS.node)) {
me.setIsAdminBypassing(false); me.setIsAdminBypassing(false);
SaberFactions.plugin.log(Level.INFO, "Found %s on admin Bypass without permission on login. Disabled it for them.", player.getName()); P.p.log(Level.INFO, "Found %s on admin Bypass without permission on login. Disabled it for them.", player.getName());
} }
@ -373,10 +373,10 @@ public class FactionsPlayerListener implements Listener {
me.logout(); // cache kills / deaths me.logout(); // cache kills / deaths
// if player is waiting for fstuck teleport but leaves, remove // if player is waiting for fstuck teleport but leaves, remove
if (SaberFactions.plugin.getStuckMap().containsKey(me.getPlayer().getUniqueId())) { if (P.p.getStuckMap().containsKey(me.getPlayer().getUniqueId())) {
FPlayers.getInstance().getByPlayer(me.getPlayer()).msg(TL.COMMAND_STUCK_CANCELLED); FPlayers.getInstance().getByPlayer(me.getPlayer()).msg(TL.COMMAND_STUCK_CANCELLED);
SaberFactions.plugin.getStuckMap().remove(me.getPlayer().getUniqueId()); P.p.getStuckMap().remove(me.getPlayer().getUniqueId());
SaberFactions.plugin.getTimers().remove(me.getPlayer().getUniqueId()); P.p.getTimers().remove(me.getPlayer().getUniqueId());
} }
Faction myFaction = me.getFaction(); Faction myFaction = me.getFaction();
@ -413,11 +413,11 @@ public class FactionsPlayerListener implements Listener {
public void enableFly(FPlayer me) { public void enableFly(FPlayer me) {
if (!me.getPlayer().hasPermission("factions.fly")) return; if (!me.getPlayer().hasPermission("factions.fly")) return;
if (SaberFactions.plugin.getConfig().getBoolean("ffly.AutoEnable")) { if (P.p.getConfig().getBoolean("ffly.AutoEnable")) {
me.setFlying(true); me.setFlying(true);
CmdFly.flyMap.put(me.getName(), true); CmdFly.flyMap.put(me.getName(), true);
if (CmdFly.id == -1) { if (CmdFly.id == -1) {
if (SaberFactions.plugin.getConfig().getBoolean("ffly.Particles.Enabled")) { if (P.p.getConfig().getBoolean("ffly.Particles.Enabled")) {
CmdFly.startParticles(); CmdFly.startParticles();
} }
} }
@ -533,25 +533,25 @@ public class FactionsPlayerListener implements Listener {
if (changedFaction) { if (changedFaction) {
Bukkit.getServer().getPluginManager().callEvent(new FPlayerEnteredFactionEvent(factionTo, factionFrom, me)); Bukkit.getServer().getPluginManager().callEvent(new FPlayerEnteredFactionEvent(factionTo, factionFrom, me));
if (SaberFactions.plugin.getConfig().getBoolean("Title.Show-Title")) { if (P.p.getConfig().getBoolean("Title.Show-Title")) {
String title = SaberFactions.plugin.getConfig().getString("Title.Format.Title"); String title = P.p.getConfig().getString("Title.Format.Title");
title = title.replace("{Faction}", factionTo.getColorTo(me) + factionTo.getTag()); title = title.replace("{Faction}", factionTo.getColorTo(me) + factionTo.getTag());
title = parseAllPlaceholders(title, factionTo, player); title = parseAllPlaceholders(title, factionTo, player);
String subTitle = SaberFactions.plugin.getConfig().getString("Title.Format.Subtitle").replace("{Description}", factionTo.getDescription()).replace("{Faction}", factionTo.getColorTo(me) + factionTo.getTag()); String subTitle = P.p.getConfig().getString("Title.Format.Subtitle").replace("{Description}", factionTo.getDescription()).replace("{Faction}", factionTo.getColorTo(me) + factionTo.getTag());
subTitle = parseAllPlaceholders(subTitle, factionTo, player); subTitle = parseAllPlaceholders(subTitle, factionTo, player);
if (!SaberFactions.plugin.mc17) { if (!P.p.mc17) {
if (!SaberFactions.plugin.mc18) { if (!P.p.mc18) {
me.getPlayer().sendTitle(SaberFactions.plugin.color(title), SaberFactions.plugin.color(subTitle), SaberFactions.plugin.getConfig().getInt("Title.Options.FadeInTime"), me.getPlayer().sendTitle(P.p.color(title), P.p.color(subTitle), P.p.getConfig().getInt("Title.Options.FadeInTime"),
SaberFactions.plugin.getConfig().getInt("Title.Options.ShowTime"), P.p.getConfig().getInt("Title.Options.ShowTime"),
SaberFactions.plugin.getConfig().getInt("Title.Options.FadeOutTime")); P.p.getConfig().getInt("Title.Options.FadeOutTime"));
} else { } else {
me.getPlayer().sendTitle(SaberFactions.plugin.color(title), SaberFactions.plugin.color(subTitle)); me.getPlayer().sendTitle(P.p.color(title), P.p.color(subTitle));
} }
} }
} }
// enable fly :) // enable fly :)
if (SaberFactions.plugin.factionsFlight && me.hasFaction() && !me.isFlying()) { if (P.p.factionsFlight && me.hasFaction() && !me.isFlying()) {
if (factionTo == me.getFaction()) enableFly(me); if (factionTo == me.getFaction()) enableFly(me);
// bypass checks // bypass checks
Relation relationTo = factionTo.getRelationTo(me); Relation relationTo = factionTo.getRelationTo(me);
@ -592,12 +592,12 @@ public class FactionsPlayerListener implements Listener {
if (me.isMapAutoUpdating()) { if (me.isMapAutoUpdating()) {
if (showTimes.containsKey(player.getUniqueId()) && (showTimes.get(player.getUniqueId()) > System.currentTimeMillis())) { if (showTimes.containsKey(player.getUniqueId()) && (showTimes.get(player.getUniqueId()) > System.currentTimeMillis())) {
if (SaberFactions.plugin.getConfig().getBoolean("findfactionsexploit.log", false)) { if (P.p.getConfig().getBoolean("findfactionsexploit.log", false)) {
SaberFactions.plugin.log(Level.WARNING, "%s tried to show a faction map too soon and triggered exploit blocker.", player.getName()); P.p.log(Level.WARNING, "%s tried to show a faction map too soon and triggered exploit blocker.", player.getName());
} }
} else { } else {
me.sendFancyMessage(Board.getInstance().getMap(me, to, player.getLocation().getYaw())); me.sendFancyMessage(Board.getInstance().getMap(me, to, player.getLocation().getYaw()));
showTimes.put(player.getUniqueId(), System.currentTimeMillis() + SaberFactions.plugin.getConfig().getLong("findfactionsexploit.cooldown", 2000)); showTimes.put(player.getUniqueId(), System.currentTimeMillis() + P.p.getConfig().getLong("findfactionsexploit.cooldown", 2000));
} }
} else { } else {
Faction myFaction = me.getFaction(); Faction myFaction = me.getFaction();
@ -880,7 +880,7 @@ public class FactionsPlayerListener implements Listener {
return PermissableAction.DOOR; return PermissableAction.DOOR;
if (material.name().toUpperCase().contains("BUTTON") || material.name().toUpperCase().contains("PRESSURE")) if (material.name().toUpperCase().contains("BUTTON") || material.name().toUpperCase().contains("PRESSURE"))
return PermissableAction.BUTTON; return PermissableAction.BUTTON;
if (SaberFactions.plugin.mc113) { if (P.p.mc113) {
switch (material) { switch (material) {
case LEVER: case LEVER:
return PermissableAction.LEVER; return PermissableAction.LEVER;

View File

@ -2,7 +2,7 @@ package com.massivecraft.factions.scoreboards;
import com.massivecraft.factions.FPlayer; import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.FPlayers; import com.massivecraft.factions.FPlayers;
import com.massivecraft.factions.SaberFactions; import com.massivecraft.factions.P;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable; import org.bukkit.scheduler.BukkitRunnable;
@ -109,7 +109,7 @@ public class FScoreboard {
updateObjective(); updateObjective();
} }
} }
}.runTaskTimer(SaberFactions.plugin, updateInterval, updateInterval); }.runTaskTimer(P.p, updateInterval, updateInterval);
} }
public void setTemporarySidebar(final FSidebarProvider provider) { public void setTemporarySidebar(final FSidebarProvider provider) {
@ -132,7 +132,7 @@ public class FScoreboard {
updateObjective(); updateObjective();
} }
} }
}.runTaskLater(SaberFactions.plugin, SaberFactions.plugin.getConfig().getInt("scoreboard.expiration", 7) * 20); }.runTaskLater(P.p, P.p.getConfig().getInt("scoreboard.expiration", 7) * 20);
} }
private void updateObjective() { private void updateObjective() {

View File

@ -2,7 +2,7 @@ package com.massivecraft.factions.scoreboards;
import com.massivecraft.factions.FPlayer; import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.Faction; import com.massivecraft.factions.Faction;
import com.massivecraft.factions.SaberFactions; import com.massivecraft.factions.P;
import com.massivecraft.factions.zcore.util.TL; import com.massivecraft.factions.zcore.util.TL;
import com.massivecraft.factions.zcore.util.TagUtil; import com.massivecraft.factions.zcore.util.TagUtil;
@ -37,6 +37,6 @@ public abstract class FSidebarProvider {
// we assume it's broken up into two lines, so returning our tl will suffice. // we assume it's broken up into two lines, so returning our tl will suffice.
return TL.COMMAND_SHOW_NOHOME.toString(); return TL.COMMAND_SHOW_NOHOME.toString();
} }
return SaberFactions.plugin.txt.parse(line); // finally add color :) return P.p.txt.parse(line); // finally add color :)
} }
} }

View File

@ -39,13 +39,13 @@ public class FTeamWrapper {
return; return;
} }
if (!SaberFactions.plugin.getConfig().getBoolean("scoreboard.default-prefixes", false) || SaberFactions.plugin.getConfig().getBoolean("See-Invisible-Faction-Members")) { if (!P.p.getConfig().getBoolean("scoreboard.default-prefixes", false) || P.p.getConfig().getBoolean("See-Invisible-Faction-Members")) {
return; return;
} }
if (updating.add(faction)) { if (updating.add(faction)) {
Bukkit.getScheduler().runTask(SaberFactions.plugin, () -> { Bukkit.getScheduler().runTask(P.p, () -> {
updating.remove(faction); updating.remove(faction);
applyUpdates(faction); applyUpdates(faction);
}); });
@ -61,7 +61,7 @@ public class FTeamWrapper {
return; return;
} }
if (!SaberFactions.plugin.getConfig().getBoolean("scoreboard.default-prefixes", false) || SaberFactions.plugin.getConfig().getBoolean("See-Invisible-Faction-Members")) { if (!P.p.getConfig().getBoolean("scoreboard.default-prefixes", false) || P.p.getConfig().getBoolean("See-Invisible-Faction-Members")) {
return; return;
} }
@ -153,7 +153,7 @@ public class FTeamWrapper {
} }
private void updatePrefixes() { private void updatePrefixes() {
if (SaberFactions.plugin.getConfig().getBoolean("scoreboard.default-prefixes", false)) { if (P.p.getConfig().getBoolean("scoreboard.default-prefixes", false)) {
for (FScoreboard fboard : teams.keySet()) { for (FScoreboard fboard : teams.keySet()) {
updatePrefix(fboard); updatePrefix(fboard);
} }
@ -161,19 +161,19 @@ public class FTeamWrapper {
} }
private void updatePrefix(FScoreboard fboard) { private void updatePrefix(FScoreboard fboard) {
if (SaberFactions.plugin.getConfig().getBoolean("scoreboard.default-prefixes", false)) { if (P.p.getConfig().getBoolean("scoreboard.default-prefixes", false)) {
FPlayer fplayer = fboard.getFPlayer(); FPlayer fplayer = fboard.getFPlayer();
Team team = teams.get(fboard); Team team = teams.get(fboard);
boolean focused = false; boolean focused = false;
if (SaberFactions.plugin.getConfig().getBoolean("See-Invisible-Faction-Members", false)) { if (P.p.getConfig().getBoolean("See-Invisible-Faction-Members", false)) {
team.setCanSeeFriendlyInvisibles(true); team.setCanSeeFriendlyInvisibles(true);
} }
if ((SaberFactions.plugin.getConfig().getBoolean("ffocus.Enabled")) && (fplayer.getFaction() != null) && (fplayer.getFaction().getFocused() != null)) { if ((P.p.getConfig().getBoolean("ffocus.Enabled")) && (fplayer.getFaction() != null) && (fplayer.getFaction().getFocused() != null)) {
for (FPlayer fp : faction.getFPlayersWhereOnline(true)) { for (FPlayer fp : faction.getFPlayersWhereOnline(true)) {
if (fplayer.getFaction().getFocused().equalsIgnoreCase(fp.getName())) { if (fplayer.getFaction().getFocused().equalsIgnoreCase(fp.getName())) {
team.setPrefix(ChatColor.translateAlternateColorCodes('&', SaberFactions.plugin.getConfig().getString("ffocus.Prefix", "&7»&b"))); team.setPrefix(ChatColor.translateAlternateColorCodes('&', P.p.getConfig().getString("ffocus.Prefix", "&7»&b")));
focused = true; focused = true;
} }
} }

View File

@ -1,7 +1,7 @@
package com.massivecraft.factions.scoreboards.sidebar; package com.massivecraft.factions.scoreboards.sidebar;
import com.massivecraft.factions.FPlayer; import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.SaberFactions; import com.massivecraft.factions.P;
import com.massivecraft.factions.scoreboards.FSidebarProvider; import com.massivecraft.factions.scoreboards.FSidebarProvider;
import java.util.ArrayList; import java.util.ArrayList;
@ -12,21 +12,21 @@ public class FDefaultSidebar extends FSidebarProvider {
@Override @Override
public String getTitle(FPlayer fplayer) { public String getTitle(FPlayer fplayer) {
return replaceTags(fplayer, SaberFactions.plugin.getConfig().getString("scoreboard.default-title", "{name}")); return replaceTags(fplayer, P.p.getConfig().getString("scoreboard.default-title", "{name}"));
} }
@Override @Override
public List<String> getLines(FPlayer fplayer) { public List<String> getLines(FPlayer fplayer) {
if (fplayer.hasFaction()) { if (fplayer.hasFaction()) {
return getOutput(fplayer, "scoreboard.default"); return getOutput(fplayer, "scoreboard.default");
} else if (SaberFactions.plugin.getConfig().getBoolean("scoreboard.factionless-enabled", false)) { } else if (P.p.getConfig().getBoolean("scoreboard.factionless-enabled", false)) {
return getOutput(fplayer, "scoreboard.factionless"); return getOutput(fplayer, "scoreboard.factionless");
} }
return getOutput(fplayer, "scoreboard.default"); // no faction, factionless-board disabled return getOutput(fplayer, "scoreboard.default"); // no faction, factionless-board disabled
} }
public List<String> getOutput(FPlayer fplayer, String list) { public List<String> getOutput(FPlayer fplayer, String list) {
List<String> lines = SaberFactions.plugin.getConfig().getStringList(list); List<String> lines = P.p.getConfig().getStringList(list);
if (lines == null || lines.isEmpty()) { if (lines == null || lines.isEmpty()) {
return new ArrayList<>(); return new ArrayList<>();

View File

@ -2,7 +2,7 @@ package com.massivecraft.factions.scoreboards.sidebar;
import com.massivecraft.factions.FPlayer; import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.Faction; import com.massivecraft.factions.Faction;
import com.massivecraft.factions.SaberFactions; import com.massivecraft.factions.P;
import com.massivecraft.factions.scoreboards.FSidebarProvider; import com.massivecraft.factions.scoreboards.FSidebarProvider;
import java.util.List; import java.util.List;
@ -22,7 +22,7 @@ public class FInfoSidebar extends FSidebarProvider {
@Override @Override
public List<String> getLines(FPlayer fplayer) { public List<String> getLines(FPlayer fplayer) {
List<String> lines = SaberFactions.plugin.getConfig().getStringList("scoreboard.finfo"); List<String> lines = P.p.getConfig().getStringList("scoreboard.finfo");
ListIterator<String> it = lines.listIterator(); ListIterator<String> it = lines.listIterator();
while (it.hasNext()) { while (it.hasNext()) {

View File

@ -1,6 +1,6 @@
package com.massivecraft.factions.struct; package com.massivecraft.factions.struct;
import com.massivecraft.factions.SaberFactions; import com.massivecraft.factions.P;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
public enum Permission { public enum Permission {
@ -128,7 +128,7 @@ public enum Permission {
} }
public boolean has(CommandSender sender, boolean informSenderIfNot) { public boolean has(CommandSender sender, boolean informSenderIfNot) {
return SaberFactions.plugin.perm.has(sender, this.node, informSenderIfNot); return P.p.perm.has(sender, this.node, informSenderIfNot);
} }
public boolean has(CommandSender sender) { public boolean has(CommandSender sender) {

View File

@ -1,7 +1,7 @@
package com.massivecraft.factions.struct; package com.massivecraft.factions.struct;
import com.massivecraft.factions.Conf; import com.massivecraft.factions.Conf;
import com.massivecraft.factions.SaberFactions; import com.massivecraft.factions.P;
import com.massivecraft.factions.util.XMaterial; import com.massivecraft.factions.util.XMaterial;
import com.massivecraft.factions.zcore.fperms.Permissable; import com.massivecraft.factions.zcore.fperms.Permissable;
import com.massivecraft.factions.zcore.util.TL; import com.massivecraft.factions.zcore.util.TL;
@ -199,7 +199,7 @@ public enum Relation implements Permissable {
// Utility method to build items for F Perm GUI // Utility method to build items for F Perm GUI
@Override @Override
public ItemStack buildItem() { public ItemStack buildItem() {
final ConfigurationSection RELATION_CONFIG = SaberFactions.plugin.getConfig().getConfigurationSection("fperm-gui.relation"); final ConfigurationSection RELATION_CONFIG = P.p.getConfig().getConfigurationSection("fperm-gui.relation");
String displayName = replacePlaceholders(RELATION_CONFIG.getString("placeholder-item.name", "")); String displayName = replacePlaceholders(RELATION_CONFIG.getString("placeholder-item.name", ""));
List<String> lore = new ArrayList<>(); List<String> lore = new ArrayList<>();

View File

@ -1,7 +1,7 @@
package com.massivecraft.factions.struct; package com.massivecraft.factions.struct;
import com.massivecraft.factions.Conf; import com.massivecraft.factions.Conf;
import com.massivecraft.factions.SaberFactions; import com.massivecraft.factions.P;
import com.massivecraft.factions.util.XMaterial; import com.massivecraft.factions.util.XMaterial;
import com.massivecraft.factions.zcore.fperms.Permissable; import com.massivecraft.factions.zcore.fperms.Permissable;
import com.massivecraft.factions.zcore.util.TL; import com.massivecraft.factions.zcore.util.TL;
@ -113,7 +113,7 @@ public enum Role implements Permissable {
// Utility method to build items for F Perm GUI // Utility method to build items for F Perm GUI
@Override @Override
public ItemStack buildItem() { public ItemStack buildItem() {
final ConfigurationSection RELATION_CONFIG = SaberFactions.plugin.getConfig().getConfigurationSection("fperm-gui.relation"); final ConfigurationSection RELATION_CONFIG = P.p.getConfig().getConfigurationSection("fperm-gui.relation");
String displayName = replacePlaceholders(RELATION_CONFIG.getString("placeholder-item.name", "")); String displayName = replacePlaceholders(RELATION_CONFIG.getString("placeholder-item.name", ""));
List<String> lore = new ArrayList<>(); List<String> lore = new ArrayList<>();
@ -132,7 +132,7 @@ public enum Role implements Permissable {
itemMeta.setDisplayName(displayName); itemMeta.setDisplayName(displayName);
itemMeta.setLore(lore); itemMeta.setLore(lore);
if (!SaberFactions.plugin.mc17) { if (!P.p.mc17) {
itemMeta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES); itemMeta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES);
} }

View File

@ -50,13 +50,13 @@ public class AutoLeaveProcessTask extends BukkitRunnable {
// Check if they should be exempt from this. // Check if they should be exempt from this.
if (!fplayer.willAutoLeave()) { if (!fplayer.willAutoLeave()) {
SaberFactions.plugin.debug(Level.INFO, fplayer.getName() + " was going to be auto-removed but was set not to."); P.p.debug(Level.INFO, fplayer.getName() + " was going to be auto-removed but was set not to.");
continue; continue;
} }
if (fplayer.isOffline() && now - fplayer.getLastLoginTime() > toleranceMillis) { if (fplayer.isOffline() && now - fplayer.getLastLoginTime() > toleranceMillis) {
if (Conf.logFactionLeave || Conf.logFactionKick) { if (Conf.logFactionLeave || Conf.logFactionKick) {
SaberFactions.plugin.log("Player " + fplayer.getName() + " was auto-removed due to inactivity."); P.p.log("Player " + fplayer.getName() + " was auto-removed due to inactivity.");
} }
// if player is faction admin, sort out the faction since he's going away // if player is faction admin, sort out the faction since he's going away

View File

@ -1,7 +1,7 @@
package com.massivecraft.factions.util; package com.massivecraft.factions.util;
import com.massivecraft.factions.Conf; import com.massivecraft.factions.Conf;
import com.massivecraft.factions.SaberFactions; import com.massivecraft.factions.P;
public class AutoLeaveTask implements Runnable { public class AutoLeaveTask implements Runnable {
@ -18,11 +18,11 @@ public class AutoLeaveTask implements Runnable {
} }
task = new AutoLeaveProcessTask(); task = new AutoLeaveProcessTask();
task.runTaskTimer(SaberFactions.plugin, 1, 1); task.runTaskTimer(P.p, 1, 1);
// maybe setting has been changed? if so, restart this task at new rate // maybe setting has been changed? if so, restart this task at new rate
if (this.rate != Conf.autoLeaveRoutineRunsEveryXMinutes) { if (this.rate != Conf.autoLeaveRoutineRunsEveryXMinutes) {
SaberFactions.plugin.startAutoLeaveTask(true); P.p.startAutoLeaveTask(true);
} }
} }
} }

View File

@ -35,7 +35,7 @@ public class ClipPlaceholderAPIManager extends PlaceholderExpansion implements R
// Return the plugin version since this expansion is bundled with the dependency // Return the plugin version since this expansion is bundled with the dependency
@Override @Override
public String getVersion() { public String getVersion() {
return SaberFactions.plugin.getDescription().getVersion(); return P.p.getDescription().getVersion();
} }
@ -80,7 +80,7 @@ public class ClipPlaceholderAPIManager extends PlaceholderExpansion implements R
String humanized = DurationFormatUtils.formatDurationWords(System.currentTimeMillis() - fPlayer.getLastLoginTime(), true, true) + TL.COMMAND_STATUS_AGOSUFFIX; String humanized = DurationFormatUtils.formatDurationWords(System.currentTimeMillis() - fPlayer.getLastLoginTime(), true, true) + TL.COMMAND_STATUS_AGOSUFFIX;
return fPlayer.isOnline() ? ChatColor.GREEN + TL.COMMAND_STATUS_ONLINE.toString() : (System.currentTimeMillis() - fPlayer.getLastLoginTime() < 432000000 ? ChatColor.YELLOW + humanized : ChatColor.RED + humanized); return fPlayer.isOnline() ? ChatColor.GREEN + TL.COMMAND_STATUS_ONLINE.toString() : (System.currentTimeMillis() - fPlayer.getLastLoginTime() < 432000000 ? ChatColor.YELLOW + humanized : ChatColor.RED + humanized);
case "player_group": case "player_group":
return SaberFactions.plugin.getPrimaryGroup(Bukkit.getOfflinePlayer(UUID.fromString(fPlayer.getId()))); return P.p.getPrimaryGroup(Bukkit.getOfflinePlayer(UUID.fromString(fPlayer.getId())));
case "player_balance": case "player_balance":
return Econ.isSetup() ? Econ.getFriendlyBalance(fPlayer) : TL.ECON_OFF.format("balance"); return Econ.isSetup() ? Econ.getFriendlyBalance(fPlayer) : TL.ECON_OFF.format("balance");
case "player_power": case "player_power":
@ -123,7 +123,7 @@ public class ClipPlaceholderAPIManager extends PlaceholderExpansion implements R
case "faction_warps": case "faction_warps":
return String.valueOf(faction.getWarps().size()); return String.valueOf(faction.getWarps().size());
case "faction_raidable": case "faction_raidable":
boolean raid = SaberFactions.plugin.getConfig().getBoolean("hcf.raidable", false) && faction.getLandRounded() >= faction.getPowerRounded(); boolean raid = P.p.getConfig().getBoolean("hcf.raidable", false) && faction.getLandRounded() >= faction.getPowerRounded();
return raid ? TL.RAIDABLE_TRUE.toString() : TL.RAIDABLE_FALSE.toString(); return raid ? TL.RAIDABLE_TRUE.toString() : TL.RAIDABLE_FALSE.toString();
case "faction_home_world": case "faction_home_world":
return faction.hasHome() ? faction.getHome().getWorld().getName() : ""; return faction.hasHome() ? faction.getHome().getWorld().getName() : "";

View File

@ -1,7 +1,7 @@
package com.massivecraft.factions.util; package com.massivecraft.factions.util;
import com.google.gson.*; import com.google.gson.*;
import com.massivecraft.factions.SaberFactions; import com.massivecraft.factions.P;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Location; import org.bukkit.Location;
@ -21,7 +21,7 @@ public class LocationTypeAdapter implements JsonSerializer<Location>, JsonDeseri
return object; return object;
} catch (Exception ex) { } catch (Exception ex) {
ex.printStackTrace(); ex.printStackTrace();
SaberFactions.plugin.log(Level.WARNING, "Error encountered while serializing a Location."); P.p.log(Level.WARNING, "Error encountered while serializing a Location.");
return object; return object;
} }
} }
@ -38,7 +38,7 @@ public class LocationTypeAdapter implements JsonSerializer<Location>, JsonDeseri
object.get("z").getAsDouble()); object.get("z").getAsDouble());
} catch (Exception ex) { } catch (Exception ex) {
ex.printStackTrace(); ex.printStackTrace();
SaberFactions.plugin.log(Level.WARNING, "Error encountered while" + P.p.log(Level.WARNING, "Error encountered while" +
" deserializing a Location."); " deserializing a Location.");
return null; return null;
} }

View File

@ -2,7 +2,7 @@ package com.massivecraft.factions.util;
import com.google.gson.*; import com.google.gson.*;
import com.massivecraft.factions.FLocation; import com.massivecraft.factions.FLocation;
import com.massivecraft.factions.SaberFactions; import com.massivecraft.factions.P;
import java.lang.reflect.Type; import java.lang.reflect.Type;
import java.util.HashSet; import java.util.HashSet;
@ -50,7 +50,7 @@ public class MapFLocToStringSetTypeAdapter implements JsonDeserializer<Map<FLoca
} catch (Exception ex) { } catch (Exception ex) {
ex.printStackTrace(); ex.printStackTrace();
SaberFactions.plugin.log(Level.WARNING, "Error encountered while deserializing a Map of FLocations to String Sets."); P.p.log(Level.WARNING, "Error encountered while deserializing a Map of FLocations to String Sets.");
return null; return null;
} }
} }
@ -95,7 +95,7 @@ public class MapFLocToStringSetTypeAdapter implements JsonDeserializer<Map<FLoca
} catch (Exception ex) { } catch (Exception ex) {
ex.printStackTrace(); ex.printStackTrace();
SaberFactions.plugin.log(Level.WARNING, "Error encountered while serializing a Map of FLocations to String Sets."); P.p.log(Level.WARNING, "Error encountered while serializing a Map of FLocations to String Sets.");
return obj; return obj;
} }
} }

View File

@ -2,7 +2,7 @@ package com.massivecraft.factions.util;
import com.massivecraft.factions.Conf; import com.massivecraft.factions.Conf;
import com.massivecraft.factions.FPlayer; import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.SaberFactions; import com.massivecraft.factions.P;
import com.massivecraft.factions.struct.Role; import com.massivecraft.factions.struct.Role;
import com.massivecraft.factions.zcore.util.TL; import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
@ -68,16 +68,16 @@ public class MiscUtil {
ArrayList<String> errors = new ArrayList<>(); ArrayList<String> errors = new ArrayList<>();
if (getComparisonString(str).length() < Conf.factionTagLengthMin) { if (getComparisonString(str).length() < Conf.factionTagLengthMin) {
errors.add(SaberFactions.plugin.txt.parse(TL.GENERIC_FACTIONTAG_TOOSHORT.toString(), Conf.factionTagLengthMin)); errors.add(P.p.txt.parse(TL.GENERIC_FACTIONTAG_TOOSHORT.toString(), Conf.factionTagLengthMin));
} }
if (str.length() > Conf.factionTagLengthMax) { if (str.length() > Conf.factionTagLengthMax) {
errors.add(SaberFactions.plugin.txt.parse(TL.GENERIC_FACTIONTAG_TOOLONG.toString(), Conf.factionTagLengthMax)); errors.add(P.p.txt.parse(TL.GENERIC_FACTIONTAG_TOOLONG.toString(), Conf.factionTagLengthMax));
} }
for (char c : str.toCharArray()) { for (char c : str.toCharArray()) {
if (!substanceChars.contains(String.valueOf(c))) { if (!substanceChars.contains(String.valueOf(c))) {
errors.add(SaberFactions.plugin.txt.parse(TL.GENERIC_FACTIONTAG_ALPHANUMERIC.toString(), c)); errors.add(P.p.txt.parse(TL.GENERIC_FACTIONTAG_ALPHANUMERIC.toString(), c));
} }
} }
@ -96,7 +96,7 @@ public class MiscUtil {
// Fix for some data being broken when we added the recruit rank. // Fix for some data being broken when we added the recruit rank.
if (player.getRole() == null) { if (player.getRole() == null) {
player.setRole(Role.NORMAL); player.setRole(Role.NORMAL);
SaberFactions.plugin.log(Level.WARNING, String.format("Player %s had null role. Setting them to normal. This isn't good D:", player.getName())); P.p.log(Level.WARNING, String.format("Player %s had null role. Setting them to normal. This isn't good D:", player.getName()));
} }
switch (player.getRole()) { switch (player.getRole()) {

View File

@ -1,7 +1,7 @@
package com.massivecraft.factions.util; package com.massivecraft.factions.util;
import com.google.gson.*; import com.google.gson.*;
import com.massivecraft.factions.SaberFactions; import com.massivecraft.factions.P;
import java.lang.reflect.Type; import java.lang.reflect.Type;
import java.util.logging.Level; import java.util.logging.Level;
@ -32,7 +32,7 @@ public class MyLocationTypeAdapter implements JsonDeserializer<LazyLocation>, Js
} catch (Exception ex) { } catch (Exception ex) {
ex.printStackTrace(); ex.printStackTrace();
SaberFactions.plugin.log(Level.WARNING, "Error encountered while deserializing a LazyLocation."); P.p.log(Level.WARNING, "Error encountered while deserializing a LazyLocation.");
return null; return null;
} }
} }
@ -52,7 +52,7 @@ public class MyLocationTypeAdapter implements JsonDeserializer<LazyLocation>, Js
return obj; return obj;
} catch (Exception ex) { } catch (Exception ex) {
ex.printStackTrace(); ex.printStackTrace();
SaberFactions.plugin.log(Level.WARNING, "Error encountered while serializing a LazyLocation."); P.p.log(Level.WARNING, "Error encountered while serializing a LazyLocation.");
return obj; return obj;
} }
} }

View File

@ -1,6 +1,5 @@
package com.massivecraft.factions.util.Particles; package com.massivecraft.factions.util.Particles;
import com.massivecraft.factions.SaberFactions;
import com.massivecraft.factions.util.XMaterial; import com.massivecraft.factions.util.XMaterial;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Color; import org.bukkit.Color;

View File

@ -1,7 +1,7 @@
package com.massivecraft.factions.util; package com.massivecraft.factions.util;
import com.google.gson.*; import com.google.gson.*;
import com.massivecraft.factions.SaberFactions; import com.massivecraft.factions.P;
import com.massivecraft.factions.struct.Relation; import com.massivecraft.factions.struct.Relation;
import com.massivecraft.factions.struct.Role; import com.massivecraft.factions.struct.Role;
import com.massivecraft.factions.zcore.fperms.Access; import com.massivecraft.factions.zcore.fperms.Access;
@ -62,7 +62,7 @@ public class PermissionsMapTypeAdapter implements JsonDeserializer<Map<Permissab
return permissionsMap; return permissionsMap;
} catch (Exception ex) { } catch (Exception ex) {
SaberFactions.plugin.log(Level.WARNING, "Error encountered while deserializing a PermissionsMap."); P.p.log(Level.WARNING, "Error encountered while deserializing a PermissionsMap.");
ex.printStackTrace(); ex.printStackTrace();
return null; return null;
} }

View File

@ -1,7 +1,7 @@
package com.massivecraft.factions.util; package com.massivecraft.factions.util;
import com.massivecraft.factions.FLocation; import com.massivecraft.factions.FLocation;
import com.massivecraft.factions.SaberFactions; import com.massivecraft.factions.P;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.World; import org.bukkit.World;
@ -45,7 +45,7 @@ public abstract class SpiralTask implements Runnable {
this.world = Bukkit.getWorld(fLocation.getWorldName()); this.world = Bukkit.getWorld(fLocation.getWorldName());
if (this.world == null) { if (this.world == null) {
SaberFactions.plugin.log(Level.WARNING, "[SpiralTask] A valid world must be specified!"); P.p.log(Level.WARNING, "[SpiralTask] A valid world must be specified!");
this.stop(); this.stop();
return; return;
} }
@ -56,7 +56,7 @@ public abstract class SpiralTask implements Runnable {
this.readyToGo = true; this.readyToGo = true;
// get this party started // get this party started
this.setTaskID(Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(SaberFactions.plugin, this, 2, 2)); this.setTaskID(Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(P.p, this, 2, 2));
} }
private static long now() { private static long now() {
@ -187,7 +187,7 @@ public abstract class SpiralTask implements Runnable {
// for successful completion // for successful completion
public void finish() { public void finish() {
// SaberFactions.plugin.log("SpiralTask successfully completed!"); // P.p.log("SpiralTask successfully completed!");
this.stop(); this.stop();
} }

View File

@ -3,7 +3,7 @@ package com.massivecraft.factions.util;
import com.massivecraft.factions.FPlayer; import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.FPlayers; import com.massivecraft.factions.FPlayers;
import com.massivecraft.factions.Faction; import com.massivecraft.factions.Faction;
import com.massivecraft.factions.SaberFactions; import com.massivecraft.factions.P;
import com.massivecraft.factions.struct.Relation; import com.massivecraft.factions.struct.Relation;
import com.massivecraft.factions.zcore.util.TL; import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
@ -12,18 +12,18 @@ import org.bukkit.Bukkit;
public class UtilFly { public class UtilFly {
public static void run() { public static void run() {
if (!SaberFactions.plugin.getConfig().getBoolean("enable-faction-flight")) if (!P.p.getConfig().getBoolean("enable-faction-flight"))
return; return;
Bukkit.getScheduler().scheduleSyncRepeatingTask(SaberFactions.plugin, () -> { Bukkit.getScheduler().scheduleSyncRepeatingTask(P.p, () -> {
for (FPlayer fp : FPlayers.getInstance().getOnlinePlayers()) { for (FPlayer fp : FPlayers.getInstance().getOnlinePlayers()) {
if (fp.isFlying()) fp.checkIfNearbyEnemies(); if (fp.isFlying()) fp.checkIfNearbyEnemies();
} }
}, 0, SaberFactions.plugin.getConfig().getInt("fly-task-interval", 10)); }, 0, P.p.getConfig().getInt("fly-task-interval", 10));
} }
public static void setFly(FPlayer fp, boolean fly, boolean silent, boolean damage) { public static void setFly(FPlayer fp, boolean fly, boolean silent, boolean damage) {
if (!SaberFactions.plugin.getConfig().getBoolean("enable-faction-flight")) if (!P.p.getConfig().getBoolean("enable-faction-flight"))
return; return;
fp.getPlayer().setAllowFlight(fly); fp.getPlayer().setAllowFlight(fly);
@ -43,7 +43,7 @@ public class UtilFly {
} }
public static void checkFly(FPlayer me, Faction factionTo) { public static void checkFly(FPlayer me, Faction factionTo) {
if (!SaberFactions.plugin.getConfig().getBoolean("enable-faction-flight")) if (!P.p.getConfig().getBoolean("enable-faction-flight"))
return; return;
if (me.isAdminBypassing() && me.isFlying()) if (me.isAdminBypassing() && me.isFlying())
@ -81,13 +81,13 @@ public class UtilFly {
public static void setFallDamage(FPlayer fp, boolean fly, boolean damage) { public static void setFallDamage(FPlayer fp, boolean fly, boolean damage) {
if (!fly) { if (!fly) {
if (!damage) { if (!damage) {
fp.sendMessage(TL.COMMAND_FLY_COOLDOWN.toString().replace("{amount}", SaberFactions.plugin.getConfig().getInt("fly-falldamage-cooldown", 3) + "")); fp.sendMessage(TL.COMMAND_FLY_COOLDOWN.toString().replace("{amount}", P.p.getConfig().getInt("fly-falldamage-cooldown", 3) + ""));
} }
int cooldown = SaberFactions.plugin.getConfig().getInt("fly-falldamage-cooldown", 3); int cooldown = P.p.getConfig().getInt("fly-falldamage-cooldown", 3);
if (cooldown > 0) { if (cooldown > 0) {
fp.setTakeFallDamage(false); fp.setTakeFallDamage(false);
Bukkit.getScheduler().runTaskLater(SaberFactions.plugin, () -> fp.setTakeFallDamage(true), 20L * cooldown); Bukkit.getScheduler().runTaskLater(P.p, () -> fp.setTakeFallDamage(true), 20L * cooldown);
} }
} }
} }

View File

@ -1,7 +1,7 @@
package com.massivecraft.factions.util; package com.massivecraft.factions.util;
import com.massivecraft.factions.FPlayer; import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.SaberFactions; import com.massivecraft.factions.P;
import com.massivecraft.factions.zcore.util.TL; import com.massivecraft.factions.zcore.util.TL;
public class WarmUpUtil { public class WarmUpUtil {
@ -21,7 +21,7 @@ public class WarmUpUtil {
player.msg(TL.WARMUPS_ALREADY); player.msg(TL.WARMUPS_ALREADY);
} else { } else {
player.msg(translationKey.format(action, delay)); player.msg(translationKey.format(action, delay));
int id = SaberFactions.plugin.getServer().getScheduler().runTaskLater(SaberFactions.plugin, () -> { int id = P.p.getServer().getScheduler().runTaskLater(P.p, () -> {
player.stopWarmup(); player.stopWarmup();
runnable.run(); runnable.run();
}, delay * 20).getTaskId(); }, delay * 20).getTaskId();

View File

@ -3,7 +3,7 @@ package com.massivecraft.factions.util;
import com.massivecraft.factions.Conf; import com.massivecraft.factions.Conf;
import com.massivecraft.factions.FPlayer; import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.Faction; import com.massivecraft.factions.Faction;
import com.massivecraft.factions.SaberFactions; import com.massivecraft.factions.P;
import com.massivecraft.factions.integration.Econ; import com.massivecraft.factions.integration.Econ;
import com.massivecraft.factions.zcore.util.TL; import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
@ -34,14 +34,14 @@ public class WarpGUI implements InventoryHolder, FactionGUI {
public WarpGUI(FPlayer fme) { public WarpGUI(FPlayer fme) {
this.fme = fme; this.fme = fme;
this.section = SaberFactions.plugin.getConfig().getConfigurationSection("fwarp-gui"); this.section = P.p.getConfig().getConfigurationSection("fwarp-gui");
} }
@Override @Override
public void build() { public void build() {
if (section == null) { if (section == null) {
SaberFactions.plugin.log(Level.WARNING, "Attempted to build f warp GUI but config section not present."); P.p.log(Level.WARNING, "Attempted to build f warp GUI but config section not present.");
SaberFactions.plugin.log(Level.WARNING, "Copy your config, allow the section to generate, then copy it back to your old config."); P.p.log(Level.WARNING, "Copy your config, allow the section to generate, then copy it back to your old config.");
return; return;
} }
@ -49,14 +49,14 @@ public class WarpGUI implements InventoryHolder, FactionGUI {
guiSize = section.getInt("rows", 3); guiSize = section.getInt("rows", 3);
if (guiSize > 6) { if (guiSize > 6) {
guiSize = 6; guiSize = 6;
SaberFactions.plugin.log(Level.INFO, "Warp GUI size out of bounds, defaulting to 6"); P.p.log(Level.INFO, "Warp GUI size out of bounds, defaulting to 6");
} }
guiSize *= 9; guiSize *= 9;
String guiName = ChatColor.translateAlternateColorCodes('&', section.getString("name", "FactionPermissions")); String guiName = ChatColor.translateAlternateColorCodes('&', section.getString("name", "FactionPermissions"));
warpGUI = Bukkit.createInventory(this, guiSize, guiName); warpGUI = Bukkit.createInventory(this, guiSize, guiName);
maxWarps = SaberFactions.plugin.getConfig().getInt("max-warps", 5); maxWarps = P.p.getConfig().getInt("max-warps", 5);
Set<String> factionWarps = fme.getFaction().getWarps().keySet(); Set<String> factionWarps = fme.getFaction().getWarps().keySet();
List<Integer> warpOpenSlots = section.getIntegerList("warp-slots"); List<Integer> warpOpenSlots = section.getIntegerList("warp-slots");
@ -64,7 +64,7 @@ public class WarpGUI implements InventoryHolder, FactionGUI {
buildDummyItems(); buildDummyItems();
if (maxWarps != warpOpenSlots.size()) { if (maxWarps != warpOpenSlots.size()) {
SaberFactions.plugin.log(Level.SEVERE, "Invalid warp slots for GUI, Please use same value as max warps"); P.p.log(Level.SEVERE, "Invalid warp slots for GUI, Please use same value as max warps");
return; return;
} }
@ -102,12 +102,12 @@ public class WarpGUI implements InventoryHolder, FactionGUI {
} else { } else {
fme.setEnteringPassword(true, warp); fme.setEnteringPassword(true, warp);
fme.msg(TL.COMMAND_FWARP_PASSWORD_REQUIRED); fme.msg(TL.COMMAND_FWARP_PASSWORD_REQUIRED);
Bukkit.getScheduler().runTaskLater(SaberFactions.plugin, () -> { Bukkit.getScheduler().runTaskLater(P.p, () -> {
if (fme.isEnteringPassword()) { if (fme.isEnteringPassword()) {
fme.msg(TL.COMMAND_FWARP_PASSWORD_TIMEOUT); fme.msg(TL.COMMAND_FWARP_PASSWORD_TIMEOUT);
fme.setEnteringPassword(false, ""); fme.setEnteringPassword(false, "");
} }
}, SaberFactions.plugin.getConfig().getInt("fwarp-gui.password-timeout", 5) * 20); }, P.p.getConfig().getInt("fwarp-gui.password-timeout", 5) * 20);
} }
} }
} }
@ -119,15 +119,15 @@ public class WarpGUI implements InventoryHolder, FactionGUI {
player.teleport(fme.getFaction().getWarp(warp).getLocation()); player.teleport(fme.getFaction().getWarp(warp).getLocation());
fme.msg(TL.COMMAND_FWARP_WARPED, warp); fme.msg(TL.COMMAND_FWARP_WARPED, warp);
} }
}, SaberFactions.plugin.getConfig().getLong("warmups.f-warp", 0)); }, P.p.getConfig().getLong("warmups.f-warp", 0));
} }
private boolean transact(FPlayer player) { private boolean transact(FPlayer player) {
if (!SaberFactions.plugin.getConfig().getBoolean("warp-cost.enabled", false) || player.isAdminBypassing()) { if (!P.p.getConfig().getBoolean("warp-cost.enabled", false) || player.isAdminBypassing()) {
return true; return true;
} }
double cost = SaberFactions.plugin.getConfig().getDouble("warp-cost.warp", 5); double cost = P.p.getConfig().getDouble("warp-cost.warp", 5);
if (!Econ.shouldBeUsed() || this.fme == null || cost == 0.0 || fme.isAdminBypassing()) { if (!Econ.shouldBeUsed() || this.fme == null || cost == 0.0 || fme.isAdminBypassing()) {
return true; return true;
@ -143,8 +143,8 @@ public class WarpGUI implements InventoryHolder, FactionGUI {
private ItemStack buildItem(String warp) { private ItemStack buildItem(String warp) {
ConfigurationSection warpItemSection = section.getConfigurationSection("warp-item"); ConfigurationSection warpItemSection = section.getConfigurationSection("warp-item");
if (warpItemSection == null) { if (warpItemSection == null) {
SaberFactions.plugin.log(Level.WARNING, "Attempted to build f warp GUI but config section not present."); P.p.log(Level.WARNING, "Attempted to build f warp GUI but config section not present.");
SaberFactions.plugin.log(Level.WARNING, "Copy your config, allow the section to generate, then copy it back to your old config."); P.p.log(Level.WARNING, "Copy your config, allow the section to generate, then copy it back to your old config.");
return new ItemStack(Material.AIR); return new ItemStack(Material.AIR);
} }
@ -178,7 +178,7 @@ public class WarpGUI implements InventoryHolder, FactionGUI {
string = ChatColor.translateAlternateColorCodes('&', string); string = ChatColor.translateAlternateColorCodes('&', string);
string = string.replace("{warp}", warp); string = string.replace("{warp}", warp);
string = string.replace("{warp-protected}", faction.hasWarpPassword(warp) ? "Enabled" : "Disabled"); string = string.replace("{warp-protected}", faction.hasWarpPassword(warp) ? "Enabled" : "Disabled");
string = string.replace("{warp-cost}", !SaberFactions.plugin.getConfig().getBoolean("warp-cost.enabled", false) ? "Disabled" : Integer.toString(SaberFactions.plugin.getConfig().getInt("warp-cost.warp", 5))); string = string.replace("{warp-cost}", !P.p.getConfig().getBoolean("warp-cost.enabled", false) ? "Disabled" : Integer.toString(P.p.getConfig().getInt("warp-cost.warp", 5)));
return string; return string;
} }
@ -188,7 +188,7 @@ public class WarpGUI implements InventoryHolder, FactionGUI {
try { try {
dummyId = Integer.parseInt(key); dummyId = Integer.parseInt(key);
} catch (NumberFormatException exception) { } catch (NumberFormatException exception) {
SaberFactions.plugin.log(Level.WARNING, "Invalid dummy item id: " + key.toUpperCase()); P.p.log(Level.WARNING, "Invalid dummy item id: " + key.toUpperCase());
continue; continue;
} }
@ -200,7 +200,7 @@ public class WarpGUI implements InventoryHolder, FactionGUI {
List<Integer> dummyIdSlots = section.getIntegerList("dummy-slots." + key); List<Integer> dummyIdSlots = section.getIntegerList("dummy-slots." + key);
for (Integer slot : dummyIdSlots) { for (Integer slot : dummyIdSlots) {
if (slot + 1 > guiSize || slot < 0) { if (slot + 1 > guiSize || slot < 0) {
SaberFactions.plugin.log(Level.WARNING, "Invalid slot: " + slot + " for dummy item: " + key); P.p.log(Level.WARNING, "Invalid slot: " + slot + " for dummy item: " + key);
continue; continue;
} }
dummySlots.add(slot); dummySlots.add(slot);
@ -213,14 +213,14 @@ public class WarpGUI implements InventoryHolder, FactionGUI {
final ConfigurationSection dummySection = section.getConfigurationSection("dummy-items." + id); final ConfigurationSection dummySection = section.getConfigurationSection("dummy-items." + id);
if (dummySection == null) { if (dummySection == null) {
SaberFactions.plugin.log(Level.WARNING, "Attempted to build f warp GUI but config section not present."); P.p.log(Level.WARNING, "Attempted to build f warp GUI but config section not present.");
SaberFactions.plugin.log(Level.WARNING, "Copy your config, allow the section to generate, then copy it back to your old config."); P.p.log(Level.WARNING, "Copy your config, allow the section to generate, then copy it back to your old config.");
return new ItemStack(Material.AIR); return new ItemStack(Material.AIR);
} }
Material material = Material.matchMaterial(dummySection.getString("material", "")); Material material = Material.matchMaterial(dummySection.getString("material", ""));
if (material == null) { if (material == null) {
SaberFactions.plugin.log(Level.WARNING, "Invalid material for dummy item: " + id); P.p.log(Level.WARNING, "Invalid material for dummy item: " + id);
return null; return null;
} }
@ -238,7 +238,7 @@ public class WarpGUI implements InventoryHolder, FactionGUI {
ItemMeta itemMeta = itemStack.getItemMeta(); ItemMeta itemMeta = itemStack.getItemMeta();
if (!SaberFactions.plugin.mc17) { if (!P.p.mc17) {
itemMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS, ItemFlag.HIDE_ATTRIBUTES); itemMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS, ItemFlag.HIDE_ATTRIBUTES);
} }

View File

@ -3,7 +3,7 @@ package com.massivecraft.factions.zcore;
import com.massivecraft.factions.FPlayer; import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.FPlayers; import com.massivecraft.factions.FPlayers;
import com.massivecraft.factions.Faction; import com.massivecraft.factions.Faction;
import com.massivecraft.factions.SaberFactions; import com.massivecraft.factions.P;
import com.massivecraft.factions.integration.Econ; import com.massivecraft.factions.integration.Econ;
import com.massivecraft.factions.zcore.util.TL; import com.massivecraft.factions.zcore.util.TL;
import com.massivecraft.factions.zcore.util.TextUtil; import com.massivecraft.factions.zcore.util.TextUtil;
@ -311,7 +311,7 @@ public abstract class MCommand<T extends MPlugin> {
s = s.replace("{power}", power); s = s.replace("{power}", power);
} }
if (s.contains("{group}")) { if (s.contains("{group}")) {
String group = SaberFactions.plugin.getPrimaryGroup(Bukkit.getOfflinePlayer(UUID.fromString(player.getId()))); String group = P.p.getPrimaryGroup(Bukkit.getOfflinePlayer(UUID.fromString(player.getId())));
s = s.replace("{group}", group); s = s.replace("{group}", group);
} }
return s; return s;

View File

@ -242,7 +242,7 @@ public abstract class MPlugin extends JavaPlugin {
// COMMAND HANDLING // COMMAND HANDLING
// -------------------------------------------- // // -------------------------------------------- //
// can be overridden by SaberFactions method, to provide option // can be overridden by P method, to provide option
public boolean logPlayerCommands() { public boolean logPlayerCommands() {
return true; return true;
} }

View File

@ -40,7 +40,7 @@ public class MPluginSecretPlayerListener implements Listener {
/* Should be handled by stuff in FactionsChatListener /* Should be handled by stuff in FactionsChatListener
Player speaker = event.getPlayer(); Player speaker = event.getPlayer();
String format = event.getFormat(); String format = event.getFormat();
format = format.replace(Conf.chatTagReplaceString, SaberFactions.plugin.getPlayerFactionTag(speaker)).replace("[FACTION_TITLE]", SaberFactions.plugin.getPlayerTitle(speaker)); format = format.replace(Conf.chatTagReplaceString, P.p.getPlayerFactionTag(speaker)).replace("[FACTION_TITLE]", P.p.getPlayerTitle(speaker));
event.setFormat(format); event.setFormat(format);
*/ */
} }

View File

@ -1,8 +1,6 @@
package com.massivecraft.factions.zcore.fperms; package com.massivecraft.factions.zcore.fperms;
import org.bukkit.ChatColor; import com.massivecraft.factions.P;
import com.massivecraft.factions.SaberFactions;
public enum Access { public enum Access {
ALLOW("Allow"), ALLOW("Allow"),
@ -37,7 +35,7 @@ public enum Access {
return name(); return name();
} }
public String getColor() { return SaberFactions.plugin.getConfig().getString("fperm-gui.action.Access-Colors." + this.name); } public String getColor() { return P.p.getConfig().getString("fperm-gui.action.Access-Colors." + this.name); }
public static Access booleanToAccess(boolean access) { public static Access booleanToAccess(boolean access) {
if (access) return Access.ALLOW; if (access) return Access.ALLOW;

View File

@ -1,7 +1,7 @@
package com.massivecraft.factions.zcore.fperms; package com.massivecraft.factions.zcore.fperms;
import com.massivecraft.factions.FPlayer; import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.SaberFactions; import com.massivecraft.factions.P;
import com.massivecraft.factions.util.XMaterial; import com.massivecraft.factions.util.XMaterial;
import org.bukkit.DyeColor; import org.bukkit.DyeColor;
import org.bukkit.Material; import org.bukkit.Material;
@ -92,11 +92,11 @@ public enum PermissableAction {
// Utility method to build items for F Perm GUI // Utility method to build items for F Perm GUI
public ItemStack buildItem(FPlayer fme, Permissable permissable) { public ItemStack buildItem(FPlayer fme, Permissable permissable) {
final ConfigurationSection section = SaberFactions.plugin.getConfig().getConfigurationSection("fperm-gui.action"); final ConfigurationSection section = P.p.getConfig().getConfigurationSection("fperm-gui.action");
if (section == null) { if (section == null) {
SaberFactions.plugin.log(Level.WARNING, "Attempted to build f perm GUI but config section not present."); P.p.log(Level.WARNING, "Attempted to build f perm GUI but config section not present.");
SaberFactions.plugin.log(Level.WARNING, "Copy your config, allow the section to generate, then copy it back to your old config."); P.p.log(Level.WARNING, "Copy your config, allow the section to generate, then copy it back to your old config.");
return new ItemStack(Material.AIR); return new ItemStack(Material.AIR);
} }
@ -128,7 +128,7 @@ public enum PermissableAction {
} }
// If under the 1.13 version we will use the colorable option. // If under the 1.13 version we will use the colorable option.
if (!SaberFactions.plugin.mc113 && !SaberFactions.plugin.mc114) { if (!P.p.mc113 && !P.p.mc114) {
//TODO see if it's working in other version than 1.13 and 1.14 //TODO see if it's working in other version than 1.13 and 1.14
DyeColor dyeColor = null; DyeColor dyeColor = null;
@ -152,7 +152,7 @@ public enum PermissableAction {
} }
for (String loreLine : section.getStringList("placeholder-item.lore")) lore.add(replacePlaceholders(loreLine, fme, permissable)); for (String loreLine : section.getStringList("placeholder-item.lore")) lore.add(replacePlaceholders(loreLine, fme, permissable));
if (!SaberFactions.plugin.mc17) itemMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS, ItemFlag.HIDE_ATTRIBUTES); if (!P.p.mc17) itemMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS, ItemFlag.HIDE_ATTRIBUTES);
itemMeta.setDisplayName(displayName); itemMeta.setDisplayName(displayName);
itemMeta.setLore(lore); itemMeta.setLore(lore);

View File

@ -1,7 +1,7 @@
package com.massivecraft.factions.zcore.fperms.gui; package com.massivecraft.factions.zcore.fperms.gui;
import com.massivecraft.factions.FPlayer; import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.SaberFactions; import com.massivecraft.factions.P;
import com.massivecraft.factions.util.FactionGUI; import com.massivecraft.factions.util.FactionGUI;
import com.massivecraft.factions.util.XMaterial; import com.massivecraft.factions.util.XMaterial;
import com.massivecraft.factions.zcore.fperms.Access; import com.massivecraft.factions.zcore.fperms.Access;
@ -37,20 +37,20 @@ public class PermissableActionGUI implements InventoryHolder, FactionGUI {
public PermissableActionGUI(FPlayer fme, Permissable permissable) { public PermissableActionGUI(FPlayer fme, Permissable permissable) {
this.fme = fme; this.fme = fme;
this.permissable = permissable; this.permissable = permissable;
this.section = SaberFactions.plugin.getConfig().getConfigurationSection("fperm-gui.action"); this.section = P.p.getConfig().getConfigurationSection("fperm-gui.action");
} }
public void build() { public void build() {
if (section == null) { if (section == null) {
SaberFactions.plugin.log(Level.WARNING, "Attempted to build f perm GUI but config section not present."); P.p.log(Level.WARNING, "Attempted to build f perm GUI but config section not present.");
SaberFactions.plugin.log(Level.WARNING, "Copy your config, allow the section to generate, then copy it back to your old config."); P.p.log(Level.WARNING, "Copy your config, allow the section to generate, then copy it back to your old config.");
return; return;
} }
guiSize = section.getInt("rows", 3); guiSize = section.getInt("rows", 3);
if (guiSize > 6) { if (guiSize > 6) {
guiSize = 6; guiSize = 6;
SaberFactions.plugin.log(Level.INFO, "Action GUI size out of bounds, defaulting to 6"); P.p.log(Level.INFO, "Action GUI size out of bounds, defaulting to 6");
} }
guiSize *= 9; guiSize *= 9;
@ -64,7 +64,7 @@ public class PermissableActionGUI implements InventoryHolder, FactionGUI {
continue; continue;
} }
if (slot + 1 > guiSize || slot < 0) { if (slot + 1 > guiSize || slot < 0) {
SaberFactions.plugin.log(Level.WARNING, "Invalid slot for: " + key.toUpperCase()); P.p.log(Level.WARNING, "Invalid slot for: " + key.toUpperCase());
continue; continue;
} }
@ -75,7 +75,7 @@ public class PermissableActionGUI implements InventoryHolder, FactionGUI {
PermissableAction permissableAction = PermissableAction.fromString(key.toUpperCase().replace('-', '_')); PermissableAction permissableAction = PermissableAction.fromString(key.toUpperCase().replace('-', '_'));
if (permissableAction == null) { if (permissableAction == null) {
SaberFactions.plugin.log(Level.WARNING, "Invalid permissable action: " + key.toUpperCase()); P.p.log(Level.WARNING, "Invalid permissable action: " + key.toUpperCase());
continue; continue;
} }
@ -102,7 +102,7 @@ public class PermissableActionGUI implements InventoryHolder, FactionGUI {
actionSlots.put(slot, action); actionSlots.put(slot, action);
} }
} }
SaberFactions.plugin.log(Level.WARNING, "Missing action: " + action.name()); P.p.log(Level.WARNING, "Missing action: " + action.name());
} }
} }
@ -148,7 +148,7 @@ public class PermissableActionGUI implements InventoryHolder, FactionGUI {
actionGUI.setItem(slot, action.buildItem(fme, permissable)); actionGUI.setItem(slot, action.buildItem(fme, permissable));
fme.msg(TL.COMMAND_PERM_SET, action.name(), access.name(), permissable.name()); fme.msg(TL.COMMAND_PERM_SET, action.name(), access.name(), permissable.name());
SaberFactions.plugin.log(String.format(TL.COMMAND_PERM_SET.toString(), action.name(), access.name(), permissable.name()) + " for faction " + fme.getTag()); P.p.log(String.format(TL.COMMAND_PERM_SET.toString(), action.name(), access.name(), permissable.name()) + " for faction " + fme.getTag());
} }
private void buildItems() { private void buildItems() {
@ -158,7 +158,7 @@ public class PermissableActionGUI implements InventoryHolder, FactionGUI {
ItemStack item = permissableAction.buildItem(fme, permissable); ItemStack item = permissableAction.buildItem(fme, permissable);
if (item == null) { if (item == null) {
SaberFactions.plugin.log(Level.WARNING, "Invalid item for: " + permissableAction.toString().toUpperCase()); P.p.log(Level.WARNING, "Invalid item for: " + permissableAction.toString().toUpperCase());
continue; continue;
} }
@ -174,8 +174,8 @@ public class PermissableActionGUI implements InventoryHolder, FactionGUI {
private ItemStack getSpecialItem(SpecialItem specialItem) { private ItemStack getSpecialItem(SpecialItem specialItem) {
if (section == null) { if (section == null) {
SaberFactions.plugin.log(Level.WARNING, "Attempted to build f perm GUI but config section not present."); P.p.log(Level.WARNING, "Attempted to build f perm GUI but config section not present.");
SaberFactions.plugin.log(Level.WARNING, "Copy your config, allow the section to generate, then copy it back to your old config."); P.p.log(Level.WARNING, "Copy your config, allow the section to generate, then copy it back to your old config.");
return new ItemStack(Material.AIR); return new ItemStack(Material.AIR);
} }
@ -183,7 +183,7 @@ public class PermissableActionGUI implements InventoryHolder, FactionGUI {
case RELATION: case RELATION:
return permissable.buildItem(); return permissable.buildItem();
case BACK: case BACK:
ConfigurationSection backButtonConfig = SaberFactions.plugin.getConfig().getConfigurationSection("fperm-gui.back-item"); ConfigurationSection backButtonConfig = P.p.getConfig().getConfigurationSection("fperm-gui.back-item");
ItemStack backButton = new ItemStack(XMaterial.matchXMaterial(backButtonConfig.getString("material")).parseItem()); ItemStack backButton = new ItemStack(XMaterial.matchXMaterial(backButtonConfig.getString("material")).parseItem());
ItemMeta backButtonMeta = backButton.getItemMeta(); ItemMeta backButtonMeta = backButton.getItemMeta();
@ -195,7 +195,7 @@ public class PermissableActionGUI implements InventoryHolder, FactionGUI {
} }
backButtonMeta.setLore(lore); backButtonMeta.setLore(lore);
if (!SaberFactions.plugin.mc17) { if (!P.p.mc17) {
backButtonMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS, ItemFlag.HIDE_ATTRIBUTES); backButtonMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS, ItemFlag.HIDE_ATTRIBUTES);
} }
@ -209,8 +209,8 @@ public class PermissableActionGUI implements InventoryHolder, FactionGUI {
private void buildDummyItems() { private void buildDummyItems() {
if (section == null) { if (section == null) {
SaberFactions.plugin.log(Level.WARNING, "Attempted to build f perm GUI but config section not present."); P.p.log(Level.WARNING, "Attempted to build f perm GUI but config section not present.");
SaberFactions.plugin.log(Level.WARNING, "Copy your config, allow the section to generate, then copy it back to your old config."); P.p.log(Level.WARNING, "Copy your config, allow the section to generate, then copy it back to your old config.");
return; return;
} }
@ -219,7 +219,7 @@ public class PermissableActionGUI implements InventoryHolder, FactionGUI {
try { try {
dummyId = Integer.parseInt(key); dummyId = Integer.parseInt(key);
} catch (NumberFormatException exception) { } catch (NumberFormatException exception) {
SaberFactions.plugin.log(Level.WARNING, "Invalid dummy item id: " + key.toUpperCase()); P.p.log(Level.WARNING, "Invalid dummy item id: " + key.toUpperCase());
continue; continue;
} }
@ -229,7 +229,7 @@ public class PermissableActionGUI implements InventoryHolder, FactionGUI {
} }
ItemMeta meta = dummyItem.getItemMeta(); ItemMeta meta = dummyItem.getItemMeta();
if (!SaberFactions.plugin.mc17) { if (!P.p.mc17) {
meta.addItemFlags(ItemFlag.HIDE_ENCHANTS, ItemFlag.HIDE_ATTRIBUTES); meta.addItemFlags(ItemFlag.HIDE_ENCHANTS, ItemFlag.HIDE_ATTRIBUTES);
} }
@ -238,7 +238,7 @@ public class PermissableActionGUI implements InventoryHolder, FactionGUI {
List<Integer> dummySlots = section.getIntegerList("dummy-items." + key); List<Integer> dummySlots = section.getIntegerList("dummy-items." + key);
for (Integer slot : dummySlots) { for (Integer slot : dummySlots) {
if (slot + 1 > guiSize || slot < 0) { if (slot + 1 > guiSize || slot < 0) {
SaberFactions.plugin.log(Level.WARNING, "Invalid slot: " + slot + " for dummy item: " + key); P.p.log(Level.WARNING, "Invalid slot: " + slot + " for dummy item: " + key);
continue; continue;
} }
usedDummySlots.add(slot); usedDummySlots.add(slot);
@ -248,17 +248,17 @@ public class PermissableActionGUI implements InventoryHolder, FactionGUI {
} }
private ItemStack buildDummyItem(int id) { private ItemStack buildDummyItem(int id) {
final ConfigurationSection dummySection = SaberFactions.plugin.getConfig().getConfigurationSection("fperm-gui.dummy-items." + id); final ConfigurationSection dummySection = P.p.getConfig().getConfigurationSection("fperm-gui.dummy-items." + id);
if (dummySection == null) { if (dummySection == null) {
SaberFactions.plugin.log(Level.WARNING, "Attempted to build dummy items for F PERM GUI but config section not present."); P.p.log(Level.WARNING, "Attempted to build dummy items for F PERM GUI but config section not present.");
SaberFactions.plugin.log(Level.WARNING, "Copy your config, allow the section to generate, then copy it back to your old config."); P.p.log(Level.WARNING, "Copy your config, allow the section to generate, then copy it back to your old config.");
return new ItemStack(Material.AIR); return new ItemStack(Material.AIR);
} }
Material material = XMaterial.matchXMaterial(dummySection.getString("material", "")).parseMaterial(); Material material = XMaterial.matchXMaterial(dummySection.getString("material", "")).parseMaterial();
if (material == null) { if (material == null) {
SaberFactions.plugin.log(Level.WARNING, "Invalid material for dummy item: " + id); P.p.log(Level.WARNING, "Invalid material for dummy item: " + id);
return null; return null;
} }
@ -284,7 +284,7 @@ public class PermissableActionGUI implements InventoryHolder, FactionGUI {
} }
itemMeta.setLore(lore); itemMeta.setLore(lore);
if (!SaberFactions.plugin.mc17) { if (!P.p.mc17) {
itemMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS, ItemFlag.HIDE_ATTRIBUTES); itemMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS, ItemFlag.HIDE_ATTRIBUTES);
} }

Some files were not shown because too many files have changed in this diff Show More