package common.biome;

import common.init.BlockRegistry;
import common.rng.Random;
import common.util.BlockPos;
import common.world.AWorldServer;
import common.world.State;

public interface IBiome {
	public static abstract class BiomeProvider {
		private static BiomeProvider provider = new BiomeProvider() {
			public IBiome getBiome(BaseBiome base) {
				return new IBiome() {
					public State getFiller() {
						return BlockRegistry.getRegisteredBlock("air").getState();
					}
					public State getTop() {
						return BlockRegistry.getRegisteredBlock("air").getState();
					}
					public void growGrass(AWorldServer worldIn, BlockPos pos, State state, Random rand) {
					}
					public boolean generateBigMushroom(AWorldServer worldIn, BlockPos pos, State state, Random rand) {
						return false;
					}
					public void generateTree(AWorldServer worldIn, BlockPos pos, State state, Random rand) {
					}
				};
			}
		};
		
		public abstract IBiome getBiome(BaseBiome base);
	}
	
	public static void setProvider(BiomeProvider provider) {
		BiomeProvider.provider = provider;
	}
	
	public static IBiome getBiome(BaseBiome base) {
		return BiomeProvider.provider.getBiome(base);
	}
	
	void growGrass(AWorldServer worldIn, BlockPos pos, State state, Random rand);
	boolean generateBigMushroom(AWorldServer worldIn, BlockPos pos, State state, Random rand);
	void generateTree(AWorldServer worldIn, BlockPos pos, State state, Random rand);
	State getFiller();
	State getTop();
}