    001    package net.minecraftforge.event.terraingen;
    002
    003    import cpw.mods.fml.common.Side;
    004    import cpw.mods.fml.common.asm.SideOnly;
    005
    006    import net.minecraft.world.biome.BiomeDecorator;
    007    import net.minecraft.world.biome.BiomeGenBase;
    008    import net.minecraftforge.event.*;
    009
    010    public class BiomeEvent extends Event
    011    {
    012        public final BiomeGenBase biome;
    013
    014        public BiomeEvent(BiomeGenBase biome)
    015        {
    016            this.biome = biome;
    017        }
    018
    019        public static class CreateDecorator extends BiomeEvent
    020        {
    021            public final BiomeDecorator originalBiomeDecorator;
    022            public BiomeDecorator newBiomeDecorator;
    023
    024            public CreateDecorator(BiomeGenBase biome, BiomeDecorator original)
    025            {
    026                super(biome);
    027                originalBiomeDecorator = original;
    028                newBiomeDecorator = original;
    029            }
    030        }
    031
    032        public static class BlockReplacement extends BiomeEvent
    033        {
    034            public final int original;
    035            public int replacement;
    036
    037            public BlockReplacement(BiomeGenBase biome, int original, int replacement)
    038            {
    039                super(biome);
    040                this.original = original;
    041                this.replacement = replacement;
    042            }
    043        }
    044
    045
    046        @SideOnly(Side.CLIENT)
    047       public static class BiomeColor extends BiomeEvent
    048        {
    049            public final int originalColor;
    050            public int newColor;
    051
    052            public BiomeColor(BiomeGenBase biome, int original)
    053            {
    054                super(biome);
    055                originalColor = original;
    056                newColor = original;
    057            }
    058        }
    059
    060        /**
    061         * This event is fired when the village generator attempts to choose a block ID
    062         * based on the village's biome.
    063         *
    064         * You can set the result to DENY to prevent the default block ID selection.
    065         */
    066        @HasResult
    067        public static class GetVillageBlockID extends BlockReplacement
    068        {
    069            public GetVillageBlockID(BiomeGenBase biome, int original, int replacement)
    070            {
    071                super(biome, original, replacement);
    072            }
    073        }
    074
    075        /**
    076         * This event is fired when the village generator attempts to choose a block
    077         * metadata based on the village's biome.
    078         *
    079         * You can set the result to DENY to prevent the default block metadata selection.
    080         */
    081        @HasResult
    082        public static class GetVillageBlockMeta extends BlockReplacement
    083        {
    084            public GetVillageBlockMeta(BiomeGenBase biome, int original, int replacement)
    085            {
    086                super(biome, original, replacement);
    087            }
    088        }
    089
    090        /**
    091         * This event is fired when a biome is queried for its grass color.
    092         */
    093
    094        @SideOnly(Side.CLIENT)
    095        public static class GetGrassColor extends BiomeColor
    096        {
    097            public GetGrassColor(BiomeGenBase biome, int original)
    098            {
    099                super(biome, original);
    100            }
    101        }
    102
    103        /**
    104         * This event is fired when a biome is queried for its grass color.
    105         */
    106        @SideOnly(Side.CLIENT)
    107        public static class GetFoliageColor extends BiomeColor
    108        {
    109            public GetFoliageColor(BiomeGenBase biome, int original)
    110            {
    111                super(biome, original);
    112            }
    113        }
    114
    115        /**
    116         * This event is fired when a biome is queried for its water color.
    117         */
    118        @SideOnly(Side.CLIENT)
    119        public static class GetWaterColor extends BiomeColor
    120        {
    121            public GetWaterColor(BiomeGenBase biome, int original)
    122            {
    123                super(biome, original);
    124            }
    125        }
    126    }