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

@@ -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);
}