001 package net.minecraftforge.event.terraingen; 002 003 import net.minecraft.world.biome.BiomeGenBase; 004 import net.minecraft.world.chunk.IChunkProvider; 005 import net.minecraftforge.event.*; 006 007 public class ChunkProviderEvent extends Event 008 { 009 010 public final IChunkProvider chunkProvider; 011 012 public ChunkProviderEvent(IChunkProvider chunkProvider) 013 { 014 this.chunkProvider = chunkProvider; 015 } 016 017 /** 018 * This event is fired when a chunks blocks are replaced by a biomes top and 019 * filler blocks. 020 * 021 * You can set the result to DENY to prevent the default replacement. 022 */ 023 @HasResult 024 public static class ReplaceBiomeBlocks extends ChunkProviderEvent 025 { 026 public final int chunkX; 027 public final int chunkZ; 028 public final byte[] blockArray; 029 public final BiomeGenBase[] biomeArray; 030 031 public ReplaceBiomeBlocks(IChunkProvider chunkProvider, int chunkX, int chunkZ, byte[] blockArray, BiomeGenBase[] biomeArray) 032 { 033 super(chunkProvider); 034 this.chunkX = chunkX; 035 this.chunkZ = chunkZ; 036 this.blockArray = blockArray; 037 this.biomeArray = biomeArray; 038 } 039 040 } 041 042 /** 043 * This event is fired before a chunks terrain noise field is initialized. 044 * 045 * You can set the result to DENY to substitute your own noise field. 046 */ 047 @HasResult 048 public static class InitNoiseField extends ChunkProviderEvent 049 { 050 public double[] noisefield; 051 public final int posX; 052 public final int posY; 053 public final int posZ; 054 public final int sizeX; 055 public final int sizeY; 056 public final int sizeZ; 057 058 public InitNoiseField(IChunkProvider chunkProvider, double[] noisefield, int posX, int posY, int posZ, int sizeX, int sizeY, int sizeZ) 059 { 060 super(chunkProvider); 061 this.noisefield = noisefield; 062 this.posX = posX; 063 this.posY = posY; 064 this.posZ = posZ; 065 this.sizeX = sizeX; 066 this.sizeY = sizeY; 067 this.sizeZ = sizeZ; 068 } 069 070 } 071 }