#Data management thread

1 messages · Page 1 of 1 (latest)

rocky barn
#

These are my classes

late fulcrum
#

Explain your problem cleary

rocky barn
#
    @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

late fulcrum
#

Why don,t you have the data ?

rocky barn
#

Ummm

#

I don't understand the question

late fulcrum
#

Why

#

You don't have the data, well, but why you don't have it ?

rocky barn
#

Ok you solved my issue already

#

lol

#

Actually

late fulcrum
#

hahaha

rocky barn
#

You made me think

#

Thanks

#

Lets test this

late fulcrum
#

Alright then ! Good luck