forked from stefatorus/LagAssist
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1.0 KiB
39 lines
1.0 KiB
4 years ago
|
package cx.sfy.LagAssist.utils;
|
||
|
|
||
|
import java.util.ArrayList;
|
||
|
import java.util.List;
|
||
|
|
||
|
import org.bukkit.Bukkit;
|
||
|
import org.bukkit.Location;
|
||
|
import org.bukkit.World;
|
||
|
|
||
|
import cx.sfy.LagAssist.Main;
|
||
|
|
||
|
public class WorldMgr {
|
||
|
|
||
|
public static List<String> blacklist = new ArrayList<String>();
|
||
|
|
||
|
public static void Enabler() {
|
||
|
if (Main.config.getBoolean("blacklisted-worlds.enabled")) {
|
||
|
Bukkit.getLogger().info(" §e[§a✔§e] §fWorldManager.");
|
||
|
blacklist = Main.config.getStringList("blacklisted-worlds.list");
|
||
|
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public static boolean isBlacklisted(World w) {
|
||
|
return blacklist.contains(w.getName());
|
||
|
}
|
||
|
|
||
|
public static String serializeLocation(Location loc) {
|
||
|
return loc.getWorld().getName() + "," + loc.getBlockX() + "," + loc.getBlockY() + "," + loc.getBlockZ();
|
||
|
}
|
||
|
|
||
|
public static Location deserializeLocation(String stg) {
|
||
|
String[] raw = stg.split(",");
|
||
|
|
||
|
return new Location(Bukkit.getWorld(raw[0]), Double.valueOf(raw[1]), Double.valueOf(raw[2]), Double.valueOf(raw[3]));
|
||
|
}
|
||
|
|
||
|
}
|