mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-12 16:27:47 +00:00
Added World to ChunkProviderEvent.ReplaceBiomeBlocks, and exposed metadata to End and Nether generation events. Close #1201
This commit is contained in:
1 parent
86ccfb1d68
commit
f6471c3c08
4 files changed
+88
-40
No files matched your search
@@ -2,6 +2,7 @@ package net.minecraftforge.event.terraingen;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.Event;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraft.world.chunk.IChunkProvider;
|
||||
|
||||
@@ -9,38 +10,41 @@ public class ChunkProviderEvent extends Event
|
||||
{
|
||||
|
||||
public final IChunkProvider chunkProvider;
|
||||
|
||||
|
||||
public ChunkProviderEvent(IChunkProvider chunkProvider)
|
||||
{
|
||||
this.chunkProvider = chunkProvider;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This event is fired when a chunks blocks are replaced by a biomes top and
|
||||
* filler blocks.
|
||||
*
|
||||
*
|
||||
* You can set the result to DENY to prevent the default replacement.
|
||||
*/
|
||||
@HasResult
|
||||
public static class ReplaceBiomeBlocks extends ChunkProviderEvent
|
||||
public static class ReplaceBiomeBlocks extends ChunkProviderEvent
|
||||
{
|
||||
public final int chunkX;
|
||||
public final int chunkZ;
|
||||
public final Block[] blockArray;
|
||||
public final byte[] metaArray;
|
||||
public final byte[] metaArray; // CAN BE NULL
|
||||
public final BiomeGenBase[] biomeArray;
|
||||
|
||||
public final World world; // CAN BE NULL
|
||||
|
||||
@Deprecated // TODO: Remove in 1.8
|
||||
public ReplaceBiomeBlocks(IChunkProvider chunkProvider, int chunkX, int chunkZ, Block[] blockArray, BiomeGenBase[] biomeArray)
|
||||
{
|
||||
super(chunkProvider);
|
||||
this.chunkX = chunkX;
|
||||
this.chunkZ = chunkZ;
|
||||
this.blockArray = blockArray;
|
||||
this.biomeArray = biomeArray;
|
||||
metaArray = new byte[256];
|
||||
this(chunkProvider, chunkX, chunkZ, blockArray, new byte[256], biomeArray, null);
|
||||
}
|
||||
|
||||
|
||||
@Deprecated // TODO: Remove in 1.8
|
||||
public ReplaceBiomeBlocks(IChunkProvider chunkProvider, int chunkX, int chunkZ, Block[] blockArray, byte[] metaArray, BiomeGenBase[] biomeArray)
|
||||
{
|
||||
this(chunkProvider, chunkZ, chunkZ, blockArray, metaArray, biomeArray, null);
|
||||
}
|
||||
|
||||
public ReplaceBiomeBlocks(IChunkProvider chunkProvider, int chunkX, int chunkZ, Block[] blockArray, byte[] metaArray, BiomeGenBase[] biomeArray, World world)
|
||||
{
|
||||
super(chunkProvider);
|
||||
this.chunkX = chunkX;
|
||||
@@ -48,17 +52,18 @@ public class ChunkProviderEvent extends Event
|
||||
this.blockArray = blockArray;
|
||||
this.biomeArray = biomeArray;
|
||||
this.metaArray = metaArray;
|
||||
this.world = world;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This event is fired before a chunks terrain noise field is initialized.
|
||||
*
|
||||
*
|
||||
* You can set the result to DENY to substitute your own noise field.
|
||||
*/
|
||||
@HasResult
|
||||
public static class InitNoiseField extends ChunkProviderEvent
|
||||
public static class InitNoiseField extends ChunkProviderEvent
|
||||
{
|
||||
public double[] noisefield;
|
||||
public final int posX;
|
||||
@@ -67,7 +72,7 @@ public class ChunkProviderEvent extends Event
|
||||
public final int sizeX;
|
||||
public final int sizeY;
|
||||
public final int sizeZ;
|
||||
|
||||
|
||||
public InitNoiseField(IChunkProvider chunkProvider, double[] noisefield, int posX, int posY, int posZ, int sizeX, int sizeY, int sizeZ)
|
||||
{
|
||||
super(chunkProvider);
|
||||
@@ -79,6 +84,6 @@ public class ChunkProviderEvent extends Event
|
||||
this.sizeY = sizeY;
|
||||
this.sizeZ = sizeZ;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user