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,16 +39,19 @@ 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 (cfg.getBoolean("worldborder.center.as_spawn", true)) {
|
||||||
if (PluginConfig.useWorldSpawn()) {
|
if (PluginConfig.useWorldSpawn()) {
|
||||||
@ -67,6 +70,7 @@ public class SettingsConfig {
|
|||||||
w.getWorldBorder().setCenter(config.getHome());
|
w.getWorldBorder().setCenter(config.getHome());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Fix for #17
|
// Fix for #17
|
||||||
String diff = cfg.getString("difficulty");
|
String diff = cfg.getString("difficulty");
|
||||||
|
Loading…
Reference in New Issue
Block a user