001 package net.minecraftforge.event.terraingen;
002
003 import java.util.Random;
004
005 import net.minecraft.world.World;
006 import net.minecraftforge.event.*;
007
008 public class DecorateBiomeEvent extends Event
009 {
010 public final World world;
011 public final Random rand;
012 public final int chunkX;
013 public final int chunkZ;
014
015 public DecorateBiomeEvent(World world, Random rand, int worldX, int worldZ)
016 {
017 this.world = world;
018 this.rand = rand;
019 this.chunkX = worldX;
020 this.chunkZ = worldZ;
021 }
022
023 public static class Pre extends DecorateBiomeEvent
024 {
025 public Pre(World world, Random rand, int worldX, int worldZ)
026 {
027 super(world, rand, worldX, worldZ);
028 }
029 }
030
031 public static class Post extends DecorateBiomeEvent
032 {
033 public Post(World world, Random rand, int worldX, int worldZ)
034 {
035 super(world, rand, worldX, worldZ);
036 }
037 }
038
039 /**
040 * This event is fired when a chunk is decorated with a biome feature.
041 *
042 * You can set the result to DENY to prevent the default biome decoration.
043 */
044 @HasResult
045 public static class Decorate extends DecorateBiomeEvent
046 {
047 /** Use CUSTOM to filter custom event types
048 */
049 public static enum EventType { BIG_SHROOM, CACTUS, CLAY, DEAD_BUSH, LILYPAD, FLOWERS, GRASS, LAKE, PUMPKIN, REED, SAND, SAND_PASS2, SHROOM, TREE, CUSTOM }
050
051 public final EventType type;
052
053 public Decorate(World world, Random rand, int worldX, int worldZ, EventType type)
054 {
055 super(world, rand, worldX, worldZ);
056 this.type = type;
057 }
058 }
059 }