mirror of
https://github.com/barkeser2002/CatServer.git
synced 2026-09-25 02:20:01 +03:00
111 lines
5.0 KiB
Diff
111 lines
5.0 KiB
Diff
--- ../src-base/minecraft/net/minecraft/world/biome/BiomeForest.java
|
|
+++ ../src-work/minecraft/net/minecraft/world/biome/BiomeForest.java
|
|
@@ -20,41 +20,52 @@
|
|
protected static final WorldGenBirchTree SUPER_BIRCH_TREE = new WorldGenBirchTree(false, true);
|
|
protected static final WorldGenBirchTree BIRCH_TREE = new WorldGenBirchTree(false, false);
|
|
protected static final WorldGenCanopyTree ROOF_TREE = new WorldGenCanopyTree(false);
|
|
- private final BiomeForest.Type type;
|
|
+ private final Type type;
|
|
|
|
- public BiomeForest(BiomeForest.Type typeIn, Biome.BiomeProperties properties)
|
|
+ public BiomeForest(Type typeIn, BiomeProperties properties)
|
|
{
|
|
super(properties);
|
|
this.type = typeIn;
|
|
this.decorator.treesPerChunk = 10;
|
|
this.decorator.grassPerChunk = 2;
|
|
|
|
- if (this.type == BiomeForest.Type.FLOWER)
|
|
+ if (this.type == Type.FLOWER)
|
|
{
|
|
this.decorator.treesPerChunk = 6;
|
|
this.decorator.flowersPerChunk = 100;
|
|
this.decorator.grassPerChunk = 1;
|
|
- this.spawnableCreatureList.add(new Biome.SpawnListEntry(EntityRabbit.class, 4, 2, 3));
|
|
+ this.spawnableCreatureList.add(new SpawnListEntry(EntityRabbit.class, 4, 2, 3));
|
|
}
|
|
|
|
- if (this.type == BiomeForest.Type.NORMAL)
|
|
+ if (this.type == Type.NORMAL)
|
|
{
|
|
- this.spawnableCreatureList.add(new Biome.SpawnListEntry(EntityWolf.class, 5, 4, 4));
|
|
+ this.spawnableCreatureList.add(new SpawnListEntry(EntityWolf.class, 5, 4, 4));
|
|
}
|
|
|
|
- if (this.type == BiomeForest.Type.ROOFED)
|
|
+ if (this.type == Type.ROOFED)
|
|
{
|
|
this.decorator.treesPerChunk = -999;
|
|
}
|
|
+
|
|
+ if (this.type == Type.FLOWER) //Needs to be done here so we have access to this.type
|
|
+ {
|
|
+ this.flowers.clear();
|
|
+ for (BlockFlower.EnumFlowerType type : BlockFlower.EnumFlowerType.values())
|
|
+ {
|
|
+ if (type.getBlockType() == BlockFlower.EnumFlowerColor.YELLOW) continue;
|
|
+ if (type == BlockFlower.EnumFlowerType.BLUE_ORCHID) type = BlockFlower.EnumFlowerType.POPPY;
|
|
+ addFlower(net.minecraft.init.Blocks.RED_FLOWER.getDefaultState().withProperty(net.minecraft.init.Blocks.RED_FLOWER.getTypeProperty(), type), 10);
|
|
+ }
|
|
+ }
|
|
}
|
|
|
|
public WorldGenAbstractTree getRandomTreeFeature(Random rand)
|
|
{
|
|
- if (this.type == BiomeForest.Type.ROOFED && rand.nextInt(3) > 0)
|
|
+ if (this.type == Type.ROOFED && rand.nextInt(3) > 0)
|
|
{
|
|
return ROOF_TREE;
|
|
}
|
|
- else if (this.type != BiomeForest.Type.BIRCH && rand.nextInt(5) != 0)
|
|
+ else if (this.type != Type.BIRCH && rand.nextInt(5) != 0)
|
|
{
|
|
return (WorldGenAbstractTree)(rand.nextInt(10) == 0 ? BIG_TREE_FEATURE : TREE_FEATURE);
|
|
}
|
|
@@ -80,24 +91,28 @@
|
|
|
|
public void decorate(World worldIn, Random rand, BlockPos pos)
|
|
{
|
|
- if (this.type == BiomeForest.Type.ROOFED)
|
|
+ if (this.type == Type.ROOFED)
|
|
{
|
|
this.addMushrooms(worldIn, rand, pos);
|
|
}
|
|
|
|
+ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(worldIn, rand, new net.minecraft.util.math.ChunkPos(pos), net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.FLOWERS))
|
|
+ { // no tab for patch
|
|
int i = rand.nextInt(5) - 3;
|
|
|
|
- if (this.type == BiomeForest.Type.FLOWER)
|
|
+ if (this.type == Type.FLOWER)
|
|
{
|
|
i += 2;
|
|
}
|
|
|
|
this.addDoublePlants(worldIn, rand, pos, i);
|
|
+ }
|
|
super.decorate(worldIn, rand, pos);
|
|
}
|
|
|
|
public void addMushrooms(World p_185379_1_, Random p_185379_2_, BlockPos p_185379_3_)
|
|
{
|
|
+
|
|
for (int i = 0; i < 4; ++i)
|
|
{
|
|
for (int j = 0; j < 4; ++j)
|
|
@@ -106,12 +121,12 @@
|
|
int l = j * 4 + 1 + 8 + p_185379_2_.nextInt(3);
|
|
BlockPos blockpos = p_185379_1_.getHeight(p_185379_3_.add(k, 0, l));
|
|
|
|
- if (p_185379_2_.nextInt(20) == 0)
|
|
+ if (p_185379_2_.nextInt(20) == 0 && net.minecraftforge.event.terraingen.TerrainGen.decorate(p_185379_1_, p_185379_2_, new net.minecraft.util.math.ChunkPos(p_185379_3_), blockpos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.BIG_SHROOM))
|
|
{
|
|
WorldGenBigMushroom worldgenbigmushroom = new WorldGenBigMushroom();
|
|
worldgenbigmushroom.generate(p_185379_1_, p_185379_2_, blockpos);
|
|
}
|
|
- else
|
|
+ else if (net.minecraftforge.event.terraingen.TerrainGen.decorate(p_185379_1_, p_185379_2_, new net.minecraft.util.math.ChunkPos(p_185379_3_), blockpos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.TREE))
|
|
{
|
|
WorldGenAbstractTree worldgenabstracttree = this.getRandomTreeFeature(p_185379_2_);
|
|
worldgenabstracttree.setDecorationDefaults();
|