Renamed Main Class of plugin from 'P' to 'SavageFactions', along with the plugin field from 'p' to 'plugin'

This commit is contained in:
ProSavage
2018-10-22 18:42:57 -05:00
parent 80e66d7d6c
commit 9aeb70404d
449 changed files with 3527 additions and 1875 deletions

View File

@@ -346,28 +346,27 @@ public class Conf {
territoryEnemyDenyCommands.add("tpa");
territoryProtectedMaterials.add(P.p.WOODEN_DOOR);
territoryProtectedMaterials.add(P.p.TRAP_DOOR);
territoryProtectedMaterials.add(P.p.FENCE_GATE);
territoryProtectedMaterials.add(SavageFactions.plugin.WOODEN_DOOR);
territoryProtectedMaterials.add(SavageFactions.plugin.TRAP_DOOR);
territoryProtectedMaterials.add(SavageFactions.plugin.FENCE_GATE);
territoryProtectedMaterials.add(Material.DISPENSER);
territoryProtectedMaterials.add(Material.CHEST);
territoryProtectedMaterials.add(Material.FURNACE);
territoryProtectedMaterials.add(P.p.BURNING_FURNACE);
territoryProtectedMaterials.add(P.p.DIODE_BLOCK_OFF);
territoryProtectedMaterials.add(P.p.DIODE_BLOCK_ON);
territoryProtectedMaterials.add(SavageFactions.plugin.BURNING_FURNACE);
territoryProtectedMaterials.add(SavageFactions.plugin.DIODE_BLOCK_OFF);
territoryProtectedMaterials.add(SavageFactions.plugin.DIODE_BLOCK_ON);
territoryProtectedMaterials.add(Material.JUKEBOX);
territoryProtectedMaterials.add(Material.BREWING_STAND);
territoryProtectedMaterials.add(P.p.ENCHANTMENT_TABLE);
territoryProtectedMaterials.add(SavageFactions.plugin.ENCHANTMENT_TABLE);
territoryProtectedMaterials.add(Material.CAULDRON);
territoryProtectedMaterials.add(P.p.ENCHANTMENT_TABLE);
territoryProtectedMaterials.add(SavageFactions.plugin.ENCHANTMENT_TABLE);
territoryProtectedMaterials.add(Material.BEACON);
territoryProtectedMaterials.add(Material.ANVIL);
territoryProtectedMaterials.add(Material.TRAPPED_CHEST);
territoryProtectedMaterials.add(Material.DROPPER);
territoryProtectedMaterials.add(Material.HOPPER);
territoryDenyUseageMaterials.add(P.p.FIREBALL);
territoryDenyUseageMaterials.add(SavageFactions.plugin.FIREBALL);
territoryDenyUseageMaterials.add(Material.FLINT_AND_STEEL);
territoryDenyUseageMaterials.add(Material.BUCKET);
territoryDenyUseageMaterials.add(Material.WATER_BUCKET);
@@ -378,32 +377,32 @@ public class Conf {
territoryDenyUseageMaterials.add(MultiversionMaterials.JUNGLE_BUTTON.parseMaterial());
territoryDenyUseageMaterials.add(MultiversionMaterials.OAK_BUTTON.parseMaterial());
territoryDenyUseageMaterials.add(MultiversionMaterials.STONE_BUTTON.parseMaterial());
if (!P.p.mc17) {
if (! SavageFactions.plugin.mc17) {
territoryDenyUseageMaterials.add(Material.ARMOR_STAND);
}
territoryProtectedMaterialsWhenOffline.add(P.p.WOODEN_DOOR);
territoryProtectedMaterialsWhenOffline.add(P.p.TRAP_DOOR);
territoryProtectedMaterialsWhenOffline.add(P.p.FENCE_GATE);
territoryProtectedMaterialsWhenOffline.add(SavageFactions.plugin.WOODEN_DOOR);
territoryProtectedMaterialsWhenOffline.add(SavageFactions.plugin.TRAP_DOOR);
territoryProtectedMaterialsWhenOffline.add(SavageFactions.plugin.FENCE_GATE);
territoryProtectedMaterialsWhenOffline.add(Material.DISPENSER);
territoryProtectedMaterialsWhenOffline.add(Material.CHEST);
territoryProtectedMaterialsWhenOffline.add(Material.FURNACE);
territoryProtectedMaterialsWhenOffline.add(P.p.BURNING_FURNACE);
territoryProtectedMaterialsWhenOffline.add(P.p.DIODE_BLOCK_OFF);
territoryProtectedMaterialsWhenOffline.add(P.p.DIODE_BLOCK_OFF);
territoryProtectedMaterialsWhenOffline.add(SavageFactions.plugin.BURNING_FURNACE);
territoryProtectedMaterialsWhenOffline.add(SavageFactions.plugin.DIODE_BLOCK_OFF);
territoryProtectedMaterialsWhenOffline.add(SavageFactions.plugin.DIODE_BLOCK_OFF);
territoryProtectedMaterialsWhenOffline.add(Material.JUKEBOX);
territoryProtectedMaterialsWhenOffline.add(Material.BREWING_STAND);
territoryProtectedMaterialsWhenOffline.add(P.p.ENCHANTMENT_TABLE);
territoryProtectedMaterialsWhenOffline.add(SavageFactions.plugin.ENCHANTMENT_TABLE);
territoryProtectedMaterialsWhenOffline.add(Material.CAULDRON);
territoryProtectedMaterialsWhenOffline.add(P.p.SOIL);
territoryProtectedMaterialsWhenOffline.add(SavageFactions.plugin.SOIL);
territoryProtectedMaterialsWhenOffline.add(Material.BEACON);
territoryProtectedMaterialsWhenOffline.add(Material.ANVIL);
territoryProtectedMaterialsWhenOffline.add(Material.TRAPPED_CHEST);
territoryProtectedMaterialsWhenOffline.add(Material.DROPPER);
territoryProtectedMaterialsWhenOffline.add(Material.HOPPER);
territoryDenyUseageMaterialsWhenOffline.add(P.p.FIREBALL);
territoryDenyUseageMaterialsWhenOffline.add(SavageFactions.plugin.FIREBALL);
territoryDenyUseageMaterialsWhenOffline.add(Material.FLINT_AND_STEEL);
territoryDenyUseageMaterialsWhenOffline.add(Material.BUCKET);
territoryDenyUseageMaterialsWhenOffline.add(Material.WATER_BUCKET);
@@ -414,7 +413,7 @@ public class Conf {
territoryDenyUseageMaterialsWhenOffline.add(MultiversionMaterials.JUNGLE_BUTTON.parseMaterial());
territoryDenyUseageMaterialsWhenOffline.add(MultiversionMaterials.OAK_BUTTON.parseMaterial());
territoryDenyUseageMaterialsWhenOffline.add(MultiversionMaterials.STONE_BUTTON.parseMaterial());
if (!P.p.mc17) {
if (! SavageFactions.plugin.mc17) {
territoryDenyUseageMaterialsWhenOffline.add(Material.ARMOR_STAND);
}
safeZoneNerfedCreatureTypes.add(EntityType.BLAZE);
@@ -435,11 +434,11 @@ public class Conf {
}
public static void load() {
P.p.persist.loadOrSaveDefault(i, Conf.class, "conf");
SavageFactions.plugin.persist.loadOrSaveDefault(i, Conf.class, "conf");
}
public static void save() {
P.p.persist.save(i);
SavageFactions.plugin.persist.save(i);
}
public enum Backend {

View File

@@ -19,9 +19,9 @@ import java.util.List;
* Logged in players always have exactly one FPlayer instance. Logged out players may or may not have an FPlayer
* instance. They will always have one if they are part of a faction. This is because only players with a faction are
* saved to disk (in order to not waste disk space).
* <p/>
* <plugin/>
* The FPlayer is linked to a minecraft player using the player name.
* <p/>
* <plugin/>
* The same instance is always returned for the same player. This means you can use the == operator. No .equals method
* necessary.
*/

View File

@@ -43,11 +43,11 @@ import java.util.*;
import java.util.logging.Level;
public class P extends MPlugin {
public class SavageFactions extends MPlugin {
// Our single plugin instance.
// Single 4 life.
public static P p;
public static SavageFactions plugin;
public static Permission perms = null;
@@ -69,10 +69,8 @@ public class P extends MPlugin {
private boolean mvdwPlaceholderAPIManager = false;
public P() {
p = this;
public SavageFactions() {
plugin = this;
}
public boolean getLocked() {
@@ -114,20 +112,20 @@ public class P extends MPlugin {
// Vault dependency check.
if (P.p.getServer().getPluginManager().getPlugin("Vault") == null) {
P.p.log("Vault is not present, the plugin will not run properly.");
P.p.getServer().getPluginManager().disablePlugin(P.p);
if (SavageFactions.plugin.getServer().getPluginManager().getPlugin("Vault") == null) {
SavageFactions.plugin.log("Vault is not present, the plugin will not run properly.");
SavageFactions.plugin.getServer().getPluginManager().disablePlugin(SavageFactions.plugin);
}
int version = Integer.parseInt(ReflectionUtils.PackageType.getServerVersion().split("_")[1]);
if (version == 7) {
P.p.log("Minecraft Version 1.7 found, disabling banners, itemflags inside GUIs, and Titles.");
SavageFactions.plugin.log("Minecraft Version 1.7 found, disabling banners, itemflags inside GUIs, and Titles.");
mc17 = true;
} else if (version == 8) {
P.p.log("Minecraft Version 1.8 found, Title Fadeouttime etc will not be configurable.");
SavageFactions.plugin.log("Minecraft Version 1.8 found, Title Fadeouttime etc will not be configurable.");
mc18 = true;
} else if (version == 13) {
P.p.log("Minecraft Version 1.13 found, New Items will be used.");
SavageFactions.plugin.log("Minecraft Version 1.13 found, New Items will be used.");
mc113 = true;
changeItemIDSInConfig();
}
@@ -186,10 +184,10 @@ public class P extends MPlugin {
if (version > 8) {
useNonPacketParticles = true;
P.p.log("Minecraft Version 1.9 or higher found, using non packet based particle API");
SavageFactions.plugin.log("Minecraft Version 1.9 or higher found, using non packet based particle API");
}
if (P.p.getConfig().getBoolean("enable-faction-flight")) {
if (SavageFactions.plugin.getConfig().getBoolean("enable-faction-flight")) {
factionsFlight = true;
}
@@ -208,7 +206,7 @@ public class P extends MPlugin {
// since some other plugins execute commands directly through this command interface, provide it
this.getCommand(this.refCommand).setExecutor(this);
if (P.p.getDescription().getFullName().contains("BETA")) {
if (SavageFactions.plugin.getDescription().getFullName().contains("BETA")) {
divider();
System.out.println("You are using a BETA version of the plugin!");
System.out.println("This comes with risks of small bugs in newer features!");
@@ -312,7 +310,7 @@ public class P extends MPlugin {
public void changeItemIDSInConfig() {
P.p.log("Starting conversion of legacy material in config to 1.13 materials.");
SavageFactions.plugin.log("Starting conversion of legacy material in config to 1.13 materials.");
replaceStringInConfig("fperm-gui.relation.materials.recruit", "WOOD_SWORD", "WOODEN_SWORD");
@@ -353,7 +351,7 @@ public class P extends MPlugin {
public void replaceStringInConfig(String path, String stringToReplace, String replacementString) {
if (getConfig().getString(path).equals(stringToReplace)) {
P.p.log("Replacing legacy material '" + stringToReplace + "' with '" + replacementString + "' for config node '" + path + "'.");
SavageFactions.plugin.log("Replacing legacy material '" + stringToReplace + "' with '" + replacementString + "' for config node '" + path + "'.");
getConfig().set(path, replacementString);
}
}
@@ -453,14 +451,14 @@ public class P extends MPlugin {
public ItemStack createLazyItem(Material material, int amount, short datavalue, String name, String lore) {
ItemStack item = new ItemStack(material, amount, datavalue);
ItemMeta meta = item.getItemMeta();
meta.setDisplayName(color(P.p.getConfig().getString(name)));
meta.setLore(colorList(P.p.getConfig().getStringList(lore)));
meta.setDisplayName(color(SavageFactions.plugin.getConfig().getString(name)));
meta.setLore(colorList(SavageFactions.plugin.getConfig().getStringList(lore)));
item.setItemMeta(meta);
return item;
}
public Economy getEcon() {
RegisteredServiceProvider<Economy> rsp = P.p.getServer().getServicesManager().getRegistration(Economy.class);
RegisteredServiceProvider<Economy> rsp = SavageFactions.plugin.getServer().getServicesManager().getRegistration(Economy.class);
Economy econ = rsp.getProvider();
return econ;
}
@@ -491,10 +489,10 @@ public class P extends MPlugin {
as.setVisible(false); //Makes the ArmorStand invisible
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.setCustomName(P.p.color(text)); //Set this to the text you want
as.setCustomName(SavageFactions.plugin.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
final ArmorStand armorStand = as;
Bukkit.getScheduler().scheduleSyncDelayedTask(P.p, new Runnable() {
Bukkit.getScheduler().scheduleSyncDelayedTask(SavageFactions.plugin, new Runnable() {
@Override
public void run() {
Bukkit.broadcastMessage("removing stand");

View File

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

View File

@@ -1,7 +1,7 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.P;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.event.FPlayerLeaveEvent;
import com.massivecraft.factions.struct.BanInfo;
import com.massivecraft.factions.struct.Permission;
@@ -80,7 +80,7 @@ public class CmdBan extends FCommand {
if (event.isCancelled()) {
// if someone cancels a ban, we'll get people complaining here. So lets log it.
P.p.log(Level.WARNING, "Attempted to ban {0} but someone cancelled the kick event. This isn't good.", target.getName());
SavageFactions.plugin.log(Level.WARNING, "Attempted to ban {0} but someone cancelled the kick event. This isn't good.", target.getName());
return;
}

View File

@@ -1,7 +1,7 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.P;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.util.TL;
import net.milkbowl.vault.economy.Economy;
@@ -31,31 +31,30 @@ public class CmdBanner extends FCommand {
@Override
public void perform() {
if (!P.p.getConfig().getBoolean("fbanners.Enabled")) {
if (! SavageFactions.plugin.getConfig().getBoolean("fbanners.Enabled")) {
msg(TL.COMMAND_BANNER_DISABLED);
return;
}
if (!fme.hasMoney(P.p.getConfig().getInt("fbanners.Banner-Cost", 5000))) {
if (! fme.hasMoney(SavageFactions.plugin.getConfig().getInt("fbanners.Banner-Cost", 5000))) {
msg(TL.COMMAND_BANNER_NOTENOUGHMONEY);
return;
}
takeMoney(fme, P.p.getConfig().getInt("fbanners.Banner-Cost", 5000));
takeMoney(fme, SavageFactions.plugin.getConfig().getInt("fbanners.Banner-Cost", 5000));
//ItemStack warBanner = P.p.createItem(Material.BANNER, 1, (short) 1, P.p.getConfig().getString("fbanners.Item.Name"), P.p.getConfig().getStringList("fbanners.Item.Lore"));
//ItemStack warBanner = SavageFactions.plugin.createItem(Material.BANNER, 1, (short) 1, SavageFactions.plugin.getConfig().getString("fbanners.Item.Name"), SavageFactions.plugin.getConfig().getStringList("fbanners.Item.Lore"));
//BannerMeta bannerMeta = (BannerMeta) warBanner.getItemMeta();
ItemStack warBanner = fme.getFaction().getBanner();
if (warBanner != null) {
ItemMeta warmeta = warBanner.getItemMeta();
warmeta.setDisplayName(P.p.color(P.p.getConfig().getString("fbanners.Item.Name")));
warmeta.setLore(P.p.colorList(P.p.getConfig().getStringList("fbanners.Item.Lore")));
warmeta.setDisplayName(SavageFactions.plugin.color(SavageFactions.plugin.getConfig().getString("fbanners.Item.Name")));
warmeta.setLore(SavageFactions.plugin.colorList(SavageFactions.plugin.getConfig().getStringList("fbanners.Item.Lore")));
warBanner.setItemMeta(warmeta);
} else {
warBanner = P.p.createItem(P.p.BANNER, 1, (short) 1, P.p.getConfig().getString("fbanners.Item.Name"), P.p.getConfig().getStringList("fbanners.Item.Lore"));
warBanner = SavageFactions.plugin.createItem(SavageFactions.plugin.BANNER, 1, (short) 1, SavageFactions.plugin.getConfig().getString("fbanners.Item.Name"), SavageFactions.plugin.getConfig().getStringList("fbanners.Item.Lore"));
}
fme.msg(TL.COMMAND_BANNER_SUCCESS);
warBanner.setAmount(1);
@@ -64,7 +63,7 @@ public class CmdBanner extends FCommand {
public boolean hasMoney(FPlayer fme, int amt) {
Economy econ = P.p.getEcon();
Economy econ = SavageFactions.plugin.getEcon();
if (econ.getBalance(fme.getPlayer()) >= amt) {
return true;
} else {
@@ -75,7 +74,7 @@ public class CmdBanner extends FCommand {
public void takeMoney(FPlayer fme, int amt) {
if (hasMoney(fme, amt)) {
Economy econ = P.p.getEcon();
Economy econ = SavageFactions.plugin.getEcon();
econ.withdrawPlayer(fme.getPlayer(), amt);
fme.sendMessage(TL.COMMAND_BANNER_MONEYTAKE.toString().replace("{amount}", amt + ""));
}

View File

@@ -1,6 +1,6 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.P;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.util.TL;
@@ -30,10 +30,10 @@ public class CmdBypass extends FCommand {
// TODO: Move this to a transient field in the model??
if (fme.isAdminBypassing()) {
fme.msg(TL.COMMAND_BYPASS_ENABLE.toString());
P.p.log(fme.getName() + TL.COMMAND_BYPASS_ENABLELOG.toString());
SavageFactions.plugin.log(fme.getName() + TL.COMMAND_BYPASS_ENABLELOG.toString());
} else {
fme.msg(TL.COMMAND_BYPASS_DISABLE.toString());
P.p.log(fme.getName() + TL.COMMAND_BYPASS_DISABLELOG.toString());
SavageFactions.plugin.log(fme.getName() + TL.COMMAND_BYPASS_DISABLELOG.toString());
}
}

View File

@@ -44,7 +44,7 @@ public class CmdChat extends FCommand {
} else if (modeString.startsWith("m") && !fme.getRole().isAtLeast(Role.MODERATOR)) {
msg(TL.COMMAND_CHAT_MOD_ONLY);
return;
} else if (modeString.startsWith("p")) {
} else if (modeString.startsWith("plugin")) {
modeTarget = ChatMode.PUBLIC;
} else if (modeString.startsWith("a")) {
modeTarget = ChatMode.ALLIANCE;

View File

@@ -1,6 +1,6 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.P;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.util.TL;
@@ -28,10 +28,10 @@ public class CmdChatSpy extends FCommand {
if (fme.isSpyingChat()) {
fme.msg(TL.COMMAND_CHATSPY_ENABLE);
P.p.log(fme.getName() + TL.COMMAND_CHATSPY_ENABLELOG.toString());
SavageFactions.plugin.log(fme.getName() + TL.COMMAND_CHATSPY_ENABLELOG.toString());
} else {
fme.msg(TL.COMMAND_CHATSPY_DISABLE);
P.p.log(fme.getName() + TL.COMMAND_CHATSPY_DISABLELOG.toString());
SavageFactions.plugin.log(fme.getName() + TL.COMMAND_CHATSPY_DISABLELOG.toString());
}
}

View File

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

View File

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

View File

@@ -1,7 +1,7 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.P;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.ChatColor;
@@ -231,10 +231,10 @@ public class CmdConfig extends FCommand {
if (!success.isEmpty()) {
if (sender instanceof Player) {
sendMessage(success);
P.p.log(success + TL.COMMAND_CONFIG_LOG.format((Player) sender));
} else // using P.p.log() instead of sendMessage if run from server console so that "[Factions v#.#.#]" is prepended in server log
SavageFactions.plugin.log(success + TL.COMMAND_CONFIG_LOG.format((Player) sender));
} else // using SavageFactions.plugin.log() instead of sendMessage if run from server console so that "[Factions v#.#.#]" is prepended in server log
{
P.p.log(success);
SavageFactions.plugin.log(success);
}
}
// save change to disk

View File

@@ -98,9 +98,9 @@ public class CmdCreate extends FCommand {
msg(TL.COMMAND_CREATE_YOUSHOULD, p.cmdBase.cmdDescription.getUseageTemplate());
if (Conf.logFactionCreate) {
P.p.log(fme.getName() + TL.COMMAND_CREATE_CREATEDLOG.toString() + tag);
SavageFactions.plugin.log(fme.getName() + TL.COMMAND_CREATE_CREATEDLOG.toString() + tag);
}
if (P.p.getConfig().getBoolean("fpaypal.Enabled")) {
if (SavageFactions.plugin.getConfig().getBoolean("fpaypal.Enabled")) {
this.fme.msg(TL.COMMAND_PAYPALSET_CREATED);
}
}

View File

@@ -1,7 +1,7 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.P;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.util.TL;
@@ -34,7 +34,7 @@ public class CmdDelFWarp extends FCommand {
}
private boolean transact(FPlayer player) {
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());
return ! SavageFactions.plugin.getConfig().getBoolean("warp-cost.enabled", false) || player.isAdminBypassing() || payForCommand(SavageFactions.plugin.getConfig().getDouble("warp-cost.delwarp", 5), TL.COMMAND_DELFWARP_TODELETE.toString(), TL.COMMAND_DELFWARP_FORDELETE.toString());
}
@Override

View File

@@ -1,7 +1,7 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Faction;
import com.massivecraft.factions.P;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.struct.Role;
import com.massivecraft.factions.zcore.fperms.Access;
@@ -69,7 +69,7 @@ public class CmdDisband extends FCommand {
if (!disbandMap.containsKey(me.getUniqueId().toString()) && faction.getTnt() > 0) {
msg(TL.COMMAND_DISBAND_CONFIRM.toString().replace("{tnt}", faction.getTnt() + ""));
disbandMap.put(me.getUniqueId().toString(), faction.getId());
Bukkit.getScheduler().scheduleSyncDelayedTask(P.p, new Runnable() {
Bukkit.getScheduler().scheduleSyncDelayedTask(SavageFactions.plugin, new Runnable() {
@Override
public void run() {
disbandMap.remove(me.getUniqueId().toString());

View File

@@ -1,7 +1,7 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.P;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.struct.Role;
import com.massivecraft.factions.util.WarmUpUtil;
@@ -82,7 +82,7 @@ public class CmdFWarp extends FCommand {
}
private boolean transact(FPlayer player) {
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());
return ! SavageFactions.plugin.getConfig().getBoolean("warp-cost.enabled", false) || player.isAdminBypassing() || payForCommand(SavageFactions.plugin.getConfig().getDouble("warp-cost.warp", 5), TL.COMMAND_FWARP_TOWARP.toString(), TL.COMMAND_FWARP_FORWARPING.toString());
}
@Override

View File

@@ -39,11 +39,11 @@ public class CmdFly extends FCommand {
public static void startParticles() {
// Just a secondary check.
if (!P.p.getConfig().getBoolean("ffly.Particles.Enabled")) {
if (! SavageFactions.plugin.getConfig().getBoolean("ffly.Particles.Enabled")) {
return;
}
id = Bukkit.getScheduler().scheduleSyncRepeatingTask(P.p, new Runnable() {
id = Bukkit.getScheduler().scheduleSyncRepeatingTask(SavageFactions.plugin, new Runnable() {
@Override
public void run() {
for (String name : flyMap.keySet()) {
@@ -54,7 +54,7 @@ public class CmdFly extends FCommand {
if (!player.isFlying()) {
continue;
}
if (!P.p.mc17) {
if (! SavageFactions.plugin.mc17) {
if (player.getGameMode() == GameMode.SPECTATOR) {
continue;
}
@@ -63,12 +63,12 @@ public class CmdFly extends FCommand {
if (FPlayers.getInstance().getByPlayer(player).isVanished()) {
// Actually, vanished players (such as admins) should not display particles to prevent others from knowing their vanished assistance for moderation.
// But we can keep it as a config.
if (P.p.getConfig().getBoolean("ffly.Particles.Enable-While-Vanished")) {
if (SavageFactions.plugin.getConfig().getBoolean("ffly.Particles.Enable-While-Vanished")) {
return;
}
continue;
}
if (P.p.useNonPacketParticles) {
if (SavageFactions.plugin.useNonPacketParticles) {
// 1.9+ based servers will use the built in particleAPI instead of packet based.
// any particle amount higher than 0 made them go everywhere, and the offset at 0 was not working.
// So setting the amount to 0 spawns 1 in the precise location
@@ -87,7 +87,7 @@ public class CmdFly extends FCommand {
}
public static void startFlyCheck() {
flyid = Bukkit.getScheduler().scheduleSyncRepeatingTask(P.p, new Runnable() {
flyid = Bukkit.getScheduler().scheduleSyncRepeatingTask(SavageFactions.plugin, new Runnable() {
@Override
public void run() throws ConcurrentModificationException { //threw the exception for now, until I recode fly :( Cringe.
checkTaskState();
@@ -185,7 +185,7 @@ public class CmdFly extends FCommand {
@Override
public void perform() {
// Disabled by default.
if (!P.p.getConfig().getBoolean("enable-faction-flight", false)) {
if (! SavageFactions.plugin.getConfig().getBoolean("enable-faction-flight", false)) {
fme.msg(TL.COMMAND_FLY_DISABLED);
return;
}
@@ -228,7 +228,7 @@ public class CmdFly extends FCommand {
fme.setFlying(true);
flyMap.put(player.getName(), true);
if (id == -1) {
if (P.p.getConfig().getBoolean("ffly.Particles.Enabled")) {
if (SavageFactions.plugin.getConfig().getBoolean("ffly.Particles.Enabled")) {
startParticles();
}
}

View File

@@ -1,6 +1,6 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.P;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.Location;
@@ -26,12 +26,12 @@ public class CmdGetVault extends FCommand {
@Override
public void perform() {
if (!P.p.getConfig().getBoolean("fvault.Enabled")) {
if (! SavageFactions.plugin.getConfig().getBoolean("fvault.Enabled")) {
fme.sendMessage("This command is disabled!");
return;
}
Location vaultLocation = fme.getFaction().getVault();
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")));
ItemStack vault = SavageFactions.plugin.createItem(Material.CHEST, 1, (short) 0, SavageFactions.plugin.color(SavageFactions.plugin.getConfig().getString("fvault.Item.Name")), SavageFactions.plugin.colorList(SavageFactions.plugin.getConfig().getStringList("fvault.Item.Lore")));
//check if vault is set
@@ -42,7 +42,7 @@ public class CmdGetVault extends FCommand {
//has enough money?
int amount = P.p.getConfig().getInt("fvault.Price");
int amount = SavageFactions.plugin.getConfig().getInt("fvault.Price");
if (!fme.hasMoney(amount)) {
return;
}

View File

@@ -1,7 +1,7 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.P;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.integration.Econ;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.util.TL;
@@ -40,7 +40,7 @@ public class CmdHelp extends FCommand {
@Override
public void perform() {
if (P.p.getConfig().getBoolean("use-old-help", true)) {
if (SavageFactions.plugin.getConfig().getBoolean("use-old-help", true)) {
if (helpPages == null) {
updateHelp();
}
@@ -57,9 +57,9 @@ public class CmdHelp extends FCommand {
sendMessage(helpPages.get(page));
return;
}
ConfigurationSection help = P.p.getConfig().getConfigurationSection("help");
ConfigurationSection help = SavageFactions.plugin.getConfig().getConfigurationSection("help");
if (help == null) {
help = P.p.getConfig().createSection("help"); // create new help section
help = SavageFactions.plugin.getConfig().createSection("help"); // create new help section
List<String> error = new ArrayList<>();
error.add("&cUpdate help messages in config.yml!");
error.add("&cSet use-old-help for legacy help messages");
@@ -72,7 +72,7 @@ public class CmdHelp extends FCommand {
return;
}
for (String helpLine : page) {
sendMessage(P.p.txt.parse(helpLine));
sendMessage(SavageFactions.plugin.txt.parse(helpLine));
}
}
@@ -189,7 +189,7 @@ public class CmdHelp extends FCommand {
pageLines.add(p.cmdBase.cmdSafeunclaimall.getUseageTemplate(true));
pageLines.add(p.cmdBase.cmdWarunclaimall.getUseageTemplate(true));
//TODO:TL
pageLines.add(p.txt.parse("<i>Note: " + p.cmdBase.cmdUnclaim.getUseageTemplate(false) + P.p.txt.parse("<i>") + " works on safe/war zones as well."));
pageLines.add(p.txt.parse("<i>Note: " + p.cmdBase.cmdUnclaim.getUseageTemplate(false) + SavageFactions.plugin.txt.parse("<i>") + " works on safe/war zones as well."));
pageLines.add(p.cmdBase.cmdPeaceful.getUseageTemplate(true));
helpPages.add(pageLines);

View File

@@ -112,9 +112,9 @@ public class CmdJoin extends FCommand {
if (Conf.logFactionJoin) {
if (samePlayer) {
P.p.log(TL.COMMAND_JOIN_JOINEDLOG.toString(), fplayer.getName(), faction.getTag());
SavageFactions.plugin.log(TL.COMMAND_JOIN_JOINEDLOG.toString(), fplayer.getName(), faction.getTag());
} else {
P.p.log(TL.COMMAND_JOIN_MOVEDLOG.toString(), fme.getName(), fplayer.getName(), faction.getTag());
SavageFactions.plugin.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.FPlayer;
import com.massivecraft.factions.Faction;
import com.massivecraft.factions.P;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.event.FPlayerLeaveEvent;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.struct.Role;
@@ -122,7 +122,7 @@ public class CmdKick extends FCommand {
fme.msg(TL.COMMAND_KICK_KICKS, toKick.describeTo(fme), toKickFaction.describeTo(fme));
}
if (Conf.logFactionKick) {
P.p.log((senderIsConsole ? "A console command" : fme.getName()) + " kicked " + toKick.getName() + " from the faction: " + toKickFaction.getTag());
SavageFactions.plugin.log((senderIsConsole ? "A console command" : fme.getName()) + " kicked " + toKick.getName() + " from the faction: " + toKickFaction.getTag());
}
if (toKick.getRole() == Role.LEADER) {
toKickFaction.promoteNewLeader();

View File

@@ -3,7 +3,7 @@ package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.Faction;
import com.massivecraft.factions.Factions;
import com.massivecraft.factions.P;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.util.TL;
import com.massivecraft.factions.zcore.util.TagUtil;
@@ -52,7 +52,7 @@ public class CmdList extends FCommand {
// remove exempt factions
if (!fme.getPlayer().hasPermission("factions.show.bypassexempt")) {
List<String> exemptFactions = P.p.getConfig().getStringList("show-exempt");
List<String> exemptFactions = SavageFactions.plugin.getConfig().getStringList("show-exempt");
Iterator<Faction> factionIterator = factionList.iterator();
while (factionIterator.hasNext()) {
Faction next = factionIterator.next();

View File

@@ -1,6 +1,6 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.P;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.zcore.util.TL;
public class CmdMoney extends FCommand {
@@ -40,7 +40,7 @@ public class CmdMoney extends FCommand {
@Override
public void perform() {
this.commandChain.add(this);
P.p.cmdAutoHelp.execute(this.sender, this.args, this.commandChain);
SavageFactions.plugin.cmdAutoHelp.execute(this.sender, this.args, this.commandChain);
}
@Override

View File

@@ -1,7 +1,7 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.P;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.iface.EconomyParticipator;
import com.massivecraft.factions.integration.Econ;
import com.massivecraft.factions.struct.Permission;
@@ -38,7 +38,7 @@ public class CmdMoneyDeposit extends FCommand {
boolean success = Econ.transferMoney(fme, fme, faction, amount);
if (success && Conf.logMoneyTransactions) {
P.p.log(ChatColor.stripColor(P.p.txt.parse(TL.COMMAND_MONEYDEPOSIT_DEPOSITED.toString(), fme.getName(), Econ.moneyString(amount), faction.describeTo(null))));
SavageFactions.plugin.log(ChatColor.stripColor(SavageFactions.plugin.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;
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.P;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.iface.EconomyParticipator;
import com.massivecraft.factions.integration.Econ;
import com.massivecraft.factions.struct.Permission;
@@ -46,7 +46,7 @@ public class CmdMoneyTransferFf extends FCommand {
if (success && Conf.logMoneyTransactions) {
String name = sender instanceof Player ? fme.getName() : sender.getName();
P.p.log(ChatColor.stripColor(P.p.txt.parse(TL.COMMAND_MONEYTRANSFERFF_TRANSFER.toString(), name, Econ.moneyString(amount), from.describeTo(null), to.describeTo(null))));
SavageFactions.plugin.log(ChatColor.stripColor(SavageFactions.plugin.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;
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.P;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.iface.EconomyParticipator;
import com.massivecraft.factions.integration.Econ;
import com.massivecraft.factions.struct.Permission;
@@ -44,7 +44,7 @@ public class CmdMoneyTransferFp extends FCommand {
boolean success = Econ.transferMoney(fme, from, to, amount);
if (success && Conf.logMoneyTransactions) {
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))));
SavageFactions.plugin.log(ChatColor.stripColor(SavageFactions.plugin.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;
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.P;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.iface.EconomyParticipator;
import com.massivecraft.factions.integration.Econ;
import com.massivecraft.factions.struct.Permission;
@@ -44,7 +44,7 @@ public class CmdMoneyTransferPf extends FCommand {
boolean success = Econ.transferMoney(fme, from, to, amount);
if (success && Conf.logMoneyTransactions) {
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))));
SavageFactions.plugin.log(ChatColor.stripColor(SavageFactions.plugin.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;
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.P;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.iface.EconomyParticipator;
import com.massivecraft.factions.integration.Econ;
import com.massivecraft.factions.struct.Permission;
@@ -47,7 +47,7 @@ public class CmdMoneyWithdraw extends FCommand {
boolean success = Econ.transferMoney(fme, faction, fme, amount);
if (success && Conf.logMoneyTransactions) {
P.p.log(ChatColor.stripColor(P.p.txt.parse(TL.COMMAND_MONEYWITHDRAW_WITHDRAW.toString(), fme.getName(), Econ.moneyString(amount), faction.describeTo(null))));
SavageFactions.plugin.log(ChatColor.stripColor(SavageFactions.plugin.txt.parse(TL.COMMAND_MONEYWITHDRAW_WITHDRAW.toString(), fme.getName(), Econ.moneyString(amount), faction.describeTo(null))));
}
}

View File

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

View File

@@ -1,10 +1,9 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Faction;
import com.massivecraft.factions.P;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.ChatColor;
public class CmdPaypalSee extends FCommand{
public CmdPaypalSee() {
@@ -21,7 +20,7 @@ public class CmdPaypalSee extends FCommand{
}
public void perform() {
if (!P.p.getConfig().getBoolean("fpaypal.Enabled")) {
if (! SavageFactions.plugin.getConfig().getBoolean("fpaypal.Enabled")) {
fme.msg(TL.GENERIC_DISABLED);
} else {
Faction faction = argAsFaction(0);

View File

@@ -1,6 +1,6 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.P;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.util.TL;
@@ -20,7 +20,7 @@ public class CmdPaypalSet extends FCommand{
}
public void perform() {
if (!P.p.getConfig().getBoolean("fpaypal.Enabled")) {
if (! SavageFactions.plugin.getConfig().getBoolean("fpaypal.Enabled")) {
fme.msg(TL.GENERIC_DISABLED);
} else {
String paypal = argAsString(0);

View File

@@ -1,6 +1,6 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.P;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.struct.Relation;
import com.massivecraft.factions.struct.Role;
import com.massivecraft.factions.zcore.fperms.Access;
@@ -104,7 +104,7 @@ public class CmdPerm extends FCommand {
}
fme.msg(TL.COMMAND_PERM_SET, argAsString(1), access.name(), argAsString(0));
P.p.log(String.format(TL.COMMAND_PERM_SET.toString(), argAsString(1), access.name(), argAsString(0)) + " for faction " + fme.getTag());
SavageFactions.plugin.log(String.format(TL.COMMAND_PERM_SET.toString(), argAsString(1), access.name(), argAsString(0)) + " for faction " + fme.getTag());
}
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.FPlayers;
import com.massivecraft.factions.Faction;
import com.massivecraft.factions.P;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.util.TL;
@@ -43,7 +43,7 @@ public class CmdPermanent extends FCommand {
faction.setPermanent(true);
}
P.p.log((fme == null ? "A server admin" : fme.getName()) + " " + change + " the faction \"" + faction.getTag() + "\".");
SavageFactions.plugin.log((fme == null ? "A server admin" : fme.getName()) + " " + change + " the faction \"" + faction.getTag() + "\".");
// Inform all players
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.Faction;
import com.massivecraft.factions.P;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.util.TL;
@@ -12,7 +12,7 @@ public class CmdPowerBoost extends FCommand {
super();
this.aliases.add("powerboost");
this.requiredArgs.add("p|f|player|faction");
this.requiredArgs.add("plugin|f|player|faction");
this.requiredArgs.add("name");
this.requiredArgs.add("# or reset");
@@ -32,7 +32,7 @@ public class CmdPowerBoost extends FCommand {
boolean doPlayer = true;
if (type.equals("f") || type.equals("faction")) {
doPlayer = false;
} else if (!type.equals("p") && !type.equals("player")) {
} else if (! type.equals("plugin") && ! type.equals("player")) {
msg(TL.COMMAND_POWERBOOST_HELP_1);
msg(TL.COMMAND_POWERBOOST_HELP_2);
return;
@@ -77,7 +77,7 @@ public class CmdPowerBoost extends FCommand {
int roundedPower = (int) Math.round(targetPower);
msg(TL.COMMAND_POWERBOOST_BOOST, target, roundedPower);
if (!senderIsConsole) {
P.p.log(TL.COMMAND_POWERBOOST_BOOSTLOG.toString(), fme.getName(), target, roundedPower);
SavageFactions.plugin.log(TL.COMMAND_POWERBOOST_BOOSTLOG.toString(), fme.getName(), target, roundedPower);
}
}

View File

@@ -1,7 +1,7 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.P;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.util.Particles.ReflectionUtils;
import com.massivecraft.factions.zcore.util.TL;
@@ -26,13 +26,13 @@ public class CmdReload extends FCommand {
public void perform() {
long timeInitStart = System.currentTimeMillis();
Conf.load();
P.p.reloadConfig();
P.p.loadLang();
SavageFactions.plugin.reloadConfig();
SavageFactions.plugin.loadLang();
int version = Integer.parseInt(ReflectionUtils.PackageType.getServerVersion().split("_")[1]);
if (P.p.getConfig().getBoolean("enable-faction-flight")) {
P.p.factionsFlight = true;
if (SavageFactions.plugin.getConfig().getBoolean("enable-faction-flight")) {
SavageFactions.plugin.factionsFlight = true;
}
long timeReload = (System.currentTimeMillis() - timeInitStart);

View File

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

View File

@@ -3,7 +3,7 @@ package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Board;
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.Factions;
import com.massivecraft.factions.P;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.Bukkit;
@@ -49,7 +49,7 @@ public class CmdSafeunclaimall extends FCommand {
msg(TL.COMMAND_SAFEUNCLAIMALL_UNCLAIMED);
if (Conf.logLandUnclaims) {
P.p.log(TL.COMMAND_SAFEUNCLAIMALL_UNCLAIMEDLOG.format(sender.getName()));
SavageFactions.plugin.log(TL.COMMAND_SAFEUNCLAIMALL_UNCLAIMEDLOG.format(sender.getName()));
}
}

View File

@@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd;
import com.massivecraft.factions.FLocation;
import com.massivecraft.factions.P;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.util.Particles.ParticleEffect;
import com.massivecraft.factions.util.VisualizeUtil;
@@ -42,7 +42,7 @@ public class CmdSeeChunk extends FCommand {
senderMustBeAdmin = false;
this.useParticles = p.getConfig().getBoolean("see-chunk.particles", true);
interval = P.p.getConfig().getLong("see-chunk.interval", 10L);
interval = SavageFactions.plugin.getConfig().getLong("see-chunk.interval", 10L);
if (effect == null) {
effect = ParticleEffect.REDSTONE;
}
@@ -73,7 +73,7 @@ public class CmdSeeChunk extends FCommand {
}
private void startTask() {
taskID = Bukkit.getScheduler().scheduleSyncRepeatingTask(P.p, new Runnable() {
taskID = Bukkit.getScheduler().scheduleSyncRepeatingTask(SavageFactions.plugin, new Runnable() {
@Override
public void run() {
Iterator itr = seeChunkMap.keySet().iterator();
@@ -123,10 +123,10 @@ public class CmdSeeChunk extends FCommand {
continue;
}
if (useParticles) {
if (P.p.useNonPacketParticles) {
if (SavageFactions.plugin.useNonPacketParticles) {
// Dust options only exists in the 1.13 API, so we use an
// alternative method to achieve this in lower versions.
if (P.p.mc113) {
if (SavageFactions.plugin.mc113) {
player.spawnParticle(Particle.REDSTONE, loc, 0, new Particle.DustOptions(Color.RED, 1));
} else {
player.getWorld().spawnParticle(Particle.REDSTONE, loc, 0, 255, 0, 0, 1);
@@ -138,7 +138,7 @@ public class CmdSeeChunk extends FCommand {
} else {
Material type = blockY % 5 == 0 ? P.p.REDSTONE_LAMP_ON : P.p.STAINED_GLASS;
Material type = blockY % 5 == 0 ? SavageFactions.plugin.REDSTONE_LAMP_ON : SavageFactions.plugin.STAINED_GLASS;
VisualizeUtil.addLocation(player, loc, type);
}
}

View File

@@ -1,7 +1,7 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.P;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.struct.Relation;
import com.massivecraft.factions.struct.Role;
@@ -46,7 +46,7 @@ public class CmdSetFWarp extends FCommand {
}
int maxWarps = P.p.getConfig().getInt("max-warps", 5);
int maxWarps = SavageFactions.plugin.getConfig().getInt("max-warps", 5);
if (maxWarps <= myFaction.getWarps().size()) {
fme.msg(TL.COMMAND_SETFWARP_LIMIT, maxWarps);
return;
@@ -68,7 +68,7 @@ public class CmdSetFWarp extends FCommand {
}
private boolean transact(FPlayer player) {
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());
return ! SavageFactions.plugin.getConfig().getBoolean("warp-cost.enabled", false) || player.isAdminBypassing() || payForCommand(SavageFactions.plugin.getConfig().getDouble("warp-cost.setwarp", 5), TL.COMMAND_SETFWARP_TOSET.toString(), TL.COMMAND_SETFWARP_FORSET.toString());
}
@Override

View File

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

View File

@@ -1,11 +1,8 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Faction;
import com.massivecraft.factions.P;
import com.massivecraft.factions.integration.Econ;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.Bukkit;
public class CmdStealth extends FCommand {
public CmdStealth() {

View File

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

View File

@@ -1,6 +1,6 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.P;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.struct.Role;
import com.massivecraft.factions.zcore.fperms.Access;
@@ -31,7 +31,7 @@ public class CmdTnt extends FCommand {
@Override
public void perform() {
if (!P.p.getConfig().getBoolean("ftnt.Enabled")) {
if (! SavageFactions.plugin.getConfig().getBoolean("ftnt.Enabled")) {
fme.msg(TL.COMMAND_TNT_DISABLED_MSG);
return;
}
@@ -73,7 +73,7 @@ public class CmdTnt extends FCommand {
return;
}
ItemStack tnt = new ItemStack(Material.TNT, amount);
if (fme.getFaction().getTnt() + amount > P.p.getConfig().getInt("ftnt.Bank-Limit")) {
if (fme.getFaction().getTnt() + amount > SavageFactions.plugin.getConfig().getInt("ftnt.Bank-Limit")) {
msg(TL.COMMAND_TNT_EXCEEDLIMIT);
return;
}
@@ -82,7 +82,7 @@ public class CmdTnt extends FCommand {
fme.getFaction().addTnt(amount);
fme.msg(TL.COMMAND_TNT_DEPOSIT_SUCCESS);
fme.sendMessage(P.p.color(TL.COMMAND_TNT_AMOUNT.toString().replace("{amount}", fme.getFaction().getTnt() + "")));
fme.sendMessage(SavageFactions.plugin.color(TL.COMMAND_TNT_AMOUNT.toString().replace("{amount}", fme.getFaction().getTnt() + "")));
return;
}

View File

@@ -1,6 +1,6 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.P;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.struct.Role;
import com.massivecraft.factions.zcore.fperms.Access;
@@ -46,12 +46,12 @@ public class CmdTntFill extends FCommand {
msg(TL.COMMAND_TNTFILL_HEADER);
int radius = argAsInt(0, 16);
int amount = argAsInt(1, 16);
if (radius > P.p.getConfig().getInt("Tntfill.max-radius")) {
msg(TL.COMMAND_TNTFILL_RADIUSMAX.toString().replace("{max}", P.p.getConfig().getInt("Tntfill.max-radius") + ""));
if (radius > SavageFactions.plugin.getConfig().getInt("Tntfill.max-radius")) {
msg(TL.COMMAND_TNTFILL_RADIUSMAX.toString().replace("{max}", SavageFactions.plugin.getConfig().getInt("Tntfill.max-radius") + ""));
return;
}
if (amount > P.p.getConfig().getInt("Tntfill.max-amount")) {
msg(TL.COMMAND_TNTFILL_AMOUNTMAX.toString().replace("{max}", P.p.getConfig().getInt("Tntfill.max-amount") + ""));
if (amount > SavageFactions.plugin.getConfig().getInt("Tntfill.max-amount")) {
msg(TL.COMMAND_TNTFILL_AMOUNTMAX.toString().replace("{max}", SavageFactions.plugin.getConfig().getInt("Tntfill.max-amount") + ""));
return;
}
int testNumber = -1;
@@ -177,7 +177,7 @@ public class CmdTntFill extends FCommand {
return;
}
ItemStack tnt = new ItemStack(Material.TNT, amount);
if (fme.getFaction().getTnt() + amount > P.p.getConfig().getInt("ftnt.Bank-Limit")) {
if (fme.getFaction().getTnt() + amount > SavageFactions.plugin.getConfig().getInt("ftnt.Bank-Limit")) {
msg(TL.COMMAND_TNT_EXCEEDLIMIT);
return;
}

View File

@@ -1,6 +1,6 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.P;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.listeners.FactionsPlayerListener;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.util.WarmUpUtil;
@@ -24,12 +24,12 @@ public class CmdTpBanner extends FCommand {
@Override
public void perform() {
if (!P.p.getConfig().getBoolean("fbanners.Enabled")) {
if (! SavageFactions.plugin.getConfig().getBoolean("fbanners.Enabled")) {
return;
}
final FactionsPlayerListener fpl = new FactionsPlayerListener(P.p);
final FactionsPlayerListener fpl = new FactionsPlayerListener(SavageFactions.plugin);
if (FactionsPlayerListener.bannerLocations.containsKey(fme.getTag())) {
fme.msg(TL.COMMAND_TPBANNER_SUCCESS);

View File

@@ -86,7 +86,7 @@ public class CmdUnclaim extends FCommand {
msg(TL.COMMAND_UNCLAIM_SAFEZONE_SUCCESS);
if (Conf.logLandUnclaims) {
P.p.log(TL.COMMAND_UNCLAIM_LOG.format(fme.getName(), target.getCoordString(), targetFaction.getTag()));
SavageFactions.plugin.log(TL.COMMAND_UNCLAIM_LOG.format(fme.getName(), target.getCoordString(), targetFaction.getTag()));
}
return true;
} else {
@@ -99,7 +99,7 @@ public class CmdUnclaim extends FCommand {
msg(TL.COMMAND_UNCLAIM_WARZONE_SUCCESS);
if (Conf.logLandUnclaims) {
P.p.log(TL.COMMAND_UNCLAIM_LOG.format(fme.getName(), target.getCoordString(), targetFaction.getTag()));
SavageFactions.plugin.log(TL.COMMAND_UNCLAIM_LOG.format(fme.getName(), target.getCoordString(), targetFaction.getTag()));
}
return true;
} else {
@@ -121,7 +121,7 @@ public class CmdUnclaim extends FCommand {
msg(TL.COMMAND_UNCLAIM_UNCLAIMS);
if (Conf.logLandUnclaims) {
P.p.log(TL.COMMAND_UNCLAIM_LOG.format(fme.getName(), target.getCoordString(), targetFaction.getTag()));
SavageFactions.plugin.log(TL.COMMAND_UNCLAIM_LOG.format(fme.getName(), target.getCoordString(), targetFaction.getTag()));
}
return true;
@@ -172,7 +172,7 @@ public class CmdUnclaim extends FCommand {
myFaction.msg(TL.COMMAND_UNCLAIM_FACTIONUNCLAIMED, fme.describeTo(myFaction, true));
if (Conf.logLandUnclaims) {
P.p.log(TL.COMMAND_UNCLAIM_LOG.format(fme.getName(), target.getCoordString(), targetFaction.getTag()));
SavageFactions.plugin.log(TL.COMMAND_UNCLAIM_LOG.format(fme.getName(), target.getCoordString(), targetFaction.getTag()));
}
return true;

View File

@@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Board;
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.P;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.event.LandUnclaimAllEvent;
import com.massivecraft.factions.integration.Econ;
import com.massivecraft.factions.struct.Permission;
@@ -52,7 +52,7 @@ public class CmdUnclaimall extends FCommand {
myFaction.msg(TL.COMMAND_UNCLAIMALL_UNCLAIMED, fme.describeTo(myFaction, true));
if (Conf.logLandUnclaims) {
P.p.log(TL.COMMAND_UNCLAIMALL_LOG.format(fme.getName(), myFaction.getTag()));
SavageFactions.plugin.log(TL.COMMAND_UNCLAIMALL_LOG.format(fme.getName(), myFaction.getTag()));
}
}

View File

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

View File

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

View File

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

View File

@@ -3,7 +3,7 @@ package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Board;
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.Factions;
import com.massivecraft.factions.P;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.Bukkit;
@@ -48,7 +48,7 @@ public class CmdWarunclaimall extends FCommand {
if (Conf.logLandUnclaims) {
P.p.log(TL.COMMAND_WARUNCLAIMALL_LOG.format(fme.getName()));
SavageFactions.plugin.log(TL.COMMAND_WARUNCLAIMALL_LOG.format(fme.getName()));
}
}

View File

@@ -1,7 +1,7 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.P;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.Bukkit;
@@ -124,7 +124,7 @@ public class FCmdRoot extends FCommand {
this.setHelpShort("The faction base command");
this.helpLong.add(p.txt.parseTags("<i>This command contains all faction stuff."));
//this.subCommands.add(p.cmdHelp);
//this.subCommands.add(plugin.cmdHelp);
this.addSubCommand(this.cmdAdmin);
this.addSubCommand(this.cmdAutoClaim);
@@ -218,22 +218,22 @@ public class FCmdRoot extends FCommand {
if (Bukkit.getServer().getPluginManager().getPlugin("CoreProtect") != null) {
P.p.log("Found CoreProtect, enabling Inspect");
SavageFactions.plugin.log("Found CoreProtect, enabling Inspect");
this.addSubCommand(this.cmdInspect);
} else {
P.p.log("CoreProtect not found, disabling Inspect");
SavageFactions.plugin.log("CoreProtect not found, disabling Inspect");
}
if (P.p.getConfig().getBoolean("enable-faction-flight", false)) {
if (SavageFactions.plugin.getConfig().getBoolean("enable-faction-flight", false)) {
this.addSubCommand(this.cmdFly);
}
if (Bukkit.getServer().getPluginManager().isPluginEnabled("FactionsTop")) {
P.p.log(Level.INFO, "Found FactionsTop plugin. Disabling our own /f top command.");
SavageFactions.plugin.log(Level.INFO, "Found FactionsTop plugin. Disabling our own /f top command.");
} else {
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.");
SavageFactions.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.");
this.addSubCommand(this.cmdTop);
}
if (P.p.getConfig().getBoolean("fpaypal.Enabled")) {
if (SavageFactions.plugin.getConfig().getBoolean("fpaypal.Enabled")) {
this.addSubCommand(this.cmdPaypalSet);
this.addSubCommand(this.cmdPaypalSee);
}

View File

@@ -13,7 +13,7 @@ import java.text.SimpleDateFormat;
import java.util.List;
public abstract class FCommand extends MCommand<P> {
public abstract class FCommand extends MCommand<SavageFactions> {
public SimpleDateFormat sdf = new SimpleDateFormat(TL.DATE_FORMAT.toString());
@@ -29,7 +29,7 @@ public abstract class FCommand extends MCommand<P> {
public boolean isMoneyCommand;
public FCommand() {
super(P.p);
super(SavageFactions.plugin);
// Due to safety reasons it defaults to disable on lock.
disableOnLock = true;
@@ -160,7 +160,7 @@ public abstract class FCommand extends MCommand<P> {
}
if (msg && ret == null) {
this.msg("<b>No player \"<p>%s<b>\" could be found.", name);
this.msg("<b>No player \"<plugin>%s<b>\" could be found.", name);
}
return ret;
@@ -233,7 +233,7 @@ public abstract class FCommand extends MCommand<P> {
}
if (msg && ret == null) {
this.msg("<b>The faction or player \"<p>%s<b>\" could not be found.", name);
this.msg("<b>The faction or player \"<plugin>%s<b>\" could not be found.", name);
}
return ret;

View File

@@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.Faction;
import com.massivecraft.factions.P;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.event.FactionRelationEvent;
import com.massivecraft.factions.event.FactionRelationWishEvent;
import com.massivecraft.factions.scoreboards.FTeamWrapper;
@@ -103,8 +103,8 @@ public abstract class FRelationCommand extends FCommand {
}
private boolean hasMaxRelations(Faction them, Relation targetRelation) {
int max = P.p.getConfig().getInt("max-relations." + targetRelation.toString(), -1);
if (P.p.getConfig().getBoolean("max-relations.enabled", false)) {
int max = SavageFactions.plugin.getConfig().getInt("max-relations." + targetRelation.toString(), - 1);
if (SavageFactions.plugin.getConfig().getBoolean("max-relations.enabled", false)) {
if (max != -1) {
if (myFaction.getRelationCount(targetRelation) >= max) {
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.FPlayer;
import com.massivecraft.factions.Faction;
import com.massivecraft.factions.P;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.iface.EconomyParticipator;
import com.massivecraft.factions.struct.Permission;
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\" ";
if (Bukkit.getServer().getPluginManager().getPlugin("Vault") == null) {
P.p.log(integrationFail + "is not installed.");
SavageFactions.plugin.log(integrationFail + "is not installed.");
return;
}
RegisteredServiceProvider<Economy> rsp = Bukkit.getServer().getServicesManager().getRegistration(Economy.class);
if (rsp == null) {
P.p.log(integrationFail + "is not hooked into an economy plugin.");
SavageFactions.plugin.log(integrationFail + "is not hooked into an economy plugin.");
return;
}
econ = rsp.getProvider();
P.p.log("Economy integration through Vault plugin successful.");
SavageFactions.plugin.log("Economy integration through Vault plugin successful.");
if (!Conf.econEnabled) {
P.p.log("NOTE: Economy is disabled. You can enable it with the command: f config econEnabled true");
SavageFactions.plugin.log("NOTE: Economy is disabled. You can enable it with the command: f config econEnabled true");
}
P.p.cmdBase.cmdHelp.updateHelp();
SavageFactions.plugin.cmdBase.cmdHelp.updateHelp();
}
public static boolean shouldBeUsed() {
@@ -82,7 +82,7 @@ public class Econ {
public static void sendBalanceInfo(FPlayer to, EconomyParticipator about) {
if (!shouldBeUsed()) {
P.p.log(Level.WARNING, "Vault does not appear to be hooked into an economy plugin.");
SavageFactions.plugin.log(Level.WARNING, "Vault does not appear to be hooked into an economy plugin.");
return;
}
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;
import com.massivecraft.factions.FLocation;
import com.massivecraft.factions.P;
import com.massivecraft.factions.SavageFactions;
import com.sk89q.worldedit.BlockVector;
import com.sk89q.worldedit.Vector;
import com.sk89q.worldguard.bukkit.WorldGuardPlugin;
@@ -38,11 +38,11 @@ public class Worldguard {
if (wgplug == null || !(wgplug instanceof WorldGuardPlugin)) {
enabled = false;
wg = null;
P.p.log("Could not hook to WorldGuard. WorldGuard checks are disabled.");
SavageFactions.plugin.log("Could not hook to WorldGuard. WorldGuard checks are disabled.");
} else {
wg = (WorldGuardPlugin) wgplug;
enabled = true;
P.p.log("Successfully hooked to WorldGuard.");
SavageFactions.plugin.log("Successfully hooked to WorldGuard.");
}
}

View File

@@ -117,7 +117,7 @@ public class EngineDynmap {
}
// Shedule non thread safe sync at the end!
Bukkit.getScheduler().scheduleSyncRepeatingTask(P.p, new Runnable() {
Bukkit.getScheduler().scheduleSyncRepeatingTask(SavageFactions.plugin, new Runnable() {
@Override
public void run() {

View File

@@ -22,10 +22,10 @@ import org.bukkit.inventory.ItemStack;
public class FactionsBlockListener implements Listener {
public P p;
public SavageFactions savageFactions;
public FactionsBlockListener(P p) {
this.p = p;
public FactionsBlockListener(SavageFactions savageFactions) {
this.savageFactions = savageFactions;
}
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
@@ -125,7 +125,7 @@ public class FactionsBlockListener implements Listener {
return false;
}
if (P.p.getConfig().getBoolean("hcf.raidable", false) && otherFaction.getLandRounded() >= otherFaction.getPowerRounded()) {
if (SavageFactions.plugin.getConfig().getBoolean("hcf.raidable", false) && otherFaction.getLandRounded() >= otherFaction.getPowerRounded()) {
return true;
}
@@ -222,7 +222,7 @@ public class FactionsBlockListener implements Listener {
@EventHandler
public void onVaultPlace(BlockPlaceEvent e) {
if (e.getItemInHand().getType() == Material.CHEST) {
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")));
ItemStack vault = SavageFactions.plugin.createItem(Material.CHEST, 1, (short) 0, SavageFactions.plugin.color(SavageFactions.plugin.getConfig().getString("fvault.Item.Name")), SavageFactions.plugin.colorList(SavageFactions.plugin.getConfig().getStringList("fvault.Item.Lore")));
if (e.getItemInHand().isSimilar(vault)) {
FPlayer fme = FPlayers.getInstance().getByPlayer(e.getPlayer());
if (fme.getFaction().getVault() != null) {
@@ -248,7 +248,7 @@ public class FactionsBlockListener implements Listener {
Material blockMaterial = blockLoc.getBlock().getType();
if (blockMaterial == Material.CHEST || (P.p.getConfig().getBoolean("fvault.No-Hoppers-near-vault") && blockMaterial == Material.HOPPER)) {
if (blockMaterial == Material.CHEST || (SavageFactions.plugin.getConfig().getBoolean("fvault.No-Hoppers-near-vault") && blockMaterial == Material.HOPPER)) {
e.setCancelled(true);
fme.msg(TL.COMMAND_GETVAULT_CHESTNEAR);
return;
@@ -267,7 +267,7 @@ public class FactionsBlockListener implements Listener {
@EventHandler
public void onHopperPlace(BlockPlaceEvent e) {
if (e.getItemInHand().getType() != Material.HOPPER && !P.p.getConfig().getBoolean("fvault.No-Hoppers-near-vault")) {
if (e.getItemInHand().getType() != Material.HOPPER && ! SavageFactions.plugin.getConfig().getBoolean("fvault.No-Hoppers-near-vault")) {
return;
}
@@ -314,7 +314,7 @@ public class FactionsBlockListener implements Listener {
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.
if (otherFaction.isNormal() && P.p.getConfig().getBoolean("disable-pistons-in-territory", false)) {
if (otherFaction.isNormal() && SavageFactions.plugin.getConfig().getBoolean("disable-pistons-in-territory", false)) {
event.setCancelled(true);
return;
}
@@ -387,7 +387,7 @@ public class FactionsBlockListener implements Listener {
if (! fme.hasFaction()) {
return;
}
if (event.getBlock().getType() == P.p.MOB_SPANWER) {
if (event.getBlock().getType() == SavageFactions.plugin.MOB_SPANWER) {
if (! fme.isAdminBypassing()) {
Access access = fme.getFaction().getAccess(fme, PermissableAction.SPAWNER);
if (access != Access.ALLOW && fme.getRole() != Role.LEADER) {

View File

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

View File

@@ -32,10 +32,10 @@ import java.util.*;
public class FactionsEntityListener implements Listener {
private static final Set<PotionEffectType> badPotionEffects = new LinkedHashSet<>(Arrays.asList(PotionEffectType.BLINDNESS, PotionEffectType.CONFUSION, PotionEffectType.HARM, PotionEffectType.HUNGER, PotionEffectType.POISON, PotionEffectType.SLOW, PotionEffectType.SLOW_DIGGING, PotionEffectType.WEAKNESS, PotionEffectType.WITHER));
public P p;
public SavageFactions savageFactions;
public FactionsEntityListener(P p) {
this.p = p;
public FactionsEntityListener(SavageFactions savageFactions) {
this.savageFactions = savageFactions;
}
@EventHandler(priority = EventPriority.NORMAL)
@@ -232,9 +232,9 @@ public class FactionsEntityListener implements Listener {
return;
}
UUID uuid = player.getUniqueId();
if (P.p.getStuckMap().containsKey(uuid)) {
if (SavageFactions.plugin.getStuckMap().containsKey(uuid)) {
FPlayers.getInstance().getByPlayer(player).msg(TL.COMMAND_STUCK_CANCELLED);
P.p.getStuckMap().remove(uuid);
SavageFactions.plugin.getStuckMap().remove(uuid);
}
}
@@ -651,7 +651,7 @@ public class FactionsEntityListener implements Listener {
@EventHandler
public void onTravel(PlayerPortalEvent event) {
if (!P.p.getConfig().getBoolean("portals.limit", false)) {
if (! SavageFactions.plugin.getConfig().getBoolean("portals.limit", false)) {
return; // Don't do anything if they don't want us to.
}
@@ -670,7 +670,7 @@ public class FactionsEntityListener implements Listener {
}
FPlayer fp = FPlayers.getInstance().getByPlayer(event.getPlayer());
String mininumRelation = P.p.getConfig().getString("portals.minimum-relation", "MEMBER"); // Defaults to Neutral if typed wrong.
String mininumRelation = SavageFactions.plugin.getConfig().getString("portals.minimum-relation", "MEMBER"); // Defaults to Neutral if typed wrong.
if (!fp.getFaction().getRelationTo(faction).isAtLeast(Relation.fromString(mininumRelation))) {
event.setCancelled(true);
}

View File

@@ -1,7 +1,7 @@
package com.massivecraft.factions.listeners;
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.P;
import com.massivecraft.factions.SavageFactions;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
@@ -48,9 +48,9 @@ public class FactionsExploitListener implements Listener {
// blocks who occupy less than 1 block width or length wise need to be handled differently
Material mat = event.getTo().getBlock().getType();
if (((mat == P.p.THIN_GLASS
|| mat == P.p.IRON_FENCE) && clippingThrough(target, from, 0.65))
|| ((mat == P.p.FENCE || mat == P.p.NETHER_FENCE) && clippingThrough(target, from, 0.45))) {
if (((mat == SavageFactions.plugin.THIN_GLASS
|| mat == SavageFactions.plugin.IRON_FENCE) && clippingThrough(target, from, 0.65))
|| ((mat == SavageFactions.plugin.FENCE || mat == SavageFactions.plugin.NETHER_FENCE) && clippingThrough(target, from, 0.45))) {
event.setTo(from);
return;
}

View File

@@ -57,15 +57,15 @@ public class FactionsPlayerListener implements Listener {
public static HashMap<String, Location> bannerLocations = new HashMap<>();
HashMap<Player, Boolean> fallMap = new HashMap<>();
HashMap<String, Boolean> bannerCooldownMap = new HashMap<>();
private P p;
private SavageFactions savageFactions;
// Holds the next time a player can have a map shown.
private HashMap<UUID, Long> showTimes = new HashMap<>();
// for handling people who repeatedly spam attempts to open a door (or similar) in another faction's territory
private Map<String, InteractAttemptSpam> interactSpammers = new HashMap<>();
public FactionsPlayerListener(P p) {
this.p = p;
for (Player player : p.getServer().getOnlinePlayers()) {
public FactionsPlayerListener(SavageFactions savageFactions) {
this.savageFactions = savageFactions;
for (Player player : savageFactions.getServer().getOnlinePlayers()) {
initPlayer(player);
}
}
@@ -100,7 +100,7 @@ public class FactionsPlayerListener implements Listener {
}
return false;
}
if (P.p.getConfig().getBoolean("hcf.raidable", false) && otherFaction.getLandRounded() >= otherFaction.getPowerRounded()) {
if (SavageFactions.plugin.getConfig().getBoolean("hcf.raidable", false) && otherFaction.getLandRounded() >= otherFaction.getPowerRounded()) {
return true;
}
@@ -195,7 +195,7 @@ public class FactionsPlayerListener implements Listener {
return true;
}
if (P.p.getConfig().getBoolean("hcf.raidable", false) && otherFaction.getLandRounded() >= otherFaction.getPowerRounded()) {
if (SavageFactions.plugin.getConfig().getBoolean("hcf.raidable", false) && otherFaction.getLandRounded() >= otherFaction.getPowerRounded()) {
return true;
}
@@ -217,7 +217,7 @@ public class FactionsPlayerListener implements Listener {
PermissableAction action = null;
if (P.p.mc113) {
if (SavageFactions.plugin.mc113) {
switch (block.getType()) {
case LEVER:
action = PermissableAction.LEVER;
@@ -319,7 +319,7 @@ public class FactionsPlayerListener implements Listener {
// You may use any block unless it is another faction's territory...
if (rel.isNeutral() || (rel.isEnemy() && Conf.territoryEnemyProtectMaterials) || (rel.isAlly() && Conf.territoryAllyProtectMaterials) || (rel.isTruce() && Conf.territoryTruceProtectMaterials)) {
if (! justCheck) {
me.msg(TL.PLAYER_USE_TERRITORY, (material == P.p.SOIL ? "trample " : "use ") + TextUtil.getMaterialName(material), otherFaction.getTag(myFaction));
me.msg(TL.PLAYER_USE_TERRITORY, (material == SavageFactions.plugin.SOIL ? "trample " : "use ") + TextUtil.getMaterialName(material), otherFaction.getTag(myFaction));
}
return false;
}
@@ -433,7 +433,7 @@ public class FactionsPlayerListener implements Listener {
me.login(); // set kills / deaths
// Check for Faction announcements. Let's delay this so they actually see it.
Bukkit.getScheduler().runTaskLater(P.p, new Runnable() {
Bukkit.getScheduler().runTaskLater(SavageFactions.plugin, new Runnable() {
@Override
public void run() {
if (me.isOnline()) {
@@ -442,9 +442,9 @@ public class FactionsPlayerListener implements Listener {
}
}, 33L); // Don't ask me why.
if (P.p.getConfig().getBoolean("scoreboard.default-enabled", false)) {
if (SavageFactions.plugin.getConfig().getBoolean("scoreboard.default-enabled", false)) {
FScoreboard.init(me);
FScoreboard.get(me).setDefaultSidebar(new FDefaultSidebar(), P.p.getConfig().getInt("default-update-interval", 20));
FScoreboard.get(me).setDefaultSidebar(new FDefaultSidebar(), SavageFactions.plugin.getConfig().getInt("default-update-interval", 20));
FScoreboard.get(me).setSidebarVisibility(me.showScoreboard());
}
@@ -459,7 +459,7 @@ public class FactionsPlayerListener implements Listener {
fallMap.put(me.getPlayer(), false);
Bukkit.getScheduler().scheduleSyncDelayedTask(P.p, new Runnable() {
Bukkit.getScheduler().scheduleSyncDelayedTask(SavageFactions.plugin, new Runnable() {
@Override
public void run() {
fallMap.remove(me.getPlayer());
@@ -470,12 +470,12 @@ public class FactionsPlayerListener implements Listener {
if (me.isSpyingChat() && ! player.hasPermission(Permission.CHATSPY.node)) {
me.setSpyingChat(false);
P.p.log(Level.INFO, "Found %s spying chat without permission on login. Disabled their chat spying.", player.getName());
SavageFactions.plugin.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)) {
me.setIsAdminBypassing(false);
P.p.log(Level.INFO, "Found %s on admin Bypass without permission on login. Disabled it for them.", player.getName());
SavageFactions.plugin.log(Level.INFO, "Found %s on admin Bypass without permission on login. Disabled it for them.", player.getName());
}
@@ -509,10 +509,10 @@ public class FactionsPlayerListener implements Listener {
me.logout(); // cache kills / deaths
// if player is waiting for fstuck teleport but leaves, remove
if (P.p.getStuckMap().containsKey(me.getPlayer().getUniqueId())) {
if (SavageFactions.plugin.getStuckMap().containsKey(me.getPlayer().getUniqueId())) {
FPlayers.getInstance().getByPlayer(me.getPlayer()).msg(TL.COMMAND_STUCK_CANCELLED);
P.p.getStuckMap().remove(me.getPlayer().getUniqueId());
P.p.getTimers().remove(me.getPlayer().getUniqueId());
SavageFactions.plugin.getStuckMap().remove(me.getPlayer().getUniqueId());
SavageFactions.plugin.getTimers().remove(me.getPlayer().getUniqueId());
}
Faction myFaction = me.getFaction();
@@ -547,12 +547,12 @@ public class FactionsPlayerListener implements Listener {
}
public void enableFly(FPlayer me) {
if (P.p.getConfig().getBoolean("ffly.AutoEnable")) {
if (SavageFactions.plugin.getConfig().getBoolean("ffly.AutoEnable")) {
me.setFlying(true);
CmdFly.flyMap.put(me.getName(), true);
if (CmdFly.id == - 1) {
if (P.p.getConfig().getBoolean("ffly.Particles.Enabled")) {
if (SavageFactions.plugin.getConfig().getBoolean("ffly.Particles.Enabled")) {
CmdFly.startParticles();
}
}
@@ -667,19 +667,19 @@ public class FactionsPlayerListener implements Listener {
if (changedFaction) {
Bukkit.getServer().getPluginManager().callEvent(new FPlayerEnteredFactionEvent(factionTo, factionFrom, me));
if (P.p.getConfig().getBoolean("Title.Show-Title")) {
String title = P.p.getConfig().getString("Title.Format.Title");
if (SavageFactions.plugin.getConfig().getBoolean("Title.Show-Title")) {
String title = SavageFactions.plugin.getConfig().getString("Title.Format.Title");
title = title.replace("{Faction}", factionTo.getColorTo(me) + factionTo.getTag());
title = parseAllPlaceholders(title, factionTo, player);
String subTitle = P.p.getConfig().getString("Title.Format.Subtitle").replace("{Description}", factionTo.getDescription()).replace("{Faction}", factionTo.getColorTo(me) + factionTo.getTag());
String subTitle = SavageFactions.plugin.getConfig().getString("Title.Format.Subtitle").replace("{Description}", factionTo.getDescription()).replace("{Faction}", factionTo.getColorTo(me) + factionTo.getTag());
subTitle = parseAllPlaceholders(subTitle, factionTo, player);
if (! P.p.mc17) {
if (! P.p.mc18) {
me.getPlayer().sendTitle(P.p.color(title), P.p.color(subTitle), P.p.getConfig().getInt("Title.Options.FadeInTime"),
P.p.getConfig().getInt("Title.Options.ShowTime"),
P.p.getConfig().getInt("Title.Options.FadeOutTime"));
if (! SavageFactions.plugin.mc17) {
if (! SavageFactions.plugin.mc18) {
me.getPlayer().sendTitle(SavageFactions.plugin.color(title), SavageFactions.plugin.color(subTitle), SavageFactions.plugin.getConfig().getInt("Title.Options.FadeInTime"),
SavageFactions.plugin.getConfig().getInt("Title.Options.ShowTime"),
SavageFactions.plugin.getConfig().getInt("Title.Options.FadeOutTime"));
} else {
me.getPlayer().sendTitle(P.p.color(title), P.p.color(subTitle));
me.getPlayer().sendTitle(SavageFactions.plugin.color(title), SavageFactions.plugin.color(subTitle));
}
@@ -687,7 +687,7 @@ public class FactionsPlayerListener implements Listener {
}
if (! P.p.factionsFlight) {
if (! SavageFactions.plugin.factionsFlight) {
return;
}
@@ -715,12 +715,12 @@ public class FactionsPlayerListener implements Listener {
if (me.isMapAutoUpdating()) {
if (showTimes.containsKey(player.getUniqueId()) && (showTimes.get(player.getUniqueId()) > System.currentTimeMillis())) {
if (P.p.getConfig().getBoolean("findfactionsexploit.log", false)) {
P.p.log(Level.WARNING, "%s tried to show a faction map too soon and triggered exploit blocker.", player.getName());
if (SavageFactions.plugin.getConfig().getBoolean("findfactionsexploit.log", false)) {
SavageFactions.plugin.log(Level.WARNING, "%s tried to show a faction map too soon and triggered exploit blocker.", player.getName());
}
} else {
me.sendFancyMessage(Board.getInstance().getMap(me, to, player.getLocation().getYaw()));
showTimes.put(player.getUniqueId(), System.currentTimeMillis() + P.p.getConfig().getLong("findfactionsexploit.cooldown", 2000));
showTimes.put(player.getUniqueId(), System.currentTimeMillis() + SavageFactions.plugin.getConfig().getLong("findfactionsexploit.cooldown", 2000));
}
} else {
Faction myFaction = me.getFaction();
@@ -776,21 +776,21 @@ public class FactionsPlayerListener implements Listener {
@EventHandler
public void onBannerPlace(BlockPlaceEvent e) {
if (P.p.mc17) {
if (SavageFactions.plugin.mc17) {
return;
}
if (e.getItemInHand().getType() == P.p.BANNER) {
if (e.getItemInHand().getType() == SavageFactions.plugin.BANNER) {
ItemStack bannerInHand = e.getItemInHand();
FPlayer fme = FPlayers.getInstance().getByPlayer(e.getPlayer());
ItemStack warBanner = fme.getFaction().getBanner();
if (warBanner != null) {
ItemMeta warmeta = warBanner.getItemMeta();
warmeta.setDisplayName(P.p.color(P.p.getConfig().getString("fbanners.Item.Name")));
warmeta.setLore(P.p.colorList(P.p.getConfig().getStringList("fbanners.Item.Lore")));
warmeta.setDisplayName(SavageFactions.plugin.color(SavageFactions.plugin.getConfig().getString("fbanners.Item.Name")));
warmeta.setLore(SavageFactions.plugin.colorList(SavageFactions.plugin.getConfig().getStringList("fbanners.Item.Lore")));
warBanner.setItemMeta(warmeta);
} else {
warBanner = P.p.createItem(P.p.BANNER, 1, (short) 1, P.p.getConfig().getString("fbanners.Item.Name"), P.p.getConfig().getStringList("fbanners.Item.Lore"));
warBanner = SavageFactions.plugin.createItem(SavageFactions.plugin.BANNER, 1, (short) 1, SavageFactions.plugin.getConfig().getString("fbanners.Item.Name"), SavageFactions.plugin.getConfig().getStringList("fbanners.Item.Lore"));
}
if (warBanner.isSimilar(bannerInHand)) {
@@ -799,7 +799,7 @@ public class FactionsPlayerListener implements Listener {
e.setCancelled(true);
return;
}
int bannerTime = P.p.getConfig().getInt("fbanners.Banner-Time") * 20;
int bannerTime = SavageFactions.plugin.getConfig().getInt("fbanners.Banner-Time") * 20;
Location placedLoc = e.getBlockPlaced().getLocation();
FLocation fplacedLoc = new FLocation(placedLoc);
@@ -811,21 +811,21 @@ public class FactionsPlayerListener implements Listener {
}
for (FPlayer fplayer : fme.getFaction().getFPlayers()) {
// if (fplayer == fme) { continue; } //Idk if I wanna not send the title to the player
fplayer.getPlayer().sendTitle(P.p.color(fme.getTag() + " Placed A WarBanner!"), P.p.color("&7use &c/f tpbanner&7 to tp to the banner!"));
fplayer.getPlayer().sendTitle(SavageFactions.plugin.color(fme.getTag() + " Placed A WarBanner!"), SavageFactions.plugin.color("&7use &c/f tpbanner&7 to tp to the banner!"));
}
bannerCooldownMap.put(fme.getTag(), true);
bannerLocations.put(fme.getTag(), e.getBlockPlaced().getLocation());
final int bannerCooldown = P.p.getConfig().getInt("fbanners.Banner-Place-Cooldown");
final int bannerCooldown = SavageFactions.plugin.getConfig().getInt("fbanners.Banner-Place-Cooldown");
final 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.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.setCustomName(P.p.color(P.p.getConfig().getString("fbanners.BannerHolo").replace("{Faction}", fme.getTag()))); //Set this to the text you want
as.setCustomName(SavageFactions.plugin.color(SavageFactions.plugin.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
final ArmorStand armorStand = as;
final String tag = fme.getTag();
Bukkit.getScheduler().scheduleSyncDelayedTask(P.p, new Runnable() {
Bukkit.getScheduler().scheduleSyncDelayedTask(SavageFactions.plugin, new Runnable() {
@Override
public void run() {
bannerCooldownMap.remove(tag);
@@ -836,9 +836,9 @@ public class FactionsPlayerListener implements Listener {
final Faction bannerFaction = fme.getFaction();
banner.getWorld().strikeLightningEffect(banner.getLocation());
// e.getPlayer().getWorld().playSound(e.getPlayer().getLocation(), Sound.ENTITY_LIGHTNING_IMPACT,2.0F,0.5F);
final int radius = P.p.getConfig().getInt("fbanners.Banner-Effect-Radius");
final List<String> effects = P.p.getConfig().getStringList("fbanners.Effects");
final int affectorTask = Bukkit.getScheduler().scheduleSyncRepeatingTask(P.p, new Runnable() {
final int radius = SavageFactions.plugin.getConfig().getInt("fbanners.Banner-Effect-Radius");
final List<String> effects = SavageFactions.plugin.getConfig().getStringList("fbanners.Effects");
final int affectorTask = Bukkit.getScheduler().scheduleSyncRepeatingTask(SavageFactions.plugin, new Runnable() {
@Override
public void run() {
@@ -862,7 +862,7 @@ public class FactionsPlayerListener implements Listener {
}
}
}, 0L, 20L);
Bukkit.getScheduler().scheduleSyncDelayedTask(P.p, new Runnable() {
Bukkit.getScheduler().scheduleSyncDelayedTask(SavageFactions.plugin, new Runnable() {
@Override
public void run() {
banner.setType(Material.AIR);

View File

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

View File

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

View File

@@ -38,13 +38,13 @@ public class FTeamWrapper {
return;
}
if (!P.p.getConfig().getBoolean("scoreboard.default-prefixes", false)) {
if (! SavageFactions.plugin.getConfig().getBoolean("scoreboard.default-prefixes", false)) {
return;
}
if (updating.add(faction)) {
Bukkit.getScheduler().runTask(P.p, new Runnable() {
Bukkit.getScheduler().runTask(SavageFactions.plugin, new Runnable() {
@Override
public void run() {
updating.remove(faction);
@@ -63,7 +63,7 @@ public class FTeamWrapper {
return;
}
if (!P.p.getConfig().getBoolean("scoreboard.default-prefixes", false)) {
if (! SavageFactions.plugin.getConfig().getBoolean("scoreboard.default-prefixes", false)) {
return;
}
@@ -155,7 +155,7 @@ public class FTeamWrapper {
}
private void updatePrefixes() {
if (P.p.getConfig().getBoolean("scoreboard.default-prefixes", false)) {
if (SavageFactions.plugin.getConfig().getBoolean("scoreboard.default-prefixes", false)) {
for (FScoreboard fboard : teams.keySet()) {
updatePrefix(fboard);
}
@@ -163,12 +163,12 @@ public class FTeamWrapper {
}
private void updatePrefix(FScoreboard fboard) {
if (P.p.getConfig().getBoolean("scoreboard.default-prefixes", false)) {
if (SavageFactions.plugin.getConfig().getBoolean("scoreboard.default-prefixes", false)) {
FPlayer fplayer = fboard.getFPlayer();
Team team = teams.get(fboard);
String prefix = TL.DEFAULT_PREFIX.toString();
if (P.p.PlaceholderApi) {
if (SavageFactions.plugin.PlaceholderApi) {
prefix = PlaceholderAPI.setPlaceholders(fplayer.getPlayer(), prefix);
prefix = PlaceholderAPI.setBracketPlaceholders(fplayer.getPlayer(), prefix);
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -50,13 +50,13 @@ public class AutoLeaveProcessTask extends BukkitRunnable {
// Check if they should be exempt from this.
if (!fplayer.willAutoLeave()) {
P.p.debug(Level.INFO, fplayer.getName() + " was going to be auto-removed but was set not to.");
SavageFactions.plugin.debug(Level.INFO, fplayer.getName() + " was going to be auto-removed but was set not to.");
continue;
}
if (fplayer.isOffline() && now - fplayer.getLastLoginTime() > toleranceMillis) {
if (Conf.logFactionLeave || Conf.logFactionKick) {
P.p.log("Player " + fplayer.getName() + " was auto-removed due to inactivity.");
SavageFactions.plugin.log("Player " + fplayer.getName() + " was auto-removed due to inactivity.");
}
// 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;
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.P;
import com.massivecraft.factions.SavageFactions;
public class AutoLeaveTask implements Runnable {
@@ -18,11 +18,11 @@ public class AutoLeaveTask implements Runnable {
}
task = new AutoLeaveProcessTask();
task.runTaskTimer(P.p, 1, 1);
task.runTaskTimer(SavageFactions.plugin, 1, 1);
// maybe setting has been changed? if so, restart this task at new rate
if (this.rate != Conf.autoLeaveRoutineRunsEveryXMinutes) {
P.p.startAutoLeaveTask(true);
SavageFactions.plugin.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
@Override
public String getVersion() {
return P.p.getDescription().getVersion();
return SavageFactions.plugin.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;
return fPlayer.isOnline() ? ChatColor.GREEN + TL.COMMAND_STATUS_ONLINE.toString() : (System.currentTimeMillis() - fPlayer.getLastLoginTime() < 432000000 ? ChatColor.YELLOW + humanized : ChatColor.RED + humanized);
case "player_group":
return P.p.getPrimaryGroup(Bukkit.getOfflinePlayer(UUID.fromString(fPlayer.getId())));
return SavageFactions.plugin.getPrimaryGroup(Bukkit.getOfflinePlayer(UUID.fromString(fPlayer.getId())));
case "player_balance":
return Econ.isSetup() ? Econ.getFriendlyBalance(fPlayer) : TL.ECON_OFF.format("balance");
case "player_power":
@@ -121,7 +121,7 @@ public class ClipPlaceholderAPIManager extends PlaceholderExpansion implements R
case "faction_warps":
return String.valueOf(faction.getWarps().size());
case "faction_raidable":
boolean raid = P.p.getConfig().getBoolean("hcf.raidable", false) && faction.getLandRounded() >= faction.getPowerRounded();
boolean raid = SavageFactions.plugin.getConfig().getBoolean("hcf.raidable", false) && faction.getLandRounded() >= faction.getPowerRounded();
return raid ? TL.RAIDABLE_TRUE.toString() : TL.RAIDABLE_FALSE.toString();
case "faction_home_world":
return faction.hasHome() ? faction.getHome().getWorld().getName() : "";

View File

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

View File

@@ -2,7 +2,7 @@ package com.massivecraft.factions.util;
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.P;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.struct.Role;
import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.ChatColor;
@@ -19,7 +19,7 @@ import java.util.logging.Level;
public class MiscUtil {
/// TODO create tag whitelist!!
public static HashSet<String> substanceChars = new HashSet<>(Arrays.asList("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"));
public static HashSet<String> substanceChars = new HashSet<>(Arrays.asList("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "SavageFactions", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "plugin", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"));
public static EntityType creatureTypeFromEntity(Entity entity) {
if (!(entity instanceof Creature)) {
@@ -67,16 +67,16 @@ public class MiscUtil {
ArrayList<String> errors = new ArrayList<>();
if (getComparisonString(str).length() < Conf.factionTagLengthMin) {
errors.add(P.p.txt.parse(TL.GENERIC_FACTIONTAG_TOOSHORT.toString(), Conf.factionTagLengthMin));
errors.add(SavageFactions.plugin.txt.parse(TL.GENERIC_FACTIONTAG_TOOSHORT.toString(), Conf.factionTagLengthMin));
}
if (str.length() > Conf.factionTagLengthMax) {
errors.add(P.p.txt.parse(TL.GENERIC_FACTIONTAG_TOOLONG.toString(), Conf.factionTagLengthMax));
errors.add(SavageFactions.plugin.txt.parse(TL.GENERIC_FACTIONTAG_TOOLONG.toString(), Conf.factionTagLengthMax));
}
for (char c : str.toCharArray()) {
if (!substanceChars.contains(String.valueOf(c))) {
errors.add(P.p.txt.parse(TL.GENERIC_FACTIONTAG_ALPHANUMERIC.toString(), c));
errors.add(SavageFactions.plugin.txt.parse(TL.GENERIC_FACTIONTAG_ALPHANUMERIC.toString(), c));
}
}
@@ -95,7 +95,7 @@ public class MiscUtil {
// Fix for some data being broken when we added the recruit rank.
if (player.getRole() == null) {
player.setRole(Role.NORMAL);
P.p.log(Level.WARNING, String.format("Player %s had null role. Setting them to normal. This isn't good D:", player.getName()));
SavageFactions.plugin.log(Level.WARNING, String.format("Player %s had null role. Setting them to normal. This isn't good D:", player.getName()));
}
switch (player.getRole()) {

View File

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

View File

@@ -1,6 +1,6 @@
package com.massivecraft.factions.util.Particles;
import com.massivecraft.factions.P;
import com.massivecraft.factions.SavageFactions;
import org.bukkit.Bukkit;
import org.bukkit.Color;
import org.bukkit.Location;
@@ -19,15 +19,15 @@ import java.util.Map.Entry;
/**
* <b>ParticleEffect Library</b>
* <p>
* <plugin>
* This library was created by @DarkBlade12 and allows you to display all Minecraft particle effects on a Bukkit server
* <p>
* <plugin>
* You are welcome to use it, modify it and redistribute it under the following conditions:
* <ul>
* <li>Don't claim this class as your own
* <li>Don't remove this disclaimer
* </ul>
* <p>
* <plugin>
* Special thanks:
* <ul>
* <li>@microgeek (original idea, names and packet parameters)
@@ -36,7 +36,7 @@ import java.util.Map.Entry;
* <li>@Cybermaxke (particle behavior)
* <li>@JamieSinn (hosting a jenkins server and documentation for particleeffect)
* </ul>
* <p>
* <plugin>
* <i>It would be nice if you provide credit to me if you use this class in a published project</i>
*
* @author DarkBlade12
@@ -454,7 +454,7 @@ public enum ParticleEffect {
*/
private static boolean isWater(Location location) {
Material material = location.getBlock().getType();
return material == Material.WATER || material == P.p.STATIONARY_WATER;
return material == Material.WATER || material == SavageFactions.plugin.STATIONARY_WATER;
}
/**
@@ -905,7 +905,7 @@ public enum ParticleEffect {
/**
* Represents the property of a particle effect
* <p>
* <plugin>
* This class is part of the <b>ParticleEffect Library</b> and follows the same usage conditions
*
* @author DarkBlade12
@@ -932,7 +932,7 @@ public enum ParticleEffect {
/**
* Represents the particle data for effects like {@link ParticleEffect#ITEM_CRACK}, {@link ParticleEffect#BLOCK_CRACK} and {@link ParticleEffect#BLOCK_DUST}
* <p>
* <plugin>
* This class is part of the <b>ParticleEffect Library</b> and follows the same usage conditions
*
* @author DarkBlade12
@@ -995,7 +995,7 @@ public enum ParticleEffect {
/**
* Represents the item data for the {@link ParticleEffect#ITEM_CRACK} effect
* <p>
* <plugin>
* This class is part of the <b>ParticleEffect Library</b> and follows the same usage conditions
*
* @author DarkBlade12
@@ -1016,7 +1016,7 @@ public enum ParticleEffect {
/**
* Represents the block data for the {@link ParticleEffect#BLOCK_CRACK} and {@link ParticleEffect#BLOCK_DUST} effects
* <p>
* <plugin>
* This class is part of the <b>ParticleEffect Library</b> and follows the same usage conditions
*
* @author DarkBlade12
@@ -1041,7 +1041,7 @@ public enum ParticleEffect {
/**
* Represents the color for effects like {@link ParticleEffect#SPELL_MOB}, {@link ParticleEffect#SPELL_MOB_AMBIENT}, {@link ParticleEffect#REDSTONE} and {@link ParticleEffect#NOTE}
* <p>
* <plugin>
* This class is part of the <b>ParticleEffect Library</b> and follows the same usage conditions
*
* @author DarkBlade12
@@ -1072,7 +1072,7 @@ public enum ParticleEffect {
/**
* Represents the color for effects like {@link ParticleEffect#SPELL_MOB}, {@link ParticleEffect#SPELL_MOB_AMBIENT} and {@link ParticleEffect#NOTE}
* <p>
* <plugin>
* This class is part of the <b>ParticleEffect Library</b> and follows the same usage conditions
*
* @author DarkBlade12
@@ -1184,7 +1184,7 @@ public enum ParticleEffect {
/**
* Represents the color for the {@link ParticleEffect#NOTE} effect
* <p>
* <plugin>
* This class is part of the <b>ParticleEffect Library</b> and follows the same usage conditions
*
* @author DarkBlade12
@@ -1243,7 +1243,7 @@ public enum ParticleEffect {
/**
* Represents a runtime exception that is thrown either if the displayed particle effect requires data and has none or vice-versa or if the data type is incorrect
* <p>
* <plugin>
* This class is part of the <b>ParticleEffect Library</b> and follows the same usage conditions
*
* @author DarkBlade12
@@ -1264,7 +1264,7 @@ public enum ParticleEffect {
/**
* Represents a runtime exception that is thrown either if the displayed particle effect is not colorable or if the particle color type is incorrect
* <p>
* <plugin>
* This class is part of the <b>ParticleEffect Library</b> and follows the same usage conditions
*
* @author DarkBlade12
@@ -1285,7 +1285,7 @@ public enum ParticleEffect {
/**
* Represents a runtime exception that is thrown if the displayed particle effect requires a newer version
* <p>
* <plugin>
* This class is part of the <b>ParticleEffect Library</b> and follows the same usage conditions
*
* @author DarkBlade12
@@ -1306,7 +1306,7 @@ public enum ParticleEffect {
/**
* Represents a particle effect packet with all attributes which is used for sending packets to the players
* <p>
* <plugin>
* This class is part of the <b>ParticleEffect Library</b> and follows the same usage conditions
*
* @author DarkBlade12
@@ -1392,7 +1392,7 @@ public enum ParticleEffect {
/**
* Initializes {@link #packetConstructor}, {@link #getHandle}, {@link #playerConnection} and {@link #sendPacket} and sets {@link #initialized} to <code>true</code> if it succeeds
* <p>
* <plugin>
* <b>Note:</b> These fields only have to be initialized once, so it will return if {@link #initialized} is already set to <code>true</code>
*
* @throws VersionIncompatibleException if your bukkit version is not supported by this library
@@ -1539,7 +1539,7 @@ public enum ParticleEffect {
/**
* Represents a runtime exception that is thrown if a bukkit version is not compatible with this library
* <p>
* <plugin>
* This class is part of the <b>ParticleEffect Library</b> and follows the same usage conditions
*
* @author DarkBlade12
@@ -1561,7 +1561,7 @@ public enum ParticleEffect {
/**
* Represents a runtime exception that is thrown if packet instantiation fails
* <p>
* <plugin>
* This class is part of the <b>ParticleEffect Library</b> and follows the same usage conditions
*
* @author DarkBlade12
@@ -1583,7 +1583,7 @@ public enum ParticleEffect {
/**
* Represents a runtime exception that is thrown if packet sending fails
* <p>
* <plugin>
* This class is part of the <b>ParticleEffect Library</b> and follows the same usage conditions
*
* @author DarkBlade12

View File

@@ -11,15 +11,15 @@ import java.util.Map;
/**
* <b>ReflectionUtils</b>
* <p>
* <plugin>
* This class provides useful methods which makes dealing with reflection much easier, especially when working with Bukkit
* <p>
* <plugin>
* You are welcome to use it, modify it and redistribute it under the following conditions:
* <ul>
* <li>Don't claim this class as your own
* <li>Don't remove this disclaimer
* </ul>
* <p>
* <plugin>
* <i>It would be nice if you provide credit to me if you use this class in a published project</i>
*
* @author DarkBlade12
@@ -346,7 +346,7 @@ public final class ReflectionUtils {
/**
* Represents an enumeration of dynamic packages of NMS and CraftBukkit
* <p>
* <plugin>
* This class is part of the <b>ReflectionUtils</b> and follows the same usage conditions
*
* @author DarkBlade12
@@ -381,7 +381,7 @@ public final class ReflectionUtils {
*
* @param path Path of the package
*/
private PackageType(String path) {
PackageType(String path) {
this.path = path;
}
@@ -391,7 +391,7 @@ public final class ReflectionUtils {
* @param parent Parent package of the package
* @param path Path of the package
*/
private PackageType(PackageType parent, String path) {
PackageType(PackageType parent, String path) {
this(parent + "." + path);
}
@@ -433,7 +433,7 @@ public final class ReflectionUtils {
/**
* Represents an enumeration of Java data types with corresponding classes
* <p>
* <plugin>
* This class is part of the <b>ReflectionUtils</b> and follows the same usage conditions
*
* @author DarkBlade12
@@ -468,7 +468,7 @@ public final class ReflectionUtils {
* @param primitive Primitive class of this data type
* @param reference Reference class of this data type
*/
private DataType(Class<?> primitive, Class<?> reference) {
DataType(Class<?> primitive, Class<?> reference) {
this.primitive = primitive;
this.reference = reference;
}
@@ -538,7 +538,7 @@ public final class ReflectionUtils {
/**
* Returns the primitive class array of the given object array
*
* @param object Given object array
* @param objects Given object array
* @return The primitive class array
*/
public static Class<?>[] getPrimitive(Object[] objects) {
@@ -553,7 +553,7 @@ public final class ReflectionUtils {
/**
* Returns the reference class array of the given object array
*
* @param object Given object array
* @param objects Given object array
* @return The reference class array
*/
public static Class<?>[] getReference(Object[] objects) {

View File

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

View File

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

View File

@@ -1,7 +1,7 @@
package com.massivecraft.factions.util;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.P;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.zcore.util.TL;
public class WarmUpUtil {
@@ -12,7 +12,7 @@ public class WarmUpUtil {
* @param action The action, inserted into the notification message.
* @param runnable The task to run after the delay. If the delay is 0, the task is instantly ran.
* @param delay The time used, in seconds, for the delay.
* <p/>
* <plugin/>
* note: for translations: %s = action, %d = delay
*/
public static void process(final FPlayer player, Warmup warmup, TL translationKey, String action, final Runnable runnable, long delay) {
@@ -21,7 +21,7 @@ public class WarmUpUtil {
player.msg(TL.WARMUPS_ALREADY);
} else {
player.msg(translationKey.format(action, delay));
int id = P.p.getServer().getScheduler().runTaskLater(P.p, new Runnable() {
int id = SavageFactions.plugin.getServer().getScheduler().runTaskLater(SavageFactions.plugin, new Runnable() {
@Override
public void run() {
player.stopWarmup();
@@ -36,7 +36,7 @@ public class WarmUpUtil {
}
public enum Warmup {
HOME, WARP, FLIGHT, BANNER, CHECKPOINT;
HOME, WARP, FLIGHT, BANNER, CHECKPOINT
}
}

View File

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

View File

@@ -2,7 +2,7 @@ package com.massivecraft.factions.zcore;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.Faction;
import com.massivecraft.factions.P;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.integration.Econ;
import com.massivecraft.factions.zcore.util.TL;
import com.massivecraft.factions.zcore.util.TextUtil;
@@ -223,7 +223,7 @@ public abstract class MCommand<T extends MPlugin> {
}
if (args.size() > 0) {
ret.append(p.txt.parseTags("<p> "));
ret.append(p.txt.parseTags("<plugin> "));
ret.append(TextUtil.implode(args, " "));
}
@@ -306,7 +306,7 @@ public abstract class MCommand<T extends MPlugin> {
s = s.replace("{power}", power);
}
if (s.contains("{group}")) {
String group = P.p.getPrimaryGroup(Bukkit.getOfflinePlayer(UUID.fromString(player.getId())));
String group = SavageFactions.plugin.getPrimaryGroup(Bukkit.getOfflinePlayer(UUID.fromString(player.getId())));
s = s.replace("{group}", group);
}
return s;

View File

@@ -218,7 +218,7 @@ public abstract class MPlugin extends JavaPlugin {
this.rawTags.put("b", "<rose>"); // bad
this.rawTags.put("h", "<pink>"); // highligh
this.rawTags.put("c", "<aqua>"); // command
this.rawTags.put("p", "<teal>"); // parameter
this.rawTags.put("plugin", "<teal>"); // parameter
}
public void initTXT() {
@@ -242,7 +242,7 @@ public abstract class MPlugin extends JavaPlugin {
// COMMAND HANDLING
// -------------------------------------------- //
// can be overridden by P method, to provide option
// can be overridden by SavageFactions method, to provide option
public boolean logPlayerCommands() {
return true;
}

View File

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

View File

@@ -1,7 +1,7 @@
package com.massivecraft.factions.zcore.fperms;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.P;
import com.massivecraft.factions.SavageFactions;
import org.bukkit.DyeColor;
import org.bukkit.Material;
import org.bukkit.configuration.ConfigurationSection;
@@ -80,11 +80,11 @@ public enum PermissableAction {
// Utility method to build items for F Perm GUI
public ItemStack buildItem(FPlayer fme, Permissable permissable) {
final ConfigurationSection section = P.p.getConfig().getConfigurationSection("fperm-gui.action");
final ConfigurationSection section = SavageFactions.plugin.getConfig().getConfigurationSection("fperm-gui.action");
if (section == null) {
P.p.log(Level.WARNING, "Attempted to build f perm GUI but config section not present.");
P.p.log(Level.WARNING, "Copy your config, allow the section to generate, then copy it back to your old config.");
SavageFactions.plugin.log(Level.WARNING, "Attempted to build f perm GUI but config section not present.");
SavageFactions.plugin.log(Level.WARNING, "Copy your config, allow the section to generate, then copy it back to your old config.");
return new ItemStack(Material.AIR);
}
@@ -96,7 +96,7 @@ public enum PermissableAction {
}
Material material = Material.matchMaterial(section.getString("materials." + name().toLowerCase().replace('_', '-')));
if (material == null) {
material = P.p.STAINED_CLAY;
material = SavageFactions.plugin.STAINED_CLAY;
}
Access access = fme.getFaction().getAccess(permissable, this);
@@ -120,7 +120,7 @@ public enum PermissableAction {
// If under the 1.13 version we will use the colorable option.
if (!P.p.mc113) {
if (! SavageFactions.plugin.mc113) {
DyeColor dyeColor = null;
try {
@@ -133,14 +133,14 @@ public enum PermissableAction {
}
} else {
// so this is in 1.13 mode, our config will automatically be updated to a material instead of color because of it being removed in the new api
item.setType(Material.valueOf(P.p.getConfig().getString("fperm-gui.action.access." + accessValue)));
item.setType(Material.valueOf(SavageFactions.plugin.getConfig().getString("fperm-gui.action.access." + accessValue)));
}
for (String loreLine : section.getStringList("placeholder-item.lore")) {
lore.add(replacePlaceholders(loreLine, fme, permissable));
}
if (!P.p.mc17) {
if (! SavageFactions.plugin.mc17) {
itemMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS, ItemFlag.HIDE_ATTRIBUTES);
}

View File

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

View File

@@ -1,7 +1,7 @@
package com.massivecraft.factions.zcore.fperms.gui;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.P;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.struct.Relation;
import com.massivecraft.factions.struct.Role;
import com.massivecraft.factions.util.FactionGUI;
@@ -35,13 +35,13 @@ public class PermissableRelationGUI implements InventoryHolder, FactionGUI {
public PermissableRelationGUI(FPlayer fme) {
this.fme = fme;
this.section = P.p.getConfig().getConfigurationSection("fperm-gui.relation");
this.section = SavageFactions.plugin.getConfig().getConfigurationSection("fperm-gui.relation");
}
public void build() {
if (section == null) {
P.p.log(Level.WARNING, "Attempted to build f perm GUI but config section not present.");
P.p.log(Level.WARNING, "Copy your config, allow the section to generate, then copy it back to your old config.");
SavageFactions.plugin.log(Level.WARNING, "Attempted to build f perm GUI but config section not present.");
SavageFactions.plugin.log(Level.WARNING, "Copy your config, allow the section to generate, then copy it back to your old config.");
return;
}
@@ -49,7 +49,7 @@ public class PermissableRelationGUI implements InventoryHolder, FactionGUI {
guiSize = section.getInt("rows", 3);
if (guiSize > 5) {
guiSize = 5;
P.p.log(Level.INFO, "Relation GUI size out of bounds, defaulting to 5");
SavageFactions.plugin.log(Level.INFO, "Relation GUI size out of bounds, defaulting to 5");
}
guiSize *= 9;
@@ -62,12 +62,12 @@ public class PermissableRelationGUI implements InventoryHolder, FactionGUI {
continue;
}
if (slot + 1 > guiSize && slot > 0) {
P.p.log(Level.WARNING, "Invalid slot of " + key.toUpperCase() + " in relation GUI skipping it");
SavageFactions.plugin.log(Level.WARNING, "Invalid slot of " + key.toUpperCase() + " in relation GUI skipping it");
continue;
}
if (getPermissable(key) == null) {
P.p.log(Level.WARNING, "Invalid permissable " + key.toUpperCase() + " skipping it");
SavageFactions.plugin.log(Level.WARNING, "Invalid permissable " + key.toUpperCase() + " skipping it");
continue;
}
@@ -112,7 +112,7 @@ public class PermissableRelationGUI implements InventoryHolder, FactionGUI {
ItemStack item = permissable.buildItem();
if (item == null) {
P.p.log(Level.WARNING, "Invalid material for " + permissable.toString().toUpperCase() + " skipping it");
SavageFactions.plugin.log(Level.WARNING, "Invalid material for " + permissable.toString().toUpperCase() + " skipping it");
continue;
}
@@ -122,8 +122,8 @@ public class PermissableRelationGUI implements InventoryHolder, FactionGUI {
private void buildDummyItems() {
if (section == null) {
P.p.log(Level.WARNING, "Attempted to build f perm GUI but config section not present.");
P.p.log(Level.WARNING, "Copy your config, allow the section to generate, then copy it back to your old config.");
SavageFactions.plugin.log(Level.WARNING, "Attempted to build f perm GUI but config section not present.");
SavageFactions.plugin.log(Level.WARNING, "Copy your config, allow the section to generate, then copy it back to your old config.");
return;
}
@@ -132,7 +132,7 @@ public class PermissableRelationGUI implements InventoryHolder, FactionGUI {
try {
dummyId = Integer.parseInt(key);
} catch (NumberFormatException exception) {
P.p.log(Level.WARNING, "Invalid dummy item id: " + key.toUpperCase());
SavageFactions.plugin.log(Level.WARNING, "Invalid dummy item id: " + key.toUpperCase());
continue;
}
@@ -142,7 +142,7 @@ public class PermissableRelationGUI implements InventoryHolder, FactionGUI {
}
ItemMeta meta = dummyItem.getItemMeta();
if (!P.p.mc17) {
if (! SavageFactions.plugin.mc17) {
meta.addItemFlags(ItemFlag.HIDE_ENCHANTS, ItemFlag.HIDE_ATTRIBUTES);
}
@@ -151,7 +151,7 @@ public class PermissableRelationGUI implements InventoryHolder, FactionGUI {
List<Integer> dummySlots = section.getIntegerList("dummy-items." + key);
for (Integer slot : dummySlots) {
if (slot + 1 > guiSize || slot < 0) {
P.p.log(Level.WARNING, "Invalid slot: " + slot + " for dummy item: " + key);
SavageFactions.plugin.log(Level.WARNING, "Invalid slot: " + slot + " for dummy item: " + key);
continue;
}
relationGUI.setItem(slot, dummyItem);
@@ -160,17 +160,17 @@ public class PermissableRelationGUI implements InventoryHolder, FactionGUI {
}
private ItemStack buildDummyItem(int id) {
final ConfigurationSection dummySection = P.p.getConfig().getConfigurationSection("fperm-gui.dummy-items." + id);
final ConfigurationSection dummySection = SavageFactions.plugin.getConfig().getConfigurationSection("fperm-gui.dummy-items." + id);
if (dummySection == null) {
P.p.log(Level.WARNING, "Attempted to build f perm GUI but config section not present.");
P.p.log(Level.WARNING, "Copy your config, allow the section to generate, then copy it back to your old config.");
SavageFactions.plugin.log(Level.WARNING, "Attempted to build f perm GUI but config section not present.");
SavageFactions.plugin.log(Level.WARNING, "Copy your config, allow the section to generate, then copy it back to your old config.");
return new ItemStack(Material.AIR);
}
Material material = Material.matchMaterial(dummySection.getString("material", ""));
if (material == null) {
P.p.log(Level.WARNING, "Invalid material for dummy item: " + id);
SavageFactions.plugin.log(Level.WARNING, "Invalid material for dummy item: " + id);
return null;
}
@@ -196,7 +196,7 @@ public class PermissableRelationGUI implements InventoryHolder, FactionGUI {
}
itemMeta.setLore(lore);
if (!P.p.mc17) {
if (! SavageFactions.plugin.mc17) {
itemMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS, ItemFlag.HIDE_ATTRIBUTES);
}

View File

@@ -19,21 +19,21 @@ public class CropUpgrades implements Listener {
int level = factionAtLoc.getUpgrade("Crop");
if (level != 0) {
if (level == 1) {
int chance = P.p.getConfig().getInt("fupgrades.MainMenu.Crops.Crop-Boost.level-1");
int chance = SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Crops.Crop-Boost.level-1");
int randomNum = ThreadLocalRandom.current().nextInt(1, 100 + 1);
if (randomNum <= chance) {
growCrop(e);
}
}
if (level == 2) {
int chance = P.p.getConfig().getInt("fupgrades.MainMenu.Crops.Crop-Boost.level-2");
int chance = SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Crops.Crop-Boost.level-2");
int randomNum = ThreadLocalRandom.current().nextInt(1, 100 + 1);
if (randomNum <= chance) {
growCrop(e);
}
}
if (level == 3) {
int chance = P.p.getConfig().getInt("fupgrades.MainMenu.Crops.Crop-Boost.level-3");
int chance = SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Crops.Crop-Boost.level-3");
int randomNum = ThreadLocalRandom.current().nextInt(1, 100 + 1);
if (randomNum <= chance) {
growCrop(e);
@@ -49,7 +49,7 @@ public class CropUpgrades implements Listener {
Material CROPS;
if (e.getBlock().getType().equals(P.p.CROPS)) {
if (e.getBlock().getType().equals(SavageFactions.plugin.CROPS)) {
e.setCancelled(true);
Crops c = new Crops(CropState.RIPE);
org.bukkit.block.BlockState bs = e.getBlock().getState();
@@ -59,13 +59,11 @@ public class CropUpgrades implements Listener {
org.bukkit.block.Block below = e.getBlock().getLocation().subtract(0, 1, 0).getBlock();
if (below.getType() == P.p.SUGAR_CANE_BLOCK) {
if (below.getType() == SavageFactions.plugin.SUGAR_CANE_BLOCK) {
org.bukkit.block.Block above = e.getBlock().getLocation().add(0, 1, 0).getBlock();
if (above.getType() == Material.AIR && above.getLocation().add(0, -2, 0).getBlock().getType() != Material.AIR) {
above.setType(P.p.SUGAR_CANE_BLOCK);
above.setType(SavageFactions.plugin.SUGAR_CANE_BLOCK);
}
}

View File

@@ -24,15 +24,15 @@ public class EXPUpgrade implements Listener {
int level = faction.getUpgrade("Exp");
if (level != 0) {
if (level == 1) {
double multiplier = P.p.getConfig().getDouble("fupgrades.MainMenu.EXP.EXP-Boost.level-1");
double multiplier = SavageFactions.plugin.getConfig().getDouble("fupgrades.MainMenu.EXP.EXP-Boost.level-1");
spawnMoreExp(e, multiplier);
}
if (level == 2) {
double multiplier = P.p.getConfig().getDouble("fupgrades.MainMenu.EXP.EXP-Boost.level-2");
double multiplier = SavageFactions.plugin.getConfig().getDouble("fupgrades.MainMenu.EXP.EXP-Boost.level-2");
spawnMoreExp(e, multiplier);
}
if (level == 3) {
double multiplier = P.p.getConfig().getDouble("fupgrades.MainMenu.EXP.EXP-Boost.level-3");
double multiplier = SavageFactions.plugin.getConfig().getDouble("fupgrades.MainMenu.EXP.EXP-Boost.level-3");
spawnMoreExp(e, multiplier);
}
}

View File

@@ -3,7 +3,7 @@ package com.massivecraft.factions.zcore.fupgrades;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.FPlayers;
import com.massivecraft.factions.Faction;
import com.massivecraft.factions.P;
import com.massivecraft.factions.SavageFactions;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.enchantments.Enchantment;
@@ -21,24 +21,24 @@ import java.util.List;
public class FUpgradesGUI implements Listener {
public void openMainMenu(FPlayer fme) {
Inventory inventory = Bukkit.createInventory(null, 27, P.p.color(P.p.getConfig().getString("fupgrades.MainMenu.Title").replace("{faction}", fme.getFaction().getTag())));
List<Integer> dummySlots = P.p.getConfig().getIntegerList("fupgrades.MainMenu.DummyItem.slots");
Material dummyMaterial = Material.getMaterial(P.p.getConfig().getString("fupgrades.MainMenu.DummyItem.Type"));
int dummyAmount = P.p.getConfig().getInt("fupgrades.MainMenu.DummyItem.Amount");
short dummyData = Short.parseShort(P.p.getConfig().getInt("fupgrades.MainMenu.DummyItem.Damage") + "");
ItemStack dummyItem = P.p.createItem(dummyMaterial,
Inventory inventory = Bukkit.createInventory(null, 27, SavageFactions.plugin.color(SavageFactions.plugin.getConfig().getString("fupgrades.MainMenu.Title").replace("{faction}", fme.getFaction().getTag())));
List<Integer> dummySlots = SavageFactions.plugin.getConfig().getIntegerList("fupgrades.MainMenu.DummyItem.slots");
Material dummyMaterial = Material.getMaterial(SavageFactions.plugin.getConfig().getString("fupgrades.MainMenu.DummyItem.Type"));
int dummyAmount = SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.DummyItem.Amount");
short dummyData = Short.parseShort(SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.DummyItem.Damage") + "");
ItemStack dummyItem = SavageFactions.plugin.createItem(dummyMaterial,
dummyAmount,
dummyData,
P.p.color(P.p.getConfig().getString("fupgrades.MainMenu.DummyItem.Name")),
P.p.colorList(P.p.getConfig().getStringList("fupgrades.MainMenu.DummyItem.Lore")));
SavageFactions.plugin.color(SavageFactions.plugin.getConfig().getString("fupgrades.MainMenu.DummyItem.Name")),
SavageFactions.plugin.colorList(SavageFactions.plugin.getConfig().getStringList("fupgrades.MainMenu.DummyItem.Lore")));
for (int i = 0; i <= dummySlots.size() - 1; i++) {
inventory.setItem(dummySlots.get(i), dummyItem);
}
ItemStack[] items = buildItems(fme);
List<Integer> cropSlots = P.p.getConfig().getIntegerList("fupgrades.MainMenu.Crops.CropItem.slots");
List<Integer> spawnerSlots = P.p.getConfig().getIntegerList("fupgrades.MainMenu.Spawners.SpawnerItem.slots");
List<Integer> expSlots = P.p.getConfig().getIntegerList("fupgrades.MainMenu.EXP.EXPItem.slots");
List<Integer> chestSlots = P.p.getConfig().getIntegerList("fupgrades.MainMenu.Chest.ChestItem.slots");
List<Integer> cropSlots = SavageFactions.plugin.getConfig().getIntegerList("fupgrades.MainMenu.Crops.CropItem.slots");
List<Integer> spawnerSlots = SavageFactions.plugin.getConfig().getIntegerList("fupgrades.MainMenu.Spawners.SpawnerItem.slots");
List<Integer> expSlots = SavageFactions.plugin.getConfig().getIntegerList("fupgrades.MainMenu.EXP.EXPItem.slots");
List<Integer> chestSlots = SavageFactions.plugin.getConfig().getIntegerList("fupgrades.MainMenu.Chest.ChestItem.slots");
for (int i = 0; i <= cropSlots.size() - 1; i++) {
inventory.setItem(cropSlots.get(i), items[2]);
}
@@ -66,7 +66,7 @@ public class FUpgradesGUI implements Listener {
return;
}
FPlayer fme = FPlayers.getInstance().getByPlayer((Player) e.getWhoClicked());
if (e.getClickedInventory().getTitle().equalsIgnoreCase(P.p.color(P.p.getConfig().getString("fupgrades.MainMenu.Title").replace("{faction}", fme.getFaction().getTag())))) {
if (e.getClickedInventory().getTitle().equalsIgnoreCase(SavageFactions.plugin.color(SavageFactions.plugin.getConfig().getString("fupgrades.MainMenu.Title").replace("{faction}", fme.getFaction().getTag())))) {
e.setCancelled(true);
ItemStack[] items = buildItems(fme);
ItemStack cropItem = items[2];
@@ -79,7 +79,7 @@ public class FUpgradesGUI implements Listener {
return;
}
if (cropLevel == 2) {
int cost = P.p.getConfig().getInt("fupgrades.MainMenu.Crops.Cost.level-3");
int cost = SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Crops.Cost.level-3");
if (hasMoney(fme, cost)) {
fme.getFaction().setUpgrades("Crop", 3);
@@ -89,7 +89,7 @@ public class FUpgradesGUI implements Listener {
}
if (cropLevel == 1) {
int cost = P.p.getConfig().getInt("fupgrades.MainMenu.Crops.Cost.level-2");
int cost = SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Crops.Cost.level-2");
if (hasMoney(fme, cost)) {
takeMoney(fme, cost);
fme.getFaction().setUpgrades("Crop", 2);
@@ -98,7 +98,7 @@ public class FUpgradesGUI implements Listener {
}
if (cropLevel == 0) {
int cost = P.p.getConfig().getInt("fupgrades.MainMenu.Crops.Cost.level-1");
int cost = SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Crops.Cost.level-1");
if (hasMoney(fme, cost)) {
takeMoney(fme, cost);
fme.getFaction().setUpgrades("Crop", 1);
@@ -113,7 +113,7 @@ public class FUpgradesGUI implements Listener {
return;
}
if (spawnerLevel == 2) {
int cost = P.p.getConfig().getInt("fupgrades.MainMenu.Spawners.Cost.level-3");
int cost = SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Spawners.Cost.level-3");
if (!hasMoney(fme, cost)) {
return;
}
@@ -122,7 +122,7 @@ public class FUpgradesGUI implements Listener {
fme.getPlayer().closeInventory();
}
if (spawnerLevel == 1) {
int cost = P.p.getConfig().getInt("fupgrades.MainMenu.Spawners.Cost.level-2");
int cost = SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Spawners.Cost.level-2");
if (!hasMoney(fme, cost)) {
return;
}
@@ -131,7 +131,7 @@ public class FUpgradesGUI implements Listener {
fme.getPlayer().closeInventory();
}
if (spawnerLevel == 0) {
int cost = P.p.getConfig().getInt("fupgrades.MainMenu.Spawners.Cost.level-1");
int cost = SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Spawners.Cost.level-1");
if (!hasMoney(fme, cost)) {
return;
}
@@ -146,7 +146,7 @@ public class FUpgradesGUI implements Listener {
return;
}
if (expLevel == 2) {
int cost = P.p.getConfig().getInt("fupgrades.MainMenu.EXP.Cost.level-3");
int cost = SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.EXP.Cost.level-3");
if (!hasMoney(fme, cost)) {
return;
}
@@ -155,7 +155,7 @@ public class FUpgradesGUI implements Listener {
fme.getPlayer().closeInventory();
}
if (expLevel == 1) {
int cost = P.p.getConfig().getInt("fupgrades.MainMenu.EXP.Cost.level-2");
int cost = SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.EXP.Cost.level-2");
if (!hasMoney(fme, cost)) {
return;
}
@@ -164,7 +164,7 @@ public class FUpgradesGUI implements Listener {
fme.getPlayer().closeInventory();
}
if (expLevel == 0) {
int cost = P.p.getConfig().getInt("fupgrades.MainMenu.EXP.Cost.level-1");
int cost = SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.EXP.Cost.level-1");
if (!hasMoney(fme, cost)) {
return;
}
@@ -179,7 +179,7 @@ public class FUpgradesGUI implements Listener {
return;
}
if (chestLevel == 2) {
int cost = P.p.getConfig().getInt("fupgrades.MainMenu.Chest.Cost.level-3");
int cost = SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Chest.Cost.level-3");
if (!hasMoney(fme, cost)) {
return;
}
@@ -189,7 +189,7 @@ public class FUpgradesGUI implements Listener {
fme.getPlayer().closeInventory();
}
if (chestLevel == 1) {
int cost = P.p.getConfig().getInt("fupgrades.MainMenu.Chest.Cost.level-2");
int cost = SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Chest.Cost.level-2");
if (!hasMoney(fme, cost)) {
return;
}
@@ -199,7 +199,7 @@ public class FUpgradesGUI implements Listener {
fme.getPlayer().closeInventory();
}
if (chestLevel == 0) {
int cost = P.p.getConfig().getInt("fupgrades.MainMenu.Chest.Cost.level-1");
int cost = SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Chest.Cost.level-1");
if (!hasMoney(fme, cost)) {
return;
}
@@ -219,7 +219,7 @@ public class FUpgradesGUI implements Listener {
if (player.getInventory().getTitle() == null) {
return;
}
String invName = P.p.color(P.p.getConfig().getString("fchest.Inventory-Title"));
String invName = SavageFactions.plugin.color(SavageFactions.plugin.getConfig().getString("fchest.Inventory-Title"));
if (player.getInventory().getTitle().equalsIgnoreCase(invName)) {
player.closeInventory();
}
@@ -228,11 +228,11 @@ public class FUpgradesGUI implements Listener {
int level = faction.getUpgrade("Chest");
int size = 9;
if (level == 1) {
size = P.p.getConfig().getInt("fupgrades.MainMenu.Chest.Chest-Size.level-1") * 9;
size = SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Chest.Chest-Size.level-1") * 9;
} else if (level == 2) {
size = P.p.getConfig().getInt("fupgrades.MainMenu.Chest.Chest-Size.level-2") * 9;
size = SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Chest.Chest-Size.level-2") * 9;
} else if (level == 3) {
size = P.p.getConfig().getInt("fupgrades.MainMenu.Chest.Chest-Size.level-3") * 9;
size = SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Chest.Chest-Size.level-3") * 9;
}
faction.setChestSize(size);
@@ -240,34 +240,34 @@ public class FUpgradesGUI implements Listener {
}
private ItemStack[] buildItems(FPlayer fme) {
Material expMaterial = Material.getMaterial(P.p.getConfig().getString("fupgrades.MainMenu.EXP.EXPItem.Type"));
int expAmt = P.p.getConfig().getInt("fupgrades.MainMenu.EXP.EXPItem.Amount");
short expData = Short.parseShort(P.p.getConfig().getInt("fupgrades.MainMenu.EXP.EXPItem.Damage") + "");
String expName = P.p.color(P.p.getConfig().getString("fupgrades.MainMenu.EXP.EXPItem.Name"));
List<String> expLore = P.p.colorList(P.p.getConfig().getStringList("fupgrades.MainMenu.EXP.EXPItem.Lore"));
Material expMaterial = Material.getMaterial(SavageFactions.plugin.getConfig().getString("fupgrades.MainMenu.EXP.EXPItem.Type"));
int expAmt = SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.EXP.EXPItem.Amount");
short expData = Short.parseShort(SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.EXP.EXPItem.Damage") + "");
String expName = SavageFactions.plugin.color(SavageFactions.plugin.getConfig().getString("fupgrades.MainMenu.EXP.EXPItem.Name"));
List<String> expLore = SavageFactions.plugin.colorList(SavageFactions.plugin.getConfig().getStringList("fupgrades.MainMenu.EXP.EXPItem.Lore"));
int expLevel = fme.getFaction().getUpgrade("Exp");
for (int i = 0; i <= expLore.size() - 1; i++) {
expLore.set(i, expLore.get(i).replace("{level}", expLevel + ""));
}
ItemStack expItem = P.p.createItem(expMaterial, expAmt, expData, expName, expLore);
ItemStack expItem = SavageFactions.plugin.createItem(expMaterial, expAmt, expData, expName, expLore);
if (expLevel >= 1) {
ItemMeta itemMeta = expItem.getItemMeta();
if (!P.p.mc17) {
if (! SavageFactions.plugin.mc17) {
itemMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
}
itemMeta.addEnchant(Enchantment.DURABILITY, 3, true);
expItem.setItemMeta(itemMeta);
}
Material spawnerMaterial = Material.getMaterial(P.p.getConfig().getString("fupgrades.MainMenu.Spawners.SpawnerItem.Type"));
int spawnerAmt = P.p.getConfig().getInt("fupgrades.MainMenu.Spawners.SpawnerItem.Amount");
short spawnerData = Short.parseShort(P.p.getConfig().getInt("fupgrades.MainMenu.Spawners.SpawnerItem.Damage") + "");
String spawnerName = P.p.color(P.p.getConfig().getString("fupgrades.MainMenu.Spawners.SpawnerItem.Name"));
List<String> spawnerLore = P.p.colorList(P.p.getConfig().getStringList("fupgrades.MainMenu.Spawners.SpawnerItem.Lore"));
Material spawnerMaterial = Material.getMaterial(SavageFactions.plugin.getConfig().getString("fupgrades.MainMenu.Spawners.SpawnerItem.Type"));
int spawnerAmt = SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Spawners.SpawnerItem.Amount");
short spawnerData = Short.parseShort(SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Spawners.SpawnerItem.Damage") + "");
String spawnerName = SavageFactions.plugin.color(SavageFactions.plugin.getConfig().getString("fupgrades.MainMenu.Spawners.SpawnerItem.Name"));
List<String> spawnerLore = SavageFactions.plugin.colorList(SavageFactions.plugin.getConfig().getStringList("fupgrades.MainMenu.Spawners.SpawnerItem.Lore"));
List<Integer> spawnerSlots = P.p.getConfig().getIntegerList("fupgrades.MainMenu.Spawners.SpawnerItem.slots");
List<Integer> spawnerSlots = SavageFactions.plugin.getConfig().getIntegerList("fupgrades.MainMenu.Spawners.SpawnerItem.slots");
int spawnerLevel = fme.getFaction().getUpgrade("Spawner");
for (int i = 0; i <= spawnerLore.size() - 1; i++) {
@@ -278,11 +278,11 @@ public class FUpgradesGUI implements Listener {
} else if (expLevel == 3) {
expItem.setAmount(3);
}
Material cropMaterial = Material.getMaterial(P.p.getConfig().getString("fupgrades.MainMenu.Crops.CropItem.Type"));
int cropAmt = P.p.getConfig().getInt("fupgrades.MainMenu.Crops.CropItem.Amount");
short cropData = Short.parseShort(P.p.getConfig().getInt("fupgrades.MainMenu.Crops.CropItem.Damage") + "");
String cropName = P.p.color(P.p.getConfig().getString("fupgrades.MainMenu.Crops.CropItem.Name"));
List<String> cropLore = P.p.colorList(P.p.getConfig().getStringList("fupgrades.MainMenu.Crops.CropItem.Lore"));
Material cropMaterial = Material.getMaterial(SavageFactions.plugin.getConfig().getString("fupgrades.MainMenu.Crops.CropItem.Type"));
int cropAmt = SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Crops.CropItem.Amount");
short cropData = Short.parseShort(SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Crops.CropItem.Damage") + "");
String cropName = SavageFactions.plugin.color(SavageFactions.plugin.getConfig().getString("fupgrades.MainMenu.Crops.CropItem.Name"));
List<String> cropLore = SavageFactions.plugin.colorList(SavageFactions.plugin.getConfig().getStringList("fupgrades.MainMenu.Crops.CropItem.Lore"));
int cropLevel = fme.getFaction().getUpgrade("Crop");
for (int i = 0; i <= cropLore.size() - 1; i++) {
String line = cropLore.get(i);
@@ -290,11 +290,11 @@ public class FUpgradesGUI implements Listener {
cropLore.set(i, line);
}
ItemStack cropItem = P.p.createItem(cropMaterial, cropAmt, cropData, cropName, cropLore);
ItemStack cropItem = SavageFactions.plugin.createItem(cropMaterial, cropAmt, cropData, cropName, cropLore);
cropItem.getItemMeta().setLore(cropLore);
if (cropLevel >= 1) {
ItemMeta itemMeta = cropItem.getItemMeta();
if (!P.p.mc17) {
if (! SavageFactions.plugin.mc17) {
itemMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
}
itemMeta.addEnchant(Enchantment.DURABILITY, 3, true);
@@ -305,11 +305,11 @@ public class FUpgradesGUI implements Listener {
} else if (cropLevel == 3) {
cropItem.setAmount(3);
}
ItemStack spawnerItem = P.p.createItem(spawnerMaterial, spawnerAmt, spawnerData, spawnerName, spawnerLore);
ItemStack spawnerItem = SavageFactions.plugin.createItem(spawnerMaterial, spawnerAmt, spawnerData, spawnerName, spawnerLore);
spawnerItem.getItemMeta().setLore(spawnerLore);
if (spawnerLevel >= 1) {
ItemMeta itemMeta = spawnerItem.getItemMeta();
if (!P.p.mc17) {
if (! SavageFactions.plugin.mc17) {
itemMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
}
itemMeta.addEnchant(Enchantment.DURABILITY, 3, true);
@@ -320,11 +320,11 @@ public class FUpgradesGUI implements Listener {
} else if (spawnerLevel == 3) {
spawnerItem.setAmount(3);
}
Material chestMaterial = Material.getMaterial(P.p.getConfig().getString("fupgrades.MainMenu.Chest.ChestItem.Type"));
int chesttAmt = P.p.getConfig().getInt("fupgrades.MainMenu.Chest.ChestItem.Amount");
short chestData = Short.parseShort(P.p.getConfig().getInt("fupgrades.MainMenu.Chest.ChestItem.Damage") + "");
String chestName = P.p.color(P.p.getConfig().getString("fupgrades.MainMenu.Chest.ChestItem.Name", "&e&lUpgrade Chest Size"));
List<String> chestLore = P.p.colorList(P.p.getConfig().getStringList("fupgrades.MainMenu.Chest.ChestItem.Lore"));
Material chestMaterial = Material.getMaterial(SavageFactions.plugin.getConfig().getString("fupgrades.MainMenu.Chest.ChestItem.Type"));
int chesttAmt = SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Chest.ChestItem.Amount");
short chestData = Short.parseShort(SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Chest.ChestItem.Damage") + "");
String chestName = SavageFactions.plugin.color(SavageFactions.plugin.getConfig().getString("fupgrades.MainMenu.Chest.ChestItem.Name", "&e&lUpgrade Chest Size"));
List<String> chestLore = SavageFactions.plugin.colorList(SavageFactions.plugin.getConfig().getStringList("fupgrades.MainMenu.Chest.ChestItem.Lore"));
int chestlevel = fme.getFaction().getUpgrade("Chest");
for (int i = 0; i <= chestLore.size() - 1; i++) {
String line = chestLore.get(i);
@@ -333,11 +333,11 @@ public class FUpgradesGUI implements Listener {
}
ItemStack chestItem = P.p.createItem(chestMaterial, chesttAmt, chestData, chestName, chestLore);
ItemStack chestItem = SavageFactions.plugin.createItem(chestMaterial, chesttAmt, chestData, chestName, chestLore);
if (chestlevel >= 1) {
ItemMeta itemMeta = chestItem.getItemMeta();
if (!P.p.mc17) {
if (! SavageFactions.plugin.mc17) {
itemMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
}
itemMeta.addEnchant(Enchantment.DURABILITY, 3, true);

View File

@@ -14,15 +14,15 @@ public class SpawnerUpgrades implements Listener {
int level = factionAtLoc.getUpgrade("Spawner");
if (level != 0) {
if (level == 1) {
int rate = P.p.getConfig().getInt("fupgrades.MainMenu.Spawners.Spawner-Boost.level-1");
int rate = SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Spawners.Spawner-Boost.level-1");
lowerSpawnerDelay(e, rate);
}
if (level == 2) {
int rate = P.p.getConfig().getInt("fupgrades.MainMenu.Spawners.Spawner-Boost.level-2");
int rate = SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Spawners.Spawner-Boost.level-2");
lowerSpawnerDelay(e, rate);
}
if (level == 3) {
int rate = P.p.getConfig().getInt("fupgrades.MainMenu.Spawners.Spawner-Boost.level-3");
int rate = SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Spawners.Spawner-Boost.level-3");
lowerSpawnerDelay(e, rate);
}

View File

@@ -158,7 +158,7 @@ public abstract class MemoryBoard extends Board {
while (iter.hasNext()) {
Entry<FLocation, String> entry = iter.next();
if (!Factions.getInstance().isValidFactionId(entry.getValue())) {
P.p.log("Board cleaner removed " + entry.getValue() + " from " + entry.getKey());
SavageFactions.plugin.log("Board cleaner removed " + entry.getValue() + " from " + entry.getKey());
iter.remove();
}
}
@@ -200,12 +200,12 @@ public abstract class MemoryBoard extends Board {
Faction faction = fplayer.getFaction();
ArrayList<FancyMessage> ret = new ArrayList<>();
Faction factionLoc = getFactionAt(flocation);
ret.add(new FancyMessage(ChatColor.DARK_GRAY + P.p.txt.titleize("(" + flocation.getCoordString() + ") " + factionLoc.getTag(fplayer))));
int buffer = P.p.getConfig().getInt("world-border.buffer", 0);
ret.add(new FancyMessage(ChatColor.DARK_GRAY + SavageFactions.plugin.txt.titleize("(" + flocation.getCoordString() + ") " + factionLoc.getTag(fplayer))));
int buffer = SavageFactions.plugin.getConfig().getInt("world-border.buffer", 0);
// Get the compass
ArrayList<String> asciiCompass = AsciiCompass.getAsciiCompass(inDegrees, ChatColor.DARK_GREEN, P.p.txt.parse("<gray>"));
ArrayList<String> asciiCompass = AsciiCompass.getAsciiCompass(inDegrees, ChatColor.DARK_GREEN, SavageFactions.plugin.txt.parse("<gray>"));
int halfWidth = Conf.mapWidth / 2;
// Use player's value for height
@@ -291,16 +291,16 @@ public abstract class MemoryBoard extends Board {
private List<String> getToolTip(Faction faction, FPlayer to) {
List<String> ret = new ArrayList<>();
List<String> show = P.p.getConfig().getStringList("map");
List<String> show = SavageFactions.plugin.getConfig().getStringList("map");
if (!faction.isNormal()) {
String tag = faction.getTag(to);
// send header and that's all
String header = show.get(0);
if (TagReplacer.HEADER.contains(header)) {
ret.add(P.p.txt.titleize(tag));
ret.add(SavageFactions.plugin.txt.titleize(tag));
} else {
ret.add(P.p.txt.parse(TagReplacer.FACTION.replace(header, tag)));
ret.add(SavageFactions.plugin.txt.parse(TagReplacer.FACTION.replace(header, tag)));
}
return ret; // we only show header for non-normal factions
}
@@ -320,7 +320,7 @@ public abstract class MemoryBoard extends Board {
List<FancyMessage> fancy = TagUtil.parseFancy(faction, to, parsed);
if (fancy != null) {
for (FancyMessage msg : fancy) {
ret.add((P.p.txt.parse(msg.toOldMessageFormat())));
ret.add((SavageFactions.plugin.txt.parse(msg.toOldMessageFormat())));
}
}
continue;
@@ -334,7 +334,7 @@ public abstract class MemoryBoard extends Board {
if (parsed.contains("%")) {
parsed = parsed.replaceAll("%", ""); // Just in case it got in there before we disallowed it.
}
ret.add(P.p.txt.parse(parsed));
ret.add(SavageFactions.plugin.txt.parse(parsed));
}
}

View File

@@ -38,9 +38,9 @@ import java.util.UUID;
* Logged in players always have exactly one FPlayer instance. Logged out players may or may not have an FPlayer
* instance. They will always have one if they are part of a faction. This is because only players with a faction are
* saved to disk (in order to not waste disk space).
* <p/>
* <plugin/>
* The FPlayer is linked to a minecraft player using the player name.
* <p/>
* <plugin/>
* The same instance is always returned for the same player. This means you can use the == operator. No .equals method
* necessary.
*/
@@ -105,7 +105,7 @@ public abstract class MemoryFPlayer implements FPlayer {
this.autoWarZoneEnabled = false;
this.loginPvpDisabled = Conf.noPVPDamageToOthersForXSecondsAfterLogin > 0;
this.powerBoost = 0.0;
this.showScoreboard = P.p.getConfig().getBoolean("scoreboard.default-enabled", false);
this.showScoreboard = SavageFactions.plugin.getConfig().getBoolean("scoreboard.default-enabled", false);
this.kills = 0;
this.deaths = 0;
this.mapHeight = Conf.mapHeight;
@@ -132,7 +132,7 @@ public abstract class MemoryFPlayer implements FPlayer {
this.spyingChat = other.spyingChat;
this.lastStoodAt = other.lastStoodAt;
this.isAdminBypassing = other.isAdminBypassing;
this.showScoreboard = P.p.getConfig().getBoolean("scoreboard.default-enabled", true);
this.showScoreboard = SavageFactions.plugin.getConfig().getBoolean("scoreboard.default-enabled", true);
this.kills = other.kills;
this.deaths = other.deaths;
this.mapHeight = Conf.mapHeight;
@@ -207,7 +207,7 @@ public abstract class MemoryFPlayer implements FPlayer {
public void setAutoLeave(boolean willLeave) {
this.willAutoLeave = willLeave;
P.p.debug(name + " set autoLeave to " + willLeave);
SavageFactions.plugin.debug(name + " set autoLeave to " + willLeave);
}
public long getLastFrostwalkerMessage() {
@@ -611,10 +611,10 @@ public abstract class MemoryFPlayer implements FPlayer {
boolean showChat = true;
if (showInfoBoard(toShow)) {
FScoreboard.get(this).setTemporarySidebar(new FInfoSidebar(toShow));
showChat = P.p.getConfig().getBoolean("scoreboard.also-send-chat", true);
showChat = SavageFactions.plugin.getConfig().getBoolean("scoreboard.also-send-chat", true);
}
if (showChat) {
this.sendMessage(P.p.txt.parse(TL.FACTION_LEAVE.format(from.getTag(this), toShow.getTag(this))));
this.sendMessage(SavageFactions.plugin.txt.parse(TL.FACTION_LEAVE.format(from.getTag(this), toShow.getTag(this))));
}
}
@@ -629,7 +629,7 @@ public abstract class MemoryFPlayer implements FPlayer {
* @return true if should show, otherwise false.
*/
public boolean showInfoBoard(Faction toShow) {
return showScoreboard && !toShow.isWarZone() && !toShow.isWilderness() && !toShow.isSafeZone() && P.p.getConfig().contains("scoreboard.finfo") && P.p.getConfig().getBoolean("scoreboard.finfo-enabled", false) && FScoreboard.get(this) != null;
return showScoreboard && ! toShow.isWarZone() && ! toShow.isWilderness() && ! toShow.isSafeZone() && SavageFactions.plugin.getConfig().contains("scoreboard.finfo") && SavageFactions.plugin.getConfig().getBoolean("scoreboard.finfo-enabled", false) && FScoreboard.get(this) != null;
}
@Override
@@ -693,7 +693,7 @@ public abstract class MemoryFPlayer implements FPlayer {
}
if (Conf.logFactionLeave) {
P.p.log(TL.LEAVE_LEFT.format(this.getName(), myFaction.getTag()));
SavageFactions.plugin.log(TL.LEAVE_LEFT.format(this.getName(), myFaction.getTag()));
}
}
@@ -708,7 +708,7 @@ public abstract class MemoryFPlayer implements FPlayer {
Factions.getInstance().removeFaction(myFaction.getId());
if (Conf.logFactionDisband) {
P.p.log(TL.LEAVE_DISBANDEDLOG.format(myFaction.getTag(), myFaction.getId(), this.getName()));
SavageFactions.plugin.log(TL.LEAVE_DISBANDEDLOG.format(myFaction.getTag(), myFaction.getId(), this.getName()));
}
}
}
@@ -726,16 +726,16 @@ public abstract class MemoryFPlayer implements FPlayer {
Faction myFaction = getFaction();
Faction currentFaction = Board.getInstance().getFactionAt(flocation);
int ownedLand = forFaction.getLandRounded();
int factionBuffer = P.p.getConfig().getInt("hcf.buffer-zone", 0);
int worldBuffer = P.p.getConfig().getInt("world-border.buffer", 0);
int factionBuffer = SavageFactions.plugin.getConfig().getInt("hcf.buffer-zone", 0);
int worldBuffer = SavageFactions.plugin.getConfig().getInt("world-border.buffer", 0);
if (Conf.worldGuardChecking && Worldguard.checkForRegionsInChunk(flocation)) {
// Checks for WorldGuard regions in the chunk attempting to be claimed
error = P.p.txt.parse(TL.CLAIM_PROTECTED.toString());
} else if (flocation.isOutsideWorldBorder(P.p.getConfig().getInt("world-border.buffer", 0))) {
error = P.p.txt.parse(TL.CLAIM_OUTSIDEWORLDBORDER.toString());
error = SavageFactions.plugin.txt.parse(TL.CLAIM_PROTECTED.toString());
} else if (flocation.isOutsideWorldBorder(SavageFactions.plugin.getConfig().getInt("world-border.buffer", 0))) {
error = SavageFactions.plugin.txt.parse(TL.CLAIM_OUTSIDEWORLDBORDER.toString());
} else if (Conf.worldsNoClaiming.contains(flocation.getWorldName())) {
error = P.p.txt.parse(TL.CLAIM_DISABLED.toString());
error = SavageFactions.plugin.txt.parse(TL.CLAIM_DISABLED.toString());
} else if (this.isAdminBypassing()) {
return true;
} else if (forFaction.isSafeZone() && Permission.MANAGE_SAFE_ZONE.has(getPlayer())) {
@@ -745,50 +745,50 @@ public abstract class MemoryFPlayer implements FPlayer {
} else if (currentFaction.getAccess(this, PermissableAction.TERRITORY) == Access.ALLOW) {
return true;
} else if (myFaction != forFaction) {
error = P.p.txt.parse(TL.CLAIM_CANTCLAIM.toString(), forFaction.describeTo(this));
error = SavageFactions.plugin.txt.parse(TL.CLAIM_CANTCLAIM.toString(), forFaction.describeTo(this));
} else if (forFaction == currentFaction) {
error = P.p.txt.parse(TL.CLAIM_ALREADYOWN.toString(), forFaction.describeTo(this, true));
error = SavageFactions.plugin.txt.parse(TL.CLAIM_ALREADYOWN.toString(), forFaction.describeTo(this, true));
} else if (this.getRole().value < Role.MODERATOR.value) {
error = P.p.txt.parse(TL.CLAIM_MUSTBE.toString(), Role.MODERATOR.getTranslation());
error = SavageFactions.plugin.txt.parse(TL.CLAIM_MUSTBE.toString(), Role.MODERATOR.getTranslation());
} else if (forFaction.getFPlayers().size() < Conf.claimsRequireMinFactionMembers) {
error = P.p.txt.parse(TL.CLAIM_MEMBERS.toString(), Conf.claimsRequireMinFactionMembers);
error = SavageFactions.plugin.txt.parse(TL.CLAIM_MEMBERS.toString(), Conf.claimsRequireMinFactionMembers);
} else if (currentFaction.isSafeZone()) {
error = P.p.txt.parse(TL.CLAIM_SAFEZONE.toString());
error = SavageFactions.plugin.txt.parse(TL.CLAIM_SAFEZONE.toString());
} else if (currentFaction.isWarZone()) {
error = P.p.txt.parse(TL.CLAIM_WARZONE.toString());
} else if (P.p.getConfig().getBoolean("hcf.allow-overclaim", true) && ownedLand >= forFaction.getPowerRounded()) {
error = P.p.txt.parse(TL.CLAIM_POWER.toString());
error = SavageFactions.plugin.txt.parse(TL.CLAIM_WARZONE.toString());
} else if (SavageFactions.plugin.getConfig().getBoolean("hcf.allow-overclaim", true) && ownedLand >= forFaction.getPowerRounded()) {
error = SavageFactions.plugin.txt.parse(TL.CLAIM_POWER.toString());
} else if (Conf.claimedLandsMax != 0 && ownedLand >= Conf.claimedLandsMax && forFaction.isNormal()) {
error = P.p.txt.parse(TL.CLAIM_LIMIT.toString());
error = SavageFactions.plugin.txt.parse(TL.CLAIM_LIMIT.toString());
} else if (currentFaction.getRelationTo(forFaction) == Relation.ALLY) {
error = P.p.txt.parse(TL.CLAIM_ALLY.toString());
error = SavageFactions.plugin.txt.parse(TL.CLAIM_ALLY.toString());
} else if (Conf.claimsMustBeConnected && !this.isAdminBypassing() && myFaction.getLandRoundedInWorld(flocation.getWorldName()) > 0 && !Board.getInstance().isConnectedLocation(flocation, myFaction) && (!Conf.claimsCanBeUnconnectedIfOwnedByOtherFaction || !currentFaction.isNormal())) {
if (Conf.claimsCanBeUnconnectedIfOwnedByOtherFaction) {
error = P.p.txt.parse(TL.CLAIM_CONTIGIOUS.toString());
error = SavageFactions.plugin.txt.parse(TL.CLAIM_CONTIGIOUS.toString());
} else {
error = P.p.txt.parse(TL.CLAIM_FACTIONCONTIGUOUS.toString());
error = SavageFactions.plugin.txt.parse(TL.CLAIM_FACTIONCONTIGUOUS.toString());
}
} else if (factionBuffer > 0 && Board.getInstance().hasFactionWithin(flocation, myFaction, factionBuffer)) {
error = P.p.txt.parse(TL.CLAIM_TOOCLOSETOOTHERFACTION.format(factionBuffer));
error = SavageFactions.plugin.txt.parse(TL.CLAIM_TOOCLOSETOOTHERFACTION.format(factionBuffer));
} else if (flocation.isOutsideWorldBorder(worldBuffer)) {
if (worldBuffer > 0) {
error = P.p.txt.parse(TL.CLAIM_OUTSIDEBORDERBUFFER.format(worldBuffer));
error = SavageFactions.plugin.txt.parse(TL.CLAIM_OUTSIDEBORDERBUFFER.format(worldBuffer));
} else {
error = P.p.txt.parse(TL.CLAIM_OUTSIDEWORLDBORDER.toString());
error = SavageFactions.plugin.txt.parse(TL.CLAIM_OUTSIDEWORLDBORDER.toString());
}
} else if (currentFaction.isNormal()) {
if (myFaction.isPeaceful()) {
error = P.p.txt.parse(TL.CLAIM_PEACEFUL.toString(), currentFaction.getTag(this));
error = SavageFactions.plugin.txt.parse(TL.CLAIM_PEACEFUL.toString(), currentFaction.getTag(this));
} else if (currentFaction.isPeaceful()) {
error = P.p.txt.parse(TL.CLAIM_PEACEFULTARGET.toString(), currentFaction.getTag(this));
error = SavageFactions.plugin.txt.parse(TL.CLAIM_PEACEFULTARGET.toString(), currentFaction.getTag(this));
} else if (!currentFaction.hasLandInflation()) {
// TODO more messages WARN current faction most importantly
error = P.p.txt.parse(TL.CLAIM_THISISSPARTA.toString(), currentFaction.getTag(this));
} else if (currentFaction.hasLandInflation() && !P.p.getConfig().getBoolean("hcf.allow-overclaim", true)) {
error = SavageFactions.plugin.txt.parse(TL.CLAIM_THISISSPARTA.toString(), currentFaction.getTag(this));
} else if (currentFaction.hasLandInflation() && ! SavageFactions.plugin.getConfig().getBoolean("hcf.allow-overclaim", true)) {
// deny over claim when it normally would be allowed.
error = P.p.txt.parse(TL.CLAIM_OVERCLAIM_DISABLED.toString());
error = SavageFactions.plugin.txt.parse(TL.CLAIM_OVERCLAIM_DISABLED.toString());
} else if (!Board.getInstance().isBorderLocation(flocation)) {
error = P.p.txt.parse(TL.CLAIM_BORDER.toString());
error = SavageFactions.plugin.txt.parse(TL.CLAIM_BORDER.toString());
}
}
// TODO: Add more else if statements.
@@ -808,7 +808,7 @@ public abstract class MemoryFPlayer implements FPlayer {
}
public void msg(String str, Object... args) {
this.sendMessage(P.p.txt.parse(str, args));
this.sendMessage(SavageFactions.plugin.txt.parse(str, args));
}
public void msg(TL translation, Object... args) {
@@ -851,7 +851,7 @@ public abstract class MemoryFPlayer implements FPlayer {
if (!damage) {
msg(TL.COMMAND_FLY_CHANGE, fly ? "enabled" : "disabled");
if (!fly) {
sendMessage(TL.COMMAND_FLY_COOLDOWN.toString().replace("{amount}", P.p.getConfig().getInt("fly-falldamage-cooldown", 3) + ""));
sendMessage(TL.COMMAND_FLY_COOLDOWN.toString().replace("{amount}", SavageFactions.plugin.getConfig().getInt("fly-falldamage-cooldown", 3) + ""));
}
} else {
@@ -860,7 +860,7 @@ public abstract class MemoryFPlayer implements FPlayer {
// If leaving fly mode, don't let them take fall damage for x seconds.
if (!fly) {
int cooldown = P.p.getConfig().getInt("fly-falldamage-cooldown", 3);
int cooldown = SavageFactions.plugin.getConfig().getInt("fly-falldamage-cooldown", 3);
CmdFly.flyMap.remove(player.getName());
// If the value is 0 or lower, make them take fall damage.
@@ -868,7 +868,7 @@ public abstract class MemoryFPlayer implements FPlayer {
// Short task so we're just doing it in method. Not clean but eh.
if (cooldown > 0) {
setTakeFallDamage(false);
Bukkit.getScheduler().runTaskLater(P.p, new Runnable() {
Bukkit.getScheduler().runTaskLater(SavageFactions.plugin, new Runnable() {
@Override
public void run() {
setTakeFallDamage(true);
@@ -1175,7 +1175,7 @@ public abstract class MemoryFPlayer implements FPlayer {
Board.getInstance().setFactionAt(forFaction, flocation);
if (Conf.logLandClaims) {
P.p.log(TL.CLAIM_CLAIMEDLOG.toString(), this.getName(), flocation.getCoordString(), forFaction.getTag());
SavageFactions.plugin.log(TL.CLAIM_CLAIMEDLOG.toString(), this.getName(), flocation.getCoordString(), forFaction.getTag());
}
return true;
@@ -1204,7 +1204,7 @@ public abstract class MemoryFPlayer implements FPlayer {
@Override
public boolean hasMoney(int amt) {
Economy econ = P.p.getEcon();
Economy econ = SavageFactions.plugin.getEcon();
if (econ.getBalance(getPlayer()) >= amt) {
return true;
} else {
@@ -1217,7 +1217,7 @@ public abstract class MemoryFPlayer implements FPlayer {
@Override
public void takeMoney(int amt) {
if (hasMoney(amt)) {
Economy econ = P.p.getEcon();
Economy econ = SavageFactions.plugin.getEcon();
econ.withdrawPlayer(getPlayer(), amt);
sendMessage(TL.GENERIC_MONEYTAKE.toString().replace("{amount}", amt + ""));
}

View File

@@ -3,7 +3,7 @@ package com.massivecraft.factions.zcore.persist;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.FPlayers;
import com.massivecraft.factions.Factions;
import com.massivecraft.factions.P;
import com.massivecraft.factions.SavageFactions;
import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer;
import org.bukkit.entity.Player;
@@ -17,7 +17,7 @@ public abstract class MemoryFPlayers extends FPlayers {
public void clean() {
for (FPlayer fplayer : this.fPlayers.values()) {
if (!Factions.getInstance().isValidFactionId(fplayer.getFactionId())) {
P.p.log("Reset faction data (invalid faction:" + fplayer.getFactionId() + ") for player " + fplayer.getName());
SavageFactions.plugin.log("Reset faction data (invalid faction:" + fplayer.getFactionId() + ") for player " + fplayer.getName());
fplayer.resetFactionData(false);
}
}

View File

@@ -258,7 +258,7 @@ public abstract class MemoryFaction implements Faction, EconomyParticipator {
}
if (Conf.logFactionDisband) {
//TODO: Format this correctly and translate.
P.p.log("The faction " + this.getTag() + " (" + this.getId() + ") was disbanded by " + (disbanderIsConsole ? "console command" : fdisbander.getName()) + ".");
SavageFactions.plugin.log("The faction " + this.getTag() + " (" + this.getId() + ") was disbanded by " + (disbanderIsConsole ? "console command" : fdisbander.getName()) + ".");
}
if (Econ.shouldBeUsed() && !disbanderIsConsole) {
@@ -270,7 +270,7 @@ public abstract class MemoryFaction implements Faction, EconomyParticipator {
String amountString = Econ.moneyString(amount);
msg(TL.COMMAND_DISBAND_HOLDINGS, amountString);
//TODO: Format this correctly and translate
P.p.log(fdisbander.getName() + " has been given bank holdings of " + amountString + " from disbanding " + this.getTag() + ".");
SavageFactions.plugin.log(fdisbander.getName() + " has been given bank holdings of " + amountString + " from disbanding " + this.getTag() + ".");
}
}
@@ -354,11 +354,11 @@ public abstract class MemoryFaction implements Faction, EconomyParticipator {
int level = getUpgrade("Chest");
int size = 9;
if (level == 1) {
size = P.p.getConfig().getInt("fupgrades.MainMenu.Chest.Chest-Size.level-1") * 9;
size = SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Chest.Chest-Size.level-1") * 9;
} else if (level == 2) {
size = P.p.getConfig().getInt("fupgrades.MainMenu.Chest.Chest-Size.level-2") * 9;
size = SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Chest.Chest-Size.level-2") * 9;
} else if (level == 3) {
size = P.p.getConfig().getInt("fupgrades.MainMenu.Chest.Chest-Size.level-3") * 9;
size = SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Chest.Chest-Size.level-3") * 9;
}
chest = Bukkit.createInventory(null, size);
@@ -551,7 +551,7 @@ public abstract class MemoryFaction implements Faction, EconomyParticipator {
}
public boolean isPowerFrozen() {
int freezeSeconds = P.p.getConfig().getInt("hcf.powerfreeze", 0);
int freezeSeconds = SavageFactions.plugin.getConfig().getInt("hcf.powerfreeze", 0);
return freezeSeconds != 0 && System.currentTimeMillis() - lastDeath < freezeSeconds * 1000;
}
@@ -637,7 +637,7 @@ public abstract class MemoryFaction implements Faction, EconomyParticipator {
}
public void resetPerms() {
P.p.log(Level.WARNING, "Resetting permissions for Faction: " + tag);
SavageFactions.plugin.log(Level.WARNING, "Resetting permissions for Faction: " + tag);
permissions.clear();
@@ -751,7 +751,7 @@ public abstract class MemoryFaction implements Faction, EconomyParticipator {
if (this.relationWish.containsKey(otherFaction.getId())) {
return this.relationWish.get(otherFaction.getId());
}
return Relation.fromString(P.p.getConfig().getString("default-relation", "neutral")); // Always default to old behavior.
return Relation.fromString(SavageFactions.plugin.getConfig().getString("default-relation", "neutral")); // Always default to old behavior.
}
public void setRelationWish(Faction otherFaction, Relation relation) {
@@ -937,7 +937,7 @@ public abstract class MemoryFaction implements Faction, EconomyParticipator {
return ret;
}
for (Player player : P.p.getServer().getOnlinePlayers()) {
for (Player player : SavageFactions.plugin.getServer().getOnlinePlayers()) {
FPlayer fplayer = FPlayers.getInstance().getByPlayer(player);
if (fplayer.getFaction() == this) {
ret.add(player);
@@ -955,7 +955,7 @@ public abstract class MemoryFaction implements Faction, EconomyParticipator {
return false;
}
for (Player player : P.p.getServer().getOnlinePlayers()) {
for (Player player : SavageFactions.plugin.getServer().getOnlinePlayers()) {
FPlayer fplayer = FPlayers.getInstance().getByPlayer(player);
if (fplayer != null && fplayer.getFaction() == this) {
return true;
@@ -1001,7 +1001,7 @@ public abstract class MemoryFaction implements Faction, EconomyParticipator {
// no members left and faction isn't permanent, so disband it
if (Conf.logFactionDisband) {
P.p.log("The faction " + this.getTag() + " (" + this.getId() + ") has been disbanded since it has no members left.");
SavageFactions.plugin.log("The faction " + this.getTag() + " (" + this.getId() + ") has been disbanded since it has no members left.");
}
for (FPlayer fplayer : FPlayers.getInstance().getOnlinePlayers()) {
@@ -1016,7 +1016,7 @@ public abstract class MemoryFaction implements Faction, EconomyParticipator {
replacements.get(0).setRole(Role.LEADER);
//TODO:TL
this.msg("<i>Faction admin <h>%s<i> has been removed. %s<i> has been promoted as the new faction admin.", oldLeader == null ? "" : oldLeader.getName(), replacements.get(0).getName());
P.p.log("Faction " + this.getTag() + " (" + this.getId() + ") admin was removed. Replacement admin: " + replacements.get(0).getName());
SavageFactions.plugin.log("Faction " + this.getTag() + " (" + this.getId() + ") admin was removed. Replacement admin: " + replacements.get(0).getName());
}
}
@@ -1024,7 +1024,7 @@ public abstract class MemoryFaction implements Faction, EconomyParticipator {
// Messages
// ----------------------------------------------//
public void msg(String message, Object... args) {
message = P.p.txt.parse(message, args);
message = SavageFactions.plugin.txt.parse(message, args);
for (FPlayer fplayer : this.getFPlayersWhereOnline(true)) {
fplayer.sendMessage(message);

View File

@@ -23,7 +23,7 @@ public class FactionsJSON {
new BukkitRunnable() {
@Override
public void run() {
Logger logger = P.p.getLogger();
Logger logger = SavageFactions.plugin.getLogger();
logger.info("Beginning Board conversion to JSON");
new JSONBoard().convertFrom((MemoryBoard) Board.getInstance());
logger.info("Board Converted");
@@ -40,6 +40,6 @@ public class FactionsJSON {
}
logger.info("Conversion Complete");
}
}.runTaskAsynchronously(P.p);
}.runTaskAsynchronously(SavageFactions.plugin);
}
}

View File

@@ -3,7 +3,7 @@ package com.massivecraft.factions.zcore.persist.json;
import com.google.gson.reflect.TypeToken;
import com.massivecraft.factions.Board;
import com.massivecraft.factions.FLocation;
import com.massivecraft.factions.P;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.zcore.persist.MemoryBoard;
import com.massivecraft.factions.zcore.util.DiscUtil;
@@ -16,7 +16,7 @@ import java.util.TreeMap;
public class JSONBoard extends MemoryBoard {
private static transient File file = new File(P.p.getDataFolder(), "board.json");
private static transient File file = new File(SavageFactions.plugin.getDataFolder(), "board.json");
// -------------------------------------------- //
// Persistance
@@ -67,14 +67,14 @@ public class JSONBoard extends MemoryBoard {
}
public void forceSave(boolean sync) {
DiscUtil.writeCatch(file, P.p.gson.toJson(dumpAsSaveFormat()), sync);
DiscUtil.writeCatch(file, SavageFactions.plugin.gson.toJson(dumpAsSaveFormat()), sync);
}
public boolean load() {
P.p.log("Loading board from disk");
SavageFactions.plugin.log("Loading board from disk");
if (!file.exists()) {
P.p.log("No board to load from disk. Creating new file.");
SavageFactions.plugin.log("No board to load from disk. Creating new file.");
forceSave();
return true;
}
@@ -82,12 +82,12 @@ public class JSONBoard extends MemoryBoard {
try {
Type type = new TypeToken<Map<String, Map<String, String>>>() {
}.getType();
Map<String, Map<String, String>> worldCoordIds = P.p.gson.fromJson(DiscUtil.read(file), type);
Map<String, Map<String, String>> worldCoordIds = SavageFactions.plugin.gson.fromJson(DiscUtil.read(file), type);
loadFromSaveFormat(worldCoordIds);
P.p.log("Loaded " + flocationIds.size() + " board locations");
SavageFactions.plugin.log("Loaded " + flocationIds.size() + " board locations");
} catch (Exception e) {
e.printStackTrace();
P.p.log("Failed to load the board from disk.");
SavageFactions.plugin.log("Failed to load the board from disk.");
return false;
}

View File

@@ -6,7 +6,7 @@ import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.FPlayers;
import com.massivecraft.factions.P;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.zcore.persist.MemoryFPlayer;
import com.massivecraft.factions.zcore.persist.MemoryFPlayers;
import com.massivecraft.factions.zcore.util.DiscUtil;
@@ -26,8 +26,8 @@ public class JSONFPlayers extends MemoryFPlayers {
private File file;
public JSONFPlayers() {
file = new File(P.p.getDataFolder(), "players.json");
gson = P.p.gson;
file = new File(SavageFactions.plugin.getDataFolder(), "players.json");
gson = SavageFactions.plugin.gson;
}
public Gson getGson() {
@@ -75,7 +75,7 @@ public class JSONFPlayers extends MemoryFPlayers {
}
this.fPlayers.clear();
this.fPlayers.putAll(fplayers);
P.p.log("Loaded " + fPlayers.size() + " players");
SavageFactions.plugin.log("Loaded " + fPlayers.size() + " players");
}
private Map<String, JSONFPlayer> loadCore() {
@@ -170,11 +170,9 @@ public class JSONFPlayers extends MemoryFPlayers {
private boolean doesKeyNeedMigration(String key) {
if (!key.matches("[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}")) {
// Not a valid UUID..
if (key.matches("[a-zA-Z0-9_]{2,16}")) {
// Valid playername, we'll mark this as one for conversion
// to UUID
return true;
}
// Valid playername, we'll mark this as one for conversion
// to UUID
return key.matches("[a-zA-Z0-9_]{2,16}");
}
return false;
}

View File

@@ -7,7 +7,7 @@ import com.google.gson.reflect.TypeToken;
import com.massivecraft.factions.FLocation;
import com.massivecraft.factions.Faction;
import com.massivecraft.factions.Factions;
import com.massivecraft.factions.P;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.zcore.persist.MemoryFaction;
import com.massivecraft.factions.zcore.persist.MemoryFactions;
import com.massivecraft.factions.zcore.util.DiscUtil;
@@ -26,8 +26,8 @@ public class JSONFactions extends MemoryFactions {
private final File file;
public JSONFactions() {
this.file = new File(P.p.getDataFolder(), "factions.json");
this.gson = P.p.gson;
this.file = new File(SavageFactions.plugin.getDataFolder(), "factions.json");
this.gson = SavageFactions.plugin.gson;
this.nextId = 1;
}
@@ -68,7 +68,7 @@ public class JSONFactions extends MemoryFactions {
this.factions.putAll(factions);
super.load();
P.p.log("Loaded " + factions.size() + " Factions");
SavageFactions.plugin.log("Loaded " + factions.size() + " Factions");
}
private Map<String, JSONFaction> loadCore() {

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