re-add alpha-like gen

This commit is contained in:
Sen 2025-08-05 13:37:51 +02:00
parent bc612ee9c8
commit 08c0422902
Signed by: sen
GPG key ID: 3AC50A6F47D1B722
51 changed files with 270 additions and 246 deletions

View file

@ -10,16 +10,16 @@ import common.init.BlockRegistry;
import common.init.MetalType;
import common.rng.WeightedList;
import common.world.State;
import server.worldgen.BiomeGenerator;
import server.worldgen.BlockReplacer;
import server.worldgen.ChunkGenerator;
import server.worldgen.FeatureDungeons;
import server.worldgen.FeatureLakes;
import server.worldgen.FeatureLiquids;
import server.worldgen.FeatureOres;
import server.worldgen.RngSpawn;
import server.worldgen.caves.MapGenBase;
import server.worldgen.component.FeatureDungeons;
import server.worldgen.component.FeatureLakes;
import server.worldgen.component.FeatureLiquids;
import server.worldgen.component.FeatureOres;
import server.worldgen.generator.ChunkGenerator;
import server.worldgen.layer.BiomeGenerator;
import server.worldgen.populator.Populator;
import server.worldgen.replacer.BlockReplacer;
import server.worldgen.structure.MapGenStructure;
public class GeneratorData {

View file

@ -55,22 +55,18 @@ import server.dimension.Domain;
import server.dimension.Galaxy;
import server.dimension.GeneratorData;
import server.dimension.Sector;
import server.worldgen.Biome;
import server.worldgen.BiomeGenerator;
import server.worldgen.FeatureDungeons;
import server.worldgen.GeneratorCavern;
import server.worldgen.GeneratorFlat;
import server.worldgen.GeneratorPerlin;
import server.worldgen.GeneratorSimple;
import server.worldgen.ReplacerAltBiome;
import server.worldgen.ReplacerAltSimple;
import server.worldgen.ReplacerAltSurface;
import server.worldgen.ReplacerMesa;
import server.worldgen.ReplacerTerranian;
import server.worldgen.Scaling;
import server.worldgen.caves.MapGenBigCaves;
import server.worldgen.caves.MapGenCaves;
import server.worldgen.caves.MapGenRavine;
import server.worldgen.component.FeatureDungeons;
import server.worldgen.generator.GeneratorCavern;
import server.worldgen.generator.GeneratorFlat;
import server.worldgen.generator.GeneratorPerlin;
import server.worldgen.generator.GeneratorSimple;
import server.worldgen.layer.Biome;
import server.worldgen.layer.BiomeGenerator;
import server.worldgen.populator.PopulatorAlphaLike;
import server.worldgen.populator.PopulatorAsteroids;
import server.worldgen.populator.PopulatorTerranian;
import server.worldgen.populator.PopulatorBlackened;
@ -79,6 +75,11 @@ import server.worldgen.populator.PopulatorForest;
import server.worldgen.populator.PopulatorHell;
import server.worldgen.populator.PopulatorMesa;
import server.worldgen.populator.PopulatorTian;
import server.worldgen.replacer.ReplacerAltBiome;
import server.worldgen.replacer.ReplacerAltSimple;
import server.worldgen.replacer.ReplacerAltSurface;
import server.worldgen.replacer.ReplacerMesa;
import server.worldgen.replacer.ReplacerTerranian;
import server.worldgen.structure.MapGenBridge;
import server.worldgen.structure.MapGenMineshaft;
import server.worldgen.structure.MapGenScatteredFeature;
@ -513,7 +514,7 @@ public abstract class UniverseRegistry extends DimensionRegistry {
registerSector("Solar", () -> {
registerStar("Sol", 695508000, 274.0f, 5778.0f, () -> {
registerPlanet("Terra", new Planet(6378136, 8766144L, 24000L, 28.0f, 9.81f, 259.15f, Blocks.stone.getState(), Blocks.water.getState(), 63), new GeneratorData()
.setGenerator(new GeneratorPerlin(true))
.setGenerator(new GeneratorPerlin(false))
.setReplacer(new ReplacerTerranian(Blocks.grass.getState(), Blocks.dirt.getState(), Blocks.gravel.getState(), Blocks.sand.getState()))
.setPopulator(new PopulatorTerranian())
.setBiomeGen(new BiomeGenerator(new Biome(8.0f, 80.0f), false, 4, 4, 6, 50,
@ -523,7 +524,7 @@ public abstract class UniverseRegistry extends DimensionRegistry {
new Biome[] {new Biome(-20.0f, 50.0f, Scaling.PLAINS_LOW), new Biome(-20.0f, 50.0f, Scaling.PLAINS_LOW), new Biome(-20.0f, 50.0f, Scaling.PLAINS_LOW), new Biome(-40.0f, 40.0f, Scaling.PLAINS_MEDIUM), new Biome(-8.0f, 80.0f, Scaling.PLAINS_MEDIUM)}))
.enableSnow()
.addCaveGen(new MapGenCaves(Blocks.lava.getState()), new MapGenRavine(Blocks.lava.getState()))
.addFeature(new FeatureDungeons(8))
.addFeature(new FeatureDungeons(8, 256))
.addLake(Blocks.water.getState(), null, Blocks.grass.getState(), 4, 0, 255, false)
.addLake(Blocks.lava.getState(), Blocks.stone.getState(), null, 8, 8, 255, true)
.addLiquid(Blocks.flowing_water.getState(), 50, 8, 255, false)
@ -619,7 +620,7 @@ public abstract class UniverseRegistry extends DimensionRegistry {
registerPlanet("gharoth", "Elbenplanet Gharoth", new Planet(2806382, 4837386L, 52960L, 30.0f, 10.0f, 257.3f + 8.0f, Blocks.dirt.getState(), Blocks.water.getState(), 64), //TODO: check temp
new GeneratorData().setGenerator(new GeneratorSimple(true))
.setReplacer(new ReplacerAltBiome(Blocks.grass.getState(), Blocks.dirt.getState(), Blocks.gravel.getState(), Blocks.sand.getState()))
.setPopulator(new PopulatorForest(4)).addCaveGen(new MapGenCaves(Blocks.air.getState())).addFeature(new FeatureDungeons(4)).enableSnow()
.setPopulator(new PopulatorForest(4)).addCaveGen(new MapGenCaves(Blocks.air.getState())).addFeature(new FeatureDungeons(4, 256)).enableSnow()
.addLake(Blocks.water.getState(), null, Blocks.grass.getState(), 4, 0, 255, false)
.addLake(Blocks.lava.getState(), null, null, 8, 8, 255, true)
.addLiquid(Blocks.flowing_water.getState(), 50, 8, 255, false)
@ -634,11 +635,11 @@ public abstract class UniverseRegistry extends DimensionRegistry {
.addSpawn(EntityElf.class, 12, 4, 16)
.addSpawn(EntityFox.class, 3, 2, 5));
registerPlanet("transylvania", "Vampirplanet Transsylvanien", new Planet(8374921, 33850466L, 49760L, 20.0f, 10.0f, 255.5f, Blocks.rock.getState(), Blocks.water.getState(), 63),
new GeneratorData().setGenerator(new GeneratorPerlin(true))
new GeneratorData().setGenerator(new GeneratorPerlin(false))
.setReplacer(new ReplacerAltSimple(Blocks.grass.getState(), Blocks.dirt.getState(), Blocks.gravel.getState()))
.setBiomeGen(new BiomeGenerator(new Biome(8.0f, 80.0f), true, 5, 3, 3, 30))
.setPopulator(new PopulatorForest(3)).addCaveGen(new MapGenCaves(Blocks.lava.getState()), new MapGenRavine(Blocks.lava.getState()))
.addFeature(new FeatureDungeons(10)).enableSnow()
.addFeature(new FeatureDungeons(10, 256)).enableSnow()
.addLake(Blocks.water.getState(), null, Blocks.grass.getState(), 4, 0, 255, false)
.addLake(Blocks.lava.getState(), null, null, 8, 8, 255, true)
.addLiquid(Blocks.flowing_water.getState(), 50, 8, 255, false)
@ -691,7 +692,7 @@ public abstract class UniverseRegistry extends DimensionRegistry {
new GeneratorData().setGenerator(new GeneratorPerlin())
.setReplacer(new ReplacerAltSimple(Blocks.blackened_soil.getState(), Blocks.blackened_dirt.getState(), Blocks.blackened_cobble.getState()))
.setPopulator(new PopulatorBlackened())
.addCaveGen(new MapGenCaves(Blocks.air.getState())).addFeature(new FeatureDungeons(4))
.addCaveGen(new MapGenCaves(Blocks.air.getState())).addFeature(new FeatureDungeons(4, 256))
.addLake(Blocks.goo.getState(), null, null, 8, 8, 255, true)
// .addOre(Blocks.PLACEHOLDER_ore.getState(), 0, 2, 3, 0, 12, false)
.addSpawn(EntityMetalhead.class, 50, 1, 1)
@ -699,6 +700,35 @@ public abstract class UniverseRegistry extends DimensionRegistry {
});
});
});
registerGalaxy("External", () -> {
registerSector("Internal", () -> {
registerStar("Caddy", 568413297, 296.0f, 6379.0f, () -> {
registerPlanet("alpha", "Alpha", new Planet(7620619, 8766144L, 24000L, 28.0f, 9.81f, 259.15f, Blocks.stone.getState(), Blocks.water.getState(), 64),
new GeneratorData().setGenerator(new GeneratorSimple(true, true))
.setReplacer(new ReplacerAltBiome(Blocks.grass.getState(), Blocks.dirt.getState(), Blocks.gravel.getState(), Blocks.sand.getState()))
.setPopulator(new PopulatorAlphaLike()).addCaveGen(new MapGenCaves(Blocks.lava.getState())).addFeature(new FeatureDungeons(8, 128)).enableSnow()
.addLake(Blocks.water.getState(), null, Blocks.grass.getState(), 4, 0, 128, false)
.addLake(Blocks.lava.getState(), null, null, 8, 8, 128, true)
.addLiquid(Blocks.flowing_water.getState(), 50, 8, 128, false)
.addLiquid(Blocks.flowing_lava.getState(), 20, 8, 128, true)
.addOre(Blocks.dirt.getState(), 20, 0, 32, 0, 128, false)
.addOre(Blocks.gravel.getState(), 10, 0, 32, 0, 128, false)
.addOre(Blocks.coal_ore.getState(), 20, 0, 16, 0, 128, false)
.addOre(Blocks.iron_ore.getState(), 20, 0, 8, 0, 64, false)
.addOre(Blocks.gold_ore.getState(), 2, 0, 8, 0, 32, false)
.addOre(Blocks.diamond_ore.getState(), 1, 0, 7, 0, 16, false)
.addSpawn(EntitySheep.class, 12, 4, 4)
.addSpawn(EntityPig.class, 10, 4, 4)
.addSpawn(EntityChicken.class, 10, 4, 4)
.addSpawn(EntityCow.class, 8, 4, 4)
.addSpawn(EntityArachnoid.class, 100, 4, 4)
.addSpawn(EntityZombie.class, 100, 4, 4)
.addSpawn(EntityUndead.class, 100, 4, 4)
.addSpawn(EntitySlime.class, 100, 4, 4)
);
});
});
});
GeneratorData warp = new GeneratorData().setGenerator(new GeneratorPerlin(1.0F, 2.0F)).setPopulator(new PopulatorChaos())
.addCaveGen(new MapGenCaves(Blocks.air.getState()), new MapGenBigCaves(), new MapGenRavine(Blocks.air.getState())).enableSnow()

View file

@ -137,7 +137,7 @@ import server.vars.SVars;
import server.world.ChunkServer;
import server.world.Region;
import server.world.WorldServer;
import server.worldgen.BiomeGenerator;
import server.worldgen.layer.BiomeGenerator;
public class Player extends User implements Executor, IPlayer
{

View file

@ -3,66 +3,46 @@ package server.world;
import common.block.Block;
import common.util.BlockPos;
public class NextTickListEntry implements Comparable<NextTickListEntry>
{
/** The id number for the next tick entry */
private static long nextTickEntryID;
private final Block block;
public final BlockPos position;
public class NextTickListEntry implements Comparable<NextTickListEntry> {
private static long nextId;
/** Time this tick is scheduled to occur at */
public long scheduledTime;
public int priority;
private final Block block;
public final BlockPos position;
private final long id;
public long scheduledTime;
public int priority;
/** The id of the tick entry */
private long tickEntryID;
public NextTickListEntry(BlockPos pos, Block block) {
this.id = nextId++;
this.position = pos;
this.block = block;
}
public NextTickListEntry(BlockPos positionIn, Block blockIn)
{
this.tickEntryID = (long)(nextTickEntryID++);
this.position = positionIn;
this.block = blockIn;
}
public boolean equals(Object obj) {
if(!(obj instanceof NextTickListEntry other))
return false;
return this.position.equals(other.position) && this.block != null && this.block == other.block;
}
public boolean equals(Object p_equals_1_)
{
if (!(p_equals_1_ instanceof NextTickListEntry))
{
return false;
}
else
{
NextTickListEntry nextticklistentry = (NextTickListEntry)p_equals_1_;
return this.position.equals(nextticklistentry.position) && this.block != null && this.block == nextticklistentry.block;
}
}
public int hashCode() {
return this.position.hashCode();
}
public int hashCode()
{
return this.position.hashCode();
}
public NextTickListEntry setScheduledTime(long time) {
this.scheduledTime = time;
return this;
}
/**
* Sets the scheduled time for this tick entry
*/
public NextTickListEntry setScheduledTime(long scheduledTimeIn)
{
this.scheduledTime = scheduledTimeIn;
return this;
}
public void setPriority(int priority) {
this.priority = priority;
}
public void setPriority(int priorityIn)
{
this.priority = priorityIn;
}
public int compareTo(NextTickListEntry other) {
return this.scheduledTime < other.scheduledTime ? -1
: (this.scheduledTime > other.scheduledTime ? 1 : (this.priority != other.priority ? this.priority - other.priority : (this.id < other.id ? -1 : (this.id > other.id ? 1 : 0))));
}
public int compareTo(NextTickListEntry p_compareTo_1_)
{
return this.scheduledTime < p_compareTo_1_.scheduledTime ? -1 : (this.scheduledTime > p_compareTo_1_.scheduledTime ? 1 : (this.priority != p_compareTo_1_.priority ? this.priority - p_compareTo_1_.priority : (this.tickEntryID < p_compareTo_1_.tickEntryID ? -1 : (this.tickEntryID > p_compareTo_1_.tickEntryID ? 1 : 0))));
}
public Block getBlock()
{
return this.block;
}
public Block getBlock() {
return this.block;
}
}

View file

@ -83,21 +83,21 @@ import server.network.Player;
import server.rng.PerlinGen;
import server.vars.SVars;
import server.village.VillageCollection;
import server.worldgen.BiomeGenerator;
import server.worldgen.BlockReplacer;
import server.worldgen.ChunkGenerator;
import server.worldgen.ChunkPrimer;
import server.worldgen.FeatureDungeons;
import server.worldgen.FeatureGenerator;
import server.worldgen.FeatureLakes;
import server.worldgen.FeatureLiquids;
import server.worldgen.FeatureOres;
import server.worldgen.GeneratorDestroyed;
import server.worldgen.GeneratorFlat;
import server.worldgen.RngSpawn;
import server.worldgen.caves.MapGenBase;
import server.worldgen.component.FeatureDungeons;
import server.worldgen.component.FeatureLakes;
import server.worldgen.component.FeatureLiquids;
import server.worldgen.component.FeatureOres;
import server.worldgen.foliage.WorldGenBigMushroom;
import server.worldgen.generator.ChunkGenerator;
import server.worldgen.generator.GeneratorDestroyed;
import server.worldgen.generator.GeneratorFlat;
import server.worldgen.layer.BiomeGenerator;
import server.worldgen.populator.Populator;
import server.worldgen.replacer.BlockReplacer;
import server.worldgen.structure.MapGenStructure;
import server.worldgen.structure.MapGenVillage;
import server.worldgen.tree.WorldGenBaseTree;

View file

@ -5,31 +5,20 @@ import common.util.BlockPos;
import common.world.State;
import server.world.WorldServer;
public abstract class FeatureGenerator
{
private final boolean doBlockNotify;
public abstract class FeatureGenerator {
private final boolean notify;
public FeatureGenerator()
{
this(false);
}
public FeatureGenerator() {
this(false);
}
public FeatureGenerator(boolean notify)
{
this.doBlockNotify = notify;
}
public FeatureGenerator(boolean notify) {
this.notify = notify;
}
public abstract boolean generate(WorldServer worldIn, Random rand, BlockPos position);
public abstract boolean generate(WorldServer world, Random rand, BlockPos pos);
protected void setBlockAndNotifyAdequately(WorldServer worldIn, BlockPos pos, State state)
{
if (this.doBlockNotify)
{
worldIn.setState(pos, state, 3);
}
else
{
worldIn.setState(pos, state, 2);
}
}
protected final void setBlockNotify(WorldServer world, BlockPos pos, State state) {
world.setState(pos, state, this.notify ? 3 : 2);
}
}

View file

@ -1,4 +1,4 @@
package server.worldgen;
package server.worldgen.component;
import java.lang.reflect.InvocationTargetException;
@ -20,22 +20,25 @@ import common.vars.Vars;
import common.world.World;
import server.vars.SVars;
import server.world.WorldServer;
import server.worldgen.LootConstants;
public class FeatureDungeons
{
private static final Class<? extends EntityLiving>[] MOB_TYPES = new Class[] {EntityUndead.class, EntityZombie.class, EntityZombie.class, EntityArachnoid.class};
private final int chance;
private final int height;
public FeatureDungeons(int chance) {
public FeatureDungeons(int chance, int height) {
this.chance = chance;
this.height = height < 1 ? 1 : height;
}
public boolean generate(WorldServer worldIn, Random rand, BlockPos position) {
boolean flag = false;
for(int z = 0; z < this.chance; z++) {
flag |= this.generateDungeon(worldIn, rand, position.add(rand.chOffset(), rand.zrange(256), rand.chOffset()));
flag |= this.generateDungeon(worldIn, rand, position.add(rand.chOffset(), rand.zrange(this.height), rand.chOffset()));
}
return flag;
}

View file

@ -1,4 +1,4 @@
package server.worldgen;
package server.worldgen.component;
import common.block.Block;
import common.block.Material;

View file

@ -1,4 +1,4 @@
package server.worldgen;
package server.worldgen.component;
import common.block.Block;
import common.init.Blocks;

View file

@ -1,4 +1,4 @@
package server.worldgen;
package server.worldgen.component;
import common.block.Block;
import common.rng.Random;

View file

@ -51,7 +51,7 @@ public class WorldGenIceSpike extends FeatureGenerator
if (block == Blocks.air || block == Blocks.dirt || block == Blocks.snow || block == Blocks.ice)
{
this.setBlockAndNotifyAdequately(worldIn, position.add(i1, k, j1), Blocks.packed_ice.getState());
this.setBlockNotify(worldIn, position.add(i1, k, j1), Blocks.packed_ice.getState());
}
if (k != 0 && l > 1)
@ -60,7 +60,7 @@ public class WorldGenIceSpike extends FeatureGenerator
if (block == Blocks.air || block == Blocks.dirt || block == Blocks.snow || block == Blocks.ice)
{
this.setBlockAndNotifyAdequately(worldIn, position.add(i1, -k, j1), Blocks.packed_ice.getState());
this.setBlockNotify(worldIn, position.add(i1, -k, j1), Blocks.packed_ice.getState());
}
}
}
@ -100,7 +100,7 @@ public class WorldGenIceSpike extends FeatureGenerator
break;
}
this.setBlockAndNotifyAdequately(worldIn, blockpos, Blocks.packed_ice.getState());
this.setBlockNotify(worldIn, blockpos, Blocks.packed_ice.getState());
blockpos = blockpos.down();
--j2;

View file

@ -193,7 +193,7 @@ public class WorldGenBigMushroom extends FeatureGenerator
if (!worldIn.getState(blockpos).getBlock().isFullBlock())
{
this.setBlockAndNotifyAdequately(worldIn, blockpos, this.mushroomType.getState().withProperty(BlockHugeMushroom.VARIANT, dir));
this.setBlockNotify(worldIn, blockpos, this.mushroomType.getState().withProperty(BlockHugeMushroom.VARIANT, dir));
}
}
}
@ -206,7 +206,7 @@ public class WorldGenBigMushroom extends FeatureGenerator
if (!block2.isFullBlock())
{
this.setBlockAndNotifyAdequately(worldIn, position.up(i3), this.mushroomType.getState().withProperty(BlockHugeMushroom.VARIANT, BlockHugeMushroom.EnumType.STEM));
this.setBlockNotify(worldIn, position.up(i3), this.mushroomType.getState().withProperty(BlockHugeMushroom.VARIANT, BlockHugeMushroom.EnumType.STEM));
}
}

View file

@ -37,7 +37,7 @@ public class WorldGenShrub extends WorldGenBaseTree
if (block1 == Blocks.dirt || block1 == Blocks.grass)
{
position = position.up();
this.setBlockAndNotifyAdequately(worldIn, position, this.woodMetadata);
this.setBlockNotify(worldIn, position, this.woodMetadata);
for (int i = position.getY(); i <= position.getY() + 2; ++i)
{
@ -58,7 +58,7 @@ public class WorldGenShrub extends WorldGenBaseTree
if (!worldIn.getState(blockpos).getBlock().isFullBlock())
{
this.setBlockAndNotifyAdequately(worldIn, blockpos, BlockLeaves.getLeavesBlock(this.leavesMetadata, worldIn.getLeavesGen(blockpos)).getState().withProperty(BlockLeaves.DECAY, Boolean.valueOf(false)));
this.setBlockNotify(worldIn, blockpos, BlockLeaves.getLeavesBlock(this.leavesMetadata, worldIn.getLeavesGen(blockpos)).getState().withProperty(BlockLeaves.DECAY, Boolean.valueOf(false)));
}
}
}

View file

@ -1,4 +1,4 @@
package server.worldgen;
package server.worldgen.generator;
import common.rng.Random;
import server.rng.PerlinGenOld;

View file

@ -1,9 +1,10 @@
package server.worldgen;
package server.worldgen.generator;
import common.dimension.Dimension;
import common.rng.Random;
import server.dimension.GeneratorData;
import server.world.WorldServer;
import server.worldgen.ChunkPrimer;
public interface ChunkGenerator {
public void generateChunk(WorldServer world, int x, int z, ChunkPrimer primer);

View file

@ -1,4 +1,4 @@
package server.worldgen;
package server.worldgen.generator;
import common.dimension.Dimension;
import common.rng.Random;
@ -7,6 +7,7 @@ import common.world.State;
import server.dimension.GeneratorData;
import server.rng.OctaveGen;
import server.world.WorldServer;
import server.worldgen.ChunkPrimer;
public class GeneratorCavern implements ChunkGenerator
{

View file

@ -1,4 +1,4 @@
package server.worldgen;
package server.worldgen.generator;
import common.dimension.Dimension;
import common.init.Blocks;
@ -6,6 +6,7 @@ import common.rng.Random;
import common.world.State;
import server.dimension.GeneratorData;
import server.world.WorldServer;
import server.worldgen.ChunkPrimer;
public class GeneratorDestroyed implements ChunkGenerator
{

View file

@ -1,4 +1,4 @@
package server.worldgen;
package server.worldgen.generator;
import java.util.Arrays;
import java.util.List;
@ -9,6 +9,7 @@ import common.rng.Random;
import common.world.State;
import server.dimension.GeneratorData;
import server.world.WorldServer;
import server.worldgen.ChunkPrimer;
public class GeneratorFlat implements ChunkGenerator {
private State[] layers;

View file

@ -1,4 +1,4 @@
package server.worldgen;
package server.worldgen.generator;
import common.dimension.Dimension;
import common.rng.Random;
@ -7,6 +7,7 @@ import common.world.State;
import server.dimension.GeneratorData;
import server.rng.OctaveGen;
import server.world.WorldServer;
import server.worldgen.ChunkPrimer;
public class GeneratorIsland implements ChunkGenerator
{

View file

@ -1,4 +1,4 @@
package server.worldgen;
package server.worldgen.generator;
import java.util.Arrays;
@ -9,7 +9,9 @@ import common.world.State;
import server.dimension.GeneratorData;
import server.rng.NoiseGen;
import server.rng.OctaveGen;
import server.rng.OctaveGenOld;
import server.world.WorldServer;
import server.worldgen.ChunkPrimer;
public class GeneratorPerlin implements ChunkGenerator
{
@ -26,7 +28,8 @@ public class GeneratorPerlin implements ChunkGenerator
}
}
private final boolean biomes;
private final boolean biomes;
private final boolean farlands;
private NoiseGen lowerNoiseGen;
private NoiseGen upperNoiseGen;
private NoiseGen mainNoiseGen;
@ -57,40 +60,48 @@ public class GeneratorPerlin implements ChunkGenerator
private final float[] depths = new float[100];
private final float[] scales = new float[100];
public GeneratorPerlin(float depth, float scale) {
this(new GeneratorSettings(), depth, scale);
}
public GeneratorPerlin() {
this(new GeneratorSettings(), 0.1f, 0.2f);
}
public GeneratorPerlin(boolean biomes) {
this(biomes, new GeneratorSettings());
}
public GeneratorPerlin(GeneratorSettings settings, float depth, float scale) {
this(false, settings);
// fixed biome values
public GeneratorPerlin(boolean farlands, GeneratorSettings settings, float depth, float scale) {
this(farlands, false, settings);
Arrays.fill(this.depths, depth);
Arrays.fill(this.scales, scale);
}
public GeneratorPerlin(GeneratorSettings settings) {
this(true, settings);
public GeneratorPerlin(boolean farlands, float depth, float scale) {
this(farlands, new GeneratorSettings(), depth, scale);
}
public GeneratorPerlin(float depth, float scale) {
this(false, depth, scale);
}
public GeneratorPerlin(boolean biomes, GeneratorSettings settings) {
this(biomes, settings.coordinateScale, settings.heightScale, settings.upperLimitScale, settings.lowerLimitScale,
public GeneratorPerlin() {
this(0.1f, 0.2f);
}
// biome values from generator
public GeneratorPerlin(boolean farlands, GeneratorSettings settings) {
this(farlands, true, settings);
}
public GeneratorPerlin(boolean farlands) {
this(farlands, new GeneratorSettings());
}
// internal
private GeneratorPerlin(boolean farlands, boolean biomes, GeneratorSettings settings) {
this(farlands, biomes, settings.coordinateScale, settings.heightScale, settings.upperLimitScale, settings.lowerLimitScale,
settings.depthNoiseScaleX, settings.depthNoiseScaleZ, settings.amplification, settings.mainNoiseScaleX,
settings.mainNoiseScaleY, settings.mainNoiseScaleZ, settings.baseSize, settings.stretchY, settings.biomeDepthWeight,
settings.biomeDepthOffset, settings.biomeScaleWeight, settings.biomeScaleOffset);
}
private GeneratorPerlin(boolean biomes, float coordinateScale, float heightScale, float upperLimitScale, float lowerLimitScale, float depthNoiseScaleX,
private GeneratorPerlin(boolean farlands, boolean biomes, float coordinateScale, float heightScale, float upperLimitScale, float lowerLimitScale, float depthNoiseScaleX,
float depthNoiseScaleZ, float amplification, float mainNoiseScaleX, float mainNoiseScaleY, float mainNoiseScaleZ,
float baseSize, float stretchY, float biomeDepthWeight, float biomeDepthOffset, float biomeScaleWeight, float biomeScaleOffset)
{
this.biomes = biomes;
this.farlands = farlands;
this.coordinateScale = coordinateScale;
this.heightScale = heightScale;
this.upperLimitScale = upperLimitScale;
@ -110,10 +121,10 @@ public class GeneratorPerlin implements ChunkGenerator
}
public void init(Random rand, Dimension dim, GeneratorData gen) {
this.lowerNoiseGen = /* farlands ? new OctaveGenOld(rand, 16) : */ new OctaveGen(rand, 16);
this.upperNoiseGen = /* farlands ? new OctaveGenOld(rand, 16) : */ new OctaveGen(rand, 16);
this.mainNoiseGen = /* farlands ? new OctaveGenOld(rand, 8) : */ new OctaveGen(rand, 8);
this.depthNoiseGen = /* farlands ? new OctaveGenOld(rand, 16) : */ new OctaveGen(rand, 16);
this.lowerNoiseGen = this.farlands ? new OctaveGenOld(rand, 16) : new OctaveGen(rand, 16);
this.upperNoiseGen = this.farlands ? new OctaveGenOld(rand, 16) : new OctaveGen(rand, 16);
this.mainNoiseGen = this.farlands ? new OctaveGenOld(rand, 8) : new OctaveGen(rand, 8);
this.depthNoiseGen = this.farlands ? new OctaveGenOld(rand, 16) : new OctaveGen(rand, 16);
this.block = dim.getFiller();
this.liquid = dim.getLiquid();
}

View file

@ -1,4 +1,4 @@
package server.worldgen;
package server.worldgen.generator;
public class GeneratorSettings {
public float coordinateScale = 684.412F;

View file

@ -1,4 +1,4 @@
package server.worldgen;
package server.worldgen.generator;
import common.dimension.Dimension;
import common.rng.Random;
@ -6,11 +6,14 @@ import common.world.State;
import server.dimension.GeneratorData;
import server.rng.NoiseGen;
import server.rng.OctaveGen;
import server.rng.OctaveGenOld;
import server.world.WorldServer;
import server.worldgen.ChunkPrimer;
public class GeneratorSimple implements ChunkGenerator
{
private final boolean biomes;
private final boolean farlands;
private BiomeGenPerlin biomeGen;
private NoiseGen lowerNoiseGen;
private NoiseGen upperNoiseGen;
@ -28,18 +31,22 @@ public class GeneratorSimple implements ChunkGenerator
private final double depthNoise[] = new double[25];
private final double[] factors = new double[256];
public GeneratorSimple(boolean biomes)
{
this.biomes = biomes;
}
public GeneratorSimple(boolean farlands, boolean biomes) {
this.biomes = biomes;
this.farlands = farlands;
}
public GeneratorSimple(boolean biomes) {
this(false, biomes);
}
public void init(Random rand, Dimension dim, GeneratorData gen) {
this.biomeGen = this.biomes ? new BiomeGenPerlin(rand.longv()) : null;
this.lowerNoiseGen = /* farlands ? new OctaveGenOld(rand, 16) : */ new OctaveGen(rand, 16);
this.upperNoiseGen = /* farlands ? new OctaveGenOld(rand, 16) : */ new OctaveGen(rand, 16);
this.mainNoiseGen = /* farlands ? new OctaveGenOld(rand, 8) : */ new OctaveGen(rand, 8);
this.biomeNoiseGen = /* farlands ? new OctaveGenOld(rand, 10) : */ new OctaveGen(rand, 10);
this.depthNoiseGen = /* farlands ? new OctaveGenOld(rand, 16) : */ new OctaveGen(rand, 16);
this.lowerNoiseGen = this.farlands ? new OctaveGenOld(rand, 16) : new OctaveGen(rand, 16);
this.upperNoiseGen = this.farlands ? new OctaveGenOld(rand, 16) : new OctaveGen(rand, 16);
this.mainNoiseGen = this.farlands ? new OctaveGenOld(rand, 8) : new OctaveGen(rand, 8);
this.biomeNoiseGen = this.farlands ? new OctaveGenOld(rand, 10) : new OctaveGen(rand, 10);
this.depthNoiseGen = this.farlands ? new OctaveGenOld(rand, 16) : new OctaveGen(rand, 16);
this.filler = dim.getFiller();
this.liquid = dim.getLiquid();
}

View file

@ -1,4 +1,6 @@
package server.worldgen;
package server.worldgen.layer;
import server.worldgen.Scaling;
public final class Biome {
public final float temperature;

View file

@ -1,27 +1,11 @@
package server.worldgen;
package server.worldgen.layer;
import java.util.List;
import common.collect.Lists;
import common.util.BlockPos;
import common.util.LongHashMap;
import server.worldgen.layer.GenLayer;
import server.worldgen.layer.GenLayerAddAreas;
import server.worldgen.layer.GenLayerAddExtra;
import server.worldgen.layer.GenLayerAddSea;
import server.worldgen.layer.GenLayerAddSnow;
import server.worldgen.layer.GenLayerBase;
import server.worldgen.layer.GenLayerBiome;
import server.worldgen.layer.GenLayerEdge;
import server.worldgen.layer.GenLayerFuzzyZoom;
import server.worldgen.layer.GenLayerRemoveEmpty;
import server.worldgen.layer.GenLayerRiver;
import server.worldgen.layer.GenLayerRiverInit;
import server.worldgen.layer.GenLayerRiverMix;
import server.worldgen.layer.GenLayerSmooth;
import server.worldgen.layer.GenLayerVoronoiZoom;
import server.worldgen.layer.GenLayerZoom;
import server.worldgen.layer.IntCache;
import server.worldgen.Scaling;
public class BiomeGenerator {
private class CacheBlock

View file

@ -1,7 +1,5 @@
package server.worldgen.layer;
import server.worldgen.Biome;
public class GenLayerAddExtra extends GenLayer
{
private final int[] biomes;

View file

@ -1,7 +1,5 @@
package server.worldgen.layer;
import server.worldgen.Biome;
public class GenLayerBiome extends GenLayer
{
private final Biome[] hot;

View file

@ -3,7 +3,6 @@ package server.worldgen.layer;
import java.util.Set;
import common.collect.Sets;
import server.worldgen.Biome;
public class GenLayerRiverMix extends GenLayer {
public static final int NONE = 0;

View file

@ -0,0 +1,20 @@
package server.worldgen.populator;
import common.rng.Random;
import common.util.BlockPos;
import server.rng.PerlinGen;
import server.world.WorldServer;
public class PopulatorAlphaLike extends PopulatorBasic {
protected static final PerlinGen TREE_NOISE = new PerlinGen(new Random(726528729282625L), 8);
public PopulatorAlphaLike() {
this.grassPerChunk = 0;
this.clayExtPerChunk = 10;
}
public void decorate(WorldServer world, Random rand, BlockPos pos) {
this.treesPerChunk = (int)((TREE_NOISE.generate((double)pos.getX() * 0.5D, (double)pos.getZ() * 0.5D) / 8D + rand.doublev() * 4D + 4D) / 3D) + 5;
super.decorate(world, rand, pos);
}
}

View file

@ -4,7 +4,6 @@ import common.block.foliage.BlockFlower;
import common.init.Blocks;
import common.rng.Random;
import common.util.BlockPos;
import server.rng.PerlinGen;
import server.world.WorldServer;
import server.worldgen.FeatureGenerator;
import server.worldgen.feature.WorldGenClay;
@ -25,7 +24,6 @@ import server.worldgen.tree.WorldGenBigTree;
import server.worldgen.tree.WorldGenTree;
public abstract class PopulatorBasic implements Populator {
protected static final PerlinGen TREE_NOISE = new PerlinGen(new Random(726528729282625L), 8);
protected static final FeatureDoublePlant DOUBLE_PLANT_GEN = new FeatureDoublePlant();
protected final WorldGenBaseTree worldGeneratorTrees = new WorldGenBaseTree(false);
@ -60,13 +58,6 @@ public abstract class PopulatorBasic implements Populator {
{
return rand.chance(10) ? this.worldGeneratorBigTree : this.worldGeneratorTrees;
}
protected WorldGenTree genBigTreeLegacy(Random rand, BlockPos pos, boolean humid)
{
int noise = (int)((TREE_NOISE.generate((double)pos.getX() * 0.5D, (double)pos.getZ() * 0.5D) / 8D + rand.doublev() * 4D + 4D) / 3D);
return (noise > 0 && rand.chance(noise)) || (humid && rand.chance(3)) ? this.worldGeneratorBigTree :
this.worldGeneratorTrees;
}
protected FeatureGenerator getRandomWorldGenForGrass(Random rand)
{

View file

@ -4,7 +4,7 @@ import common.init.Blocks;
import common.rng.Random;
import common.util.BlockPos;
import server.world.WorldServer;
import server.worldgen.FeatureOres;
import server.worldgen.component.FeatureOres;
import server.worldgen.feature.WorldGenFire;
import server.worldgen.feature.WorldGenGlowStone;
import server.worldgen.feature.WorldGenHellLava;

View file

@ -4,7 +4,7 @@ import common.init.Blocks;
import common.rng.Random;
import common.util.BlockPos;
import server.world.WorldServer;
import server.worldgen.FeatureOres;
import server.worldgen.component.FeatureOres;
import server.worldgen.tree.WorldGenTaiga2;
import server.worldgen.tree.WorldGenTree;

View file

@ -1,10 +1,11 @@
package server.worldgen;
package server.worldgen.replacer;
import common.dimension.Dimension;
import common.rng.Random;
import common.world.State;
import server.dimension.GeneratorData;
import server.world.WorldServer;
import server.worldgen.ChunkPrimer;
public interface BlockReplacer {
void replaceBlocks(WorldServer world, int x, int z, ChunkPrimer primer, Random rand);

View file

@ -1,4 +1,4 @@
package server.worldgen;
package server.worldgen.replacer;
import common.block.Block;
import common.dimension.Dimension;
@ -6,15 +6,15 @@ import common.init.Blocks;
import common.rng.Random;
import common.world.State;
import server.dimension.GeneratorData;
import server.rng.NoiseGen;
import server.rng.OctaveGen;
import server.world.WorldServer;
import server.worldgen.ChunkPrimer;
public class ReplacerAltBiome implements BlockReplacer
{
private final boolean useFiller;
private NoiseGen altNoiseGen;
private NoiseGen exclNoiseGen;
private OctaveGen altNoiseGen;
private OctaveGen exclNoiseGen;
private State filler;
private State top;

View file

@ -1,4 +1,4 @@
package server.worldgen;
package server.worldgen.replacer;
import common.dimension.Dimension;
import common.init.Blocks;
@ -7,6 +7,7 @@ import common.util.BlockPos;
import common.world.State;
import server.dimension.GeneratorData;
import server.world.WorldServer;
import server.worldgen.ChunkPrimer;
public class ReplacerAltSimple extends ReplacerBiome
{

View file

@ -1,4 +1,4 @@
package server.worldgen;
package server.worldgen.replacer;
import common.block.Block;
import common.dimension.Dimension;
@ -8,6 +8,7 @@ import common.world.State;
import server.dimension.GeneratorData;
import server.rng.OctaveGen;
import server.world.WorldServer;
import server.worldgen.ChunkPrimer;
public class ReplacerAltSurface implements BlockReplacer
{

View file

@ -1,4 +1,4 @@
package server.worldgen;
package server.worldgen.replacer;
import common.block.Block;
import common.block.Material;
@ -8,6 +8,7 @@ import common.world.State;
import server.dimension.GeneratorData;
import server.rng.PerlinGen;
import server.world.WorldServer;
import server.worldgen.ChunkPrimer;
public abstract class ReplacerBiome implements BlockReplacer
{

View file

@ -1,4 +1,4 @@
package server.worldgen;
package server.worldgen.replacer;
import java.util.Arrays;
@ -10,6 +10,7 @@ import common.world.State;
import server.dimension.GeneratorData;
import server.rng.PerlinGen;
import server.world.WorldServer;
import server.worldgen.ChunkPrimer;
public class ReplacerMesa extends ReplacerBiome
{

View file

@ -1,4 +1,4 @@
package server.worldgen;
package server.worldgen.replacer;
import common.block.foliage.BlockLilyPad;
import common.dimension.Dimension;
@ -9,6 +9,7 @@ import common.world.State;
import server.dimension.GeneratorData;
import server.rng.PerlinGen;
import server.world.WorldServer;
import server.worldgen.ChunkPrimer;
public class ReplacerTerranian extends ReplacerAltSimple {
private PerlinGen grassNoiseGen;

View file

@ -1,4 +1,4 @@
package server.worldgen;
package server.worldgen.replacer;
import common.block.Block;
import common.dimension.Dimension;
@ -7,6 +7,7 @@ import common.rng.Random;
import common.world.State;
import server.dimension.GeneratorData;
import server.world.WorldServer;
import server.worldgen.ChunkPrimer;
public class ReplacerTopLayer implements BlockReplacer
{

View file

@ -117,7 +117,7 @@ public class WorldGenBaseTree extends WorldGenTree
if (block == Blocks.air || block.getMaterial() == Material.LEAVES || block.getMaterial() == Material.BUSH)
{
this.setBlockAndNotifyAdequately(worldIn, blockpos, this.metaLeaves == null ? Blocks.dry_leaves.getState() : BlockLeaves.getLeavesBlock(this.metaLeaves, worldIn.getLeavesGen(blockpos)).getState().withProperty(BlockLeaves.DECAY, Boolean.valueOf(false)));
this.setBlockNotify(worldIn, blockpos, this.metaLeaves == null ? Blocks.dry_leaves.getState() : BlockLeaves.getLeavesBlock(this.metaLeaves, worldIn.getLeavesGen(blockpos)).getState().withProperty(BlockLeaves.DECAY, Boolean.valueOf(false)));
}
}
}
@ -130,7 +130,7 @@ public class WorldGenBaseTree extends WorldGenTree
if (block2 == Blocks.air || block2.getMaterial() == Material.LEAVES || block2.getMaterial() == Material.BUSH || block2 == Blocks.dry_leaves)
{
this.setBlockAndNotifyAdequately(worldIn, position.up(j3), this.metaWood);
this.setBlockNotify(worldIn, position.up(j3), this.metaWood);
if (this.vinesGrow && j3 > 0)
{
@ -219,7 +219,7 @@ public class WorldGenBaseTree extends WorldGenTree
private void func_181651_a(WorldServer p_181651_1_, BlockPos p_181651_2_, PropertyBool p_181651_3_)
{
this.setBlockAndNotifyAdequately(p_181651_1_, p_181651_2_, Blocks.vine.getState().withProperty(p_181651_3_, Boolean.valueOf(true)));
this.setBlockNotify(p_181651_1_, p_181651_2_, Blocks.vine.getState().withProperty(p_181651_3_, Boolean.valueOf(true)));
}
private void func_181650_b(WorldServer p_181650_1_, BlockPos p_181650_2_, PropertyBool p_181650_3_)

View file

@ -131,7 +131,7 @@ public class WorldGenBigTree extends WorldGenTree
if (block == Blocks.air || block.getMaterial() == Material.LEAVES)
{
this.setBlockAndNotifyAdequately(this.world, blockpos, p_181631_3_);
this.setBlockNotify(this.world, blockpos, p_181631_3_);
}
}
}
@ -194,7 +194,7 @@ public class WorldGenBigTree extends WorldGenTree
{
BlockPos blockpos1 = p_175937_1_.add((double)(0.5F + (float)j * f), (double)(0.5F + (float)j * f1), (double)(0.5F + (float)j * f2));
Facing.Axis blocklog$enumaxis = this.func_175938_b(p_175937_1_, blockpos1);
this.setBlockAndNotifyAdequately(this.world, blockpos1, this.logBase.withProperty(BlockLog.AXIS, blocklog$enumaxis));
this.setBlockNotify(this.world, blockpos1, this.logBase.withProperty(BlockLog.AXIS, blocklog$enumaxis));
}
}

View file

@ -103,7 +103,7 @@ public class WorldGenBirch extends WorldGenTree
if (block == Blocks.air || block.getMaterial() == Material.LEAVES)
{
this.setBlockAndNotifyAdequately(worldIn, blockpos, BlockLeaves.getLeavesBlock(leavesBlock, worldIn.getLeavesGen(blockpos)).getState().withProperty(BlockLeaves.DECAY, Boolean.valueOf(false)));
this.setBlockNotify(worldIn, blockpos, BlockLeaves.getLeavesBlock(leavesBlock, worldIn.getLeavesGen(blockpos)).getState().withProperty(BlockLeaves.DECAY, Boolean.valueOf(false)));
}
}
}
@ -116,7 +116,7 @@ public class WorldGenBirch extends WorldGenTree
if (block2 == Blocks.air || block2.getMaterial() == Material.LEAVES)
{
this.setBlockAndNotifyAdequately(worldIn, position.up(j2), logBlock);
this.setBlockNotify(worldIn, position.up(j2), logBlock);
}
}

View file

@ -201,7 +201,7 @@ public class WorldGenDarkOak extends WorldGenTree
{
if (this.canBeReplaced(p_181639_1_.getState(p_181639_2_).getBlock()))
{
this.setBlockAndNotifyAdequately(p_181639_1_, p_181639_2_, logBlock);
this.setBlockNotify(p_181639_1_, p_181639_2_, logBlock);
}
}
@ -212,7 +212,7 @@ public class WorldGenDarkOak extends WorldGenTree
if (block == Blocks.air)
{
this.setBlockAndNotifyAdequately(worldIn, blockpos, BlockLeaves.getLeavesBlock(leavesBlock, worldIn.getLeavesGen(blockpos)).getState().withProperty(BlockLeaves.DECAY, Boolean.valueOf(false)));
this.setBlockNotify(worldIn, blockpos, BlockLeaves.getLeavesBlock(leavesBlock, worldIn.getLeavesGen(blockpos)).getState().withProperty(BlockLeaves.DECAY, Boolean.valueOf(false)));
}
}
}

View file

@ -124,7 +124,7 @@ public abstract class WorldGenHugeTree extends WorldGenTree
if (block == Blocks.air || block.getMaterial() == Material.LEAVES)
{
this.setBlockAndNotifyAdequately(worldIn, blockpos, BlockLeaves.getLeavesBlock(this.leavesMetadata, worldIn.getLeavesGen(blockpos)).getState().withProperty(BlockLeaves.DECAY, Boolean.valueOf(false)));
this.setBlockNotify(worldIn, blockpos, BlockLeaves.getLeavesBlock(this.leavesMetadata, worldIn.getLeavesGen(blockpos)).getState().withProperty(BlockLeaves.DECAY, Boolean.valueOf(false)));
}
}
}
@ -146,7 +146,7 @@ public abstract class WorldGenHugeTree extends WorldGenTree
if (block == Blocks.air || block.getMaterial() == Material.LEAVES)
{
this.setBlockAndNotifyAdequately(worldIn, blockpos, BlockLeaves.getLeavesBlock(this.leavesMetadata, worldIn.getLeavesGen(blockpos)).getState().withProperty(BlockLeaves.DECAY, Boolean.valueOf(false)));
this.setBlockNotify(worldIn, blockpos, BlockLeaves.getLeavesBlock(this.leavesMetadata, worldIn.getLeavesGen(blockpos)).getState().withProperty(BlockLeaves.DECAY, Boolean.valueOf(false)));
}
}
}

View file

@ -39,7 +39,7 @@ public class WorldGenJungle extends WorldGenHugeTree
{
k = position.getX() + (int)(1.5F + ExtMath.cos(f) * (float)i1);
l = position.getZ() + (int)(1.5F + ExtMath.sin(f) * (float)i1);
this.setBlockAndNotifyAdequately(worldIn, new BlockPos(k, j - 3 + i1 / 2, l), this.woodMetadata);
this.setBlockNotify(worldIn, new BlockPos(k, j - 3 + i1 / 2, l), this.woodMetadata);
}
int j2 = 1 + rand.zrange(2);
@ -58,7 +58,7 @@ public class WorldGenJungle extends WorldGenHugeTree
if (this.canBeReplaced(worldIn.getState(blockpos).getBlock()))
{
this.setBlockAndNotifyAdequately(worldIn, blockpos, this.woodMetadata);
this.setBlockNotify(worldIn, blockpos, this.woodMetadata);
if (i2 > 0)
{
@ -73,7 +73,7 @@ public class WorldGenJungle extends WorldGenHugeTree
if (this.canBeReplaced(worldIn.getState(blockpos1).getBlock()))
{
this.setBlockAndNotifyAdequately(worldIn, blockpos1, this.woodMetadata);
this.setBlockNotify(worldIn, blockpos1, this.woodMetadata);
if (i2 > 0)
{
@ -86,7 +86,7 @@ public class WorldGenJungle extends WorldGenHugeTree
if (this.canBeReplaced(worldIn.getState(blockpos2).getBlock()))
{
this.setBlockAndNotifyAdequately(worldIn, blockpos2, this.woodMetadata);
this.setBlockNotify(worldIn, blockpos2, this.woodMetadata);
if (i2 > 0)
{
@ -99,7 +99,7 @@ public class WorldGenJungle extends WorldGenHugeTree
if (this.canBeReplaced(worldIn.getState(blockpos3).getBlock()))
{
this.setBlockAndNotifyAdequately(worldIn, blockpos3, this.woodMetadata);
this.setBlockNotify(worldIn, blockpos3, this.woodMetadata);
if (i2 > 0)
{
@ -118,7 +118,7 @@ public class WorldGenJungle extends WorldGenHugeTree
{
if (p_181632_2_.zrange(3) > 0 && p_181632_1_.isAirBlock(p_181632_3_))
{
this.setBlockAndNotifyAdequately(p_181632_1_, p_181632_3_, Blocks.vine.getState().withProperty(p_181632_4_, Boolean.valueOf(true)));
this.setBlockNotify(p_181632_1_, p_181632_3_, Blocks.vine.getState().withProperty(p_181632_4_, Boolean.valueOf(true)));
}
}

View file

@ -42,7 +42,7 @@ public class WorldGenPine extends WorldGenHugeTree
if (block == Blocks.air || block.getMaterial() == Material.LEAVES)
{
this.setBlockAndNotifyAdequately(worldIn, position.up(j), this.woodMetadata);
this.setBlockNotify(worldIn, position.up(j), this.woodMetadata);
}
if (j < i - 1)
@ -51,21 +51,21 @@ public class WorldGenPine extends WorldGenHugeTree
if (block == Blocks.air || block.getMaterial() == Material.LEAVES)
{
this.setBlockAndNotifyAdequately(worldIn, position.add(1, j, 0), this.woodMetadata);
this.setBlockNotify(worldIn, position.add(1, j, 0), this.woodMetadata);
}
block = worldIn.getState(position.add(1, j, 1)).getBlock();
if (block == Blocks.air || block.getMaterial() == Material.LEAVES)
{
this.setBlockAndNotifyAdequately(worldIn, position.add(1, j, 1), this.woodMetadata);
this.setBlockNotify(worldIn, position.add(1, j, 1), this.woodMetadata);
}
block = worldIn.getState(position.add(0, j, 1)).getBlock();
if (block == Blocks.air || block.getMaterial() == Material.LEAVES)
{
this.setBlockAndNotifyAdequately(worldIn, position.add(0, j, 1), this.woodMetadata);
this.setBlockNotify(worldIn, position.add(0, j, 1), this.woodMetadata);
}
}
}
@ -131,7 +131,7 @@ public class WorldGenPine extends WorldGenHugeTree
if (block == Blocks.grass || block == Blocks.dirt || block == Blocks.coarse_dirt || block == Blocks.podzol)
{
this.setBlockAndNotifyAdequately(worldIn, blockpos, field_181635_g);
this.setBlockNotify(worldIn, blockpos, field_181635_g);
break;
}

View file

@ -204,7 +204,7 @@ public class WorldGenSavanna extends WorldGenTree
private void func_181642_b(WorldServer p_181642_1_, BlockPos p_181642_2_)
{
this.setBlockAndNotifyAdequately(p_181642_1_, p_181642_2_, field_181643_a);
this.setBlockNotify(p_181642_1_, p_181642_2_, field_181643_a);
}
private void func_175924_b(WorldServer worldIn, BlockPos p_175924_2_)
@ -213,7 +213,7 @@ public class WorldGenSavanna extends WorldGenTree
if (block == Blocks.air || block.getMaterial() == Material.LEAVES)
{
this.setBlockAndNotifyAdequately(worldIn, p_175924_2_, BlockLeaves.getLeavesBlock(field_181644_b, worldIn.getLeavesGen(p_175924_2_)).getState().withProperty(BlockLeaves.DECAY, Boolean.valueOf(false)));
this.setBlockNotify(worldIn, p_175924_2_, BlockLeaves.getLeavesBlock(field_181644_b, worldIn.getLeavesGen(p_175924_2_)).getState().withProperty(BlockLeaves.DECAY, Boolean.valueOf(false)));
}
}
}

View file

@ -112,7 +112,7 @@ public class WorldGenSwamp extends WorldGenTree
if (!worldIn.getState(blockpos).getBlock().isFullBlock())
{
this.setBlockAndNotifyAdequately(worldIn, blockpos, BlockLeaves.getLeavesBlock(field_181649_b, worldIn.getLeavesGen(blockpos)).getState().withProperty(BlockLeaves.DECAY, Boolean.valueOf(false)));
this.setBlockNotify(worldIn, blockpos, BlockLeaves.getLeavesBlock(field_181649_b, worldIn.getLeavesGen(blockpos)).getState().withProperty(BlockLeaves.DECAY, Boolean.valueOf(false)));
}
}
}
@ -125,7 +125,7 @@ public class WorldGenSwamp extends WorldGenTree
if (block2 == Blocks.air || block2.getMaterial() == Material.LEAVES || block2 == Blocks.flowing_water || block2 == Blocks.water)
{
this.setBlockAndNotifyAdequately(worldIn, position.up(i2), field_181648_a);
this.setBlockNotify(worldIn, position.up(i2), field_181648_a);
}
}
@ -189,12 +189,12 @@ public class WorldGenSwamp extends WorldGenTree
private void func_181647_a(WorldServer p_181647_1_, BlockPos p_181647_2_, PropertyBool p_181647_3_)
{
State iblockstate = Blocks.swamp_vine.getState().withProperty(p_181647_3_, Boolean.valueOf(true));
this.setBlockAndNotifyAdequately(p_181647_1_, p_181647_2_, iblockstate);
this.setBlockNotify(p_181647_1_, p_181647_2_, iblockstate);
int i = 4;
for (p_181647_2_ = p_181647_2_.down(); p_181647_1_.getState(p_181647_2_).getBlock() == Blocks.air && i > 0; --i)
{
this.setBlockAndNotifyAdequately(p_181647_1_, p_181647_2_, iblockstate);
this.setBlockNotify(p_181647_1_, p_181647_2_, iblockstate);
p_181647_2_ = p_181647_2_.down();
}
}

View file

@ -95,7 +95,7 @@ public class WorldGenTaiga1 extends WorldGenTree
if (!worldIn.getState(blockpos).getBlock().isFullBlock())
{
this.setBlockAndNotifyAdequately(worldIn, blockpos, BlockLeaves.getLeavesBlock(field_181637_b, worldIn.getLeavesGen(blockpos)).getState().withProperty(BlockLeaves.DECAY, Boolean.valueOf(false)));
this.setBlockNotify(worldIn, blockpos, BlockLeaves.getLeavesBlock(field_181637_b, worldIn.getLeavesGen(blockpos)).getState().withProperty(BlockLeaves.DECAY, Boolean.valueOf(false)));
}
}
}
@ -117,7 +117,7 @@ public class WorldGenTaiga1 extends WorldGenTree
if (block1 == Blocks.air || block1.getMaterial() == Material.LEAVES)
{
this.setBlockAndNotifyAdequately(worldIn, position.up(i3), field_181636_a);
this.setBlockNotify(worldIn, position.up(i3), field_181636_a);
}
}

View file

@ -101,7 +101,7 @@ public class WorldGenTaiga2 extends WorldGenTree
if (!worldIn.getState(blockpos).getBlock().isFullBlock())
{
this.setBlockAndNotifyAdequately(worldIn, blockpos, BlockLeaves.getLeavesBlock(field_181646_b, worldIn.getLeavesGen(blockpos)).getState().withProperty(BlockLeaves.DECAY, Boolean.valueOf(false)));
this.setBlockNotify(worldIn, blockpos, BlockLeaves.getLeavesBlock(field_181646_b, worldIn.getLeavesGen(blockpos)).getState().withProperty(BlockLeaves.DECAY, Boolean.valueOf(false)));
}
}
}
@ -132,7 +132,7 @@ public class WorldGenTaiga2 extends WorldGenTree
if (block2 == Blocks.air || block2.getMaterial() == Material.LEAVES)
{
this.setBlockAndNotifyAdequately(worldIn, position.up(k4), field_181645_a);
this.setBlockNotify(worldIn, position.up(k4), field_181645_a);
}
}

View file

@ -35,7 +35,7 @@ public abstract class WorldGenTree extends FeatureGenerator
{
if (worldIn.getState(pos) != worldIn.gen.getTop())
{
this.setBlockAndNotifyAdequately(worldIn, pos, worldIn.gen.getTop()); // Blocks.dirt.getDefaultState());
this.setBlockNotify(worldIn, pos, worldIn.gen.getTop()); // Blocks.dirt.getDefaultState());
}
}
}