Skip to content

Commit

Permalink
Fix EntitiesUnloadEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
Mgazul committed Oct 28, 2024
1 parent 7c635fd commit 28f3564
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public void close(boolean save) throws IOException {
*/
@Overwrite
private boolean storeChunkSections(long l, Consumer<T> consumer) {
PersistentEntitySectionManager.ChunkLoadStatus chunkLoadStatus = (PersistentEntitySectionManager.ChunkLoadStatus)this.chunkLoadStatuses.get(l);
PersistentEntitySectionManager.ChunkLoadStatus chunkLoadStatus = this.chunkLoadStatuses.get(l);
if (chunkLoadStatus == PersistentEntitySectionManager.ChunkLoadStatus.PENDING) {
return false;
} else {
Expand All @@ -72,8 +72,7 @@ private boolean storeChunkSections(long l, Consumer<T> consumer) {
if (chunkLoadStatus == PersistentEntitySectionManager.ChunkLoadStatus.LOADED) {
this.permanentStorage.storeEntities(new ChunkEntities(new ChunkPos(l), ImmutableList.of()));
if (banner$fireEvent) {
CraftEventFactory.callEntitiesUnloadEvent(((EntityStorage) permanentStorage).level, new ChunkPos(l),
list.stream().map(entity -> (Entity) entity).collect(Collectors.toList()));
CraftEventFactory.callEntitiesUnloadEvent(((EntityStorage) permanentStorage).level, new ChunkPos(l), ImmutableList.of());
}
}
return true;
Expand Down

0 comments on commit 28f3564

Please sign in to comment.