Replace all '/' in path to File.separator - Code Refactor

This commit is contained in:
Xephi
2014-08-25 03:12:28 +02:00
parent 12795436a0
commit d7cb60c1fe
104 changed files with 2470 additions and 3690 deletions
@@ -24,8 +24,7 @@ public class BungeeCordMessage implements PluginMessageListener {
return;
}
try {
final DataInputStream in = new DataInputStream(
new ByteArrayInputStream(message));
final DataInputStream in = new DataInputStream(new ByteArrayInputStream(message));
String subchannel = in.readUTF();
if (subchannel.equals("IP")) { // We need only the IP channel
String ip = in.readUTF();
@@ -19,8 +19,7 @@ public abstract class CombatTagComunicator {
public static boolean isNPC(Entity player) {
try {
if (Bukkit.getServer().getPluginManager().getPlugin("CombatTag") != null) {
combatApi = new CombatTagApi((CombatTag) Bukkit.getServer()
.getPluginManager().getPlugin("CombatTag"));
combatApi = new CombatTagApi((CombatTag) Bukkit.getServer().getPluginManager().getPlugin("CombatTag"));
try {
combatApi.getClass().getMethod("isNPC");
} catch (Exception e) {
@@ -12,7 +12,7 @@ public class EssSpawn extends CustomConfiguration {
private static EssSpawn spawn;
public EssSpawn() {
super(new File("./plugins/Essentials/spawn.yml"));
super(new File("." + File.separator + "plugins" + File.separator + "Essentials" + File.separator + "spawn.yml"));
spawn = this;
load();
}
@@ -26,16 +26,11 @@ public class EssSpawn extends CustomConfiguration {
public Location getLocation() {
try {
if (!this.contains("spawns.default.world")) return null;
if (this.getString("spawns.default.world").isEmpty()
|| this.getString("spawns.default.world") == "") return null;
Location location = new Location(Bukkit.getWorld(this
.getString("spawns.default.world")),
this.getDouble("spawns.default.x"),
this.getDouble("spawns.default.y"),
this.getDouble("spawns.default.z"), Float.parseFloat(this
.getString("spawns.default.yaw")),
Float.parseFloat(this.getString("spawns.default.pitch")));
if (!this.contains("spawns.default.world"))
return null;
if (this.getString("spawns.default.world").isEmpty() || this.getString("spawns.default.world") == "")
return null;
Location location = new Location(Bukkit.getWorld(this.getString("spawns.default.world")), this.getDouble("spawns.default.x"), this.getDouble("spawns.default.y"), this.getDouble("spawns.default.z"), Float.parseFloat(this.getString("spawns.default.yaw")), Float.parseFloat(this.getString("spawns.default.pitch")));
return location;
} catch (NullPointerException npe) {
return null;