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