ForgePatch/common/net/minecraftforge/event/terraingen/TerrainGen.java

57 lines
2.4 KiB
Java
Raw Normal View History

package net.minecraftforge.event.terraingen;
import java.util.Random;
import net.minecraft.src.*;
import net.minecraftforge.common.*;
import net.minecraftforge.event.Event.*;
import net.minecraftforge.event.terraingen.DecorateBiomeEvent.*;
import net.minecraftforge.event.terraingen.OreGenEvent.*;
import net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.*;
import net.minecraftforge.event.terraingen.PopulateChunkEvent.*;
public abstract class TerrainGen
{
public static NoiseGeneratorOctaves[] getModdedNoiseGenerators(World world, Random rand, NoiseGeneratorOctaves[] original)
{
InitNoiseGensEvent event = new InitNoiseGensEvent(world, rand, original);
MinecraftForge.TERRAIN_GEN_BUS.post(event);
return event.newNoiseGens;
}
public static MapGenBase getModdedMapGen(MapGenBase original, InitMapGenEvent.EventType type)
{
InitMapGenEvent event = new InitMapGenEvent(type, original);
MinecraftForge.TERRAIN_GEN_BUS.post(event);
return event.newGen;
}
public static boolean populate(IChunkProvider chunkProvider, World world, Random rand, int chunkX, int chunkZ, boolean hasVillageGenerated, Populate.EventType type)
{
PopulateChunkEvent.Populate event = new PopulateChunkEvent.Populate(chunkProvider, world, rand, chunkX, chunkZ, hasVillageGenerated, type);
MinecraftForge.TERRAIN_GEN_BUS.post(event);
return event.getResult() != Result.DENY;
}
public static boolean decorate(World world, Random rand, int chunkX, int chunkZ, Decorate.EventType type)
{
Decorate event = new Decorate(world, rand, chunkX, chunkZ, type);
MinecraftForge.TERRAIN_GEN_BUS.post(event);
return event.getResult() != Result.DENY;
}
public static boolean generateOre(World world, Random rand, WorldGenerator generator, int worldX, int worldZ, GenerateMinable.EventType type)
{
GenerateMinable event = new GenerateMinable(world, rand, generator, worldX, worldZ, type);
MinecraftForge.ORE_GEN_BUS.post(event);
return event.getResult() != Result.DENY;
}
public static boolean saplingGrowTree(World world, Random rand, int x, int y, int z)
{
SaplingGrowTreeEvent event = new SaplingGrowTreeEvent(world, rand, x, y, z);
MinecraftForge.TERRAIN_GEN_BUS.post(event);
return event.getResult() != Result.DENY;
}
}