, 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;
}
}
diff --git a/src/main/java/com/massivecraft/factions/util/Particles/ParticleEffect.java b/src/main/java/com/massivecraft/factions/util/Particles/ParticleEffect.java
index d4ebd837..e555ca7e 100644
--- a/src/main/java/com/massivecraft/factions/util/Particles/ParticleEffect.java
+++ b/src/main/java/com/massivecraft/factions/util/Particles/ParticleEffect.java
@@ -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;
/**
* ParticleEffect Library
- *
+ *
* This library was created by @DarkBlade12 and allows you to display all Minecraft particle effects on a Bukkit server
- *
+ *
* You are welcome to use it, modify it and redistribute it under the following conditions:
*
* - Don't claim this class as your own
*
- Don't remove this disclaimer
*
- *
+ *
* Special thanks:
*
* - @microgeek (original idea, names and packet parameters)
@@ -36,7 +36,7 @@ import java.util.Map.Entry;
*
- @Cybermaxke (particle behavior)
*
- @JamieSinn (hosting a jenkins server and documentation for particleeffect)
*
- *
+ *
* It would be nice if you provide credit to me if you use this class in a published project
*
* @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
- *
+ *
* This class is part of the ParticleEffect Library 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}
- *
+ *
* This class is part of the ParticleEffect Library 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
- *
+ *
* This class is part of the ParticleEffect Library 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
- *
+ *
* This class is part of the ParticleEffect Library 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}
- *
+ *
* This class is part of the ParticleEffect Library 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}
- *
+ *
* This class is part of the ParticleEffect Library and follows the same usage conditions
*
* @author DarkBlade12
@@ -1184,7 +1184,7 @@ public enum ParticleEffect {
/**
* Represents the color for the {@link ParticleEffect#NOTE} effect
- *
+ *
* This class is part of the ParticleEffect Library 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
- *
+ *
* This class is part of the ParticleEffect Library 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
- *
+ *
* This class is part of the ParticleEffect Library 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
- *
+ *
* This class is part of the ParticleEffect Library 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
- *
+ *
* This class is part of the ParticleEffect Library 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 true
if it succeeds
- *
+ *
* Note: These fields only have to be initialized once, so it will return if {@link #initialized} is already set to true
*
* @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
- *
+ *
* This class is part of the ParticleEffect Library 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
- *
+ *
* This class is part of the ParticleEffect Library 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
- *
+ *
* This class is part of the ParticleEffect Library and follows the same usage conditions
*
* @author DarkBlade12
diff --git a/src/main/java/com/massivecraft/factions/util/Particles/ReflectionUtils.java b/src/main/java/com/massivecraft/factions/util/Particles/ReflectionUtils.java
index 28bd8abe..4758b937 100644
--- a/src/main/java/com/massivecraft/factions/util/Particles/ReflectionUtils.java
+++ b/src/main/java/com/massivecraft/factions/util/Particles/ReflectionUtils.java
@@ -11,15 +11,15 @@ import java.util.Map;
/**
* ReflectionUtils
- *
+ *
* This class provides useful methods which makes dealing with reflection much easier, especially when working with Bukkit
- *
+ *
* You are welcome to use it, modify it and redistribute it under the following conditions:
*
* - Don't claim this class as your own
*
- Don't remove this disclaimer
*
- *
+ *
* It would be nice if you provide credit to me if you use this class in a published project
*
* @author DarkBlade12
@@ -346,7 +346,7 @@ public final class ReflectionUtils {
/**
* Represents an enumeration of dynamic packages of NMS and CraftBukkit
- *
+ *
* This class is part of the ReflectionUtils 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
- *
+ *
* This class is part of the ReflectionUtils 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) {
diff --git a/src/main/java/com/massivecraft/factions/util/PermissionsMapTypeAdapter.java b/src/main/java/com/massivecraft/factions/util/PermissionsMapTypeAdapter.java
index fe5e160d..60b355dc 100644
--- a/src/main/java/com/massivecraft/factions/util/PermissionsMapTypeAdapter.java
+++ b/src/main/java/com/massivecraft/factions/util/PermissionsMapTypeAdapter.java
@@ -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
+ *
* 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
}
}
diff --git a/src/main/java/com/massivecraft/factions/util/WarpGUI.java b/src/main/java/com/massivecraft/factions/util/WarpGUI.java
index bb789bd8..a6147e91 100644
--- a/src/main/java/com/massivecraft/factions/util/WarpGUI.java
+++ b/src/main/java/com/massivecraft/factions/util/WarpGUI.java
@@ -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 factionWarps = fme.getFaction().getWarps().keySet();
List 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 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);
}
diff --git a/src/main/java/com/massivecraft/factions/zcore/MCommand.java b/src/main/java/com/massivecraft/factions/zcore/MCommand.java
index 6813997e..6d4c035c 100644
--- a/src/main/java/com/massivecraft/factions/zcore/MCommand.java
+++ b/src/main/java/com/massivecraft/factions/zcore/MCommand.java
@@ -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 {
}
if (args.size() > 0) {
- ret.append(p.txt.parseTags(" "));
+ ret.append(p.txt.parseTags(" "));
ret.append(TextUtil.implode(args, " "));
}
@@ -306,7 +306,7 @@ public abstract class MCommand {
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;
diff --git a/src/main/java/com/massivecraft/factions/zcore/MPlugin.java b/src/main/java/com/massivecraft/factions/zcore/MPlugin.java
index f143b6ec..fac24a23 100644
--- a/src/main/java/com/massivecraft/factions/zcore/MPlugin.java
+++ b/src/main/java/com/massivecraft/factions/zcore/MPlugin.java
@@ -218,7 +218,7 @@ public abstract class MPlugin extends JavaPlugin {
this.rawTags.put("b", ""); // bad
this.rawTags.put("h", ""); // highligh
this.rawTags.put("c", ""); // command
- this.rawTags.put("p", ""); // parameter
+ this.rawTags.put("plugin", ""); // 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;
}
diff --git a/src/main/java/com/massivecraft/factions/zcore/MPluginSecretPlayerListener.java b/src/main/java/com/massivecraft/factions/zcore/MPluginSecretPlayerListener.java
index 16de69d3..8d7c92cc 100644
--- a/src/main/java/com/massivecraft/factions/zcore/MPluginSecretPlayerListener.java
+++ b/src/main/java/com/massivecraft/factions/zcore/MPluginSecretPlayerListener.java
@@ -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);
*/
}
diff --git a/src/main/java/com/massivecraft/factions/zcore/fperms/PermissableAction.java b/src/main/java/com/massivecraft/factions/zcore/fperms/PermissableAction.java
index 714f85d6..be36ce6f 100644
--- a/src/main/java/com/massivecraft/factions/zcore/fperms/PermissableAction.java
+++ b/src/main/java/com/massivecraft/factions/zcore/fperms/PermissableAction.java
@@ -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);
}
diff --git a/src/main/java/com/massivecraft/factions/zcore/fperms/gui/PermissableActionGUI.java b/src/main/java/com/massivecraft/factions/zcore/fperms/gui/PermissableActionGUI.java
index edc8970b..be228598 100644
--- a/src/main/java/com/massivecraft/factions/zcore/fperms/gui/PermissableActionGUI.java
+++ b/src/main/java/com/massivecraft/factions/zcore/fperms/gui/PermissableActionGUI.java
@@ -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 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);
}
diff --git a/src/main/java/com/massivecraft/factions/zcore/fperms/gui/PermissableRelationGUI.java b/src/main/java/com/massivecraft/factions/zcore/fperms/gui/PermissableRelationGUI.java
index 7b9d976e..b01b78d7 100644
--- a/src/main/java/com/massivecraft/factions/zcore/fperms/gui/PermissableRelationGUI.java
+++ b/src/main/java/com/massivecraft/factions/zcore/fperms/gui/PermissableRelationGUI.java
@@ -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 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);
}
diff --git a/src/main/java/com/massivecraft/factions/zcore/fupgrades/CropUpgrades.java b/src/main/java/com/massivecraft/factions/zcore/fupgrades/CropUpgrades.java
index 697741b5..d6f4cc19 100644
--- a/src/main/java/com/massivecraft/factions/zcore/fupgrades/CropUpgrades.java
+++ b/src/main/java/com/massivecraft/factions/zcore/fupgrades/CropUpgrades.java
@@ -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);
}
}
diff --git a/src/main/java/com/massivecraft/factions/zcore/fupgrades/EXPUpgrade.java b/src/main/java/com/massivecraft/factions/zcore/fupgrades/EXPUpgrade.java
index dadd86ce..a552d989 100644
--- a/src/main/java/com/massivecraft/factions/zcore/fupgrades/EXPUpgrade.java
+++ b/src/main/java/com/massivecraft/factions/zcore/fupgrades/EXPUpgrade.java
@@ -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);
}
}
diff --git a/src/main/java/com/massivecraft/factions/zcore/fupgrades/FUpgradesGUI.java b/src/main/java/com/massivecraft/factions/zcore/fupgrades/FUpgradesGUI.java
index a86ec3a3..266e8422 100644
--- a/src/main/java/com/massivecraft/factions/zcore/fupgrades/FUpgradesGUI.java
+++ b/src/main/java/com/massivecraft/factions/zcore/fupgrades/FUpgradesGUI.java
@@ -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 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 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 cropSlots = P.p.getConfig().getIntegerList("fupgrades.MainMenu.Crops.CropItem.slots");
- List spawnerSlots = P.p.getConfig().getIntegerList("fupgrades.MainMenu.Spawners.SpawnerItem.slots");
- List expSlots = P.p.getConfig().getIntegerList("fupgrades.MainMenu.EXP.EXPItem.slots");
- List chestSlots = P.p.getConfig().getIntegerList("fupgrades.MainMenu.Chest.ChestItem.slots");
+ List cropSlots = SavageFactions.plugin.getConfig().getIntegerList("fupgrades.MainMenu.Crops.CropItem.slots");
+ List spawnerSlots = SavageFactions.plugin.getConfig().getIntegerList("fupgrades.MainMenu.Spawners.SpawnerItem.slots");
+ List expSlots = SavageFactions.plugin.getConfig().getIntegerList("fupgrades.MainMenu.EXP.EXPItem.slots");
+ List 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 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 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 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 spawnerLore = SavageFactions.plugin.colorList(SavageFactions.plugin.getConfig().getStringList("fupgrades.MainMenu.Spawners.SpawnerItem.Lore"));
- List spawnerSlots = P.p.getConfig().getIntegerList("fupgrades.MainMenu.Spawners.SpawnerItem.slots");
+ List 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 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 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 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 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);
diff --git a/src/main/java/com/massivecraft/factions/zcore/fupgrades/SpawnerUpgrades.java b/src/main/java/com/massivecraft/factions/zcore/fupgrades/SpawnerUpgrades.java
index b7c44841..e017ee43 100644
--- a/src/main/java/com/massivecraft/factions/zcore/fupgrades/SpawnerUpgrades.java
+++ b/src/main/java/com/massivecraft/factions/zcore/fupgrades/SpawnerUpgrades.java
@@ -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);
}
diff --git a/src/main/java/com/massivecraft/factions/zcore/persist/MemoryBoard.java b/src/main/java/com/massivecraft/factions/zcore/persist/MemoryBoard.java
index dfff9f05..df1cb518 100644
--- a/src/main/java/com/massivecraft/factions/zcore/persist/MemoryBoard.java
+++ b/src/main/java/com/massivecraft/factions/zcore/persist/MemoryBoard.java
@@ -158,7 +158,7 @@ public abstract class MemoryBoard extends Board {
while (iter.hasNext()) {
Entry 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 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 asciiCompass = AsciiCompass.getAsciiCompass(inDegrees, ChatColor.DARK_GREEN, P.p.txt.parse(""));
+ ArrayList asciiCompass = AsciiCompass.getAsciiCompass(inDegrees, ChatColor.DARK_GREEN, SavageFactions.plugin.txt.parse(""));
int halfWidth = Conf.mapWidth / 2;
// Use player's value for height
@@ -291,16 +291,16 @@ public abstract class MemoryBoard extends Board {
private List getToolTip(Faction faction, FPlayer to) {
List ret = new ArrayList<>();
- List show = P.p.getConfig().getStringList("map");
+ List 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 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));
}
}
diff --git a/src/main/java/com/massivecraft/factions/zcore/persist/MemoryFPlayer.java b/src/main/java/com/massivecraft/factions/zcore/persist/MemoryFPlayer.java
index 6e16d1ab..c9569930 100644
--- a/src/main/java/com/massivecraft/factions/zcore/persist/MemoryFPlayer.java
+++ b/src/main/java/com/massivecraft/factions/zcore/persist/MemoryFPlayer.java
@@ -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).
- *
+ *
* The FPlayer is linked to a minecraft player using the player name.
- *
+ *
* 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 + ""));
}
diff --git a/src/main/java/com/massivecraft/factions/zcore/persist/MemoryFPlayers.java b/src/main/java/com/massivecraft/factions/zcore/persist/MemoryFPlayers.java
index 708baf32..f4f6c239 100644
--- a/src/main/java/com/massivecraft/factions/zcore/persist/MemoryFPlayers.java
+++ b/src/main/java/com/massivecraft/factions/zcore/persist/MemoryFPlayers.java
@@ -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);
}
}
diff --git a/src/main/java/com/massivecraft/factions/zcore/persist/MemoryFaction.java b/src/main/java/com/massivecraft/factions/zcore/persist/MemoryFaction.java
index 29814d8b..16a37dee 100644
--- a/src/main/java/com/massivecraft/factions/zcore/persist/MemoryFaction.java
+++ b/src/main/java/com/massivecraft/factions/zcore/persist/MemoryFaction.java
@@ -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("Faction admin %s has been removed. %s 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);
diff --git a/src/main/java/com/massivecraft/factions/zcore/persist/json/FactionsJSON.java b/src/main/java/com/massivecraft/factions/zcore/persist/json/FactionsJSON.java
index 2cc1c833..c0f145e8 100644
--- a/src/main/java/com/massivecraft/factions/zcore/persist/json/FactionsJSON.java
+++ b/src/main/java/com/massivecraft/factions/zcore/persist/json/FactionsJSON.java
@@ -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);
}
}
diff --git a/src/main/java/com/massivecraft/factions/zcore/persist/json/JSONBoard.java b/src/main/java/com/massivecraft/factions/zcore/persist/json/JSONBoard.java
index 53b40aad..31dbf8b5 100644
--- a/src/main/java/com/massivecraft/factions/zcore/persist/json/JSONBoard.java
+++ b/src/main/java/com/massivecraft/factions/zcore/persist/json/JSONBoard.java
@@ -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