Closed Nishh closed 6 years ago
this line: https://github.com/Ugleh/RedstoneProximitySensor/blob/master/src/com/ugleh/redstoneproximitysensor/utils/RPS.java#L133
you wanted to check if chunk is loaded. but Location#getChunk loads the chunk. and makes lag if you have a lot of rps (and memory leak. keeps all rps chunks loaded) https://www.spigotmc.org/threads/when-are-chunks-loaded.58342/
if you do boolean isLoaded = location.getWorld().isChunkLoaded(location.getBlockX()>>4,location.getBlockZ()>>4); problem will be fixed.
Sorry for the late reply, I have been on hiatus. Thanks for the info, I will implement.
this line: https://github.com/Ugleh/RedstoneProximitySensor/blob/master/src/com/ugleh/redstoneproximitysensor/utils/RPS.java#L133
you wanted to check if chunk is loaded. but Location#getChunk loads the chunk. and makes lag if you have a lot of rps (and memory leak. keeps all rps chunks loaded) https://www.spigotmc.org/threads/when-are-chunks-loaded.58342/
if you do boolean isLoaded = location.getWorld().isChunkLoaded(location.getBlockX()>>4,location.getBlockZ()>>4); problem will be fixed.