Commit Graph
11 Commits
Author SHA1 Message Date
Bjarne Koll ce991b96eb Fully deserialise persistent anger post async load (#8560)
The modified patch prevents entity loading off the main thread when
entities are initially loaded.

However, the initial loading of an entity is not the only time the
Entity#readAdditionalSaveData method is called. Commands like /data also
invoke the method (through Entity#load) to update an entities data
without completely re-creating it.

This however breaks with the current patch, as the patch moves parts of
the entity lookup for persistent anger deserialisation into the first
tick of an entity (which obviously is only called once and hence not
re-run when an already ticking entity is modified as laid out above).

This change actively runs the now split logic for deserialisation again
if the entity has already ticked its first tick. This way, initial
deserialisation is still split into one off thread and the first tick
parts, but following main thread deserialisations can happen completely
inside Entity#readAdditionalSaveData is called.
2022-12-02 18:09:41 +01:00
Bjarne Koll f044bd9e6c Mark parsed PoiChunks with data as not loaded (#8405)
Previously, PoiChunk#empty would create a new empty poi chunk with
loaded already set to true, as no data was contained in the chunk.
This allowed the poi chunk to skip expensive trips to the main thread.

However, PoiChunk#parse used #empty to create the initial PoiChunk
instance that is then filled with data.
This leads to PoiChunks returned from #parse to already be marked as
loaded, preventing the then needed trip to the tick thread to update
things like the village distance tracker.

To fix this, this commit now marks the PoiChunks loaded state as false
if the parse logic actually read and parsed any data.
This allows the PoiChunk#load method to properly run its callbacks when
called for the first time.
2022-09-29 17:54:47 +02:00
Bjarne Koll 614f528234 Fix typos in isTickingWorlds API javadocs (#8382) 2022-09-25 02:01:17 +02:00
Bjarne Koll 0ed6315664 Properly close section storage managed files (#8364) 2022-09-17 20:50:01 +02:00
Bjarne Koll c908ebcbcb Add ZombieVillager conversion without entity event (#8111)
The ZombieVillager#setConversionTime API method internally calls
startConversion which always broadcasts the entity event responsible for
playing the respective sound at the beginning of a conversion.

This is not always wanted by developers when modifying already
converting zombies in particular.

This commit expands the ZombieVillager interface with another overload
of the setConversionTime method that also takes a simple toggle flag
indicating whether or not the entity event should be published to the
world.
2022-07-07 23:43:28 +02:00
Bjarne Koll 569283aecf Call EntityDropItemEvent for goats dropping horns (#8094) 2022-07-04 21:26:43 +02:00
Bjarne Koll 0c85e94214 Revert to old createProfile(UUID, String) logic (#7723) 2022-04-22 20:54:08 +02:00
Bjarne Koll 6b895464b0 Properly create profiles with custom name/uuid (#7558) 2022-03-19 14:39:38 +01:00
Bjarne Koll 905e5cdc31 Properly lookup random-ticked precipitation blocks (#7606) 2022-03-15 19:44:25 +01:00
Bjarne Koll 9425b30b18 Use access transformers for player profile API (#7468) 2022-02-18 18:30:37 +01:00
Bjarne Koll 1586de3418 Log exceptions thrown during chat processing (#7467) 2022-02-12 03:42:12 +01:00