From 8b0e59209c735c3168eb76dd01b638d26957c349 Mon Sep 17 00:00:00 2001 From: MattBDev Date: Tue, 5 Jul 2016 23:43:08 -0400 Subject: [PATCH] Remove getServerName() --- .../main/java/com/plotsquared/bukkit/BukkitMain.java | 5 ----- .../java/com/intellectualcrafters/plot/IPlotMain.java | 6 ------ .../com/intellectualcrafters/plot/commands/Load.java | 10 ++-------- .../com/intellectualcrafters/plot/commands/Save.java | 3 +-- .../main/java/com/plotsquared/sponge/SpongeMain.java | 5 ----- 5 files changed, 3 insertions(+), 26 deletions(-) diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/BukkitMain.java b/Bukkit/src/main/java/com/plotsquared/bukkit/BukkitMain.java index 7fb9c2fde..fcb6354d1 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/BukkitMain.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/BukkitMain.java @@ -570,11 +570,6 @@ public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain return new BukkitInventoryUtil(); } - @Override - public String getServerName() { - return Bukkit.getServerName(); - } - @Override public void startMetrics() { Metrics metrics = new Metrics(this); diff --git a/Core/src/main/java/com/intellectualcrafters/plot/IPlotMain.java b/Core/src/main/java/com/intellectualcrafters/plot/IPlotMain.java index 205677391..6c644b38b 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/IPlotMain.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/IPlotMain.java @@ -236,12 +236,6 @@ public interface IPlotMain extends ILogger { */ void registerWorldEvents(); - /** - * Get the name of the server. - * @return the server name - */ - String getServerName(); - /** * Get the class that will manage player titles. * @return diff --git a/Core/src/main/java/com/intellectualcrafters/plot/commands/Load.java b/Core/src/main/java/com/intellectualcrafters/plot/commands/Load.java index b8073f9cd..301f0d87f 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/commands/Load.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/commands/Load.java @@ -148,13 +148,7 @@ public class Load extends SubCommand { String world = split[1]; PlotId id = PlotId.fromString(split[2] + ';' + split[3]); String size = split[4]; - String server = split[5].replaceAll(".schematic", ""); - String color; - if (PS.get().IMP.getServerName().replaceAll("[^A-Za-z0-9]", "").equals(server)) { - color = "$4"; - } else { - color = "$1"; - } + String color = "$4"; MainUtil.sendMessage(player, "$3[$2" + (i + 1) + "$3] " + color + time + "$3 | " + color + world + ';' + id + "$3 | " + color + size + 'x' + size); } catch (Exception e) { @@ -191,7 +185,7 @@ public class Load extends SubCommand { time -= minutes * 60; toreturn.append(minutes + "m "); } - if (toreturn.equals("") || (time > 0)) { + if (toreturn.length() == 0 || (time > 0)) { toreturn.append(time + "s "); } return toreturn.toString().trim(); diff --git a/Core/src/main/java/com/intellectualcrafters/plot/commands/Save.java b/Core/src/main/java/com/intellectualcrafters/plot/commands/Save.java index c2c99f258..90fb76050 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/commands/Save.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/commands/Save.java @@ -63,12 +63,11 @@ public class Save extends SubCommand { @Override public void run() { String time = (System.currentTimeMillis() / 1000) + ""; - String name = PS.get().IMP.getServerName().replaceAll("[^A-Za-z0-9]", ""); Location[] corners = plot.getCorners(); int size = (corners[1].getX() - corners[0].getX()) + 1; PlotId id = plot.getId(); String world = plot.getArea().toString().replaceAll(";", "-").replaceAll("[^A-Za-z0-9]", ""); - final String file = time + '_' + world + '_' + id.x + '_' + id.y + '_' + size + '_' + name; + final String file = time + '_' + world + '_' + id.x + '_' + id.y + '_' + size; UUID uuid = player.getUUID(); SchematicHandler.manager.upload(value, uuid, file, new RunnableVal() { @Override diff --git a/Sponge/src/main/java/com/plotsquared/sponge/SpongeMain.java b/Sponge/src/main/java/com/plotsquared/sponge/SpongeMain.java index 44848bd05..6d5671ebc 100644 --- a/Sponge/src/main/java/com/plotsquared/sponge/SpongeMain.java +++ b/Sponge/src/main/java/com/plotsquared/sponge/SpongeMain.java @@ -293,11 +293,6 @@ public class SpongeMain implements IPlotMain { Sponge.getEventManager().registerListeners(this, new WorldEvents()); } - @Override - public String getServerName() { - throw new UnsupportedOperationException("NOT IMPLEMENTED YET"); - } - @Override public void startMetrics() { SpongeMetrics metrics = new SpongeMetrics(this.game, this.plugin);