mirror of
https://github.com/trainerlord/WorldSystem.git
synced 2024-09-29 04:27:32 +02:00
Fixed worldborder bug
This commit is contained in:
parent
1fb92ab47c
commit
f543417fe4
@ -39,32 +39,36 @@ public class SettingsConfig {
|
|||||||
String worldname = w.getName();
|
String worldname = w.getName();
|
||||||
UUID uuid = UUID.fromString(worldname.substring(worldname.length() - 36));
|
UUID uuid = UUID.fromString(worldname.substring(worldname.length() - 36));
|
||||||
Player p = Bukkit.getPlayer(uuid);
|
Player p = Bukkit.getPlayer(uuid);
|
||||||
|
|
||||||
|
// Only edit worldborder size if owner is online
|
||||||
if (p != null && p.isOnline()) {
|
if (p != null && p.isOnline()) {
|
||||||
|
|
||||||
|
// Check permissions
|
||||||
for (String string : borderSizes.keySet()) {
|
for (String string : borderSizes.keySet()) {
|
||||||
if (p.hasPermission(string) && size < borderSizes.get(string)) {
|
if (p.hasPermission(string) && size < borderSizes.get(string)) {
|
||||||
size = borderSizes.get(string);
|
size = borderSizes.get(string);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
w.getWorldBorder().setSize(size);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
w.getWorldBorder().setSize(size);
|
if (cfg.getBoolean("worldborder.center.as_spawn", true)) {
|
||||||
|
if (PluginConfig.useWorldSpawn()) {
|
||||||
if (cfg.getBoolean("worldborder.center.as_spawn", true)) {
|
w.getWorldBorder().setCenter(PluginConfig.getWorldSpawn(w));
|
||||||
if (PluginConfig.useWorldSpawn()) {
|
} else {
|
||||||
w.getWorldBorder().setCenter(PluginConfig.getWorldSpawn(w));
|
w.getWorldBorder().setCenter(w.getSpawnLocation());
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
w.getWorldBorder().setCenter(w.getSpawnLocation());
|
Location loc = new Location(w, cfg.getDouble("worldborder.center.x", 0),
|
||||||
|
cfg.getDouble("worldborder.center.y", 20), cfg.getDouble("worldborder.center.z", 0));
|
||||||
|
w.getWorldBorder().setCenter(loc);
|
||||||
|
}
|
||||||
|
if (cfg.getBoolean("worldborder.center.as_home")) {
|
||||||
|
WorldConfig config = WorldConfig.getWorldConfig(w.getName());
|
||||||
|
if (config.getHome() != null)
|
||||||
|
w.getWorldBorder().setCenter(config.getHome());
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
Location loc = new Location(w, cfg.getDouble("worldborder.center.x", 0),
|
|
||||||
cfg.getDouble("worldborder.center.y", 20), cfg.getDouble("worldborder.center.z", 0));
|
|
||||||
w.getWorldBorder().setCenter(loc);
|
|
||||||
}
|
|
||||||
if (cfg.getBoolean("worldborder.center.as_home")) {
|
|
||||||
WorldConfig config = WorldConfig.getWorldConfig(w.getName());
|
|
||||||
if (config.getHome() != null)
|
|
||||||
w.getWorldBorder().setCenter(config.getHome());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user