Merge branch 'feature/rm-redundant-methods' of https://github.com/manuelgu/PlotSquared into manuelgu-feature/rm-redundant-methods

This commit is contained in:
MattBDev 2016-03-20 19:52:11 -04:00
commit cb0b59fdb4
16 changed files with 288 additions and 275 deletions

View File

@ -45,7 +45,6 @@ import org.bukkit.OfflinePlayer;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.HashSet; import java.util.HashSet;
@ -70,7 +69,7 @@ public class PlotAPI {
/** /**
* Permission that allows for admin access, this permission node will allow the player to use any part of the * Permission that allows for admin access, this permission node will allow the player to use any part of the
* plugin, without limitations. * plugin, without limitations.
* @deprecated Use C.PERMISSION_ADMIN.s() instead * @deprecated Use C.PERMISSION_ADMIN instead
*/ */
@Deprecated @Deprecated
public static final String ADMIN_PERMISSION = C.PERMISSION_ADMIN.s(); public static final String ADMIN_PERMISSION = C.PERMISSION_ADMIN.s();
@ -400,7 +399,7 @@ public class PlotAPI {
* @see com.intellectualcrafters.plot.config.C * @see com.intellectualcrafters.plot.config.C
*/ */
public void sendConsoleMessage(final C c) { public void sendConsoleMessage(final C c) {
sendConsoleMessage(c.s()); sendConsoleMessage(c);
} }
/** /**

View File

@ -87,7 +87,6 @@ import org.bukkit.generator.ChunkGenerator;
import org.bukkit.metadata.MetadataValue; import org.bukkit.metadata.MetadataValue;
import org.bukkit.plugin.Plugin; import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
@ -192,7 +191,7 @@ public class BukkitMain extends JavaPlugin implements Listener, IPlotMain {
@Override @Override
public void runEntityTask() { public void runEntityTask() {
log(C.PREFIX.s() + "KillAllEntities started."); log(C.PREFIX + "KillAllEntities started.");
TaskManager.runTaskRepeat(new Runnable() { TaskManager.runTaskRepeat(new Runnable() {
@Override @Override
public void run() { public void run() {
@ -514,7 +513,7 @@ public class BukkitMain extends JavaPlugin implements Listener, IPlotMain {
Settings.OFFLINE_MODE = true; Settings.OFFLINE_MODE = true;
} }
if (!checkVersion) { if (!checkVersion) {
log(C.PREFIX.s() + " &c[WARN] Titles are disabled - please update your version of Bukkit to support this feature."); log(C.PREFIX + " &c[WARN] Titles are disabled - please update your version of Bukkit to support this feature.");
Settings.TITLES = false; Settings.TITLES = false;
FlagManager.removeFlag(FlagManager.getFlag("titles")); FlagManager.removeFlag(FlagManager.getFlag("titles"));
} else { } else {
@ -524,9 +523,9 @@ public class BukkitMain extends JavaPlugin implements Listener, IPlotMain {
} }
} }
if (Settings.OFFLINE_MODE) { if (Settings.OFFLINE_MODE) {
log(C.PREFIX.s() + " &6PlotSquared is using Offline Mode UUIDs either because of user preference, or because you are using an old version of Bukkit"); log(C.PREFIX + " &6PlotSquared is using Offline Mode UUIDs either because of user preference, or because you are using an old version of Bukkit");
} else { } else {
log(C.PREFIX.s() + " &6PlotSquared is using online UUIDs"); log(C.PREFIX + " &6PlotSquared is using online UUIDs");
} }
return Settings.USE_SQLUUIDHANDLER ? new SQLUUIDHandler(wrapper) : new FileUUIDHandler(wrapper); return Settings.USE_SQLUUIDHANDLER ? new SQLUUIDHandler(wrapper) : new FileUUIDHandler(wrapper);
} }
@ -571,9 +570,9 @@ public class BukkitMain extends JavaPlugin implements Listener, IPlotMain {
try { try {
Metrics metrics = new Metrics(this); Metrics metrics = new Metrics(this);
metrics.start(); metrics.start();
log(C.PREFIX.s() + "&6Metrics enabled."); log(C.PREFIX + "&6Metrics enabled.");
} catch (IOException e) { } catch (IOException e) {
log(C.PREFIX.s() + "&cFailed to load up metrics."); log(C.PREFIX + "&cFailed to load up metrics.");
} }
} }

View File

@ -42,7 +42,6 @@ import com.plotsquared.bukkit.uuid.LowerOfflineUUIDWrapper;
import com.plotsquared.bukkit.uuid.OfflineUUIDWrapper; import com.plotsquared.bukkit.uuid.OfflineUUIDWrapper;
import com.plotsquared.general.commands.Argument; import com.plotsquared.general.commands.Argument;
import com.plotsquared.general.commands.CommandDeclaration; import com.plotsquared.general.commands.CommandDeclaration;
import java.io.File; import java.io.File;
import java.io.FilenameFilter; import java.io.FilenameFilter;
import java.io.IOException; import java.io.IOException;
@ -142,7 +141,7 @@ public class DebugUUID extends SubCommand {
final UUID uuid = UUID.fromString(s); final UUID uuid = UUID.fromString(s);
uuids.add(uuid); uuids.add(uuid);
} catch (final Exception e) { } catch (final Exception e) {
MainUtil.sendMessage(player, C.PREFIX.s() + "Invalid playerdata: " + current); MainUtil.sendMessage(player, C.PREFIX + "Invalid playerdata: " + current);
} }
} }
final File playersFolder = new File(worldname + File.separator + "players"); final File playersFolder = new File(worldname + File.separator + "players");
@ -172,7 +171,7 @@ public class DebugUUID extends SubCommand {
uCReverse.put(uuid2, uuid); uCReverse.put(uuid2, uuid);
} }
} catch (final Throwable e) { } catch (final Throwable e) {
MainUtil.sendMessage(player, C.PREFIX.s() + "&6Invalid playerdata: " + uuid.toString() + ".dat"); MainUtil.sendMessage(player, C.PREFIX + "&6Invalid playerdata: " + uuid.toString() + ".dat");
} }
} }
for (final String name : names) { for (final String name : names) {

View File

@ -10,12 +10,15 @@ import com.intellectualcrafters.plot.database.DBFunc;
import com.intellectualcrafters.plot.object.OfflinePlotPlayer; import com.intellectualcrafters.plot.object.OfflinePlotPlayer;
import com.intellectualcrafters.plot.object.RunnableVal; import com.intellectualcrafters.plot.object.RunnableVal;
import com.intellectualcrafters.plot.object.StringWrapper; import com.intellectualcrafters.plot.object.StringWrapper;
import com.intellectualcrafters.plot.util.*; import com.intellectualcrafters.plot.util.ExpireManager;
import com.intellectualcrafters.plot.util.StringMan;
import com.intellectualcrafters.plot.util.TaskManager;
import com.intellectualcrafters.plot.util.UUIDHandler;
import com.intellectualcrafters.plot.util.UUIDHandlerImplementation;
import com.intellectualcrafters.plot.uuid.UUIDWrapper; import com.intellectualcrafters.plot.uuid.UUIDWrapper;
import com.plotsquared.bukkit.util.NbtFactory; import com.plotsquared.bukkit.util.NbtFactory;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.World; import org.bukkit.World;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.FilenameFilter; import java.io.FilenameFilter;
@ -50,7 +53,7 @@ public class FileUUIDHandler extends UUIDHandlerImplementation {
TaskManager.runTaskAsync(new Runnable() { TaskManager.runTaskAsync(new Runnable() {
@Override @Override
public void run() { public void run() {
PS.debug(C.PREFIX.s() + "&6Starting player data caching for: " + world); PS.debug(C.PREFIX + "&6Starting player data caching for: " + world);
final File uuidfile = new File(PS.get().IMP.getDirectory(), "uuids.txt"); final File uuidfile = new File(PS.get().IMP.getDirectory(), "uuids.txt");
if (uuidfile.exists()) { if (uuidfile.exists()) {
try { try {
@ -112,7 +115,7 @@ public class FileUUIDHandler extends UUIDHandlerImplementation {
} }
} catch (final Exception e) { } catch (final Exception e) {
e.printStackTrace(); e.printStackTrace();
PS.debug(C.PREFIX.s() + "Invalid playerdata: " + current); PS.debug(C.PREFIX + "Invalid playerdata: " + current);
} }
} }
} }
@ -150,7 +153,7 @@ public class FileUUIDHandler extends UUIDHandlerImplementation {
final UUID uuid = UUID.fromString(s); final UUID uuid = UUID.fromString(s);
uuids.add(uuid); uuids.add(uuid);
} catch (final Exception e) { } catch (final Exception e) {
PS.debug(C.PREFIX.s() + "Invalid playerdata: " + current); PS.debug(C.PREFIX + "Invalid playerdata: " + current);
} }
} }
break; break;
@ -195,7 +198,7 @@ public class FileUUIDHandler extends UUIDHandlerImplementation {
} }
toAdd.put(new StringWrapper(name), uuid); toAdd.put(new StringWrapper(name), uuid);
} catch (final Throwable e) { } catch (final Throwable e) {
PS.debug(C.PREFIX.s() + "&6Invalid playerdata: " + uuid.toString() + ".dat"); PS.debug(C.PREFIX + "&6Invalid playerdata: " + uuid.toString() + ".dat");
} }
} }
for (final String name : names) { for (final String name : names) {

View File

@ -195,7 +195,7 @@ public class SQLUUIDHandler extends UUIDHandlerImplementation {
@Override @Override
public void fetchUUID(final String name, final RunnableVal<UUID> ifFetch) { public void fetchUUID(final String name, final RunnableVal<UUID> ifFetch) {
PS.debug(C.PREFIX.s() + "UUID for '" + name + "' was null. We'll cache this from the mojang servers!"); PS.debug(C.PREFIX + "UUID for '" + name + "' was null. We'll cache this from the mojang servers!");
if (ifFetch == null) { if (ifFetch == null) {
return; return;
} }
@ -250,7 +250,7 @@ public class SQLUUIDHandler extends UUIDHandlerImplementation {
statement.setString(1, uuid.toString()); statement.setString(1, uuid.toString());
statement.setString(2, name.toString()); statement.setString(2, name.toString());
statement.execute(); statement.execute();
PS.debug(C.PREFIX.s() + "&cAdded '&6" + uuid + "&c' - '&6" + name + "&c'"); PS.debug(C.PREFIX + "&cAdded '&6" + uuid + "&c' - '&6" + name + "&c'");
} catch (final SQLException e) { } catch (final SQLException e) {
e.printStackTrace(); e.printStackTrace();
} }
@ -275,7 +275,7 @@ public class SQLUUIDHandler extends UUIDHandlerImplementation {
statement.setString(1, name.value); statement.setString(1, name.value);
statement.setString(2, uuid.toString()); statement.setString(2, uuid.toString());
statement.execute(); statement.execute();
PS.debug(C.PREFIX.s() + "Name change for '" + uuid + "' to '" + name.value + "'"); PS.debug(C.PREFIX + "Name change for '" + uuid + "' to '" + name.value + "'");
} catch (final SQLException e) { } catch (final SQLException e) {
e.printStackTrace(); e.printStackTrace();
} }

View File

@ -54,7 +54,6 @@ import com.intellectualcrafters.plot.util.WorldUtil;
import com.intellectualcrafters.plot.util.area.QuadMap; import com.intellectualcrafters.plot.util.area.QuadMap;
import com.plotsquared.listener.WESubscriber; import com.plotsquared.listener.WESubscriber;
import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEdit;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.FileOutputStream; import java.io.FileOutputStream;
@ -165,7 +164,7 @@ public class PS {
} }
TASK = IMP.getTaskManager(); TASK = IMP.getTaskManager();
if (!C.ENABLED.s().isEmpty()) { if (!C.ENABLED.s().isEmpty()) {
log(C.ENABLED.s()); log(C.ENABLED);
} }
setupConfigs(); setupConfigs();
translationFile = new File(IMP.getDirectory() + File.separator + "translations" + File.separator + "PlotSquared.use_THIS.yml"); translationFile = new File(IMP.getDirectory() + File.separator + "translations" + File.separator + "PlotSquared.use_THIS.yml");
@ -1370,10 +1369,10 @@ public class PS {
// Conventional plot generator // Conventional plot generator
PlotArea plotArea = pg.getNewPlotArea(world, null, null, null); PlotArea plotArea = pg.getNewPlotArea(world, null, null, null);
PlotManager plotManager = pg.getNewPlotManager(); PlotManager plotManager = pg.getNewPlotManager();
log(C.PREFIX.s() + "&aDetected world load for '" + world + "'"); log(C.PREFIX + "&aDetected world load for '" + world + "'");
log(C.PREFIX.s() + "&3 - generator: &7" + baseGenerator + ">" + pg); log(C.PREFIX + "&3 - generator: &7" + baseGenerator + ">" + pg);
log(C.PREFIX.s() + "&3 - plotworld: &7" + plotArea.getClass().getName()); log(C.PREFIX + "&3 - plotworld: &7" + plotArea.getClass().getName());
log(C.PREFIX.s() + "&3 - manager: &7" + plotManager.getClass().getName()); log(C.PREFIX + "&3 - manager: &7" + plotManager.getClass().getName());
if (!config.contains(path)) { if (!config.contains(path)) {
config.createSection(path); config.createSection(path);
worldSection = config.getConfigurationSection(path); worldSection = config.getConfigurationSection(path);
@ -1399,7 +1398,7 @@ public class PS {
PS.debug("World possibly already loaded: " + world); PS.debug("World possibly already loaded: " + world);
return; return;
} }
log(C.PREFIX.s() + "&aDetected world load for '" + world + "'"); log(C.PREFIX + "&aDetected world load for '" + world + "'");
String gen_string = worldSection.getString("generator.plugin", "PlotSquared"); String gen_string = worldSection.getString("generator.plugin", "PlotSquared");
if (type == 2) { if (type == 2) {
Set<PlotCluster> clusters = clusters_tmp != null ? clusters_tmp.get(world) : new HashSet<PlotCluster>(); Set<PlotCluster> clusters = clusters_tmp != null ? clusters_tmp.get(world) : new HashSet<PlotCluster>();
@ -1415,7 +1414,7 @@ public class PS {
worldSection.createSection("areas." + fullId); worldSection.createSection("areas." + fullId);
DBFunc.replaceWorld(world, world + ";" + name, pos1, pos2); // NPE DBFunc.replaceWorld(world, world + ";" + name, pos1, pos2); // NPE
log(C.PREFIX.s() + "&3 - " + name + "-" + pos1 + "-" + pos2); log(C.PREFIX + "&3 - " + name + "-" + pos1 + "-" + pos2);
GeneratorWrapper<?> areaGen = IMP.getGenerator(world, gen_string); GeneratorWrapper<?> areaGen = IMP.getGenerator(world, gen_string);
if (areaGen == null) { if (areaGen == null) {
throw new IllegalArgumentException("Invalid Generator: " + gen_string); throw new IllegalArgumentException("Invalid Generator: " + gen_string);
@ -1428,10 +1427,10 @@ public class PS {
} catch (final IOException e) { } catch (final IOException e) {
e.printStackTrace(); e.printStackTrace();
} }
log(C.PREFIX.s() + "&c | &9generator: &7" + baseGenerator + ">" + areaGen); log(C.PREFIX + "&c | &9generator: &7" + baseGenerator + ">" + areaGen);
log(C.PREFIX.s() + "&c | &9plotworld: &7" + pa); log(C.PREFIX + "&c | &9plotworld: &7" + pa);
log(C.PREFIX.s() + "&c | &9manager: &7" + pa); log(C.PREFIX + "&c | &9manager: &7" + pa);
log(C.PREFIX.s() + "&cNote: &7Area created for cluster:" + name + " (invalid or old configuration?)"); log(C.PREFIX + "&cNote: &7Area created for cluster:" + name + " (invalid or old configuration?)");
areaGen.getPlotGenerator().initialize(pa); areaGen.getPlotGenerator().initialize(pa);
areaGen.augment(pa); areaGen.augment(pa);
toLoad.add(pa); toLoad.add(pa);
@ -1453,9 +1452,9 @@ public class PS {
} catch (final IOException e) { } catch (final IOException e) {
e.printStackTrace(); e.printStackTrace();
} }
log(C.PREFIX.s() + "&3 - generator: &7" + baseGenerator + ">" + areaGen); log(C.PREFIX + "&3 - generator: &7" + baseGenerator + ">" + areaGen);
log(C.PREFIX.s() + "&3 - plotworld: &7" + pa); log(C.PREFIX + "&3 - plotworld: &7" + pa);
log(C.PREFIX.s() + "&3 - manager: &7" + pa.getPlotManager()); log(C.PREFIX + "&3 - manager: &7" + pa.getPlotManager());
areaGen.getPlotGenerator().initialize(pa); areaGen.getPlotGenerator().initialize(pa);
areaGen.augment(pa); areaGen.augment(pa);
addPlotArea(pa); addPlotArea(pa);
@ -1465,7 +1464,7 @@ public class PS {
throw new IllegalArgumentException("Invalid type for multi-area world. Expected `2`, got `" + type + "`"); throw new IllegalArgumentException("Invalid type for multi-area world. Expected `2`, got `" + type + "`");
} }
for (String areaId : areasSection.getKeys(false)) { for (String areaId : areasSection.getKeys(false)) {
log(C.PREFIX.s() + "&3 - " + areaId); log(C.PREFIX + "&3 - " + areaId);
String[] split = areaId.split("([^\\-]+)(?:-{1})(-{0,1}\\d+\\;-{0,1}\\d+)(?:-{1})(-{0,1}\\d+\\;-{0,1}\\d+)"); String[] split = areaId.split("([^\\-]+)(?:-{1})(-{0,1}\\d+\\;-{0,1}\\d+)(?:-{1})(-{0,1}\\d+\\;-{0,1}\\d+)");
if (split.length != 3) { if (split.length != 3) {
throw new IllegalArgumentException("Invalid Area identifier: " + areaId + ". Expected form `<name>-<pos1>-<pos2>`"); throw new IllegalArgumentException("Invalid Area identifier: " + areaId + ". Expected form `<name>-<pos1>-<pos2>`");
@ -1524,10 +1523,10 @@ public class PS {
} catch (final IOException e) { } catch (final IOException e) {
e.printStackTrace(); e.printStackTrace();
} }
log(C.PREFIX.s() + "&aDetected area load for '" + world + "'"); log(C.PREFIX + "&aDetected area load for '" + world + "'");
log(C.PREFIX.s() + "&c | &9generator: &7" + baseGenerator + ">" + areaGen); log(C.PREFIX + "&c | &9generator: &7" + baseGenerator + ">" + areaGen);
log(C.PREFIX.s() + "&c | &9plotworld: &7" + pa); log(C.PREFIX + "&c | &9plotworld: &7" + pa);
log(C.PREFIX.s() + "&c | &9manager: &7" + pa.getPlotManager()); log(C.PREFIX + "&c | &9manager: &7" + pa.getPlotManager());
areaGen.getPlotGenerator().initialize(pa); areaGen.getPlotGenerator().initialize(pa);
areaGen.augment(pa); areaGen.augment(pa);
addPlotArea(pa); addPlotArea(pa);
@ -1764,7 +1763,7 @@ public class PS {
public void setupDatabase() { public void setupDatabase() {
try { try {
if (Settings.DB.USE_MONGO) { if (Settings.DB.USE_MONGO) {
log(C.PREFIX.s() + "MongoDB is not yet implemented"); log(C.PREFIX + "MongoDB is not yet implemented");
log(C.PREFIX + "&cNo storage type is set!"); log(C.PREFIX + "&cNo storage type is set!");
IMP.disable(); IMP.disable();
return; return;
@ -1786,7 +1785,7 @@ public class PS {
this.clusters_tmp = DBFunc.getClusters(); this.clusters_tmp = DBFunc.getClusters();
} }
} catch (ClassNotFoundException | SQLException e) { } catch (ClassNotFoundException | SQLException e) {
log(C.PREFIX.s() + "&cFailed to open DATABASE connection. The plugin will disable itself."); log(C.PREFIX + "&cFailed to open DATABASE connection. The plugin will disable itself.");
if (Settings.DB.USE_MONGO) { if (Settings.DB.USE_MONGO) {
log("$4MONGO"); log("$4MONGO");
} else if (Settings.DB.USE_MYSQL) { } else if (Settings.DB.USE_MYSQL) {
@ -2195,7 +2194,7 @@ public class PS {
// Misc // Misc
Settings.DEBUG = config.getBoolean("debug"); Settings.DEBUG = config.getBoolean("debug");
if (Settings.DEBUG) { if (Settings.DEBUG) {
log(C.PREFIX.s() + "&6Debug Mode Enabled (Default). Edit the config to turn this off."); log(C.PREFIX + "&6Debug Mode Enabled (Default). Edit the config to turn this off.");
} }
Settings.CONSOLE_COLOR = config.getBoolean("console.color"); Settings.CONSOLE_COLOR = config.getBoolean("console.color");
if (!config.getBoolean("chat.fancy") || !checkVersion(IMP.getServerVersion(), 1, 8, 0)) { if (!config.getBoolean("chat.fancy") || !checkVersion(IMP.getServerVersion(), 1, 8, 0)) {
@ -2216,7 +2215,7 @@ public class PS {
public void setupConfigs() { public void setupConfigs() {
final File folder = new File(IMP.getDirectory() + File.separator + "config"); final File folder = new File(IMP.getDirectory() + File.separator + "config");
if (!folder.exists() && !folder.mkdirs()) { if (!folder.exists() && !folder.mkdirs()) {
log(C.PREFIX.s() + "&cFailed to create the /plugins/config folder. Please create it manually."); log(C.PREFIX + "&cFailed to create the /plugins/config folder. Please create it manually.");
} }
try { try {
styleFile = new File(IMP.getDirectory() + File.separator + "translations" + File.separator + "style.yml"); styleFile = new File(IMP.getDirectory() + File.separator + "translations" + File.separator + "style.yml");
@ -2315,7 +2314,7 @@ public class PS {
settings.put("Schematics Save Path", "" + Settings.SCHEMATIC_SAVE_PATH); settings.put("Schematics Save Path", "" + Settings.SCHEMATIC_SAVE_PATH);
settings.put("API Location", "" + Settings.API_URL); settings.put("API Location", "" + Settings.API_URL);
for (final Entry<String, String> setting : settings.entrySet()) { for (final Entry<String, String> setting : settings.entrySet()) {
log(C.PREFIX.s() + String.format("&cKey: &6%s&c, Value: &6%s", setting.getKey(), setting.getValue())); log(C.PREFIX + String.format("&cKey: &6%s&c, Value: &6%s", setting.getKey(), setting.getValue()));
} }
} }
} }

View File

@ -26,7 +26,6 @@ import com.intellectualcrafters.plot.util.SetupUtils;
import com.intellectualcrafters.plot.util.StringMan; import com.intellectualcrafters.plot.util.StringMan;
import com.intellectualcrafters.plot.util.WorldUtil; import com.intellectualcrafters.plot.util.WorldUtil;
import com.plotsquared.general.commands.CommandDeclaration; import com.plotsquared.general.commands.CommandDeclaration;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Objects; import java.util.Objects;

View File

@ -33,7 +33,6 @@ import com.intellectualcrafters.plot.util.Permissions;
import com.intellectualcrafters.plot.util.StringMan; import com.intellectualcrafters.plot.util.StringMan;
import com.intellectualcrafters.plot.util.UUIDHandler; import com.intellectualcrafters.plot.util.UUIDHandler;
import com.plotsquared.general.commands.CommandDeclaration; import com.plotsquared.general.commands.CommandDeclaration;
import java.util.HashSet; import java.util.HashSet;
import java.util.UUID; import java.util.UUID;
@ -165,7 +164,7 @@ public class Merge extends SubCommand {
return false; return false;
} }
if (!Permissions.hasPermission(plr, C.PERMISSION_MERGE_OTHER)) { if (!Permissions.hasPermission(plr, C.PERMISSION_MERGE_OTHER)) {
MainUtil.sendMessage(plr, C.NO_PERMISSION, C.PERMISSION_MERGE_OTHER.s()); MainUtil.sendMessage(plr, C.NO_PERMISSION, C.PERMISSION_MERGE_OTHER);
return false; return false;
} }
HashSet<UUID> uuids = adjacent.getOwners(); HashSet<UUID> uuids = adjacent.getOwners();

View File

@ -23,11 +23,21 @@ package com.intellectualcrafters.plot.flag;
import com.intellectualcrafters.plot.PS; import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.config.C; import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.database.DBFunc; import com.intellectualcrafters.plot.database.DBFunc;
import com.intellectualcrafters.plot.object.*; import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotArea;
import com.intellectualcrafters.plot.object.PlotCluster;
import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.object.PlotSettings;
import com.intellectualcrafters.plot.object.RunnableVal;
import com.intellectualcrafters.plot.util.EventUtil; import com.intellectualcrafters.plot.util.EventUtil;
import com.intellectualcrafters.plot.util.Permissions; import com.intellectualcrafters.plot.util.Permissions;
import java.util.ArrayList;
import java.util.*; import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
/** /**
* Flag Manager Utility * Flag Manager Utility
@ -84,7 +94,7 @@ public class FlagManager {
} }
public static boolean addFlag(final AbstractFlag af, final boolean reserved) { public static boolean addFlag(final AbstractFlag af, final boolean reserved) {
PS.debug(C.PREFIX.s() + "&8 - Adding flag: &7" + af); PS.debug(C.PREFIX + "&8 - Adding flag: &7" + af);
PS.get().foreachPlotArea(new RunnableVal<PlotArea>() { PS.get().foreachPlotArea(new RunnableVal<PlotArea>() {
@Override @Override
public void run(PlotArea value) { public void run(PlotArea value) {

View File

@ -32,7 +32,6 @@ import com.intellectualcrafters.plot.util.MathMan;
import com.intellectualcrafters.plot.util.SchematicHandler; import com.intellectualcrafters.plot.util.SchematicHandler;
import com.intellectualcrafters.plot.util.SchematicHandler.Dimension; import com.intellectualcrafters.plot.util.SchematicHandler.Dimension;
import com.intellectualcrafters.plot.util.SchematicHandler.Schematic; import com.intellectualcrafters.plot.util.SchematicHandler.Schematic;
import java.io.File; import java.io.File;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
@ -250,7 +249,7 @@ public class HybridPlotWorld extends ClassicPlotWorld {
} }
} }
if (schem1 == null || schem2 == null || ROAD_WIDTH == 0) { if (schem1 == null || schem2 == null || ROAD_WIDTH == 0) {
PS.debug(C.PREFIX.s() + "&3 - schematic: &7false"); PS.debug(C.PREFIX + "&3 - schematic: &7false");
return; return;
} }
ROAD_SCHEMATIC_ENABLED = true; ROAD_SCHEMATIC_ENABLED = true;

View File

@ -210,7 +210,7 @@ public abstract class HybridUtils {
} }
if (regions.isEmpty() && chunks.isEmpty()) { if (regions.isEmpty() && chunks.isEmpty()) {
HybridUtils.UPDATE = false; HybridUtils.UPDATE = false;
PS.debug(C.PREFIX.s() + "Finished road conversion"); PS.debug(C.PREFIX + "Finished road conversion");
// CANCEL TASK // CANCEL TASK
} else { } else {
final Runnable task = this; final Runnable task = this;
@ -236,7 +236,7 @@ public abstract class HybridUtils {
final long diff = System.currentTimeMillis() + 1; final long diff = System.currentTimeMillis() + 1;
if (((System.currentTimeMillis() - baseTime - last.get()) > 2000) && (last.get() != 0)) { if (((System.currentTimeMillis() - baseTime - last.get()) > 2000) && (last.get() != 0)) {
last.set(0); last.set(0);
PS.debug(C.PREFIX.s() + "Detected low TPS. Rescheduling in 30s"); PS.debug(C.PREFIX + "Detected low TPS. Rescheduling in 30s");
Iterator<ChunkLoc> iter = chunks.iterator(); Iterator<ChunkLoc> iter = chunks.iterator();
final ChunkLoc chunk = iter.next(); final ChunkLoc chunk = iter.next();
iter.remove(); iter.remove();

View File

@ -14,7 +14,6 @@ import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.object.RunnableVal; import com.intellectualcrafters.plot.object.RunnableVal;
import com.intellectualcrafters.plot.object.StringWrapper; import com.intellectualcrafters.plot.object.StringWrapper;
import com.intellectualcrafters.plot.uuid.UUIDWrapper; import com.intellectualcrafters.plot.uuid.UUIDWrapper;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.Map; import java.util.Map;
@ -86,7 +85,7 @@ public abstract class UUIDHandlerImplementation {
} }
uuidMap.put(name, uuid); uuidMap.put(name, uuid);
} }
PS.debug(C.PREFIX.s() + "&6Cached a total of: " + uuidMap.size() + " UUIDs"); PS.debug(C.PREFIX + "&6Cached a total of: " + uuidMap.size() + " UUIDs");
} }
public boolean add(final StringWrapper name, final UUID uuid) { public boolean add(final StringWrapper name, final UUID uuid) {

View File

@ -1,12 +1,11 @@
package com.intellectualcrafters.plot.util.helpmenu; package com.intellectualcrafters.plot.util.helpmenu;
import java.util.ArrayList;
import java.util.List;
import com.intellectualcrafters.plot.commands.CommandCategory; import com.intellectualcrafters.plot.commands.CommandCategory;
import com.intellectualcrafters.plot.config.C; import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.object.PlotPlayer; import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.util.MainUtil; import com.intellectualcrafters.plot.util.MainUtil;
import java.util.ArrayList;
import java.util.List;
public class HelpPage { public class HelpPage {
@ -22,12 +21,12 @@ public class HelpPage {
if (helpObjects.size() < 1) { if (helpObjects.size() < 1) {
MainUtil.sendMessage(player, C.NOT_VALID_NUMBER, "(0)"); MainUtil.sendMessage(player, C.NOT_VALID_NUMBER, "(0)");
} else { } else {
MainUtil.sendMessage(player, C.HELP_HEADER.s(), false); MainUtil.sendMessage(player, C.HELP_HEADER, false);
MainUtil.sendMessage(player, _header, false); MainUtil.sendMessage(player, _header, false);
for (final HelpObject object : helpObjects) { for (final HelpObject object : helpObjects) {
MainUtil.sendMessage(player, object.toString(), false); MainUtil.sendMessage(player, object.toString(), false);
} }
MainUtil.sendMessage(player, C.HELP_FOOTER.s(), false); MainUtil.sendMessage(player, C.HELP_FOOTER, false);
} }
} }

View File

@ -29,8 +29,17 @@ import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotArea; import com.intellectualcrafters.plot.object.PlotArea;
import com.intellectualcrafters.plot.object.PlotPlayer; import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.object.RunnableVal; import com.intellectualcrafters.plot.object.RunnableVal;
import com.intellectualcrafters.plot.util.*; import com.intellectualcrafters.plot.util.AbstractTitle;
import com.intellectualcrafters.plot.util.CommentManager;
import com.intellectualcrafters.plot.util.EventUtil;
import com.intellectualcrafters.plot.util.ExpireManager;
import com.intellectualcrafters.plot.util.MainUtil;
import com.intellectualcrafters.plot.util.Permissions;
import com.intellectualcrafters.plot.util.PlotGamemode;
import com.intellectualcrafters.plot.util.PlotWeather;
import com.intellectualcrafters.plot.util.StringMan;
import com.intellectualcrafters.plot.util.TaskManager;
import com.intellectualcrafters.plot.util.UUIDHandler;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.UUID; import java.util.UUID;

View File

@ -84,7 +84,7 @@ public class MainListener {
if (Settings.USE_PLOTME_ALIAS) { if (Settings.USE_PLOTME_ALIAS) {
SpongeMain.THIS.getGame().getCommandManager().process(source, ("plots " + event.getArguments()).trim()); SpongeMain.THIS.getGame().getCommandManager().process(source, ("plots " + event.getArguments()).trim());
} else { } else {
source.sendMessage(SpongeUtil.getText(C.NOT_USING_PLOTME.s())); source.sendMessage(SpongeUtil.getText(C.NOT_USING_PLOTME));
} }
event.setCancelled(true); event.setCancelled(true);
} }