mirror of
https://github.com/songoda/FabledSkyBlock.git
synced 2025-02-19 05:01:45 +01:00
[Fixed] Island Setting saving was still bugged.
[Fixed] LagSpike due to old method used in BlockListener.
This commit is contained in:
parent
09e5291478
commit
ebfaea252c
@ -934,7 +934,7 @@ public class Island {
|
|||||||
|
|
||||||
for (Entry<IslandRole, List<IslandPermission>> entry : this.islandPermissions.entrySet()) {
|
for (Entry<IslandRole, List<IslandPermission>> entry : this.islandPermissions.entrySet()) {
|
||||||
for (IslandPermission permission : entry.getValue()) {
|
for (IslandPermission permission : entry.getValue()) {
|
||||||
configLoad.set("Settings." + entry.getKey().getFriendlyName() + "." + permission.getPermission().getName(), permission.getStatus());
|
configLoad.set("Settings." + entry.getKey().getFriendlyName().toUpperCase(Locale.US) + "." + permission.getPermission().getName(), permission.getStatus());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -335,13 +335,23 @@ public class BlockListeners implements Listener {
|
|||||||
isObstructing = true;
|
isObstructing = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Specific check for beds
|
// Specific check for beds using getBlockData() for versions 1.13 and above
|
||||||
if (!isObstructing && event.getBlock().getState().getData() instanceof org.bukkit.material.Bed) {
|
if (!isObstructing && event.getBlock().getBlockData() instanceof org.bukkit.block.data.type.Bed && MajorServerVersion.isServerVersionAtLeast(MajorServerVersion.V1_13)) {
|
||||||
|
org.bukkit.block.data.type.Bed bedData = (org.bukkit.block.data.type.Bed) event.getBlock().getBlockData();
|
||||||
|
BlockFace bedDirection = bedData.getFacing();
|
||||||
|
org.bukkit.block.Block bedBlock = block.getRelative(bedDirection);
|
||||||
|
if (LocationUtil.isLocationAffectingIslandSpawn(bedBlock.getLocation(), island, world)) {
|
||||||
|
isObstructing = true;
|
||||||
|
}
|
||||||
|
} // Specific check for beds using getBlockData() for versions 1.12 and below
|
||||||
|
else if (MajorServerVersion.isServerVersionAtOrBelow(MajorServerVersion.V1_12)) {
|
||||||
|
if (!isObstructing && event.getBlock().getState().getData() instanceof org.bukkit.material.Bed){
|
||||||
BlockFace bedDirection = ((org.bukkit.material.Bed) event.getBlock().getState().getData()).getFacing();
|
BlockFace bedDirection = ((org.bukkit.material.Bed) event.getBlock().getState().getData()).getFacing();
|
||||||
org.bukkit.block.Block bedBlock = block.getRelative(bedDirection);
|
org.bukkit.block.Block bedBlock = block.getRelative(bedDirection);
|
||||||
if (LocationUtil.isLocationAffectingIslandSpawn(bedBlock.getLocation(), island, world)) {
|
if (LocationUtil.isLocationAffectingIslandSpawn(bedBlock.getLocation(), island, world)) {
|
||||||
isObstructing = true;
|
isObstructing = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isObstructing) {
|
if (isObstructing) {
|
||||||
|
Loading…
Reference in New Issue
Block a user