At least check if the chunk is loaded before updating signs, rather than just load them. - This needs major work

This commit is contained in:
selfslaughter 2020-04-30 03:41:34 +10:00
parent f37387800e
commit 0ba732fed9

View File

@ -92,6 +92,9 @@ public class SignsHandler {
MemoryStorage.signs.load();
for (String sign : MemoryStorage.signs.getFile().getKeys(false)) {
Location loc = (Location) MemoryStorage.signs.getFile().get(sign + ".location");
// check if that area is actually loaded. If not move on.
if (loc.getWorld().isChunkLoaded(loc.getBlockX() >> 4, loc.getBlockZ() >> 4)) {
if (loc.getBlock().getState() instanceof Sign) {
Sign signblock = (Sign) loc.getBlock().getState();
String[] lines = signblock.getLines();
@ -179,3 +182,4 @@ public class SignsHandler {
}
}
}
}