Remove getServerName()

This commit is contained in:
MattBDev 2016-07-05 23:43:08 -04:00
parent ca8b82dcbe
commit 8b0e59209c
5 changed files with 3 additions and 26 deletions

View File

@ -570,11 +570,6 @@ public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain
return new BukkitInventoryUtil(); return new BukkitInventoryUtil();
} }
@Override
public String getServerName() {
return Bukkit.getServerName();
}
@Override @Override
public void startMetrics() { public void startMetrics() {
Metrics metrics = new Metrics(this); Metrics metrics = new Metrics(this);

View File

@ -236,12 +236,6 @@ public interface IPlotMain extends ILogger {
*/ */
void registerWorldEvents(); void registerWorldEvents();
/**
* Get the name of the server.
* @return the server name
*/
String getServerName();
/** /**
* Get the class that will manage player titles. * Get the class that will manage player titles.
* @return * @return

View File

@ -148,13 +148,7 @@ public class Load extends SubCommand {
String world = split[1]; String world = split[1];
PlotId id = PlotId.fromString(split[2] + ';' + split[3]); PlotId id = PlotId.fromString(split[2] + ';' + split[3]);
String size = split[4]; String size = split[4];
String server = split[5].replaceAll(".schematic", ""); String color = "$4";
String color;
if (PS.get().IMP.getServerName().replaceAll("[^A-Za-z0-9]", "").equals(server)) {
color = "$4";
} else {
color = "$1";
}
MainUtil.sendMessage(player, MainUtil.sendMessage(player,
"$3[$2" + (i + 1) + "$3] " + color + time + "$3 | " + color + world + ';' + id + "$3 | " + color + size + 'x' + size); "$3[$2" + (i + 1) + "$3] " + color + time + "$3 | " + color + world + ';' + id + "$3 | " + color + size + 'x' + size);
} catch (Exception e) { } catch (Exception e) {
@ -191,7 +185,7 @@ public class Load extends SubCommand {
time -= minutes * 60; time -= minutes * 60;
toreturn.append(minutes + "m "); toreturn.append(minutes + "m ");
} }
if (toreturn.equals("") || (time > 0)) { if (toreturn.length() == 0 || (time > 0)) {
toreturn.append(time + "s "); toreturn.append(time + "s ");
} }
return toreturn.toString().trim(); return toreturn.toString().trim();

View File

@ -63,12 +63,11 @@ public class Save extends SubCommand {
@Override @Override
public void run() { public void run() {
String time = (System.currentTimeMillis() / 1000) + ""; String time = (System.currentTimeMillis() / 1000) + "";
String name = PS.get().IMP.getServerName().replaceAll("[^A-Za-z0-9]", "");
Location[] corners = plot.getCorners(); Location[] corners = plot.getCorners();
int size = (corners[1].getX() - corners[0].getX()) + 1; int size = (corners[1].getX() - corners[0].getX()) + 1;
PlotId id = plot.getId(); PlotId id = plot.getId();
String world = plot.getArea().toString().replaceAll(";", "-").replaceAll("[^A-Za-z0-9]", ""); 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(); UUID uuid = player.getUUID();
SchematicHandler.manager.upload(value, uuid, file, new RunnableVal<URL>() { SchematicHandler.manager.upload(value, uuid, file, new RunnableVal<URL>() {
@Override @Override

View File

@ -293,11 +293,6 @@ public class SpongeMain implements IPlotMain {
Sponge.getEventManager().registerListeners(this, new WorldEvents()); Sponge.getEventManager().registerListeners(this, new WorldEvents());
} }
@Override
public String getServerName() {
throw new UnsupportedOperationException("NOT IMPLEMENTED YET");
}
@Override @Override
public void startMetrics() { public void startMetrics() {
SpongeMetrics metrics = new SpongeMetrics(this.game, this.plugin); SpongeMetrics metrics = new SpongeMetrics(this.game, this.plugin);