下面列出了怎么用net.minecraft.world.gen.layer.GenLayer的API类实例代码及写法,或者点击链接到github查看源代码。
public BiomeProviderTofu(long seed, WorldType worldType)
{
this();
GenLayer agenlayer[] = GenLayerTofu.initializeAllBiomeGeneratorsTofu(seed, worldType);
this.genBiomes = agenlayer[0];
this.biomeIndexLayer = agenlayer[1];
}
@SubscribeEvent(priority = EventPriority.LOWEST)
public void onBiomeGenInit(WorldTypeEvent.InitBiomeGens event) {
// Negative one is flag value for normal world gen
if (bparams.getBiome() == -1)
return;
GenLayer[] replacement = new GenLayer[2];
replacement[0] = new GenLayerConstant(bparams.getBiome());
replacement[1] = replacement[0];
event.setNewBiomeGens(replacement);
}
/**
* Creates the GenLayerBiome used for generating the world
*
* @param worldSeed The world seed
* @param parentLayer The parent layer to feed into any layer you return
* @return A GenLayer that will return ints representing the Biomes to be generated, see GenLayerBiome
*/
@Override
public GenLayer getBiomeLayer(long worldSeed, GenLayer parentLayer, ChunkGeneratorSettings chunkProviderSettings)
{
//return super.getBiomeLayer(worldSeed, parentLayer);
GenLayer ret = new GenLayerBiomePlanet(200L, parentLayer, this);
ret = GenLayerZoom.magnify(1000L, ret, 2);
//REKT with random ocean
//ret = new GenLayerEdge(1000L, ret, Mode.SPECIAL);
return ret;
}
/**
* the first array item is a linked list of the bioms, the second is the zoom function, the third is the same as the
* first.
*/
public static GenLayer[] initializeAllBiomeGeneratorsTofu(long seed, WorldType worldType)
{
byte biomeSize = getModdedBiomeSize(worldType, (byte) (worldType == WorldType.LARGE_BIOMES ? 7 : 5));
GenLayerIsland genlayerisland = new GenLayerIsland(1L);
GenLayerFuzzyZoom genlayerfuzzyzoom = new GenLayerFuzzyZoom(2000L, genlayerisland);
GenLayerAddIsland genlayeraddisland = new GenLayerAddIsland(1L, genlayerfuzzyzoom);
GenLayerZoom genlayerzoom = new GenLayerZoom(2001L, genlayeraddisland);
genlayeraddisland = new GenLayerAddIsland(2L, genlayerzoom);
genlayeraddisland = new GenLayerAddIsland(50L, genlayeraddisland);
genlayeraddisland = new GenLayerAddIsland(70L, genlayeraddisland);
genlayeraddisland = new GenLayerAddIsland(3L, genlayeraddisland);
genlayeraddisland = new GenLayerAddIsland(2L, genlayeraddisland);
GenLayerEdge genlayeredge = new GenLayerEdge(2L, genlayeraddisland, GenLayerEdge.Mode.COOL_WARM);
genlayeredge = new GenLayerEdge(2L, genlayeredge, GenLayerEdge.Mode.HEAT_ICE);
genlayeredge = new GenLayerEdge(3L, genlayeredge, GenLayerEdge.Mode.SPECIAL);
genlayerzoom = new GenLayerZoom(2002L, genlayeredge);
genlayerzoom = new GenLayerZoom(2003L, genlayerzoom);
genlayeraddisland = new GenLayerAddIsland(4L, genlayerzoom);
GenLayerTofu genlayer3 = GenLayerZoom.magnify(1000L, genlayeraddisland, 0);
GenLayerTofu genlayer = GenLayerZoom.magnify(1000L, genlayer3, 0);
GenLayerRiverInit genlayerriverinit = new GenLayerRiverInit(100L, genlayer);
Object object = GenLayerTofu.getBiomeLayer(seed, genlayer3, worldType);
GenLayerTofu genlayer1 = GenLayerZoom.magnify(1000L, genlayerriverinit, 2);
GenLayerHills genlayerhills = new GenLayerHills(1000L, (GenLayerTofu)object, genlayer1);
genlayer = GenLayerZoom.magnify(1000L, genlayerriverinit, 2);
genlayer = GenLayerZoom.magnify(1000L, genlayer, biomeSize);
GenLayerRiver genlayerriver = new GenLayerRiver(1L, genlayer);
GenLayerSmooth genlayersmooth = new GenLayerSmooth(1000L, genlayerriver);
object = GenLayerZoom.magnify(1000L, genlayerhills, 2);
for (int j = 0; j < biomeSize; ++j)
{
object = new GenLayerZoom((long)(1000 + j), (GenLayerTofu)object);
if (j == 0)
{
object = new GenLayerAddIsland(3L, (GenLayerTofu)object);
}
if (j == 1)
{
object = new GenLayerShore(1000L, (GenLayerTofu)object);
}
}
GenLayerSmooth genlayersmooth1 = new GenLayerSmooth(1000L, (GenLayerTofu)object);
GenLayerRiverMix genlayerrivermix = new GenLayerRiverMix(100L, genlayersmooth1, genlayersmooth);
GenLayerTofu layerVoronoi = new GenLayerTofuVoronoiZoom(10L, genlayerrivermix);
genlayerrivermix.initWorldGenSeed(seed);
layerVoronoi.initWorldGenSeed(seed);
return new GenLayer[] {genlayerrivermix, layerVoronoi};
}
public GenLayerBiomesTofu(long seed, GenLayer genlayer) {
super(seed);
this.parent = genlayer;
}
public GenLayerBiomeEdge(long p_i45475_1_, GenLayer p_i45475_3_)
{
super(p_i45475_1_);
this.parent = p_i45475_3_;
}
public GenLayerTofuVoronoiZoom(long p_i2133_1_, GenLayer p_i2133_3_)
{
super(p_i2133_1_);
super.parent = p_i2133_3_;
}
public GenLayerRiverMix(long par1, GenLayer par3GenLayer, GenLayer par4GenLayer)
{
super(par1);
this.biomePatternGeneratorChain = par3GenLayer;
this.riverPatternGeneratorChain = par4GenLayer;
}
public GenLayerZoom(long par1, GenLayer par3GenLayer)
{
super(par1);
super.parent = par3GenLayer;
}
public GenLayerRiver(long par1, GenLayer par3GenLayer)
{
super(par1);
super.parent = par3GenLayer;
}
@Override
public GenLayer[] getModdedBiomeGenerators(WorldType worldType, long seed, GenLayer[] original)
{
return original;
}
public GenLayerVoronoiExtended(long p_i2133_1_, GenLayer p_i2133_3_)
{
super(p_i2133_1_);
super.parent = p_i2133_3_;
}
public GenLayerBiomePlanet(long p_i2122_1_, GenLayer p_i2122_3_, WorldType worldType)
{
super(p_i2122_1_);
this.parent = p_i2122_3_;
biomeEntries = new ArrayList<BiomeManager.BiomeEntry>();
}