mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-12 08:17:35 +00:00
Fixed ChunkDataEvent.Save being fired with a null world if chunk isn't fully generated when unloaded. (#6628)
This commit is contained in:
1 parent
4fce4eb10b
commit
1fa88ebd56
5 files changed
+46
-1
No files matched your search
@@ -20,6 +20,7 @@
|
||||
package net.minecraftforge.event.world;
|
||||
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.world.IWorld;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
import net.minecraft.world.chunk.ChunkStatus;
|
||||
@@ -47,6 +48,12 @@ public class ChunkDataEvent extends ChunkEvent
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public ChunkDataEvent(IChunk chunk, IWorld world, CompoundNBT data)
|
||||
{
|
||||
super(chunk, world);
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public CompoundNBT getData()
|
||||
{
|
||||
return data;
|
||||
@@ -92,9 +99,15 @@ public class ChunkDataEvent extends ChunkEvent
|
||||
**/
|
||||
public static class Save extends ChunkDataEvent
|
||||
{
|
||||
@Deprecated // remove in 1.16
|
||||
public Save(IChunk chunk, CompoundNBT data)
|
||||
{
|
||||
super(chunk, data);
|
||||
}
|
||||
|
||||
public Save(IChunk chunk, IWorld world, CompoundNBT data)
|
||||
{
|
||||
super(chunk, world, data);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
package net.minecraftforge.event.world;
|
||||
|
||||
import net.minecraft.world.IWorld;
|
||||
import net.minecraft.world.chunk.IChunk;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
@@ -41,6 +42,12 @@ public class ChunkEvent extends WorldEvent
|
||||
this.chunk = chunk;
|
||||
}
|
||||
|
||||
public ChunkEvent(IChunk chunk, IWorld world)
|
||||
{
|
||||
super(world);
|
||||
this.chunk = chunk;
|
||||
}
|
||||
|
||||
public IChunk getChunk()
|
||||
{
|
||||
return chunk;
|
||||
|
||||
Reference in new issue
Block a user