MDouglas345 / Brok-n-Sindri-s-Trinkets

Creative Commons Zero v1.0 Universal
1 stars 1 forks source link

Item does not return when pinned in entity and chunk not loaded #34

Closed MDouglas345 closed 2 years ago

MDouglas345 commented 2 years ago

Whoops forgot description; the chunk needs to be fully loaded(?) to spawn in the entities for that chunk, which is why an entities cannot be accessed in unloaded chunks.

Solution idea : Create an interface mixin for the ServerChunkManager class that returns a completablefuture object, which will get the chunk and trigger my own code after that deals with entities in that chunk.

MDouglas345 commented 2 years ago

Fixed. Needs testing. The solution I went with was to create a new cardinal components array that stored all pinned entities, and referred to that when recalling and when the entity loaded / died, the array would reflect the current state of that entity.

I had to use this approach because MC's entity retrieval system is finicky at best.