@EventHandler(priority = EventPriority.MONITOR) void onWorldLoad(WorldLoadEvent event) { for (CChunkLoader cl : DataStoreManager.getDataStore().getChunkLoaders(event.getWorld().getName())) { if (cl.isLoadable()) { BCLForgeLib.instance().addChunkLoader(cl); } } }
@EventHandler(priority = EventPriority.MONITOR) void onPlayerQuit(PlayerQuitEvent event) { List<CChunkLoader> clList = DataStoreManager.getDataStore().getChunkLoaders(event.getPlayer().getUniqueId()); for (CChunkLoader chunkLoader : clList) { if (!chunkLoader.isAlwaysOn()) { BCLForgeLib.instance().removeChunkLoader(chunkLoader); } } }
@EventHandler(priority = EventPriority.MONITOR) void onPlayerLogin(PlayerLoginEvent event) { if (event.getResult() != Result.ALLOWED) { return; } List<CChunkLoader> clList = DataStoreManager.getDataStore().getChunkLoaders(event.getPlayer().getUniqueId()); for (CChunkLoader chunkLoader : clList) { if (!chunkLoader.isAlwaysOn() && chunkLoader.blockCheck()) { BCLForgeLib.instance().addChunkLoader(chunkLoader); } } }