#Data management thread
1 messages · Page 1 of 1 (latest)
These are my classes
ChestManager.java
https://paste.md-5.net/timewaqici.cs
ChestPersistenceHandler.java
https://paste.md-5.net/vecokimiho.java
Explain your problem cleary
@EventHandler
public void onChunkLoad(ChunkLoadEvent event) {
if (!PDCUtils.has(event.getChunk(), NBTTags.ULTRA_CHEST_LOCATION_KEY, DataType.LOCATION)) return;
plugin.getChestManager().loadChestData(event.getChunk());
}
@EventHandler
public void onChunkUnload(ChunkUnloadEvent event) {
if (!PDCUtils.has(event.getChunk(), NBTTags.ULTRA_CHEST_LOCATION_KEY, DataType.LOCATION)) return;
CompletableFuture.runAsync(() -> {
plugin.getChestManager().unloadChestData(event.getChunk());
});
}
}
I am trying to only save the data to the PDC when a chunk unloads, and read it and store it when it loads
While it's loaded, I will use the stored object instead of the PDC object
But I'm having issues with onChunkUnload
Because I don't have the data to actually make it save from that method
Why don,t you have the data ?
.
Why
You don't have the data, well, but why you don't have it ?
hahaha
Alright then ! Good luck