diff --git a/patches/minecraft/net/minecraft/world/chunk/storage/ChunkSerializer.java.patch b/patches/minecraft/net/minecraft/world/chunk/storage/ChunkSerializer.java.patch
index 7edd688bf..269b4f4e2 100644
--- a/patches/minecraft/net/minecraft/world/chunk/storage/ChunkSerializer.java.patch
+++ b/patches/minecraft/net/minecraft/world/chunk/storage/ChunkSerializer.java.patch
@@ -17,7 +17,24 @@
chunkprimer.func_201637_h(blockpos);
}
}
-@@ -294,12 +295,22 @@
+@@ -182,6 +183,7 @@
+ }
+
+ if (chunkstatus$type == ChunkStatus.Type.LEVELCHUNK) {
++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.ChunkDataEvent.Load(ichunk, compoundnbt, chunkstatus$type));
+ return new ChunkPrimerWrapper((Chunk)ichunk);
+ } else {
+ ChunkPrimer chunkprimer1 = (ChunkPrimer)ichunk;
+@@ -215,6 +217,8 @@
+ chunkprimer1.func_205767_a(generationstage$carving, BitSet.valueOf(compoundnbt5.func_74770_j(s1)));
+ }
+
++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.ChunkDataEvent.Load(ichunk, compoundnbt, chunkstatus$type));
++
+ return chunkprimer1;
+ }
+ }
+@@ -294,12 +298,22 @@
for(int k = 0; k < chunk.func_177429_s().length; ++k) {
for(Entity entity : chunk.func_177429_s()[k]) {
CompoundNBT compoundnbt3 = new CompoundNBT();
diff --git a/src/main/java/net/minecraftforge/event/world/ChunkDataEvent.java b/src/main/java/net/minecraftforge/event/world/ChunkDataEvent.java
index 0e1c77c42..d107154d7 100644
--- a/src/main/java/net/minecraftforge/event/world/ChunkDataEvent.java
+++ b/src/main/java/net/minecraftforge/event/world/ChunkDataEvent.java
@@ -22,6 +22,7 @@ package net.minecraftforge.event.world;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.world.World;
import net.minecraft.world.chunk.Chunk;
+import net.minecraft.world.chunk.ChunkStatus;
import net.minecraft.world.chunk.IChunk;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.eventbus.api.Cancelable;
@@ -54,7 +55,7 @@ public class ChunkDataEvent extends ChunkEvent
/**
* ChunkDataEvent.Load is fired when vanilla Minecraft attempts to load Chunk data.
* This event is fired during chunk loading in
- * {@link net.minecraftforge.common.chunkio.ChunkIOProvider#syncCallback()}.
+ * {@link net.minecraft.world.chunk.storage.ChunkSerializer.read(ServerWorld, TemplateManager, PointOfInterestManager, ChunkPos, CompoundNBT)} which means it is async, so be careful.
*
* This event is not {@link Cancelable}.
*
@@ -64,9 +65,17 @@ public class ChunkDataEvent extends ChunkEvent
**/
public static class Load extends ChunkDataEvent
{
- public Load(IChunk chunk, CompoundNBT data)
+ private ChunkStatus.Type status;
+
+ public Load(IChunk chunk, CompoundNBT data, ChunkStatus.Type status)
{
super(chunk, data);
+ this.status = status;
+ }
+
+ public ChunkStatus.Type getStatus()
+ {
+ return this.status;
}
}