move worldgen to server

This commit is contained in:
Sen 2025-05-14 00:37:46 +02:00
parent e26938ee77
commit 111226fe28
159 changed files with 1917 additions and 1951 deletions

View file

@ -95,7 +95,7 @@ import client.window.Wheel;
import client.window.Window;
import client.window.WindowEvent;
import client.world.WorldClient;
import common.biome.Biome;
import common.biome.BaseBiome;
import common.block.Block;
import common.collect.Lists;
import common.collect.Maps;
@ -116,6 +116,7 @@ import common.init.ItemRegistry;
import common.init.Items;
import common.init.Registry;
import common.init.SoundEvent;
import common.init.UniverseRegistry;
import common.inventory.InventoryPlayer;
import common.item.Item;
import common.item.ItemBlock;
@ -1728,7 +1729,7 @@ public class Client implements IThreadListener {
break;
}
Biome biome = null;
BaseBiome biome = null;
String bline;
String lline;
if(this.world.isBlockLoaded(blockpos)) {
@ -2638,6 +2639,7 @@ public class Client implements IThreadListener {
Window.init();
ModelBlock.setAsProvider();
Registry.setup("Render thread");
UniverseRegistry.register();
CLIENT.run();
Window.end();
}

View file

@ -14,7 +14,7 @@ import client.renderer.particle.EffectRenderer;
import client.renderer.texture.DynamicTexture;
import client.renderer.texture.TextureMap;
import client.world.WorldClient;
import common.biome.Biome;
import common.biome.BaseBiome;
import common.block.Block;
import common.entity.Entity;
import common.entity.npc.EntityNPC;
@ -1144,7 +1144,7 @@ public class EntityRenderer {
for (int l = 0; l < k; ++l)
{
BlockPos blockpos1 = world.getPrecipitationHeight(blockpos.add(this.random.zrange(i) - this.random.zrange(i), 0, this.random.zrange(i) - this.random.zrange(i)));
Biome biomegenbase = world.getBiomeGenForCoords(blockpos1);
BaseBiome biomegenbase = world.getBiomeGenForCoords(blockpos1);
BlockPos blockpos2 = blockpos1.down();
Block block = world.getState(blockpos2).getBlock();
float temp = World.ABSOLUTE_ZERO + world.getTempOffset() + biomegenbase.getTemperature(blockpos1);
@ -1253,7 +1253,7 @@ public class EntityRenderer {
double d3 = (double)this.rainXCoords[i2] * 0.5D;
double d4 = (double)this.rainYCoords[i2] * 0.5D;
blockpos$mutableblockpos.set(l1, 0, k1);
Biome biomegenbase = world.getBiomeGenForCoords(blockpos$mutableblockpos);
BaseBiome biomegenbase = world.getBiomeGenForCoords(blockpos$mutableblockpos);
// if (biomegenbase.canRain() || biomegenbase.isSnowyBiome())
// {

View file

@ -2,7 +2,7 @@ package client.renderer;
import java.util.Arrays;
import common.biome.Biome;
import common.biome.BaseBiome;
import common.init.Blocks;
import common.tileentity.TileEntity;
import common.util.BlockPos;
@ -125,7 +125,7 @@ public class RegionRenderCache extends ChunkCache implements IWorldAccess
return i << 20 | j << 4;
}
public Biome getBiomeGenForCoords(BlockPos pos)
public BaseBiome getBiomeGenForCoords(BlockPos pos)
{
return this.worldObj.getBiomeGenForCoords(pos);
}

View file

@ -6,7 +6,7 @@ import java.util.Set;
import client.Client;
import client.renderer.particle.EntityFX;
import client.renderer.particle.EntityFirework;
import common.biome.Biome;
import common.biome.BaseBiome;
import common.block.Block;
import common.collect.Lists;
import common.collect.Sets;
@ -759,10 +759,10 @@ public class WorldClient extends AWorldClient
public Vec3 getSkyColor(Entity entity, float partial) {
BlockPos pos = new BlockPos(ExtMath.floord(entity.posX), ExtMath.floord(entity.posY),
ExtMath.floord(entity.posZ));
Biome biome = this.getBiomeGenForCoords(pos);
BaseBiome biome = this.getBiomeGenForCoords(pos);
Vec3 vec;
if(biome.getSkyColor() != 0xffffffff)
vec = new Vec3(biome.getSkyColor());
if(biome.skyColor != 0xffffffff)
vec = new Vec3(biome.skyColor);
else
vec = new Vec3(this.dimension.getSkyColor());
if(this.dimension.getType().days) {
@ -815,10 +815,10 @@ public class WorldClient extends AWorldClient
public Vec3 getCloudColour(Entity entity, float partialTicks) {
Vec3 color = new Vec3(this.dimension.getCloudColor());
Biome biome = this.getBiomeGenForCoords(new BlockPos(ExtMath.floord(entity.posX), ExtMath.floord(entity.posY),
BaseBiome biome = this.getBiomeGenForCoords(new BlockPos(ExtMath.floord(entity.posX), ExtMath.floord(entity.posY),
ExtMath.floord(entity.posZ)));
if(biome.getCloudColor() != 0xffffffff)
color = new Vec3(biome.getCloudColor());
if(biome.cloudColor != 0xffffffff)
color = new Vec3(biome.cloudColor);
float r = (float)color.xCoord;
float g = (float)color.yCoord;
float b = (float)color.zCoord;
@ -854,10 +854,10 @@ public class WorldClient extends AWorldClient
public Vec3 getFogColor(Entity entity, float partialTicks) {
Vec3 color = new Vec3(this.dimension.getFogColor());
Biome biome = this.getBiomeGenForCoords(new BlockPos(ExtMath.floord(entity.posX), ExtMath.floord(entity.posY),
BaseBiome biome = this.getBiomeGenForCoords(new BlockPos(ExtMath.floord(entity.posX), ExtMath.floord(entity.posY),
ExtMath.floord(entity.posZ)));
if(biome.getFogColor() != 0xffffffff)
color = new Vec3(biome.getFogColor());
if(biome.fogColor != 0xffffffff)
color = new Vec3(biome.fogColor);
if(!this.dimension.getType().days)
return color;
float sun = ExtMath.clampf(ExtMath.cos(this.getCelestialAngle(partialTicks) * (float)Math.PI * 2.0F) * 2.0F + 0.5F,

View file

@ -1,6 +1,96 @@
package common.biome;
public abstract class BaseBiome {
import java.util.List;
import java.util.Map;
import common.collect.Lists;
import common.collect.Maps;
import common.color.Colorizer;
import common.log.Log;
import common.rng.PerlinGen;
import common.rng.Random;
import common.util.BlockPos;
import common.util.ExtMath;
public enum BaseBiome {
NONE(0, "none", "<Keins>", 0x000000),
PLAINS(1, "plains", "Ebene", 0x8db360, 12.0f, 40.0f),
DESERT(2, "desert", "Wüste", 0xfa9418, 60.0f, 0.0f),
EXTREMEHILLS(3, "extremeHills", "Extremes Bergland", 0x606060, -12.0f, 30.0f),
FOREST(4, "forest", "Wald", 0x056621, 8.0f, 80.0f),
TAIGA(5, "taiga", "Taiga", 0x0b6659, -10.0f, 80.0f),
SWAMPLAND(6, "swampland", "Sumpf", 0x07f9b2, 12.0f, 90.0f, 0xe0ffae, 0xffffffff, 6975545),
RIVER(7, "river", "Fluss", 0x0000ff),
EXTERMINATED(8, "exterminated", "Ausgelöscht", 0x000000, 150.0f, 0.0f, 0x202020, 0x303030, 0x303030, 0x101010, 0x303030, 0x000000),
SPACE(9, "space", "Leere des Weltraums", 0x000000, 0.0f, 0.0f),
FROZENSEA(10, "frozenSea", "Vereister See", 0x9090a0, -20.0f),
FROZENRIVER(11, "frozenRiver", "Vereister Fluss", 0xa0a0ff, -20.0f),
ICEPLAINS(12, "icePlains", "Eisebene", 0xffffff, -20.0f),
ICEMOUNTAINS(13, "iceMountains", "Vereistes Bergland", 0xa0a0a0, -20.0f),
MUSHROOMPLAINS(14, "mushroomPlains", "Pilzland", 0xff00ff, 16.0f, 100.0f),
BLACKENED(15, "blackened", "Schwarz", 0x000000, 0.0f, 0.0f),
BEACH(16, "beach", "Strand", 0xfade55, 12.0f, 40.0f),
DESERTHILLS(17, "desertHills", "Wüsten-Bergland", 0xd25f12, 60.0f, 0.0f),
FORESTHILLS(18, "forestHills", "Wald-Bergland", 0x22551c, 8.0f, 80.0f),
TAIGAHILLS(19, "taigaHills", "Taiga-Bergland", 0x163933, -10.0f, 80.0f),
EXTREMEHILLSEDGE(20, "extremeHillsEdge", "Extremes Bergland Gr.", 0x72789a, -12.0f, 30.0f),
JUNGLE(21, "jungle", "Urwald", 0x537b09, 18.0f, 90.0f),
JUNGLEHILLS(22, "jungleHills", "Urwald-Bergland", 0x2c4205, 18.0f, 90.0f),
JUNGLEEDGE(23, "jungleEdge", "Urwald Gr.", 0x628b17, 18.0f, 80.0f),
SEA(24, "sea", "See", 0x000070),
STONEBEACH(25, "stoneBeach", "Steinstrand", 0xa2a284, -12.0f, 30.0f),
COLDBEACH(26, "coldBeach", "Vereister Strand", 0xfaf0c0, -18.0f, 30.0f),
BIRCHFOREST(27, "birchForest", "Birkenwald", 0x307444, 4.0f, 60.0f),
BIRCHFORESTHILLS(28, "birchForestHills", "Birkenwald-Bergland", 0x1f5f32, 4.0f, 60.0f),
ROOFEDFOREST(29, "roofedForest", "Dichter Wald", 0x40511a, 8.0f, 80.0f),
COLDTAIGA(30, "coldTaiga", "Vereiste Taiga", 0x31554a, -40.0f, 40.0f),
COLDTAIGAHILLS(31, "coldTaigaHills", "Vereistes Taiga-Bergland", 0x243f36, -40.0f, 40.0f),
MEGATAIGA(32, "megaTaiga", "Hohe Taiga", 0x596651, -8.0f, 80.0f),
MEGATAIGAHILLS(33, "megaTaigaHills", "Hohes Taiga-Bergland", 0x454f3e, -8.0f, 80.0f),
EXTREMEHILLSPLUS(34, "extremeHillsPlus", "Extremes Bergland +", 0x507050, -12.0f, 30.0f),
SAVANNA(35, "savanna", "Savanne", 0xbdb25f, 28.0f, 0.0f),
SAVANNAPLATEAU(36, "savannaPlateau", "Savannen-Plateau", 0xa79d64, 20.0f, 0.0f),
MESA(37, "mesa", "Mesa", 0xd94515, 0.0f, 0.0f, 0xffffff, 9470285, 10387789),
MESAPLATEAUF(38, "mesaPlateauF", "Mesa-Waldplateau", 0xb09765, 0.0f, 0.0f, 0xffffff, 9470285, 10387789),
MESAPLATEAU(39, "mesaPlateau", "Mesa-Plateau", 0xca8c65, 0.0f, 0.0f, 0xffffff, 9470285, 10387789),
SNOWLAND(40, "snowLand", "Eisland", 0xffffff, 0.0f, 100.0f),
TIAN(41, "tian", "Tian", 0x808080, 0.0f, 80.0f),
ELVENFOREST(42, "elvenForest", "Elbenwald", 0x059821, 8.0f, 90.0f),
UPPERHELL(43, "upperHell", "Übergang in die Hölle", 0xff0000, 0.0f, 0.0f, 0x000000, 0x000000, 0x000000),
LOWERHELL(44, "lowerHell", "Abgrund der Hölle", 0xff0000, 0.0f, 0.0f, 0x000000, 0x000000, 0x000000),
HELLHILLS(45, "hellHills", "Bergland der Hölle", 0xff0000, 0.0f, 0.0f, 0x000000, 0x000000, 0x000000),
SOULPLAINS(46, "soulPlains", "Seelenland", 0xff0000, 0.0f, 0.0f, 0x000000, 0x000000, 0x000000),
ASHLAND(47, "ashLand", "Verbrannt", 0xff0000, 0.0f, 0.0f, 0x000000, 0x000000, 0x000000),
MOON(48, "moon", "Mondoberfläche", 0xa0a0a0, 0.0f, 0.0f),
CHAOS(49, "chaos", "Chaos", 0xff00ff),
DESERTM(130, "desertM", "Wüste M", 0xfa9418, 60.0f, 0.0f),
EXTREMEHILLSM(131, "extremeHillsM", "Extremes Bergland M", 0x606060, -12.0f, 30.0f),
FLOWERFOREST(132, "flowerForest", "Blumenwald", 0x6a7425, 8.0f, 80.0f),
TAIGAM(133, "taigaM", "Taiga M", 0x0b6659, -10.0f, 80.0f),
SWAMPLANDM(134, "swamplandM", "Sumpf M", 0x07f9b2, 12.0f, 90.0f, 0xe0ffae, 0xffffffff, 6975545),
ICEPLAINSSPIKES(140, "icePlainsSpikes", "Eisebene + Spitzen", 0xd2ffff, -20.0f),
JUNGLEM(149, "jungleM", "Urwald M", 0x537b09, 18.0f, 90.0f),
JUNGLEEDGEM(151, "jungleEdgeM", "Urwald Gr. M", 0x628b17, 18.0f, 80.0f),
BIRCHFORESTM(155, "birchForestM", "Birkenwald M", 0x307444, 4.0f, 60.0f),
BIRCHFORESTHILLSM(156, "birchForestHillsM", "Birkenwald-Bergland M", 0x1f5f32, 4.0f, 60.0f),
ROOFEDFORESTM(157, "roofedForestM", "Dichter Wald M", 0x40511a, 8.0f, 80.0f),
COLDTAIGAM(158, "coldTaigaM", "Vereiste Taiga M", 0x31554a, -40.0f, 40.0f),
MEGASPRUCETAIGA(160, "megaSpruceTaiga", "Hohe Fichtentaiga", 0x596651, -10.0f, 80.0f),
REDWOODTAIGAHILLSM(161, "redwoodTaigaHillsM", "Mammutbaumtaiga", 0x596651, -10.0f, 80.0f),
EXTREMEHILLSPLUSM(162, "extremeHillsPlusM", "Extremes Bergland + M", 0x507050, -12.0f, 30.0f),
SAVANNAM(163, "savannaM", "Savanne M", 0xbdb25f, 24.0f, 0.0f),
SAVANNAPLATEAUM(164, "savannaPlateauM", "Savannen-Plateau M", 0xa79d64, 20.0f, 0.0f),
MESABRYCE(165, "mesaBryce", "Mesa (Bryce)", 0xd94515, 0.0f, 0.0f, 0xffffff, 9470285, 10387789),
MESAPLATEAUFM(166, "mesaPlateauFM", "Mesa-Waldplateau M", 0xb09765, 0.0f, 0.0f, 0xffffff, 9470285, 10387789),
MESAPLATEAUM(167, "mesaPlateauM", "Mesa-Plateau M", 0xca8c65, 0.0f, 0.0f, 0xffffff, 9470285, 10387789);
public static final BaseBiome DEF_BIOME = FOREST;
private static final PerlinGen TEMP_NOISE = new PerlinGen(new Random(1234L), 1);
private static final PerlinGen COLOR_NOISE = new PerlinGen(new Random(2345L), 1);
private static final BaseBiome[] BIOMES = new BaseBiome[256];
private static final Map<String, BaseBiome> LOOKUP = Maps.newTreeMap();
public final int id;
public final String name;
public final String display;
@ -8,11 +98,68 @@ public abstract class BaseBiome {
public final float temperature;
public final float humidity;
public final int waterColor;
public final int grassColor;
public final int foliageColor;
public final int skyColor;
public final int fogColor;
public final int cloudColor;
private BaseBiome(int id, String name, String display, int color, float temperature, float humidity, int waterColor, int skyColor, int fogColor, int cloudColor) {
static {
for(BaseBiome biome : values()) {
BIOMES[biome.id] = biome;
if(LOOKUP.containsKey(biome.name.toLowerCase()))
throw new IllegalStateException("Biom \"" + biome.name + "\" ist als ID " + LOOKUP.get(biome.name.toLowerCase()).id + " und " + biome.id + " definiert");
LOOKUP.put(biome.name.toLowerCase(), biome);
}
}
public static BaseBiome getBiome(int id)
{
if (id >= 0 && id < BIOMES.length)
{
return BIOMES[id];
}
else
{
Log.JNI.warn("Biom-ID ist nicht im Bereich: " + id + ", verwende " + DEF_BIOME.id + " (" + DEF_BIOME.name + ")");
return DEF_BIOME;
}
}
public static BaseBiome getBiomeDef(int id)
{
if (id >= 0 && id < BIOMES.length)
{
BaseBiome biome = BIOMES[id];
return biome == null ? DEF_BIOME : biome;
}
else
{
Log.JNI.warn("Biom-ID ist nicht im Bereich: " + id + ", verwende " + DEF_BIOME.id + " (" + DEF_BIOME.name + ")");
return DEF_BIOME;
}
}
public static List<String> getBiomeNames() {
return Lists.newArrayList(LOOKUP.keySet());
}
public static BaseBiome findByName(String name) {
BaseBiome biome = LOOKUP.get(name.toLowerCase().replace(" ", "").replace("_", ""));
if(biome == null) {
int z;
try {
z = Integer.parseInt(name);
}
catch(NumberFormatException e) {
return DEF_BIOME;
}
return z < 0 || z >= BIOMES.length || BIOMES[z] == null ? DEF_BIOME : BIOMES[z];
}
return biome;
}
private BaseBiome(int id, String name, String display, int color, float temperature, float humidity, int waterColor, int grassColor, int foliageColor, int skyColor, int fogColor, int cloudColor) {
this.id = id;
this.name = name;
this.display = display;
@ -20,28 +167,69 @@ public abstract class BaseBiome {
this.humidity = humidity;
this.color = color;
this.waterColor = waterColor;
this.grassColor = grassColor;
this.foliageColor = foliageColor;
this.skyColor = skyColor;
this.fogColor = fogColor;
this.cloudColor = cloudColor;
}
private BaseBiome(int id, String name, String display, int color, float temperature, float humidity, int waterColor) {
this(id, name, display, color, temperature, humidity, waterColor, 0xffffffff, 0xffffffff, 0xffffffff);
}
private BaseBiome(int id, String name, String display, int color, float temperature, float humidity, int skyColor, int fogColor, int cloudColor) {
this(id, name, display, color, temperature, humidity, 0xffffff, skyColor, fogColor, cloudColor);
private BaseBiome(int id, String name, String display, int color, float temperature, float humidity, int waterColor, int grassColor, int foliageColor) {
this(id, name, display, color, temperature, humidity, waterColor, grassColor, foliageColor, 0xffffffff, 0xffffffff, 0xffffffff);
}
private BaseBiome(int id, String name, String display, int color, float temperature, float humidity) {
this(id, name, display, color, temperature, humidity, 0xffffff, 0xffffffff, 0xffffffff, 0xffffffff);
this(id, name, display, color, temperature, humidity, 0xffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff);
}
private BaseBiome(int id, String name, String display, int color, float temperature) {
this(id, name, display, color, temperature, 50.0f, 0xffffff, 0xffffffff, 0xffffffff, 0xffffffff);
this(id, name, display, color, temperature, 50.0f, 0xffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff);
}
private BaseBiome(int id, String name, String display, int color) {
this(id, name, display, color, 0.0f, 50.0f, 0xffffff, 0xffffffff, 0xffffffff, 0xffffffff);
this(id, name, display, color, 0.0f, 50.0f, 0xffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff);
}
public final float getTemperature(BlockPos pos) {
if(pos.getY() > 64) {
float f = (float)(TEMP_NOISE.generate((double)pos.getX() * 1.0D / 8.0D, (double)pos.getZ() * 1.0D / 8.0D) * 4.0D);
return this.temperature - (f + (float)pos.getY() - 64.0F) / 15.0f;
}
return this.temperature;
}
public float getFactor() {
float f = this.humidity * 0.01f * ((this.temperature + 14.0f) / 40.0f + 0.15f);
return f > 1.0f ? 1.0f : f;
}
public boolean isHighHumidity() {
return this.humidity > 85.0f;
}
// skycolor = ((temp + 14) / 40 + 0.15) / 3
public int getGrassColorAtPos(BlockPos pos) {
if(this.grassColor != 0xffffffff)
return this.grassColor;
if(this == SWAMPLAND || this == SWAMPLANDM) {
double d0 = COLOR_NOISE.generate((double)pos.getX() * 0.0225D, (double)pos.getZ() * 0.0225D);
return d0 < -0.1D ? 5011004 : 6975545;
}
if(this == ELVENFOREST)
return Colorizer.getGrassColor(1.0f, this.humidity * 0.01f);
double d0 = (double)ExtMath.clampf((this.getTemperature(pos) + 14.0f) / 40.0f + 0.15f, 0.0F, 1.0F);
double d1 = (double)ExtMath.clampf(this.humidity * 0.01f, 0.0F, 1.0F);
return this == ROOFEDFOREST || this == ROOFEDFORESTM ? (Colorizer.getGrassColor(d0, d1) & 16711422) + 2634762 >> 1 : Colorizer.getGrassColor(d0, d1);
}
public int getFoliageColorAtPos(BlockPos pos) {
if(this.foliageColor != 0xffffffff)
return this.foliageColor;
if(this == ELVENFOREST)
return Colorizer.getFoliageColor(1.0f, this.humidity * 0.01f);
double d0 = (double)ExtMath.clampf((this.getTemperature(pos) + 14.0f) / 40.0f + 0.15f, 0.0F, 1.0F);
double d1 = (double)ExtMath.clampf(this.humidity * 0.01f, 0.0F, 1.0F);
return Colorizer.getFoliageColor(d0, d1);
}
}

View file

@ -1,33 +0,0 @@
package common.biome;
import common.init.Blocks;
import common.rng.Random;
import common.rng.WeightedList;
import common.util.BlockPos;
import common.world.AWorldServer;
public class BiomeExterminated extends Biome {
public BiomeExterminated(int id) {
super(id);
this.topBlock = Blocks.air.getState();
this.fillerBlock = Blocks.air.getState();
}
protected void addMobs(WeightedList<RngSpawn> mobs) {
}
public void decorate(AWorldServer worldIn, Random rand, BlockPos pos) {
}
public int getSkyColor() {
return 0x101010;
}
public int getFogColor() {
return 0x303030;
}
public int getCloudColor() {
return 0x000000;
}
}

View file

@ -0,0 +1,47 @@
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();
}

View file

@ -1,5 +1,6 @@
package common.block;
import common.biome.IBiome;
import common.color.Colorizer;
import common.init.Blocks;
import common.init.Config;
@ -113,54 +114,7 @@ public class BlockGrass extends Block implements IGrowable
public void grow(AWorldServer worldIn, Random rand, BlockPos pos, State state)
{
BlockPos blockpos = pos.up();
for (int i = 0; i < 128; ++i)
{
BlockPos blockpos1 = blockpos;
int j = 0;
while (true)
{
if (j >= i / 16)
{
if (worldIn.getState(blockpos1).getBlock().material == Material.air)
{
if (rand.chance(8))
{
BlockFlower.EnumFlowerType blockflower$enumflowertype = worldIn.getBiomeGenForCoords(blockpos1).pickRandomFlower(rand, blockpos1);
BlockFlower blockflower = blockflower$enumflowertype.getBlockType().getBlock();
State iblockstate = blockflower.getState().withProperty(blockflower.getTypeProperty(), blockflower$enumflowertype);
if (blockflower.canBlockStay(worldIn, blockpos1, iblockstate))
{
worldIn.setState(blockpos1, iblockstate, 3);
}
}
else
{
State iblockstate1 = Blocks.tallgrass.getState().withProperty(BlockTallGrass.TYPE, BlockTallGrass.EnumType.GRASS);
if (Blocks.tallgrass.canBlockStay(worldIn, blockpos1, iblockstate1))
{
worldIn.setState(blockpos1, iblockstate1, 3);
}
}
}
break;
}
blockpos1 = blockpos1.add(rand.zrange(3) - 1, (rand.zrange(3) - 1) * rand.zrange(3) / 2, rand.zrange(3) - 1);
if (worldIn.getState(blockpos1.down()).getBlock() != Blocks.grass || worldIn.getState(blockpos1).getBlock().isNormalCube())
{
break;
}
++j;
}
}
IBiome.getBiome(worldIn.getBiomeGenForCoords(pos)).growGrass(worldIn, pos, state, rand);
}
public BlockLayer getBlockLayer()

View file

@ -1,5 +1,6 @@
package common.block;
import common.biome.IBiome;
import common.init.Blocks;
import common.init.Config;
import common.model.Model;
@ -9,8 +10,6 @@ import common.util.BlockPos;
import common.world.State;
import common.world.World;
import common.world.AWorldServer;
import common.worldgen.FeatureGenerator;
import common.worldgen.foliage.WorldGenBigMushroom;
public class BlockMushroom extends BlockBush implements IGrowable
{
@ -86,31 +85,6 @@ public class BlockMushroom extends BlockBush implements IGrowable
}
}
public boolean generateBigMushroom(AWorldServer worldIn, BlockPos pos, State state, Random rand)
{
worldIn.setBlockToAir(pos);
FeatureGenerator worldgenerator = null;
if (this == Blocks.brown_mushroom)
{
worldgenerator = new WorldGenBigMushroom(Blocks.brown_mushroom_block);
}
else if (this == Blocks.red_mushroom)
{
worldgenerator = new WorldGenBigMushroom(Blocks.red_mushroom_block);
}
if (worldgenerator != null && worldgenerator.generate(worldIn, rand, pos))
{
return true;
}
else
{
worldIn.setState(pos, state, 3);
return false;
}
}
/**
* Whether this IGrowable can grow
*/
@ -126,7 +100,7 @@ public class BlockMushroom extends BlockBush implements IGrowable
public void grow(AWorldServer worldIn, Random rand, BlockPos pos, State state)
{
this.generateBigMushroom(worldIn, pos, state, rand);
IBiome.getBiome(worldIn.getBiomeGenForCoords(pos)).generateBigMushroom(worldIn, pos, state, rand);
}
public Model getModel(ModelProvider provider, String name, State state) {

View file

@ -2,6 +2,7 @@ package common.block;
import java.util.List;
import common.biome.IBiome;
import common.collect.Lists;
import common.init.Blocks;
import common.init.Config;
@ -16,15 +17,6 @@ import common.util.BlockPos;
import common.world.State;
import common.world.World;
import common.world.AWorldServer;
import common.worldgen.FeatureGenerator;
import common.worldgen.tree.WorldGenBaseTree;
import common.worldgen.tree.WorldGenBigTree;
import common.worldgen.tree.WorldGenBirch;
import common.worldgen.tree.WorldGenDarkOak;
import common.worldgen.tree.WorldGenJungle;
import common.worldgen.tree.WorldGenPine;
import common.worldgen.tree.WorldGenSavanna;
import common.worldgen.tree.WorldGenTaiga2;
public class BlockSapling extends BlockBush implements IGrowable
{
@ -79,158 +71,10 @@ public class BlockSapling extends BlockBush implements IGrowable
}
else
{
this.generateTree(worldIn, pos, state, rand);
IBiome.getBiome(worldIn.getBiomeGenForCoords(pos)).generateTree(worldIn, pos, state, rand);
}
}
public void generateTree(AWorldServer worldIn, BlockPos pos, State state, Random rand)
{
WoodType type = state.getBlock() instanceof BlockSapling ? ((BlockSapling)state.getBlock()).type : WoodType.OAK;
State log = type == WoodType.CHERRY ? Blocks.cherry_log.getState() : // .withProperty(BlockNewLog.VARIANT, BlockPlanks.EnumType.CHERRY) :
(type == WoodType.MAPLE ? Blocks.maple_log.getState() /* .withProperty(BlockNewLog.VARIANT, BlockPlanks.EnumType.MAPLE) */ : Blocks.oak_log.getState());
State leaves = type == WoodType.CHERRY ? Blocks.cherry_leaves.getState() :
(type == WoodType.MAPLE ? Blocks.maple_leaves.getState() : Blocks.oak_leaves.getState());
FeatureGenerator worldgenerator = (FeatureGenerator)(rand.chance(10) ? new WorldGenBigTree(true, log, leaves) : new WorldGenBaseTree(true, log, leaves));
int i = 0;
int j = 0;
boolean flag = false;
// leaves = leaves.withProperty(BlockLeaves.TYPE, worldIn.getLeavesGen());
switch (type)
{
case SPRUCE:
label114:
for (i = 0; i >= -1; --i)
{
for (j = 0; j >= -1; --j)
{
if (this.isSameSaplingTypeIn(worldIn, pos, i, j, WoodType.SPRUCE))
{
worldgenerator = new WorldGenPine(false, rand.chance());
flag = true;
break label114;
}
}
}
if (!flag)
{
j = 0;
i = 0;
worldgenerator = new WorldGenTaiga2(true);
}
break;
case BIRCH:
worldgenerator = new WorldGenBirch(true, false);
break;
case TIAN:
worldgenerator = new WorldGenBigTree(true, Blocks.tian_log.getState(), Blocks.tian_leaves.getState())
.setHeightLimit(6, 20);
break;
case JUNGLE:
State iblockstate = Blocks.jungle_log.getState(); // .withProperty(BlockOldLog.VARIANT, BlockPlanks.EnumType.JUNGLE);
State iblockstate1 = Blocks.jungle_leaves.getState(); // .withProperty(BlockOldLeaf.VARIANT, BlockPlanks.EnumType.JUNGLE); // .withProperty(BlockLeaves.CHECK_DECAY, Boolean.valueOf(false));
label269:
for (i = 0; i >= -1; --i)
{
for (j = 0; j >= -1; --j)
{
if (this.isSameSaplingTypeIn(worldIn, pos, i, j, WoodType.JUNGLE))
{
worldgenerator = new WorldGenJungle(true, 10, 20, iblockstate, iblockstate1);
flag = true;
break label269;
}
}
}
if (!flag)
{
j = 0;
i = 0;
worldgenerator = new WorldGenBaseTree(true, rand.range(4, 10), iblockstate, iblockstate1, false);
}
break;
case ACACIA:
worldgenerator = new WorldGenSavanna(true);
break;
case DARK_OAK:
label390:
for (i = 0; i >= -1; --i)
{
for (j = 0; j >= -1; --j)
{
if (this.isSameSaplingTypeIn(worldIn, pos, i, j, WoodType.DARK_OAK))
{
worldgenerator = new WorldGenDarkOak(true);
flag = true;
break label390;
}
}
}
if (!flag)
{
return;
}
case OAK:
case CHERRY:
case MAPLE:
}
State iblockstate2 = Blocks.air.getState();
if (flag)
{
worldIn.setState(pos.add(i, 0, j), iblockstate2, 4);
worldIn.setState(pos.add(i + 1, 0, j), iblockstate2, 4);
worldIn.setState(pos.add(i, 0, j + 1), iblockstate2, 4);
worldIn.setState(pos.add(i + 1, 0, j + 1), iblockstate2, 4);
}
else
{
worldIn.setState(pos, iblockstate2, 4);
}
if (!worldgenerator.generate(worldIn, rand, pos.add(i, 0, j)))
{
if (flag)
{
worldIn.setState(pos.add(i, 0, j), state, 4);
worldIn.setState(pos.add(i + 1, 0, j), state, 4);
worldIn.setState(pos.add(i, 0, j + 1), state, 4);
worldIn.setState(pos.add(i + 1, 0, j + 1), state, 4);
}
else
{
worldIn.setState(pos, state, 4);
}
}
}
private boolean isSameSaplingTypeIn(World worldIn, BlockPos pos, int xOff, int yOff, WoodType type)
{
return this.isTypeAt(worldIn, pos.add(xOff, 0, yOff), type) && this.isTypeAt(worldIn, pos.add(xOff + 1, 0, yOff), type) && this.isTypeAt(worldIn, pos.add(xOff, 0, yOff + 1), type) && this.isTypeAt(worldIn, pos.add(xOff + 1, 0, yOff + 1), type);
}
/**
* Check whether the given BlockPos has a Sapling of the given type
*/
public boolean isTypeAt(World worldIn, BlockPos pos, WoodType type)
{
State iblockstate = worldIn.getState(pos);
return iblockstate.getBlock() instanceof BlockSapling && ((BlockSapling)iblockstate.getBlock()).type == type;
}
// /**
// * Gets the metadata of the item this Block can drop. This method is called when the block gets destroyed. It
// * returns the metadata of the dropped item based on the old metadata of the block.
@ -296,4 +140,8 @@ public class BlockSapling extends BlockBush implements IGrowable
public Model getModel(ModelProvider provider, String name, State state) {
return provider.getModel(name).cross();
}
public WoodType getWoodType() {
return this.type;
}
}

View file

@ -1,6 +1,6 @@
package common.color;
import common.biome.Biome;
import common.biome.BaseBiome;
import common.util.BlockPos;
import common.world.IWorldAccess;
@ -8,21 +8,21 @@ public enum Colorizer {
NONE(0xffffff), BASIC(0x37b500), PINE(0x3f993f), BIRCH(0x68a723);
private interface ColorResolver {
int getColorAtPos(Biome biome, BlockPos pos);
int getColorAtPos(BaseBiome biome, BlockPos pos);
}
private static final ColorResolver GRASS_COLOR = new ColorResolver() {
public int getColorAtPos(Biome biome, BlockPos pos) {
public int getColorAtPos(BaseBiome biome, BlockPos pos) {
return biome.getGrassColorAtPos(pos);
}
};
private static final ColorResolver FOLIAGE_COLOR = new ColorResolver() {
public int getColorAtPos(Biome biome, BlockPos pos) {
public int getColorAtPos(BaseBiome biome, BlockPos pos) {
return biome.getFoliageColorAtPos(pos);
}
};
private static final ColorResolver WATER_COLOR_MULTIPLIER = new ColorResolver() {
public int getColorAtPos(Biome biome, BlockPos pos) {
public int getColorAtPos(BaseBiome biome, BlockPos pos) {
return biome.waterColor;
}
};

View file

@ -4,7 +4,8 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import common.biome.Biome;
import common.biome.BaseBiome;
import common.biome.IBiome;
import common.block.LeavesType;
import common.collect.Lists;
import common.collect.Maps;
@ -16,34 +17,13 @@ import common.init.UniverseRegistry;
import common.nbt.NBTTagCompound;
import common.nbt.NBTTagList;
import common.nbt.NBTTagString;
import common.rng.Random;
import common.util.ExtMath;
import common.util.Vec3;
import common.world.State;
import common.world.Weather;
import common.worldgen.BiomeGenLayered;
import common.worldgen.BiomeGenPerlin;
import common.worldgen.BiomeGenSingle;
import common.worldgen.BiomeGenerator;
import common.worldgen.BlockReplacer;
import common.worldgen.ChunkGenerator;
import common.worldgen.FeatureDungeons;
import common.worldgen.FeatureLakes;
import common.worldgen.FeatureLiquids;
import common.worldgen.FeatureOres;
import common.worldgen.GeneratorCavern;
import common.worldgen.GeneratorDestroyed;
import common.worldgen.GeneratorFlat;
import common.worldgen.GeneratorIsland;
import common.worldgen.GeneratorPerlin;
import common.worldgen.GeneratorSimple;
import common.worldgen.ReplacerAltBiome;
import common.worldgen.ReplacerAltSurface;
import common.worldgen.ReplacerBiome;
import common.worldgen.ReplacerTopLayer;
import common.worldgen.caves.MapGenBigCaves;
import common.worldgen.caves.MapGenCaves;
import common.worldgen.caves.MapGenRavine;
import common.worldgen.FeatureLake;
import common.worldgen.FeatureLiquid;
import common.worldgen.FeatureOre;
public abstract class Dimension extends Nameable implements Comparable<Dimension> {
public class GeneratorSettings {
@ -290,7 +270,7 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
private int addRarity = 50; // b.layered
private int seaLevel = 0; // g.perlin, g.cavern, g.simple, g.destroyed, lake (r), r.biome, r.simple, r.alternate, ...
private Biome defaultBiome = Biome.none; // biomegen
private BaseBiome defaultBiome = BaseBiome.NONE; // biomegen
private State filler = Blocks.air.getState(); // caves+rav, liquid, ore, g.perlin, g.cavern, g.island,
// g.simple, g.flat (sealevel), r.biome, r.simple, r.alternate, r.toplayer
@ -303,15 +283,15 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
private State ceiling = null; // chunk
private State caveFiller = Blocks.air.getState(); // cavebase, ravine
private State[] layers = null; // g.flat
private Biome[] frostBiomes = null; // b.layered
private Biome[] coldBiomes = null; // b.layered
private Biome[] mediumBiomes = null; // b.layered
private Biome[] hotBiomes = null; // b.layered
private Biome[] addBiomes = null; // b.layered
private BaseBiome[] frostBiomes = null; // b.layered
private BaseBiome[] coldBiomes = null; // b.layered
private BaseBiome[] mediumBiomes = null; // b.layered
private BaseBiome[] hotBiomes = null; // b.layered
private BaseBiome[] addBiomes = null; // b.layered
private final List<FeatureOres> ores = Lists.newArrayList();
private final List<FeatureLakes> lakes = Lists.newArrayList();
private final List<FeatureLiquids> liquids = Lists.newArrayList();
private final List<FeatureOre> ores = Lists.newArrayList();
private final List<FeatureLake> lakes = Lists.newArrayList();
private final List<FeatureLiquid> liquids = Lists.newArrayList();
private long seed = 0L;
@ -482,15 +462,16 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
return this;
}
public final Dimension setBiomeGen(Biome mainBiome, boolean semiFixed, int biomeSize, int riverSize, int snowRarity, int seaRarity) {
public final Dimension setBiomeGen(BaseBiome mainBiome, boolean semiFixed, int biomeSize, int riverSize, int snowRarity, int seaRarity) {
return this.setBiomeGen(mainBiome, semiFixed, biomeSize, riverSize, snowRarity, seaRarity, 1);
}
public final Dimension setBiomeGen(Biome mainBiome, boolean semiFixed, int biomeSize, int riverSize, int snowRarity, int seaRarity,
int addRarity, Biome ... add) {
public final Dimension setBiomeGen(BaseBiome mainBiome, boolean semiFixed, int biomeSize, int riverSize, int snowRarity, int seaRarity,
int addRarity, BaseBiome ... add) {
this.defaultBiome = mainBiome;
this.top = mainBiome.fillerBlock;
this.surface = mainBiome.topBlock;
IBiome biome = IBiome.getBiome(mainBiome);
this.top = biome.getFiller();
this.surface = biome.getTop();
this.semiFixed = semiFixed;
this.biomeSize = biomeSize;
this.riverSize = riverSize;
@ -501,30 +482,31 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
return this;
}
public final Dimension setFrostBiomes(Biome ... biomes) {
public final Dimension setFrostBiomes(BaseBiome ... biomes) {
this.frostBiomes = biomes;
return this;
}
public final Dimension setColdBiomes(Biome ... biomes) {
public final Dimension setColdBiomes(BaseBiome ... biomes) {
this.coldBiomes = biomes;
return this;
}
public final Dimension setMediumBiomes(Biome ... biomes) {
public final Dimension setMediumBiomes(BaseBiome ... biomes) {
this.mediumBiomes = biomes;
return this;
}
public final Dimension setHotBiomes(Biome ... biomes) {
public final Dimension setHotBiomes(BaseBiome ... biomes) {
this.hotBiomes = biomes;
return this;
}
public final Dimension setBiome(Biome value) {
public final Dimension setBiome(BaseBiome value) {
this.defaultBiome = value;
this.top = value.fillerBlock;
this.surface = value.topBlock;
IBiome biome = IBiome.getBiome(value);
this.top = biome.getFiller();
this.surface = biome.getTop();
return this;
}
@ -613,24 +595,24 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
public final Dimension addLake(State state, State filler, State top, int chance, int minHeight, int maxHeight,
boolean ratiod) {
this.lakes.add(new FeatureLakes(state, filler, top, chance, minHeight, maxHeight, ratiod));
this.lakes.add(new FeatureLake(state, filler, top, chance, minHeight, maxHeight, ratiod));
return this;
}
public final Dimension addLiquid(State state, int chance, int minHeight, int maxHeight, boolean lower) {
this.liquids.add(new FeatureLiquids(state, chance, minHeight, maxHeight, lower));
this.liquids.add(new FeatureLiquid(state, chance, minHeight, maxHeight, lower));
return this;
}
public final Dimension addOre(State state, int count, int more, int size, int minHeight, int maxHeight, boolean distrib) {
this.ores.add(new FeatureOres(state, count, more, size, minHeight, maxHeight, distrib));
this.ores.add(new FeatureOre(state, count, more, size, minHeight, maxHeight, distrib));
return this;
}
public final Dimension addMetalOres(MetalType ... metals) {
for(MetalType metal : metals) {
int count = METAL_COUNTS[metal.rarity];
this.ores.add(new FeatureOres(BlockRegistry.getRegisteredBlock(metal.name + "_ore").getState(),
this.ores.add(new FeatureOre(BlockRegistry.getRegisteredBlock(metal.name + "_ore").getState(),
count < 0 ? 0 : count, count < 0 ? (-count) : 0, METAL_SIZES[metal.rarity], 0, METAL_HEIGHTS[metal.rarity], false));
}
return this;
@ -736,86 +718,6 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
}
public final BiomeGenerator createBiomeGenerator(Random rand) {
return this.biomeSize > 0 ? new BiomeGenLayered(rand.longv(), this.defaultBiome, this.semiFixed, this.biomeSize, this.riverSize,
this.snowRarity, this.seaRarity, this.addBiomes == null ? new Biome[0] : this.addBiomes, this.addRarity,
this.hotBiomes == null ? new Biome[] {this.defaultBiome} : this.hotBiomes,
this.mediumBiomes == null ? new Biome[] {this.defaultBiome} : this.mediumBiomes,
this.coldBiomes == null ? new Biome[] {this.defaultBiome} : this.coldBiomes,
this.frostBiomes == null ? new Biome[] {this.defaultBiome} : this.frostBiomes) : new BiomeGenSingle(this.defaultBiome);
}
public final ChunkGenerator createChunkGenerator(Random rand) {
switch(this.generatorType) {
case FLAT:
return this.layers == null ? new GeneratorFlat(this.seaLevel, this.filler) : new GeneratorFlat(this.layers);
case PERLIN:
default:
return new GeneratorPerlin(rand, this.filler, this.liquid, this.noiseGen);
case SIMPLE:
return new GeneratorSimple(rand, this.filler, this.liquid,
this.biomeSize > 0 ? null : new BiomeGenPerlin(rand.longv()));
case ISLAND:
return new GeneratorIsland(rand, this.filler);
case CAVERN:
return new GeneratorCavern(rand, this.filler, this.liquid);
case DESTROYED:
return new GeneratorDestroyed(this.seaLevel);
}
}
public final BlockReplacer createBlockReplacer(Random rand) {
switch(this.replacerType) {
case BIOMES:
default:
return new ReplacerBiome(rand);
case SIMPLE:
return new ReplacerAltBiome(rand, this.filler, this.liquid, this.alt2, this.alt1);
case ALTERNATE:
return new ReplacerAltSurface(rand, this.filler, this.alt1, this.alt2, this.liquid);
case TOPLAYER:
return new ReplacerTopLayer(this.surface, this.filler.getBlock());
case NONE:
return null;
}
}
public final FeatureDungeons createDungeonGenerator() {
return this.dungeons > 0 ? new FeatureDungeons(this.dungeons) : null;
}
public final MapGenCaves createCaveGenerator() {
return this.caves ?
(new MapGenCaves(this.caveFiller, this.filler.getBlock(), this.top.getBlock(),
this.surface.getBlock(), this.alt1.getBlock())) : null;
}
public final MapGenRavine createRavineGenerator() {
return this.ravines ?
(new MapGenRavine(this.caveFiller, this.filler.getBlock(),
this.top.getBlock(), this.surface.getBlock())) : null;
}
public final MapGenBigCaves createBigCaveGenerator() {
return this.strideCaves ?
(new MapGenBigCaves(this.filler.getBlock(),
this.top.getBlock(), this.surface.getBlock())) : null;
}
public final FeatureOres[] getOres() {
return this.ores.isEmpty() ? null : this.ores.toArray(new FeatureOres[this.ores.size()]);
}
public final FeatureLakes[] getLakes() {
return this.lakes.isEmpty() ? null : this.lakes.toArray(new FeatureLakes[this.lakes.size()]);
}
public final FeatureLiquids[] getLiquids() {
return this.liquids.isEmpty() ? null : this.liquids.toArray(new FeatureLiquids[this.liquids.size()]);
}
public final long getSeed() {
return this.seed;
}
@ -1108,8 +1010,7 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
this.addRarity = tag.getInteger("AddRarity");
// this.biomeRarity = tag.getInteger("BiomeRarity");
this.seaLevel = tag.getInteger("SeaLevel");
this.defaultBiome = Biome.findByName(tag.getString("DefaultBiome"));
this.defaultBiome = this.defaultBiome == null ? Biome.DEF_BIOME : this.defaultBiome;
this.defaultBiome = BaseBiome.findByName(tag.getString("DefaultBiome"));
this.semiFixed = tag.getBoolean("SemiFixed");
this.defaultWeather = Weather.getByName(tag.getString("DefaultWeather"));
this.defaultWeather = this.defaultWeather == null ? Weather.CLEAR : this.defaultWeather;
@ -1142,10 +1043,9 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
this.addBiomes = null;
}
else {
this.addBiomes = new Biome[list.tagCount()];
this.addBiomes = new BaseBiome[list.tagCount()];
for(int z = 0; z < this.addBiomes.length; z++) {
this.addBiomes[z] = Biome.findByName(list.getStringTagAt(z));
this.addBiomes[z] = this.addBiomes[z] == null ? Biome.DEF_BIOME : this.addBiomes[z];
this.addBiomes[z] = BaseBiome.findByName(list.getStringTagAt(z));
}
}
}
@ -1158,10 +1058,9 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
this.frostBiomes = null;
}
else {
this.frostBiomes = new Biome[list.tagCount()];
this.frostBiomes = new BaseBiome[list.tagCount()];
for(int z = 0; z < this.frostBiomes.length; z++) {
this.frostBiomes[z] = Biome.findByName(list.getStringTagAt(z));
this.frostBiomes[z] = this.frostBiomes[z] == null ? Biome.DEF_BIOME : this.frostBiomes[z];
this.frostBiomes[z] = BaseBiome.findByName(list.getStringTagAt(z));
}
}
}
@ -1174,10 +1073,9 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
this.coldBiomes = null;
}
else {
this.coldBiomes = new Biome[list.tagCount()];
this.coldBiomes = new BaseBiome[list.tagCount()];
for(int z = 0; z < this.coldBiomes.length; z++) {
this.coldBiomes[z] = Biome.findByName(list.getStringTagAt(z));
this.coldBiomes[z] = this.coldBiomes[z] == null ? Biome.DEF_BIOME : this.coldBiomes[z];
this.coldBiomes[z] = BaseBiome.findByName(list.getStringTagAt(z));
}
}
}
@ -1190,10 +1088,9 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
this.mediumBiomes = null;
}
else {
this.mediumBiomes = new Biome[list.tagCount()];
this.mediumBiomes = new BaseBiome[list.tagCount()];
for(int z = 0; z < this.mediumBiomes.length; z++) {
this.mediumBiomes[z] = Biome.findByName(list.getStringTagAt(z));
this.mediumBiomes[z] = this.mediumBiomes[z] == null ? Biome.DEF_BIOME : this.mediumBiomes[z];
this.mediumBiomes[z] = BaseBiome.findByName(list.getStringTagAt(z));
}
}
}
@ -1206,10 +1103,9 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
this.hotBiomes = null;
}
else {
this.hotBiomes = new Biome[list.tagCount()];
this.hotBiomes = new BaseBiome[list.tagCount()];
for(int z = 0; z < this.hotBiomes.length; z++) {
this.hotBiomes[z] = Biome.findByName(list.getStringTagAt(z));
this.hotBiomes[z] = this.hotBiomes[z] == null ? Biome.DEF_BIOME : this.hotBiomes[z];
this.hotBiomes[z] = BaseBiome.findByName(list.getStringTagAt(z));
}
}
}
@ -1221,7 +1117,7 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
NBTTagList list = tag.getTagList("Ores", 10);
for(int z = 0; z < list.tagCount(); z++) {
NBTTagCompound gen = list.getCompoundTagAt(z);
this.ores.add(new FeatureOres(BlockRegistry.getFromIdName(gen.getString("Block"), Blocks.iron_ore.getState()),
this.ores.add(new FeatureOre(BlockRegistry.getFromIdName(gen.getString("Block"), Blocks.iron_ore.getState()),
gen.getInteger("Count"), gen.getInteger("Add"), gen.getInteger("Size"),
gen.getInteger("MinC"), gen.getInteger("MaxS"), gen.getBoolean("Distrib")));
}
@ -1231,7 +1127,7 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
NBTTagList list = tag.getTagList("Lakes", 10);
for(int z = 0; z < list.tagCount(); z++) {
NBTTagCompound gen = list.getCompoundTagAt(z);
this.lakes.add(new FeatureLakes(
this.lakes.add(new FeatureLake(
BlockRegistry.getFromIdName(gen.getString("Block"), Blocks.iron_ore.getState()),
gen.hasKey("Filler", 8) ? BlockRegistry.getFromIdName(gen.getString("Filler"), null) : null,
gen.hasKey("Top", 8) ? BlockRegistry.getFromIdName(gen.getString("Top"), null) : null,
@ -1243,7 +1139,7 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
NBTTagList list = tag.getTagList("Liquids", 10);
for(int z = 0; z < list.tagCount(); z++) {
NBTTagCompound gen = list.getCompoundTagAt(z);
this.liquids.add(new FeatureLiquids(
this.liquids.add(new FeatureLiquid(
BlockRegistry.getFromIdName(gen.getString("Block"), Blocks.iron_ore.getState()),
gen.getInteger("Chance"), gen.getInteger("Min"), gen.getInteger("Max"), gen.getBoolean("Lower")));
}
@ -1376,47 +1272,47 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
}
if(this.addBiomes != null) {
NBTTagList list = new NBTTagList();
for(Biome biome : this.addBiomes) {
for(BaseBiome biome : this.addBiomes) {
list.appendTag(new NBTTagString(biome.name.toLowerCase()));
}
tag.setTag("AddBiomes", list);
}
if(this.frostBiomes != null) {
NBTTagList list = new NBTTagList();
for(Biome biome : this.frostBiomes) {
for(BaseBiome biome : this.frostBiomes) {
list.appendTag(new NBTTagString(biome.name.toLowerCase()));
}
tag.setTag("FrostBiomes", list);
}
if(this.coldBiomes != null) {
NBTTagList list = new NBTTagList();
for(Biome biome : this.coldBiomes) {
for(BaseBiome biome : this.coldBiomes) {
list.appendTag(new NBTTagString(biome.name.toLowerCase()));
}
tag.setTag("ColdBiomes", list);
}
if(this.mediumBiomes != null) {
NBTTagList list = new NBTTagList();
for(Biome biome : this.mediumBiomes) {
for(BaseBiome biome : this.mediumBiomes) {
list.appendTag(new NBTTagString(biome.name.toLowerCase()));
}
tag.setTag("MediumBiomes", list);
}
if(this.hotBiomes != null) {
NBTTagList list = new NBTTagList();
for(Biome biome : this.hotBiomes) {
for(BaseBiome biome : this.hotBiomes) {
list.appendTag(new NBTTagString(biome.name.toLowerCase()));
}
tag.setTag("HotBiomes", list);
}
if(!this.ores.isEmpty()) {
NBTTagList list = new NBTTagList();
for(FeatureOres gen : this.ores) {
for(FeatureOre gen : this.ores) {
NBTTagCompound ore = new NBTTagCompound();
ore.setString("Block", BlockRegistry.toIdName(gen.oreBlock));
ore.setBoolean("Distrib", gen.distributed);
ore.setInteger("Size", gen.numberOfBlocks);
ore.setInteger("Count", gen.spawns);
ore.setString("Block", BlockRegistry.toIdName(gen.state));
ore.setBoolean("Distrib", gen.dist);
ore.setInteger("Size", gen.size);
ore.setInteger("Count", gen.count);
ore.setInteger("Add", gen.more);
ore.setInteger("MinC", gen.min);
ore.setInteger("MaxS", gen.max);
@ -1426,7 +1322,7 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
}
if(!this.lakes.isEmpty()) {
NBTTagList list = new NBTTagList();
for(FeatureLakes gen : this.lakes) {
for(FeatureLake gen : this.lakes) {
NBTTagCompound lake = new NBTTagCompound();
lake.setString("Block", BlockRegistry.toIdName(gen.state));
if(gen.filler != null)
@ -1443,7 +1339,7 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
}
if(!this.liquids.isEmpty()) {
NBTTagList list = new NBTTagList();
for(FeatureLiquids gen : this.liquids) {
for(FeatureLiquid gen : this.liquids) {
NBTTagCompound liquid = new NBTTagCompound();
liquid.setString("Block", BlockRegistry.toIdName(gen.state));
liquid.setBoolean("Lower", gen.lower);
@ -1529,4 +1425,112 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
protected String getIdentifier() {
return this.name;
}
public int getBiomeSize() {
return this.biomeSize;
}
public BaseBiome getDefaultBiome() {
return this.defaultBiome;
}
public boolean isSemiFixed() {
return this.semiFixed;
}
public int getRiverSize() {
return this.riverSize;
}
public int getSnowRarity() {
return this.snowRarity;
}
public int getSeaRarity() {
return this.seaRarity;
}
public BaseBiome[] getAddBiomes() {
return this.addBiomes;
}
public int getAddRarity() {
return this.addRarity;
}
public BaseBiome[] getHotBiomes() {
return this.hotBiomes;
}
public BaseBiome[] getMediumBiomes() {
return this.mediumBiomes;
}
public BaseBiome[] getColdBiomes() {
return this.coldBiomes;
}
public BaseBiome[] getFrostBiomes() {
return this.frostBiomes;
}
public GeneratorType getGeneratorType() {
return this.generatorType;
}
public State[] getLayers() {
return this.layers;
}
public GeneratorSettings getNoiseGen() {
return this.noiseGen;
}
public ReplacerType getReplacerType() {
return this.replacerType;
}
public State getAlt1() {
return this.alt1;
}
public State getAlt2() {
return this.alt2;
}
public State getSurface() {
return this.surface;
}
public int getDungeons() {
return this.dungeons;
}
public boolean hasCaves() {
return this.caves;
}
public State getCaveFiller() {
return this.caveFiller;
}
public boolean hasRavines() {
return this.ravines;
}
public boolean hasStrideCaves() {
return this.strideCaves;
}
public List<FeatureOre> getOres() {
return this.ores;
}
public List<FeatureLake> getLakes() {
return this.lakes;
}
public List<FeatureLiquid> getLiquids() {
return this.liquids;
}
}

View file

@ -1,6 +1,6 @@
package common.dimension;
import common.biome.Biome;
import common.biome.BaseBiome;
public final class Space extends Dimension {
public static final Space INSTANCE = new Space();
@ -8,7 +8,7 @@ public final class Space extends Dimension {
private Space() {
super(0, "space");
this.setPhysics(1L, 1L, 0.0f, 0.0f, 2.7f, 15).setTimeQualifier(8);
this.setBiome(Biome.space).setStarBrightness(1.0f).setDeepStarBrightness(1.0f);
this.setBiome(BaseBiome.SPACE).setStarBrightness(1.0f).setDeepStarBrightness(1.0f);
this.setCustomName("Der Weltraum");
}

View file

@ -12,7 +12,7 @@ import common.ai.EntityAITempt;
import common.ai.EntityAIWander;
import common.ai.EntityAIWatchClosest;
import common.attributes.Attributes;
import common.biome.Biome;
import common.biome.BaseBiome;
import common.collect.Maps;
import common.color.DyeColor;
import common.entity.item.EntityItem;
@ -303,9 +303,9 @@ public class EntitySheep extends EntityAnimal
DyeColor.MAGENTA, DyeColor.ORANGE, DyeColor.PINK, DyeColor.PURPLE, DyeColor.RED
};
public static DyeColor getRandomSheepColor(Random random, Biome biome)
public static DyeColor getRandomSheepColor(Random random, BaseBiome biome)
{
if(biome == Biome.snowLand)
if(biome == BaseBiome.SNOWLAND)
return DyeColor.WHITE;
int i = random.zrange(140);
return i < 20 ? DyeColor.BLACK :

View file

@ -3,7 +3,7 @@ package common.entity.npc;
import common.ai.EntityAIBase;
import common.ai.EntityMoveHelper;
import common.attributes.Attributes;
import common.biome.Biome;
import common.biome.BaseBiome;
import common.entity.DamageSource;
import common.entity.Entity;
import common.entity.types.EntityLiving;
@ -396,9 +396,9 @@ public class EntitySlime extends EntityNPC
// {
// if (this.worldObj.getDifficulty() != Difficulty.PEACEFUL)
// {
Biome biomegenbase = this.worldObj.getBiomeGenForCoords(blockpos);
BaseBiome biomegenbase = this.worldObj.getBiomeGenForCoords(blockpos);
if (biomegenbase == Biome.swampland && this.posY > 50.0D && this.posY < 70.0D && this.rand.floatv() < 0.5F && this.rand.floatv() < this.worldObj.getCurrentMoonPhaseFactor() && this.worldObj.getLightFromNeighbors(new BlockPos(this)) <= this.rand.zrange(8))
if (biomegenbase == BaseBiome.SWAMPLAND && this.posY > 50.0D && this.posY < 70.0D && this.rand.floatv() < 0.5F && this.rand.floatv() < this.worldObj.getCurrentMoonPhaseFactor() && this.worldObj.getLightFromNeighbors(new BlockPos(this)) <= this.rand.zrange(8))
{
return super.getCanSpawnHere();
}

View file

@ -26,7 +26,6 @@ import common.util.HitPosition;
import common.util.Vec3;
import common.world.World;
import common.world.AWorldServer;
import common.worldgen.LootConstants;
public class EntityHook extends Entity implements IObjectData
{
@ -614,7 +613,7 @@ public class EntityHook extends Entity implements IObjectData
if (f < f1)
{
// this.angler.triggerAchievement(StatRegistry.junkFishedStat);
return ((RngFishable)LootConstants.FISHING_JUNK.pick(this.rand)).getItemStack(this.rand);
return ((RngFishable)FishConstants.FISHING_JUNK.pick(this.rand)).getItemStack(this.rand);
}
else
{
@ -623,13 +622,13 @@ public class EntityHook extends Entity implements IObjectData
if (f < f2)
{
// this.angler.triggerAchievement(StatRegistry.treasureFishedStat);
return ((RngFishable)LootConstants.FISHING_TREASURE.pick(this.rand)).getItemStack(this.rand);
return ((RngFishable)FishConstants.FISHING_TREASURE.pick(this.rand)).getItemStack(this.rand);
}
else
{
float f3 = f - f2;
// this.angler.triggerAchievement(StatRegistry.fishCaughtStat);
return ((RngFishable)LootConstants.FISH_TYPES.pick(this.rand)).getItemStack(this.rand);
return ((RngFishable)FishConstants.FISH_TYPES.pick(this.rand)).getItemStack(this.rand);
}
}
}

View file

@ -0,0 +1,29 @@
package common.entity.projectile;
import common.color.DyeColor;
import common.init.Blocks;
import common.init.Items;
import common.item.ItemFishFood;
import common.item.ItemStack;
import common.rng.WeightedList;
public abstract class FishConstants {
public static final WeightedList<RngFishable> FISHING_JUNK = new WeightedList<RngFishable>(
(new RngFishable(new ItemStack(Items.leather_boots), 10)).setMaxDamagePercent(0.9F), new RngFishable(new ItemStack(Items.leather), 10),
new RngFishable(new ItemStack(Items.bone), 10), new RngFishable(new ItemStack(Items.potion), 10),
new RngFishable(new ItemStack(Items.string), 5), (new RngFishable(new ItemStack(Items.fishing_rod), 2)).setMaxDamagePercent(0.9F),
new RngFishable(new ItemStack(Items.bowl), 10), new RngFishable(new ItemStack(Items.stick), 5),
new RngFishable(new ItemStack(Items.dye, 10, DyeColor.BLACK.getDyeDamage()), 1),
new RngFishable(new ItemStack(Blocks.tripwire_hook), 10), new RngFishable(new ItemStack(Items.rotten_flesh), 10));
public static final WeightedList<RngFishable> FISHING_TREASURE = new WeightedList<RngFishable>(
new RngFishable(new ItemStack(Blocks.waterlily), 1), new RngFishable(new ItemStack(Items.name_tag), 1),
new RngFishable(new ItemStack(Items.saddle), 1),
(new RngFishable(new ItemStack(Items.bow), 1)).setMaxDamagePercent(0.25F).setEnchantable(),
(new RngFishable(new ItemStack(Items.fishing_rod), 1)).setMaxDamagePercent(0.25F).setEnchantable(),
(new RngFishable(new ItemStack(Items.book), 1)).setEnchantable());
public static final WeightedList<RngFishable> FISH_TYPES = new WeightedList<RngFishable>(
new RngFishable(new ItemStack(Items.fish, 1, ItemFishFood.FishType.COD.getMetadata()), 60),
new RngFishable(new ItemStack(Items.fish, 1, ItemFishFood.FishType.SALMON.getMetadata()), 25),
new RngFishable(new ItemStack(Items.fish, 1, ItemFishFood.FishType.CLOWNFISH.getMetadata()), 2),
new RngFishable(new ItemStack(Items.fish, 1, ItemFishFood.FishType.PUFFERFISH.getMetadata()), 13));
}

View file

@ -31,7 +31,6 @@ public abstract class Registry {
SmeltingRegistry.register();
EntityRegistry.register();
DispenserRegistry.register();
UniverseRegistry.register();
}
public static void setup(String thread) {

View file

@ -4,7 +4,7 @@ import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import common.biome.Biome;
import common.biome.BaseBiome;
import common.block.BlockColored;
import common.block.BlockSand;
import common.block.LeavesType;
@ -518,7 +518,7 @@ public abstract class UniverseRegistry {
PORTALS.put(portal.ordinal() | 0x7ff00000, BASE_ALIASES.get(dest).getDimensionId());
}
static void register() {
public static void register() {
registerGalaxy("Milchstraße", "milkyway");
registerSector("Solar", "solar", "milkyway");
registerDimension("Sol", new Star(2, "sol", 0xff7f00, 274.0f, 5778.0f, Blocks.lava.getState(), 128).setTimeQualifier(1), "solar");
@ -526,12 +526,12 @@ public abstract class UniverseRegistry {
259.15f).setTimeQualifier(0)
.setPerlinGen(Blocks.stone.getState(), Blocks.water.getState(), 63)
.setBiomeReplacer(Blocks.gravel.getState())
.setBiomeGen(Biome.forest, false, 4, 4, 6, 50, 50, Biome.mushroomPlains).enableMobs().enableSnow()
.setFrostBiomes(Biome.icePlains, Biome.icePlains, Biome.icePlains, Biome.coldTaiga, Biome.megaTaiga)
.setColdBiomes(Biome.forest, Biome.extremeHills, Biome.taiga, Biome.plains, Biome.blackened)
.setMediumBiomes(Biome.forest, Biome.roofedForest, Biome.extremeHills, Biome.plains, Biome.birchForest,
Biome.swampland, Biome.jungle, Biome.blackened)
.setHotBiomes(Biome.desert, Biome.desert, Biome.desert, Biome.savanna, Biome.savanna, Biome.plains)
.setBiomeGen(BaseBiome.FOREST, false, 4, 4, 6, 50, 50, BaseBiome.MUSHROOMPLAINS).enableMobs().enableSnow()
.setFrostBiomes(BaseBiome.ICEPLAINS, BaseBiome.ICEPLAINS, BaseBiome.ICEPLAINS, BaseBiome.COLDTAIGA, BaseBiome.MEGATAIGA)
.setColdBiomes(BaseBiome.FOREST, BaseBiome.EXTREMEHILLS, BaseBiome.TAIGA, BaseBiome.PLAINS, BaseBiome.BLACKENED)
.setMediumBiomes(BaseBiome.FOREST, BaseBiome.ROOFEDFOREST, BaseBiome.EXTREMEHILLS, BaseBiome.PLAINS, BaseBiome.BIRCHFOREST,
BaseBiome.SWAMPLAND, BaseBiome.JUNGLE, BaseBiome.BLACKENED)
.setHotBiomes(BaseBiome.DESERT, BaseBiome.DESERT, BaseBiome.DESERT, BaseBiome.SAVANNA, BaseBiome.SAVANNA, BaseBiome.PLAINS)
.enableCavesRavines(Blocks.lava.getState()).setDungeons(8).setWorldFloor(Blocks.bedrock.getState())
.addLake(Blocks.water.getState(), null, Blocks.grass.getState(), 4, 0, 255, false)
.addLake(Blocks.lava.getState(), Blocks.stone.getState(), null, 8, 8, 255, true)
@ -549,7 +549,7 @@ public abstract class UniverseRegistry {
.addOre(Blocks.cinnabar_ore.getState(), 1, 0, 11, 0, 24, false)
.enableVillages().enableMineshafts().enableScattered().enableStrongholds(), "sol");
registerDimension("Luna", new Moon(3, "luna", 0x333333, 0x333333, 655728L, 655728L, 1.62f, 210.0f, 8)
.setPerlinGen(Blocks.moon_rock.getState(), Blocks.air.getState(), 63).setBiome(Biome.moon)
.setPerlinGen(Blocks.moon_rock.getState(), Blocks.air.getState(), 63).setBiome(BaseBiome.MOON)
.setTimeQualifier(1), "terra");
registerDimension("Merkur", new Planet(4, "mercury", 0x666666, 0x535353, 0x858585, 2111297L, 1407509L, 3.7f, 440.0f)
@ -592,7 +592,7 @@ public abstract class UniverseRegistry {
registerDimension("Gi'rok", new Star(100, "girok", 0xff8f00, 232.0f, 5220.0f, Blocks.lava.getState(), 112).setTimeQualifier(2), "solar");
registerDimension("'Elbenplanet Gharoth'", new Planet(101, "gharoth", 0xffffffff, 0xc0d8ff, 0xffffff, 4837386L, 52960L, 30.0f, 10.0f, 257.3f)
.setTimeQualifier(2).setSimpleGen(Blocks.dirt.getState(), Blocks.water.getState(), 64)
.setSimpleReplacer(Blocks.gravel.getState(), Blocks.sand.getState()).setBiome(Biome.elvenForest)
.setSimpleReplacer(Blocks.gravel.getState(), Blocks.sand.getState()).setBiome(BaseBiome.ELVENFOREST)
.enableCaves(Blocks.air.getState()).setDungeons(4).enableMobs().enableSnow()
.setWorldFloor(Blocks.bedrock.getState())
.addLake(Blocks.water.getState(), null, Blocks.grass.getState(), 4, 0, 255, false)
@ -603,7 +603,7 @@ public abstract class UniverseRegistry {
.addOre(Blocks.gyriyn_ore.getState(), 0, 2, 3, 0, 12, false), "girok");
registerDimension("'Vampirplanet Transsylvanien'", new Planet(102, "transylvania", 0xffffffff, 0xc0d8ff, 0xffffff, 33850466L, 49760L, 20.0f, 10.0f, 255.5f)
.setTimeQualifier(5).setPerlinGen(Blocks.rock.getState(), Blocks.water.getState(), 63)
.setBiomeReplacer(Blocks.gravel.getState()).setBiomeGen(Biome.forest, true, 5, 3, 3, 30)
.setBiomeReplacer(Blocks.gravel.getState()).setBiomeGen(BaseBiome.FOREST, true, 5, 3, 3, 30)
.enableCavesRavines(Blocks.lava.getState()).setDungeons(10).enableMobs().enableSnow()
.setWorldFloor(Blocks.bedrock.getState())
.addLake(Blocks.water.getState(), null, Blocks.grass.getState(), 4, 0, 255, false)
@ -615,12 +615,12 @@ public abstract class UniverseRegistry {
.addOre(Blocks.ardite_ore.getState(), 0, 2, 3, 0, 12, false)
.addOre(Blocks.nichun_ore.getState(), 0, 10, 1, 0, 10, false), "girok");
registerDimension("'Eismond Yrdinath'", new Moon(103, "yrdinath", 0xccccff, 0xccccff, 46743637L, 17460L, 2.5f, 239.15f, 8).setTimeQualifier(4)
.setPerlinGen(Blocks.snow.getState(), Blocks.ice.getState(), 63).setBiome(Biome.snowLand)
.setPerlinGen(Blocks.snow.getState(), Blocks.ice.getState(), 63).setBiome(BaseBiome.SNOWLAND)
.setWorldFloor(Blocks.air.getState()).enableMobs().enableSnow().setWeather(Weather.SNOW), "transylvania");
registerDimension("'Wüstenplanet Me'sar'", new Planet(104, "mesar", 0xff7f3f, 0xff6022, 0xff6f00, 56643366L, 87340L, 11.0f, 333.15f)
.setTimeQualifier(5).setPerlinGen(Blocks.rock.getState(), Blocks.air.getState(), 63)
.setBiomeReplacer(Blocks.sand.getState().withProperty(BlockSand.VARIANT, BlockSand.EnumType.RED_SAND))
.setBiomeGen(Biome.mesa, true, 3, 1000, 100000, 100000)
.setBiomeGen(BaseBiome.MESA, true, 3, 1000, 100000, 100000)
.enableCavesRavines(Blocks.lava.getState()).enableMobs()
.setWorldFloor(Blocks.bedrock.getState())
.addLake(Blocks.lava.getState(), null, null, 8, 8, 255, true)
@ -637,7 +637,7 @@ public abstract class UniverseRegistry {
registerDimension("Ov'rol", new Star(120, "ovrol", 0x000000, 302.0f, 12666.0f, Blocks.goo.getState(), 192), "blvck");
registerDimension("'Schwarzplanet'", new Planet(121, "blackplanet", 0x000000, 0x000000, 0x000000, 4632918508L, 204556L, 12.0f, 0.0f)
.setPerlinGen(Blocks.blackened_stone.getState(), Blocks.goo.getState(), 63)
.setBiomeReplacer(Blocks.blackened_cobble.getState()).setBiome(Biome.blackened)
.setBiomeReplacer(Blocks.blackened_cobble.getState()).setBiome(BaseBiome.BLACKENED)
.enableCaves(Blocks.air.getState()).setDungeons(4).enableMobs()
.setWorldFloor(Blocks.bedrock.getState())
.addLake(Blocks.goo.getState(), null, null, 8, 8, 255, true)
@ -646,7 +646,7 @@ public abstract class UniverseRegistry {
registerDimension("Der Warp", new Semi(-1, "warp", 0x0c001f, 0x0c001f, 0x190033, 285.0f, 3).setCloudTexture("clouds_dense").setCloudHeight(238.0f)
.setPerlinGen(Blocks.obsidian.getState(), Blocks.lava.getState(), 63)
.setBiome(Biome.chaos).enableCavesRavines(Blocks.air.getState()).enableLongCaves().enableMobs().enableSnow()
.setBiome(BaseBiome.CHAOS).enableCavesRavines(Blocks.air.getState()).enableLongCaves().enableMobs().enableSnow()
.addLake(Blocks.water.getState(), null, Blocks.obsidian.getState(), 8, 0, 255, false)
.addLake(Blocks.lava.getState(), null, null, 1, 8, 255, false)
.addLiquid(Blocks.flowing_water.getState(), 1, 8, 255, false)
@ -656,7 +656,7 @@ public abstract class UniverseRegistry {
registerDomain("Tian'Xin", "tianxin");
registerDimension("Ni'enrath", new Area(-2, "nienrath", 0x7f00ff, 0x7f00ff, 276.15f, 1)
.setPerlinGen(Blocks.tian.getState(), Blocks.water.getState(), 63).setBiome(Biome.tian)
.setPerlinGen(Blocks.tian.getState(), Blocks.water.getState(), 63).setBiome(BaseBiome.TIAN)
.setBiomeReplacer(Blocks.tian.getState()).enableLongCaves().enableMobs().enableSnow()
.addLake(Blocks.water.getState(), Blocks.tian.getState(), Blocks.tian.getState(), 4, 0, 255, false)
.addLiquid(Blocks.flowing_water.getState(), 50, 8, 255, false), "tianxin");
@ -670,32 +670,32 @@ public abstract class UniverseRegistry {
.setWorldFloor(Blocks.air.getState()).setWorldCeiling(Blocks.bedrock.getState()).enableDenseFog()
.setCavernGen(Blocks.hellrock.getState(), Blocks.lava.getState(), 63)
.setSurfaceReplacer(Blocks.gravel.getState(), Blocks.soul_sand.getState())
.setBiome(Biome.upperHell), "hell");
.setBiome(BaseBiome.UPPERHELL), "hell");
registerDimension("Kreis Kyroth", new Area(-1002, "kyroth", 0x990000, 0x990000, 387.15f, 3).enableLongCaves().enableMobs()
.setWorldFloor(Blocks.air.getState())
.setSimpleGen(Blocks.hellrock.getState(), Blocks.lava.getState(), 64)
.setSimpleReplacer(Blocks.obsidian.getState(), Blocks.soul_sand.getState())
.setBiome(Biome.lowerHell)
.setBiome(BaseBiome.LOWERHELL)
.addLake(Blocks.lava.getState(), null, null, 4, 8, 255, false)
.addLiquid(Blocks.flowing_lava.getState(), 40, 8, 255, true), "hell");
registerDimension("Kreis Ahrd", new Area(-1003, "ahrd", 0xcc0000, 0xcc0000, 467.15f, 15).enableLongCaves().enableMobs()
.setWorldFloor(Blocks.air.getState())
.setPerlinGen(Blocks.hellrock.getState(), Blocks.lava.getState(), 63)
.setBiomeReplacer(Blocks.soul_sand.getState()).setBiome(Biome.hellHills)
.setBiomeReplacer(Blocks.soul_sand.getState()).setBiome(BaseBiome.HELLHILLS)
.addLake(Blocks.lava.getState(), Blocks.soul_sand.getState(), Blocks.soul_sand.getState(),
2, 8, 255, false).addLiquid(Blocks.flowing_lava.getState(), 80, 8, 255, true), "hell");
registerDimension("Kreis Mizorath", new Area(-1004, "mizorath", 0xff0000, 0xff0000, 1067.15f, 15).enableMobs()
.setWorldFloor(Blocks.air.getState())
.setPerlinGen(Blocks.hellrock.getState(), Blocks.blood.getState(), 63)
.setBiomeReplacer(Blocks.soul_sand.getState()).setBiome(Biome.soulPlains), "hell");
.setBiomeReplacer(Blocks.soul_sand.getState()).setBiome(BaseBiome.SOULPLAINS), "hell");
registerDimension("Kreis Dargoth", new Area(-1005, "dargoth", 0xff3f0c, 0xff3f0c, 1707.15f, 15).enableMobs()
.setWorldFloor(Blocks.air.getState())
.setPerlinGen(Blocks.hellrock.getState(), Blocks.magma.getState(), 63)
.setBiomeReplacer(Blocks.soul_sand.getState()).setBiome(Biome.soulPlains), "hell");
.setBiomeReplacer(Blocks.soul_sand.getState()).setBiome(BaseBiome.SOULPLAINS), "hell");
registerDimension("Kreis Aasirith", new Area(-1006, "aasirith", 0x191919, 0x191919, 2482.0f, 1).enableLongCaves().enableMobs()
.setWorldFloor(Blocks.air.getState())
.setPerlinGen(Blocks.rock.getState(), Blocks.magma.getState(), 63)
.setBiomeReplacer(Blocks.ash.getState()).setBiome(Biome.ashLand)
.setBiomeReplacer(Blocks.ash.getState()).setBiome(BaseBiome.ASHLAND)
.addLake(Blocks.lava.getState(), Blocks.rock.getState(), Blocks.rock.getState(),
2, 8, 255, false).addLiquid(Blocks.flowing_lava.getState(), 80, 8, 255, true), "hell");
@ -749,7 +749,7 @@ public abstract class UniverseRegistry {
dtag.setInteger("SeaRarity", 50);
dtag.setInteger("AddRarity", 50);
dtag.setInteger("SeaLevel", 0);
dtag.setString("DefaultBiome", Biome.none.name.toLowerCase());
dtag.setString("DefaultBiome", BaseBiome.NONE.name.toLowerCase());
dtag.setBoolean("SemiFixed", false);
// dtag.setString("DefaultWeather", Weather.CLEAR.getName());
dtag.setString("DefaultLeaves", LeavesType.SPRING.getName());
@ -768,11 +768,11 @@ public abstract class UniverseRegistry {
return dim;
}
private static Dimension addFlatPreset(String name, Biome biome, boolean populate, State main, Object ... layers) {
private static Dimension addFlatPreset(String name, BaseBiome biome, boolean populate, State main, Object ... layers) {
return addFlatPreset(name, "terra", biome, populate, main, layers);
}
private static Dimension addFlatPreset(String name, String base, Biome biome, boolean populate, State main, Object ... layers) {
private static Dimension addFlatPreset(String name, String base, BaseBiome biome, boolean populate, State main, Object ... layers) {
Dimension dim = addPreset("Flach - " + name, base, "ClearGenerator:1b" + (populate ? "" : ",NoPopulation:1b"));
dim.setBiome(biome);
if(main != null)
@ -795,33 +795,33 @@ public abstract class UniverseRegistry {
addPreset("Chaotische Höhlen", "UpperLmtScale:2.0,LowerLmtScale:64.0,SeaLevel:6");
addPreset("Viel Glück", "LiquidBlock:lava,SeaLevel:40");
addFlatPreset("Klassisch", Biome.plains, false, Blocks.dirt.getState(), Blocks.bedrock.getState(), 2, Blocks.dirt.getState(),
addFlatPreset("Klassisch", BaseBiome.PLAINS, false, Blocks.dirt.getState(), Blocks.bedrock.getState(), 2, Blocks.dirt.getState(),
Blocks.grass.getState()).enableVillages();
addFlatPreset("Abbauwelt", Biome.extremeHills, true, Blocks.stone.getState(), Blocks.bedrock.getState(), 230, Blocks.stone.getState(),
addFlatPreset("Abbauwelt", BaseBiome.EXTREMEHILLS, true, Blocks.stone.getState(), Blocks.bedrock.getState(), 230, Blocks.stone.getState(),
5, Blocks.dirt.getState(), Blocks.grass.getState()).enableStrongholds().enableMineshafts().setDungeons(8);
addFlatPreset("Wasserwelt", Biome.sea, false, Blocks.stone.getState(), Blocks.bedrock.getState(), 5, Blocks.stone.getState(),
addFlatPreset("Wasserwelt", BaseBiome.SEA, false, Blocks.stone.getState(), Blocks.bedrock.getState(), 5, Blocks.stone.getState(),
52, Blocks.dirt.getState(), 5, Blocks.sand.getState(), 90, Blocks.water.getState());
addFlatPreset("Oberfläche", Biome.plains, true, Blocks.stone.getState(), Blocks.bedrock.getState(), 59, Blocks.stone.getState(),
addFlatPreset("Oberfläche", BaseBiome.PLAINS, true, Blocks.stone.getState(), Blocks.bedrock.getState(), 59, Blocks.stone.getState(),
3, Blocks.dirt.getState(), Blocks.grass.getState()).setBiomeReplacer(Blocks.gravel.getState()).enableVillages().enableStrongholds().enableMineshafts().setDungeons(8)
.addLake(Blocks.water.getState(), null, Blocks.grass.getState(), 4, 0, 255, false).addLake(Blocks.lava.getState(), Blocks.stone.getState(), null, 8, 8, 255, true);
addFlatPreset("Verschneites Königreich", Biome.icePlains, false, Blocks.stone.getState(), Blocks.bedrock.getState(), 59, Blocks.stone.getState(),
addFlatPreset("Verschneites Königreich", BaseBiome.ICEPLAINS, false, Blocks.stone.getState(), Blocks.bedrock.getState(), 59, Blocks.stone.getState(),
3, Blocks.dirt.getState(), Blocks.grass.getState(), Blocks.snow_layer.getState()).enableVillages();
addFlatPreset("Verschneites Königreich +", Biome.icePlains, true, Blocks.stone.getState(), Blocks.bedrock.getState(), 59, Blocks.stone.getState(),
addFlatPreset("Verschneites Königreich +", BaseBiome.ICEPLAINS, true, Blocks.stone.getState(), Blocks.bedrock.getState(), 59, Blocks.stone.getState(),
3, Blocks.dirt.getState(), Blocks.grass.getState(), Blocks.snow_layer.getState()).setBiomeReplacer(Blocks.gravel.getState()).enableVillages()
.addLake(Blocks.water.getState(), null, Blocks.grass.getState(), 4, 0, 255, false);
addFlatPreset("Unendliche Grube", Biome.plains, false, Blocks.dirt.getState(), 2, Blocks.cobblestone.getState(), 3, Blocks.dirt.getState(), Blocks.grass.getState())
addFlatPreset("Unendliche Grube", BaseBiome.PLAINS, false, Blocks.dirt.getState(), 2, Blocks.cobblestone.getState(), 3, Blocks.dirt.getState(), Blocks.grass.getState())
.setBiomeReplacer(Blocks.gravel.getState()).enableVillages();
addFlatPreset("Wüste", Biome.desert, false, Blocks.stone.getState(), Blocks.bedrock.getState(), 3, Blocks.stone.getState(), 52, Blocks.sandstone.getState())
addFlatPreset("Wüste", BaseBiome.DESERT, false, Blocks.stone.getState(), Blocks.bedrock.getState(), 3, Blocks.stone.getState(), 52, Blocks.sandstone.getState())
.enableVillages().enableScattered();
addFlatPreset("Redstonewelt", Biome.desert, false, Blocks.sandstone.getState(), Blocks.bedrock.getState(), 3, Blocks.stone.getState(),
addFlatPreset("Redstonewelt", BaseBiome.DESERT, false, Blocks.sandstone.getState(), Blocks.bedrock.getState(), 3, Blocks.stone.getState(),
52, Blocks.sandstone.getState());
addPreset("Leer", "ClearGenerator:1b");

View file

@ -1,6 +1,6 @@
package common.item;
import common.biome.Biome;
import common.biome.BaseBiome;
import common.color.TextColor;
import common.entity.npc.EntityNPC;
import common.util.BlockPos;
@ -14,7 +14,7 @@ public class ItemInfoWand extends ItemWand {
public void onUse(ItemStack stack, EntityNPC player, AWorldServer world, Vec3 vec)
{
Biome biome = world.getBiomeGenForCoords(new BlockPos(vec.xCoord, 0, vec.zCoord));
BaseBiome biome = world.getBiomeGenForCoords(new BlockPos(vec.xCoord, 0, vec.zCoord));
player.connection.addHotbar(TextColor.NEON + "* Position bei Level %d: %.3f %.3f %.3f, %s [%d], %.2f °C", world.dimension.getDimensionId(),
vec.xCoord, vec.yCoord, vec.zCoord,
biome.display, biome.id, world.getTemperatureC(new BlockPos(vec)));

View file

@ -10,12 +10,10 @@ import common.entity.types.EntityLiving;
import common.model.ParticleType;
import common.network.IPlayer;
import common.network.Packet;
import common.rng.Random;
import common.util.BlockPos;
import common.util.BoundingBox;
import common.util.PortalType;
import common.village.Village;
import common.worldgen.BiomeGenerator;
public abstract class AWorldServer extends World {
protected AWorldServer(Dimension dim, boolean debug) {
@ -25,10 +23,8 @@ public abstract class AWorldServer extends World {
public abstract List<IPlayer> getAllPlayers();
public abstract AWorldServer getOtherWorld(int dimension);
public abstract void placeInDimension(Entity entity, AWorldServer oldWorld, AWorldServer world, BlockPos pos, PortalType portal);
public abstract State getSurfaceLiquid();
public abstract boolean addLoader(BlockPos pos);
public abstract boolean removeLoader(BlockPos pos);
public abstract BiomeGenerator getBiomeGenerator();
public abstract boolean isBlockTickPending(BlockPos pos, Block blockType);
public abstract void updateBlockTick(BlockPos pos, Block blockIn, int delay, int priority);
public abstract void resetUpdateEntityTick();
@ -39,24 +35,13 @@ public abstract class AWorldServer extends World {
public abstract long getSeed();
public abstract boolean isExterminated();
public abstract boolean exterminate();
public abstract void forceBlockUpdateTick(Block blockType, BlockPos pos, Random random);
public abstract Village getNearestVillage(BlockPos doorBlock, int radius);
public abstract void addToVillagerPositionList(BlockPos blockpos);
public abstract void removePlayer(EntityNPC player);
public abstract void updateMountedMovingPlayer(EntityNPC player);
public abstract boolean isPlayerWatchingChunk(EntityNPC player, int chunkX, int chunkZ);
public abstract void untrackEntity(Entity entityIn);
public abstract void updateTrackedPlayer(EntityNPC player);
public abstract void sendToAllTrackingEntity(Entity entityIn, Packet packet);
public abstract void sendToAllTrackingAndSelf(Entity entityIn, Packet packet);
public abstract void removePlayerFromTrackers(EntityNPC player);
public abstract void updateChunksForPlayer(EntityNPC player, Chunk chunk);
public abstract boolean isDaytime();
public abstract int getSkylightSubtracted();
public abstract boolean isBlockinHighHumidity(BlockPos pos);
public abstract <T extends Entity> T findNearestEntityWithinAABB(Class<? extends T> entityType, BoundingBox aabb, T closestTo);
public abstract boolean canBlockFreeze(BlockPos pos, boolean noWaterAdj);
public abstract BlockPos getTopSolidOrLiquidBlock(BlockPos pos);
public abstract void removePlayerEntityDangerously(Entity entityIn);
public abstract long getTime();
}

View file

@ -6,11 +6,12 @@ import java.util.Map;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.function.Predicate;
import common.biome.Biome;
import common.biome.BaseBiome;
import common.block.Block;
import common.block.ITileEntityProvider;
import common.collect.Maps;
import common.entity.Entity;
import common.init.BlockRegistry;
import common.init.Blocks;
import common.log.Log;
import common.material.Material;
@ -24,8 +25,7 @@ import common.util.ExtMath;
import common.util.Facing;
import common.util.NibbleArray;
import common.worldgen.BiomeGenerator;
import common.worldgen.ChunkPrimer;
import common.worldgen.GeneratorDebug;
import common.worldgen.DebugStates;
public class Chunk {
public final int xPos;
@ -63,14 +63,14 @@ public class Chunk {
Arrays.fill(this.biomes, (byte)-1);
}
public Chunk(World world, ChunkPrimer primer, State base, State ceil, Random rand, Biome[] biomes, int x, int z) {
public Chunk(World world, short[] data, int height, State base, State ceil, Random rand, BaseBiome[] biomes, int x, int z) {
this(world, x, z);
boolean sky = !world.dimension.hasNoLight();
for(int bx = 0; bx < 16; ++bx) {
for(int bz = 0; bz < 16; ++bz) {
for(int by = 0; by < primer.height; ++by) {
State state = primer.get(bx, by, bz);
if(state.getBlock().getMaterial() != Material.air) {
for(int by = 0; by < height; ++by) {
State state = BlockRegistry.STATEMAP.getByValue(data[bx << 4 | bz | by << 8]);
if(state != null && state.getBlock().getMaterial() != Material.air) {
int y = by >> 4;
if(this.blocks[y] == null)
this.blocks[y] = new BlockArray(y << 4, sky);
@ -92,16 +92,16 @@ public class Chunk {
}
}
if(ceil != null) {
int y = (primer.height - 1) >> 4;
int y = (height - 1) >> 4;
if(this.blocks[y] == null)
this.blocks[y] = new BlockArray(y << 4, sky);
y = (primer.height - 5) >> 4;
y = (height - 5) >> 4;
if(this.blocks[y] == null)
this.blocks[y] = new BlockArray(y << 4, sky);
for(int bx = 0; bx < 16; ++bx) {
for(int bz = 0; bz < 16; ++bz) {
for(int by = primer.height - 1; by >= primer.height - 5; --by) {
if(by >= (primer.height - 1) - rand.zrange(5))
for(int by = height - 1; by >= height - 5; --by) {
if(by >= (height - 1) - rand.zrange(5))
this.blocks[by >> 4].set(bx, by & 15, bz, ceil);
}
}
@ -412,7 +412,7 @@ public class Chunk {
// }
if(pos.getY() == 1) {
state = GeneratorDebug.getState(pos.getX(), pos.getZ());
state = DebugStates.getState(pos.getX(), pos.getZ());
}
return state == null ? Blocks.air.getState() : state;
@ -956,19 +956,18 @@ public class Chunk {
}
}
public Biome getBiome(BlockPos pos, BiomeGenerator gen) {
public BaseBiome getBiome(BlockPos pos, BiomeGenerator gen) {
int x = pos.getX() & 15;
int z = pos.getZ() & 15;
int o = this.biomes[z << 4 | x] & 255;
if(o == 255) {
Biome biome = gen == null ? Biome.DEF_BIOME : gen.getBiomeGenerator(pos, Biome.DEF_BIOME);
BaseBiome biome = gen == null ? BaseBiome.DEF_BIOME : gen.getBiomeGenerator(pos, BaseBiome.DEF_BIOME);
o = biome.id;
this.biomes[z << 4 | x] = (byte)(o & 255);
}
Biome biome = Biome.getBiome(o);
return biome == null ? Biome.DEF_BIOME : biome;
return BaseBiome.getBiomeDef(o);
}
public byte[] getBiomes() {

View file

@ -1,279 +0,0 @@
package common.world;
import java.util.Collection;
import java.util.List;
import java.util.function.Predicate;
import common.biome.Biome;
import common.block.Block;
import common.block.LeavesType;
import common.entity.Entity;
import common.entity.item.EntityExplosion;
import common.entity.npc.EntityNPC;
import common.init.SoundEvent;
import common.item.ItemStack;
import common.model.ParticleType;
import common.tileentity.TileEntity;
import common.util.BlockPos;
import common.util.BoundingBox;
import common.util.Facing;
import common.util.HitPosition;
import common.util.Vec3;
public interface IWorld {
boolean isBlockSolid(BlockPos pos);
void setGravity(float gravity);
Biome getBiomeGenForCoords(BlockPos pos);
boolean isAirBlock(BlockPos pos);
boolean isBlockLoaded(BlockPos pos);
boolean isBlockLoaded(BlockPos pos, boolean allowEmpty);
boolean isAreaLoaded(BlockPos center, int radius);
boolean isAreaLoaded(BlockPos center, int radius, boolean allowEmpty);
boolean isAreaLoaded(BlockPos from, BlockPos to);
boolean isAreaLoaded(BlockPos from, BlockPos to, boolean allowEmpty);
Chunk getChunk(BlockPos pos);
boolean setState(BlockPos pos, State newState, int flags);
boolean setState(BlockPos pos, State state);
boolean setBlockToAir(BlockPos pos);
boolean destroyBlock(BlockPos pos, boolean dropBlock);
void notifyNeighborsRespectDebug(BlockPos pos, Block blockType);
void markBlocksDirtyVertical(int x1, int z1, int x2, int z2);
void markBlockRangeForRenderUpdate(BlockPos rangeMin, BlockPos rangeMax);
void notifyNeighborsOfStateChange(BlockPos pos, Block blockType);
void notifyNeighborsOfStateExcept(BlockPos pos, Block blockType, Facing skipSide);
void notifyBlockOfStateChange(BlockPos pos, Block blockIn);
boolean canSeeSky(BlockPos pos);
int getLight(BlockPos pos);
int getLightFromNeighbors(BlockPos pos);
BlockPos getHeight(BlockPos pos);
int getChunksLowestHorizon(int x, int z);
int getLightFromNeighborsFor(LightType type, BlockPos pos);
int getLightFor(LightType type, BlockPos pos);
void setLightFor(LightType type, BlockPos pos, int lightValue);
int getCombinedLight(BlockPos pos, int lightValue);
float getLightBrightness(BlockPos pos);
State getState(BlockPos pos);
BlockPos getBlockTrace(Entity entity, int distance);
HitPosition rayTraceBlocks(Vec3 p_72933_1_, Vec3 p_72933_2_);
HitPosition rayTraceBlocks(Vec3 start, Vec3 end, boolean stopOnLiquid);
HitPosition rayTraceBlocks(Vec3 vec31, Vec3 vec32, boolean stopOnLiquid, boolean ignoreBlockWithoutBoundingBox,
boolean returnLastUncollidableBlock);
void playSoundAtEntity(Entity entityIn, SoundEvent name, float volume);
boolean spawnEntityInWorld(Entity entityIn);
void removeEntity(Entity entityIn);
List<BoundingBox> getCollidingBoundingBoxes(Entity entityIn, BoundingBox bb);
List<BoundingBox> getCollisionBoxes(BoundingBox bb);
int calculateSkylightSubtracted(boolean current);
float getCelestialAngle(float partialTicks);
int getMoonPhase();
float getCurrentMoonPhaseFactor();
float getCelestialAngleRadians(float partialTicks);
BlockPos getPrecipitationHeight(BlockPos pos);
void updateEntities();
boolean addTileEntity(TileEntity tile);
void addTileEntities(Collection<TileEntity> tileEntityCollection);
void updateEntity(Entity entityIn, boolean forceUpdate);
boolean checkNoEntityCollision(BoundingBox bb);
boolean checkNoEntityCollision(BoundingBox bb, Entity entityIn);
boolean isAnyLiquid(BoundingBox bb);
boolean isFlammableWithin(BoundingBox bb);
boolean handleLiquidAcceleration(BoundingBox bb, Entity entityIn);
boolean isMaterialInMolten(BoundingBox bb);
boolean isAABBInLiquid(BoundingBox bb);
Explosion createExplosion(Entity entityIn, double x, double y, double z, float strength, boolean isSmoking);
Explosion createAltExplosion(Entity entityIn, double x, double y, double z, float strength, boolean isSmoking);
Explosion newExplosion(Entity entityIn, double x, double y, double z, float strength, boolean isFlaming, boolean isSmoking, boolean altSound);
EntityExplosion newExplosion(double x, double y, double z, int strength);
float getBlockDensity(Vec3 vec, BoundingBox bb);
boolean extinguishFire(EntityNPC player, BlockPos pos, Facing side);
TileEntity getTileEntity(BlockPos pos);
void setTileEntity(BlockPos pos, TileEntity tileEntityIn);
void removeTileEntity(BlockPos pos);
void markTileEntityForRemoval(TileEntity tileEntityIn);
float getTempOffset();
LeavesType getLeavesGen(BlockPos pos);
float getTemperatureK(BlockPos pos);
float getTemperatureC(BlockPos pos);
boolean canFreezeAt(BlockPos pos);
boolean canBurnAt(BlockPos pos);
boolean doesWaterVaporize(BlockPos pos);
boolean isLavaFaster(BlockPos pos);
boolean canSnowAt(BlockPos pos, boolean checkLight, boolean allowLayers);
boolean checkLight(BlockPos pos);
boolean checkLightFor(LightType lightType, BlockPos pos);
List<Entity> getEntitiesWithinAABBExcludingEntity(Entity entityIn, BoundingBox bb);
List<Entity> getEntitiesInAABBexcluding(Entity entityIn, BoundingBox boundingBox, Predicate<? super Entity> predicate);
<T extends Entity> List<T> getEntitiesWithinAABB(Class<? extends T> classEntity, BoundingBox bb);
<T extends Entity> List<T> getEntitiesWithinAABB(Class<? extends T> clazz, BoundingBox aabb, Predicate<? super T> filter);
Entity getEntityByID(int id);
void markChunkDirty(BlockPos pos, TileEntity unusedTileEntity);
void loadEntities(Collection<Entity> entityCollection);
void unloadEntities(Collection<Entity> entityCollection);
boolean canBlockBePlaced(Block blockIn, BlockPos pos, boolean p_175716_3_, Facing side, Entity entityIn, ItemStack itemStackIn);
int getSeaLevel();
int getStrongPower(BlockPos pos);
boolean isSidePowered(BlockPos pos, Facing side);
int getRedstonePower(BlockPos pos, Facing facing);
boolean isBlockPowered(BlockPos pos);
int isBlockIndirectlyGettingPowered(BlockPos pos);
EntityNPC getClosestPlayerToEntity(Entity entityIn, double distance);
EntityNPC getClosestPlayer(double x, double y, double z, double distance);
boolean isAnyPlayerWithinRangeAt(double x, double y, double z, double range);
void setTimeFactor(int factor);
void setEntityState(Entity entityIn, byte state);
void addBlockEvent(BlockPos pos, Block blockIn, int eventID, int eventParam);
Weather getWeather();
long getDayTime();
void setWeather(Weather weather);
void setDayTime(long time);
float getDarkness();
void setDarkness(float dark);
float getRainStrength();
void setRainStrength(float strength);
float getFogStrength();
void setFogStrength(float strength);
void setTemperature(float temp);
boolean isDark();
boolean isThundering();
boolean hasDownfall();
boolean isRaining();
boolean isRainingAt(BlockPos strikePosition, boolean wet);
void playAuxSFX(int type, BlockPos pos, int data);
void updateComparatorOutputLevel(BlockPos pos, Block blockIn);
void scheduleUpdate(BlockPos pos, Block blockIn, int delay);
void spawnParticle(ParticleType particleType, double xCoord, double yCoord, double zCoord, double xOffset, double yOffset, double zOffset,
int... data);
Chunk getChunk(int x, int z);
void markBlockForUpdate(BlockPos pos);
void markBlockRangeForRenderUpdate(int x1, int y1, int z1, int x2, int y2, int z2);
void playSound(SoundEvent sound, double x, double y, double z, float volume);
void playAuxSFX(EntityNPC player, int sfxType, BlockPos blockPosIn, int data);
void sendBlockBreakProgress(int breakerId, BlockPos pos, int progress);
}

View file

@ -1,6 +1,6 @@
package common.world;
import common.biome.Biome;
import common.biome.BaseBiome;
import common.tileentity.TileEntity;
import common.util.BlockPos;
@ -8,5 +8,5 @@ public interface IWorldAccess extends IBlockAccess
{
TileEntity getTileEntity(BlockPos pos);
int getCombinedLight(BlockPos pos, int lightValue);
Biome getBiomeGenForCoords(BlockPos pos);
BaseBiome getBiomeGenForCoords(BlockPos pos);
}

View file

@ -6,7 +6,7 @@ import java.util.List;
import java.util.Set;
import java.util.function.Predicate;
import common.biome.Biome;
import common.biome.BaseBiome;
import common.block.Block;
import common.block.BlockHopper;
import common.block.BlockLiquid;
@ -38,7 +38,7 @@ import common.util.HitPosition;
import common.util.IntHashMap;
import common.util.Vec3;
public abstract class World implements IWorldAccess, IWorld {
public abstract class World implements IWorldAccess {
public static final float[][] BRIGHTNESS = new float[16][16];
static {
for(int l = 0; l < 16; l++) {
@ -133,11 +133,11 @@ public abstract class World implements IWorldAccess, IWorld {
this.gravity = Math.signum(this.gravity) * 0.075;
}
public Biome getBiomeGenForCoords(final BlockPos pos) {
public BaseBiome getBiomeGenForCoords(final BlockPos pos) {
if(this.isBlockLoaded(pos))
return this.getChunk(pos).getBiome(pos, null);
else
return Biome.DEF_BIOME;
return BaseBiome.DEF_BIOME;
}
public boolean isAirBlock(BlockPos pos) {

View file

@ -2,15 +2,15 @@ package common.worldgen;
import java.util.Set;
import common.biome.Biome;
import common.biome.BaseBiome;
import common.util.BlockPos;
public interface BiomeGenerator {
public void genFactors(double[] factors, int xPos, int zPos, int sizeX, int sizeZ);
public Biome getBiomeGenerator(BlockPos pos, Biome def);
public void getGenBiomes(Biome[] biomes, int x, int z, int width, int height);
public void getChunkBiomes(Biome[] oldBiomeList, int x, int z, int width, int depth);
public void getBiomes(Biome[] listToReuse, int x, int z, int width, int length, boolean cacheFlag);
public boolean areBiomesViable(int x, int z, int size, Set<Biome> allowed);
public BaseBiome getBiomeGenerator(BlockPos pos, BaseBiome def);
public void getGenBiomes(BaseBiome[] biomes, int x, int z, int width, int height);
public void getChunkBiomes(BaseBiome[] oldBiomeList, int x, int z, int width, int depth);
public void getBiomes(BaseBiome[] listToReuse, int x, int z, int width, int length, boolean cacheFlag);
public boolean areBiomesViable(int x, int z, int size, Set<BaseBiome> allowed);
public void cleanupCache();
}

View file

@ -1,9 +0,0 @@
package common.worldgen;
import common.biome.Biome;
import common.rng.Random;
import common.world.AWorldServer;
public interface BlockReplacer {
public void replaceBlocks(AWorldServer world, int x, int z, ChunkPrimer primer, Random rand, Biome[] biomes);
}

View file

@ -1,8 +0,0 @@
package common.worldgen;
import common.world.AWorldServer;
public interface ChunkGenerator {
public void generateChunk(AWorldServer world, int x, int z, ChunkPrimer primer);
public int getMaximumHeight();
}

View file

@ -7,10 +7,8 @@ import common.collect.Lists;
import common.init.BlockRegistry;
import common.util.ExtMath;
import common.world.State;
import common.world.AWorldServer;
public class GeneratorDebug implements ChunkGenerator
{
public class DebugStates {
private static final List<State> STATES = Lists.<State>newArrayList();
private static final int XSTRETCH;
private static final int ZSTRETCH;
@ -37,23 +35,4 @@ public class GeneratorDebug implements ChunkGenerator
}
return state;
}
public int getMaximumHeight() {
return 72;
}
public void generateChunk(AWorldServer world, int x, int z, ChunkPrimer primer)
{
for(int bx = 0; bx < 16; ++bx) {
for(int bz = 0; bz < 16; ++bz) {
int sx = x * 16 + bx;
int sz = z * 16 + bz;
// primer.set(bx, 60, bz, Blocks.glass.getDefaultState());
State state = getState(sx, sz);
if(state != null) {
primer.set(bx, 1, bz, state);
}
}
}
}
}

View file

@ -0,0 +1,23 @@
package common.worldgen;
import common.world.State;
public class FeatureLake {
public final State state;
public final State filler;
public final State top;
public final int chance;
public final int minHeight;
public final int maxHeight;
public final boolean ratiod;
public FeatureLake(State state, State filler, State top, int chance, int minHeight, int maxHeight, boolean ratiod) {
this.state = state;
this.filler = filler;
this.top = top;
this.chance = chance;
this.minHeight = minHeight;
this.maxHeight = maxHeight;
this.ratiod = ratiod;
}
}

View file

@ -0,0 +1,19 @@
package common.worldgen;
import common.world.State;
public class FeatureLiquid {
public final State state;
public final int chance;
public final int minHeight;
public final int maxHeight;
public final boolean lower;
public FeatureLiquid(State state, int chance, int minHeight, int maxHeight, boolean lower) {
this.state = state;
this.chance = chance;
this.minHeight = minHeight;
this.maxHeight = maxHeight;
this.lower = lower;
}
}

View file

@ -0,0 +1,23 @@
package common.worldgen;
import common.world.State;
public class FeatureOre {
public final State state;
public final int count;
public final int more;
public final int size;
public final int min;
public final int max;
public final boolean dist;
public FeatureOre(State state, int count, int more, int size, int min, int max, boolean dist) {
this.state = state;
this.count = count;
this.more = more;
this.size = size;
this.min = min;
this.max = max;
this.dist = dist;
}
}

View file

@ -86,6 +86,7 @@ import io.netty.channel.socket.nio.NioServerSocketChannel;
import io.netty.handler.timeout.ReadTimeoutHandler;
import io.netty.util.concurrent.Future;
import io.netty.util.concurrent.GenericFutureListener;
import server.biome.Biome;
import server.clipboard.ReorderRegistry;
import server.clipboard.RotationRegistry;
import server.command.CommandEnvironment;
@ -144,6 +145,8 @@ public final class Server implements IThreadListener {
public static void main(String[] args) {
Util.checkOs();
Registry.setup("Server thread");
Biome.setAsProvider();
UniverseRegistry.register();
RotationRegistry.register();
ReorderRegistry.register();
boolean debug = System.getProperty("server.debug", null) != null;
@ -907,10 +910,11 @@ public final class Server implements IThreadListener {
public void recreatePlayer(Player conn) {
EntityNPC old = conn.getEntity();
BlockPos pos = old.getPosition();
old.getServerWorld().removePlayerFromTrackers(old);
old.getServerWorld().untrackEntity(old);
old.getServerWorld().removePlayer(old);
old.getServerWorld().removePlayerEntityDangerously(old);
WorldServer oldWorld = (WorldServer)old.getServerWorld();
oldWorld.removePlayerFromTrackers(old);
oldWorld.untrackEntity(old);
oldWorld.removePlayer(old);
oldWorld.removePlayerEntityDangerously(old);
WorldPos bed = old.getSpawnPoint();
WorldPos origin = old.getOrigin();
BlockPos spawn = null;
@ -976,10 +980,11 @@ public final class Server implements IThreadListener {
oldTag.setInteger("Dimension", old.worldObj.dimension.getDimensionId());
oldTag.setString("id", EntityRegistry.getEntityString(old));
old.getServerWorld().removePlayerFromTrackers(old);
old.getServerWorld().untrackEntity(old);
old.getServerWorld().removePlayer(old);
old.getServerWorld().removePlayerEntityDangerously(old);
WorldServer oldWorld = (WorldServer)old.getServerWorld();
oldWorld.removePlayerFromTrackers(old);
oldWorld.untrackEntity(old);
oldWorld.removePlayer(old);
oldWorld.removePlayerEntityDangerously(old);
// old.dead = false;
WorldServer world = tag == null ? this.space : this.getWorld(tag.getInteger("Dimension"));

View file

@ -1,16 +1,13 @@
package common.biome;
import java.util.List;
import java.util.Map;
package server.biome;
import common.biome.BaseBiome;
import common.biome.IBiome;
import common.block.Block;
import common.block.BlockColored;
import common.block.BlockFlower;
import common.block.BlockSand;
import common.block.BlockSapling;
import common.block.BlockTallGrass;
import common.collect.Lists;
import common.collect.Maps;
import common.color.Colorizer;
import common.color.DyeColor;
import common.entity.animal.EntityBat;
import common.entity.animal.EntityChicken;
@ -27,104 +24,107 @@ import common.entity.npc.EntitySlime;
import common.entity.npc.EntityUndead;
import common.entity.npc.EntityZombie;
import common.init.Blocks;
import common.init.WoodType;
import common.log.Log;
import common.material.Material;
import common.rng.PerlinGen;
import common.rng.Random;
import common.rng.WeightedList;
import common.util.BlockPos;
import common.util.ExtMath;
import common.world.AWorldServer;
import common.world.State;
import common.world.World;
import common.world.AWorldServer;
import common.worldgen.ChunkPrimer;
import common.worldgen.FeatureGenerator;
import common.worldgen.feature.WorldGenClay;
import common.worldgen.feature.WorldGenClayExt;
import common.worldgen.feature.WorldGenSand;
import common.worldgen.foliage.FeatureDoublePlant;
import common.worldgen.foliage.WorldGenBigMushroom;
import common.worldgen.foliage.WorldGenCactus;
import common.worldgen.foliage.WorldGenDeadBush;
import common.worldgen.foliage.WorldGenFlowers;
import common.worldgen.foliage.WorldGenMushroom;
import common.worldgen.foliage.WorldGenPumpkin;
import common.worldgen.foliage.WorldGenReed;
import common.worldgen.foliage.WorldGenTallGrass;
import common.worldgen.foliage.WorldGenWaterlily;
import common.worldgen.tree.WorldGenBaseTree;
import common.worldgen.tree.WorldGenBigTree;
import common.worldgen.tree.WorldGenSwamp;
import common.worldgen.tree.WorldGenTree;
import server.world.WorldServer;
import server.worldgen.ChunkPrimer;
import server.worldgen.FeatureGenerator;
import server.worldgen.feature.WorldGenClay;
import server.worldgen.feature.WorldGenClayExt;
import server.worldgen.feature.WorldGenSand;
import server.worldgen.foliage.FeatureDoublePlant;
import server.worldgen.foliage.WorldGenBigMushroom;
import server.worldgen.foliage.WorldGenCactus;
import server.worldgen.foliage.WorldGenDeadBush;
import server.worldgen.foliage.WorldGenFlowers;
import server.worldgen.foliage.WorldGenMushroom;
import server.worldgen.foliage.WorldGenPumpkin;
import server.worldgen.foliage.WorldGenReed;
import server.worldgen.foliage.WorldGenTallGrass;
import server.worldgen.foliage.WorldGenWaterlily;
import server.worldgen.tree.WorldGenBaseTree;
import server.worldgen.tree.WorldGenBigTree;
import server.worldgen.tree.WorldGenBirch;
import server.worldgen.tree.WorldGenDarkOak;
import server.worldgen.tree.WorldGenJungle;
import server.worldgen.tree.WorldGenPine;
import server.worldgen.tree.WorldGenSavanna;
import server.worldgen.tree.WorldGenSwamp;
import server.worldgen.tree.WorldGenTaiga2;
import server.worldgen.tree.WorldGenTree;
public abstract class Biome {
private static final Biome[] BIOMES = new Biome[256];
public abstract class Biome implements IBiome {
public static final Biome[] BIOMES = new Biome[256];
public static final Biome none = (new BiomeNone(0)).setBiomeName("none", "<Keins>");
public static final Biome none = (new BiomeNone());
public static final Biome plains = (new BiomePlains(1)).setColor(9286496).setBiomeName("plains", "Ebene");
public static final Biome desert = (new BiomeDesert(2)).setColor(16421912).setBiomeName("desert", "Wüste").setTemperature(60.0f).setHumidity(0.0f).setScaling(Scaling.PLAINS_LOW);
public static final Biome extremeHills = (new BiomeHills(3, false)).setColor(6316128).setBiomeName("extremeHills", "Extremes Bergland").setScaling(Scaling.HILLS_LARGE).setTemperature(-12.0f).setHumidity(30.0f);
public static final Biome forest = (new BiomeForest(4, 0)).setColor(353825).setBiomeName("forest", "Wald");
public static final Biome taiga = (new BiomeTaiga(5, 0)).setColor(747097).setBiomeName("taiga", "Taiga").setTemperature(-10.0f).setHumidity(80.0f).setScaling(Scaling.PLAINS_MEDIUM);
public static final Biome swampland = (new BiomeSwamp(6)).setColor(522674).setBiomeName("swampland", "Sumpf").setScaling(Scaling.SEA_POND).setTemperature(12.0f).setHumidity(90.0f);
public static final Biome river = (new BiomeWater(7, true)).setColor(255).setBiomeName("river", "Fluss").setScaling(Scaling.SEA_SHALLOW);
public static final Biome plains = (new BiomePlains());
public static final Biome desert = (new BiomeDesert(false)).setScaling(Scaling.PLAINS_LOW);
public static final Biome extremeHills = (new BiomeHills(BaseBiome.EXTREMEHILLS, false)).setScaling(Scaling.HILLS_LARGE);
public static final Biome forest = (new BiomeForest(BaseBiome.FOREST, 0));
public static final Biome taiga = (new BiomeTaiga(BaseBiome.TAIGA, 0)).setScaling(Scaling.PLAINS_MEDIUM);
public static final Biome swampland = (new BiomeSwamp()).setScaling(Scaling.SEA_POND);
public static final Biome river = (new BiomeWater(BaseBiome.RIVER, true)).setScaling(Scaling.SEA_SHALLOW);
public static final Biome exterminated = (new BiomeExterminated(8)).setColor(0x000000).setBiomeName("exterminated", "Ausgelöscht").setHumidity(0.0f).setTemperature(150.0f);
public static final Biome space = (new BiomeSpace(9)).setColor(0x000000).setBiomeName("space", "Leere des Weltraums").setHumidity(0.0f);
public static final Biome exterminated = (new BiomeExterminated());
public static final Biome space = (new BiomeSpace());
public static final Biome frozenSea = (new BiomeWater(10, false)).setColor(9474208).setBiomeName("frozenSea", "Vereister See").enableColdBeach().setScaling(Scaling.SEA_MEDIUM).setTemperature(-20.0f).setHumidity(50.0f);
public static final Biome frozenRiver = (new BiomeWater(11, true)).setColor(10526975).setBiomeName("frozenRiver", "Vereister Fluss").enableColdBeach().setScaling(Scaling.SEA_SHALLOW).setTemperature(-20.0f).setHumidity(50.0f);
public static final Biome icePlains = (new BiomeSnow(12, false)).setColor(16777215).setBiomeName("icePlains", "Eisebene").enableColdBeach().setTemperature(-20.0f).setHumidity(50.0f).setScaling(Scaling.PLAINS_LOW);
public static final Biome iceMountains = (new BiomeSnow(13, false)).setColor(10526880).setBiomeName("iceMountains", "Vereistes Bergland").enableColdBeach().setScaling(Scaling.HILLS_LOW).setTemperature(-20.0f).setHumidity(50.0f);
public static final Biome mushroomPlains = (new BiomeMushroom(14)).setColor(16711935).setBiomeName("mushroomPlains", "Pilzland").setTemperature(16.0f).setHumidity(100.0f).setScaling(Scaling.PLAINS_VARYING);
public static final Biome blackened = (new BiomeBlackened(15)).setColor(0x000000).setBiomeName("blackened", "Schwarz").setHumidity(0.0f);
public static final Biome beach = (new BiomeBeach(16)).setColor(16440917).setBiomeName("beach", "Strand").setTemperature(12.0f).setHumidity(40.0f).setScaling(Scaling.SEA_SHORE);
public static final Biome desertHills = (new BiomeDesert(17)).setColor(13786898).setBiomeName("desertHills", "Wüsten-Bergland").setTemperature(60.0f).setHumidity(0.0f).setScaling(Scaling.HILLS_LOW);
public static final Biome forestHills = (new BiomeForest(18, 0)).setColor(2250012).setBiomeName("forestHills", "Wald-Bergland").setScaling(Scaling.HILLS_LOW);
public static final Biome taigaHills = (new BiomeTaiga(19, 0)).setColor(1456435).setBiomeName("taigaHills", "Taiga-Bergland").setTemperature(-10.0f).setHumidity(80.0f).setScaling(Scaling.HILLS_LOW);
public static final Biome extremeHillsEdge = (new BiomeHills(20, true)).setColor(7501978).setBiomeName("extremeHillsEdge", "Extremes Bergland Gr.").setScaling(Scaling.HILLS_MEDIUM).setTemperature(-12.0f).setHumidity(30.0f);
public static final Biome jungle = (new BiomeJungle(21, false)).setColor(5470985).setBiomeName("jungle", "Urwald").setTemperature(18.0f).setHumidity(90.0f);
public static final Biome jungleHills = (new BiomeJungle(22, false)).setColor(2900485).setBiomeName("jungleHills", "Urwald-Bergland").setTemperature(18.0f).setHumidity(90.0f).setScaling(Scaling.HILLS_LOW);
public static final Biome jungleEdge = (new BiomeJungle(23, true)).setColor(6458135).setBiomeName("jungleEdge", "Urwald Gr.").setTemperature(18.0f).setHumidity(80.0f);
public static final Biome sea = (new BiomeWater(24, false)).setColor(112).setBiomeName("sea", "See").setScaling(Scaling.SEA_MEDIUM);
public static final Biome stoneBeach = (new BiomeStoneBeach(25)).setColor(10658436).setBiomeName("stoneBeach", "Steinstrand").setTemperature(-12.0f).setHumidity(30.0f).setScaling(Scaling.SEA_VARYING);
public static final Biome coldBeach = (new BiomeBeach(26)).setColor(16445632).setBiomeName("coldBeach", "Vereister Strand").setTemperature(-18.0f).setHumidity(30.0f).setScaling(Scaling.SEA_SHORE).enableColdBeach();
public static final Biome birchForest = (new BiomeForest(27, 2)).setBiomeName("birchForest", "Birkenwald").setColor(3175492);
public static final Biome birchForestHills = (new BiomeForest(28, 2)).setBiomeName("birchForestHills", "Birkenwald-Bergland").setColor(2055986).setScaling(Scaling.HILLS_LOW);
public static final Biome roofedForest = (new BiomeForest(29, 3)).setColor(4215066).setBiomeName("roofedForest", "Dichter Wald");
public static final Biome coldTaiga = (new BiomeTaiga(30, 0)).setColor(3233098).setBiomeName("coldTaiga", "Vereiste Taiga").enableColdBeach().setTemperature(-40.0f).setHumidity(40.0f).setScaling(Scaling.PLAINS_MEDIUM);
public static final Biome coldTaigaHills = (new BiomeTaiga(31, 0)).setColor(2375478).setBiomeName("coldTaigaHills", "Vereistes Taiga-Bergland").enableColdBeach().setTemperature(-40.0f).setHumidity(40.0f).setScaling(Scaling.HILLS_LOW);
public static final Biome megaTaiga = (new BiomeTaiga(32, 1)).setColor(5858897).setBiomeName("megaTaiga", "Hohe Taiga").setTemperature(-8.0f).setHumidity(80.0f).setScaling(Scaling.PLAINS_MEDIUM);
public static final Biome megaTaigaHills = (new BiomeTaiga(33, 1)).setColor(4542270).setBiomeName("megaTaigaHills", "Hohes Taiga-Bergland").setTemperature(-8.0f).setHumidity(80.0f).setScaling(Scaling.HILLS_LOW);
public static final Biome extremeHillsPlus = (new BiomeHills(34, true)).setColor(5271632).setBiomeName("extremeHillsPlus", "Extremes Bergland +").setScaling(Scaling.HILLS_LARGE).setTemperature(-12.0f).setHumidity(30.0f);
public static final Biome savanna = (new BiomeSavanna(35)).setColor(12431967).setBiomeName("savanna", "Savanne").setTemperature(28.0F).setHumidity(0.0f).setScaling(Scaling.PLAINS_LOW);
public static final Biome savannaPlateau = (new BiomeSavanna(36)).setColor(10984804).setBiomeName("savannaPlateau", "Savannen-Plateau").setTemperature(20.0F).setHumidity(0.0f).setScaling(Scaling.HILLS_PLATEAU);
public static final Biome frozenSea = (new BiomeWater(BaseBiome.FROZENSEA, false)).enableColdBeach().setScaling(Scaling.SEA_MEDIUM);
public static final Biome frozenRiver = (new BiomeWater(BaseBiome.FROZENRIVER, true)).enableColdBeach().setScaling(Scaling.SEA_SHALLOW);
public static final Biome icePlains = (new BiomeSnow(BaseBiome.ICEPLAINS, false)).enableColdBeach().setScaling(Scaling.PLAINS_LOW);
public static final Biome iceMountains = (new BiomeSnow(BaseBiome.ICEMOUNTAINS, false)).enableColdBeach().setScaling(Scaling.HILLS_LOW);
public static final Biome mushroomPlains = (new BiomeMushroom()).setScaling(Scaling.PLAINS_VARYING);
public static final Biome blackened = (new BiomeBlackened());
public static final Biome beach = (new BiomeBeach(false)).setScaling(Scaling.SEA_SHORE);
public static final Biome desertHills = (new BiomeDesert(true)).setScaling(Scaling.HILLS_LOW);
public static final Biome forestHills = (new BiomeForest(BaseBiome.FORESTHILLS, 0)).setScaling(Scaling.HILLS_LOW);
public static final Biome taigaHills = (new BiomeTaiga(BaseBiome.TAIGAHILLS, 0)).setScaling(Scaling.HILLS_LOW);
public static final Biome extremeHillsEdge = (new BiomeHills(BaseBiome.EXTREMEHILLSEDGE, true)).setScaling(Scaling.HILLS_MEDIUM);
public static final Biome jungle = (new BiomeJungle(BaseBiome.JUNGLE, false));
public static final Biome jungleHills = (new BiomeJungle(BaseBiome.JUNGLEHILLS, false)).setScaling(Scaling.HILLS_LOW);
public static final Biome jungleEdge = (new BiomeJungle(BaseBiome.JUNGLEEDGE, true));
public static final Biome sea = (new BiomeWater(BaseBiome.SEA, false)).setScaling(Scaling.SEA_MEDIUM);
public static final Biome stoneBeach = (new BiomeStoneBeach()).setScaling(Scaling.SEA_VARYING);
public static final Biome coldBeach = (new BiomeBeach(true)).setScaling(Scaling.SEA_SHORE).enableColdBeach();
public static final Biome birchForest = (new BiomeForest(BaseBiome.BIRCHFOREST, 2));
public static final Biome birchForestHills = (new BiomeForest(BaseBiome.BIRCHFORESTHILLS, 2)).setScaling(Scaling.HILLS_LOW);
public static final Biome roofedForest = (new BiomeForest(BaseBiome.ROOFEDFOREST, 3));
public static final Biome coldTaiga = (new BiomeTaiga(BaseBiome.COLDTAIGA, 0)).enableColdBeach().setScaling(Scaling.PLAINS_MEDIUM);
public static final Biome coldTaigaHills = (new BiomeTaiga(BaseBiome.COLDTAIGAHILLS, 0)).enableColdBeach().setScaling(Scaling.HILLS_LOW);
public static final Biome megaTaiga = (new BiomeTaiga(BaseBiome.MEGATAIGA, 1)).setScaling(Scaling.PLAINS_MEDIUM);
public static final Biome megaTaigaHills = (new BiomeTaiga(BaseBiome.MEGATAIGAHILLS, 1)).setScaling(Scaling.HILLS_LOW);
public static final Biome extremeHillsPlus = (new BiomeHills(BaseBiome.EXTREMEHILLSPLUS, true)).setScaling(Scaling.HILLS_LARGE);
public static final Biome savanna = (new BiomeSavanna(false)).setScaling(Scaling.PLAINS_LOW);
public static final Biome savannaPlateau = (new BiomeSavanna(true)).setScaling(Scaling.HILLS_PLATEAU);
public static final Biome mesa = (new BiomeMesa(37, false, false)).setColor(14238997).setBiomeName("mesa", "Mesa");
public static final Biome mesaPlateau_F = (new BiomeMesa(38, false, true)).setColor(11573093).setBiomeName("mesaPlateauF", "Mesa-Waldplateau").setScaling(Scaling.HILLS_PLATEAU);
public static final Biome mesaPlateau = (new BiomeMesa(39, false, false)).setColor(13274213).setBiomeName("mesaPlateau", "Mesa-Plateau").setScaling(Scaling.HILLS_PLATEAU);
public static final Biome mesa = (new BiomeMesa(BaseBiome.MESA, false, false));
public static final Biome mesaPlateau_F = (new BiomeMesa(BaseBiome.MESAPLATEAUF, false, true)).setScaling(Scaling.HILLS_PLATEAU);
public static final Biome mesaPlateau = (new BiomeMesa(BaseBiome.MESAPLATEAU, false, false)).setScaling(Scaling.HILLS_PLATEAU);
public static final Biome snowLand = (new BiomeSnowLand(40)).setColor(0xffffff).setBiomeName("snowLand", "Eisland").enableColdBeach().setHumidity(100.0f);
public static final Biome tian = (new BiomeTian(41)).setColor(0x808080).setBiomeName("tian", "Tian").setHumidity(80.0f).setScaling(Scaling.VARYING_MEDIUM);
public static final Biome elvenForest = (new BiomeForest(42, 4)).setColor(0x059821).setBiomeName("elvenForest", "Elbenwald").setHumidity(90.0f);
public static final Biome upperHell = (new BiomeHell(43, 0)).setColor(16711680).setBiomeName("upperHell", "Übergang in die Hölle").setHumidity(0.0f);
public static final Biome lowerHell = (new BiomeHell(44, 1)).setColor(16711680).setBiomeName("lowerHell", "Abgrund der Hölle").setHumidity(0.0f);
public static final Biome hellHills = (new BiomeHell(45, 1)).setColor(16711680).setBiomeName("hellHills", "Bergland der Hölle").setHumidity(0.0f).setScaling(Scaling.HILLS_LARGE);
public static final Biome soulPlains = (new BiomeHell(46, 1)).setColor(16711680).setBiomeName("soulPlains", "Seelenland").setHumidity(0.0f).setScaling(Scaling.SEA_POND);
public static final Biome ashLand = (new BiomeHell(47, 2)).setColor(16711680).setBiomeName("ashLand", "Verbrannt").setHumidity(0.0f).setScaling(Scaling.PLAINS_LOW);
public static final Biome moon = (new BiomeMoon(48)).setColor(0xa0a0a0).setBiomeName("moon", "Mondoberfläche").setHumidity(0.0f).setScaling(Scaling.PLAINS_LOW);
public static final Biome chaos = (new BiomeChaos(49)).setColor(0xff00ff).setBiomeName("chaos", "Chaos").setHumidity(50.0f).setScaling(Scaling.VARYING_CHAOTIC);
public static final Biome snowLand = (new BiomeSnowLand()).enableColdBeach();
public static final Biome tian = (new BiomeTian()).setScaling(Scaling.VARYING_MEDIUM);
public static final Biome elvenForest = (new BiomeForest(BaseBiome.ELVENFOREST, 4));
public static final Biome upperHell = (new BiomeHell(BaseBiome.UPPERHELL, 0));
public static final Biome lowerHell = (new BiomeHell(BaseBiome.LOWERHELL, 1));
public static final Biome hellHills = (new BiomeHell(BaseBiome.HELLHILLS, 1)).setScaling(Scaling.HILLS_LARGE);
public static final Biome soulPlains = (new BiomeHell(BaseBiome.SOULPLAINS, 1)).setScaling(Scaling.SEA_POND);
public static final Biome ashLand = (new BiomeHell(BaseBiome.ASHLAND, 2)).setScaling(Scaling.PLAINS_LOW);
public static final Biome moon = (new BiomeMoon()).setScaling(Scaling.PLAINS_LOW);
public static final Biome chaos = (new BiomeChaos()).setScaling(Scaling.VARYING_CHAOTIC);
public static final Biome DEF_BIOME = forest;
protected static final PerlinGen TEMP_NOISE;
protected static final PerlinGen TREE_NOISE;
protected static final PerlinGen GRASS_NOISE;
protected static final FeatureDoublePlant DOUBLE_PLANT_GEN;
private static final Map<String, Biome> LOOKUP = Maps.newTreeMap();
private static final List<Biome> LIST = Lists.newArrayList();
public final int id;
public final BaseBiome base;
protected final WeightedList<RngSpawn> mobs = new WeightedList<RngSpawn>();
protected final WorldGenBaseTree worldGeneratorTrees = new WorldGenBaseTree(false);
@ -142,13 +142,6 @@ public abstract class Biome {
private final FeatureGenerator waterlilyGen = new WorldGenWaterlily();
private final FeatureGenerator clayGenExt = new WorldGenClayExt(32);
public String name = null;
public String display = "<?>";
public int color = 0x000000;
protected float temperature = 0.0f;
protected float humidity = 50.0f;
public int waterColor = 0xffffff;
public State topBlock = Blocks.grass.getState();
public State fillerBlock = Blocks.dirt.getState();
public float depth = Scaling.VARYING_LOW.depth;
@ -172,9 +165,30 @@ public abstract class Biome {
protected int clayExtPerChunk = 0; // 10
protected int bigMushroomsPerChunk = 0;
protected Biome(int id) {
this.id = id;
BIOMES[id] = this;
public static Biome getBiome(int id)
{
if (id >= 0 && id < BIOMES.length)
{
return BIOMES[id];
}
else
{
Log.JNI.warn("Biom-ID ist nicht im Bereich: " + id + ", verwende " + BaseBiome.DEF_BIOME.id + " (" + BaseBiome.DEF_BIOME.name + ")");
return BIOMES[BaseBiome.DEF_BIOME.id];
}
}
public static void setAsProvider() {
IBiome.setProvider(new IBiome.BiomeProvider() {
public final IBiome getBiome(BaseBiome base) {
return BIOMES[base.id];
}
});
}
protected Biome(BaseBiome base) {
BIOMES[base.id] = this;
this.base = base;
this.addMobs(this.mobs);
}
@ -196,36 +210,6 @@ public abstract class Biome {
mobs.add(new RngSpawn(EntityMouse.class, 10, 8, 8));
}
public int getSkyColor() {
return 0xffffffff;
}
public int getFogColor() {
return 0xffffffff;
}
public int getCloudColor() {
return 0xffffffff;
}
public float getFactor() {
float f = this.humidity * 0.01f * ((this.temperature + 14.0f) / 40.0f + 0.15f);
return f > 1.0f ? 1.0f : f;
}
// skycolor = ((temp + 14) / 40 + 0.15) / 3
protected Biome setTemperature(float temp)
{
this.temperature = temp;
return this;
}
protected Biome setHumidity(float humidity)
{
this.humidity = humidity;
return this;
}
protected final Biome setScaling(Scaling scaling)
{
return this.setScaling(scaling.depth, scaling.scale);
@ -246,13 +230,10 @@ public abstract class Biome {
public WorldGenTree genBigTreeLegacy(Random rand, BlockPos pos)
{
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)) || (this.isHighHumidity() && rand.chance(3)) ? this.worldGeneratorBigTree :
return (noise > 0 && rand.chance(noise)) || (this.base.isHighHumidity() && rand.chance(3)) ? this.worldGeneratorBigTree :
this.worldGeneratorTrees;
}
/**
* Gets a WorldGen appropriate for this biome.
*/
public FeatureGenerator getRandomWorldGenForGrass(Random rand)
{
return new WorldGenTallGrass(BlockTallGrass.EnumType.GRASS);
@ -263,6 +244,14 @@ public abstract class Biome {
return rand.rarity(3) ? BlockFlower.EnumFlowerType.DANDELION : BlockFlower.EnumFlowerType.ROSE;
}
public State getFiller() {
return this.fillerBlock;
}
public State getTop() {
return this.topBlock;
}
protected Biome enableColdBeach()
{
this.allowColdBeach = true;
@ -275,48 +264,17 @@ public abstract class Biome {
return this;
}
protected Biome setBiomeName(String name, String display)
{
this.name = name;
this.display = display;
return this;
}
protected Biome setColor(int colorIn)
{
this.color = colorIn;
return this;
}
public WeightedList<RngSpawn> getMobs()
{
return this.mobs;
}
public boolean isHighHumidity()
{
return this.humidity > 85.0f;
}
public float getMobGenChance()
{
return 0.1F;
}
public final float getTemperature(BlockPos pos)
{
if (pos.getY() > 64)
{
float f = (float)(TEMP_NOISE.generate((double)pos.getX() * 1.0D / 8.0D, (double)pos.getZ() * 1.0D / 8.0D) * 4.0D);
return this.temperature - (f + (float)pos.getY() - 64.0F) / 15.0f;
}
else
{
return this.temperature;
}
}
public void decorate(AWorldServer world, Random rand, BlockPos pos)
public void decorate(WorldServer world, Random rand, BlockPos pos)
{
for (int i = 0; i < this.sandPerChunk2; ++i)
{
@ -551,21 +509,7 @@ public abstract class Biome {
}
}
public int getGrassColorAtPos(BlockPos pos)
{
double d0 = (double)ExtMath.clampf((this.getTemperature(pos) + 14.0f) / 40.0f + 0.15f, 0.0F, 1.0F);
double d1 = (double)ExtMath.clampf(this.humidity * 0.01f, 0.0F, 1.0F);
return Colorizer.getGrassColor(d0, d1);
}
public int getFoliageColorAtPos(BlockPos pos)
{
double d0 = (double)ExtMath.clampf((this.getTemperature(pos) + 14.0f) / 40.0f + 0.15f, 0.0F, 1.0F);
double d1 = (double)ExtMath.clampf(this.humidity * 0.01f, 0.0F, 1.0F);
return Colorizer.getFoliageColor(d0, d1);
}
public void genTerrainBlocks(AWorldServer worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal)
public void genTerrainBlocks(WorldServer worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal)
{
this.generateBiomeTerrain(worldIn, rand, chunkPrimerIn, x, z, noiseVal);
}
@ -580,7 +524,7 @@ public abstract class Biome {
*
* If this.fillerBlock is red sand, we replace some of that with red sandstone.
*/
public final void generateBiomeTerrain(AWorldServer worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal)
public final void generateBiomeTerrain(WorldServer worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal)
{
int i = worldIn.getSeaLevel();
State worldState = worldIn.dimension.getFiller();
@ -621,7 +565,7 @@ public abstract class Biome {
if (j1 < i && (iblockstate == null || iblockstate.getBlock().getMaterial() == Material.air))
{
if (freeze && World.ABSOLUTE_ZERO + worldIn.getTempOffset() + this.getTemperature(blockpos$mutableblockpos.set(x, j1, z)) <= 0.0F)
if (freeze && World.ABSOLUTE_ZERO + worldIn.getTempOffset() + this.base.getTemperature(blockpos$mutableblockpos.set(x, j1, z)) <= 0.0F)
{
iblockstate = Blocks.ice.getState();
}
@ -663,14 +607,231 @@ public abstract class Biome {
}
}
protected Biome createMutation()
public boolean generateBigMushroom(AWorldServer worldIn, BlockPos pos, State state, Random rand)
{
return this.createMutatedBiome(this.id + 128);
worldIn.setBlockToAir(pos);
FeatureGenerator worldgenerator = null;
if (state.getBlock() == Blocks.brown_mushroom)
{
worldgenerator = new WorldGenBigMushroom(Blocks.brown_mushroom_block);
}
else if (state.getBlock() == Blocks.red_mushroom)
{
worldgenerator = new WorldGenBigMushroom(Blocks.red_mushroom_block);
}
if (worldgenerator != null && worldgenerator.generate((WorldServer)worldIn, rand, pos))
{
return true;
}
else
{
worldIn.setState(pos, state, 3);
return false;
}
}
protected Biome createMutatedBiome(int p_180277_1_)
private boolean isTypeAt(World worldIn, BlockPos pos, WoodType type)
{
return new BiomeMutated(p_180277_1_, this);
State iblockstate = worldIn.getState(pos);
return iblockstate.getBlock() instanceof BlockSapling && ((BlockSapling)iblockstate.getBlock()).getWoodType() == type;
}
private boolean isSameSaplingTypeIn(World worldIn, BlockPos pos, int xOff, int yOff, WoodType type)
{
return this.isTypeAt(worldIn, pos.add(xOff, 0, yOff), type) && this.isTypeAt(worldIn, pos.add(xOff + 1, 0, yOff), type) && this.isTypeAt(worldIn, pos.add(xOff, 0, yOff + 1), type) && this.isTypeAt(worldIn, pos.add(xOff + 1, 0, yOff + 1), type);
}
public void generateTree(AWorldServer worldIn, BlockPos pos, State state, Random rand)
{
WoodType type = state.getBlock() instanceof BlockSapling ? ((BlockSapling)state.getBlock()).getWoodType() : WoodType.OAK;
State log = type == WoodType.CHERRY ? Blocks.cherry_log.getState() : // .withProperty(BlockNewLog.VARIANT, BlockPlanks.EnumType.CHERRY) :
(type == WoodType.MAPLE ? Blocks.maple_log.getState() /* .withProperty(BlockNewLog.VARIANT, BlockPlanks.EnumType.MAPLE) */ : Blocks.oak_log.getState());
State leaves = type == WoodType.CHERRY ? Blocks.cherry_leaves.getState() :
(type == WoodType.MAPLE ? Blocks.maple_leaves.getState() : Blocks.oak_leaves.getState());
FeatureGenerator worldgenerator = (FeatureGenerator)(rand.chance(10) ? new WorldGenBigTree(true, log, leaves) : new WorldGenBaseTree(true, log, leaves));
int i = 0;
int j = 0;
boolean flag = false;
// leaves = leaves.withProperty(BlockLeaves.TYPE, worldIn.getLeavesGen());
switch (type)
{
case SPRUCE:
label114:
for (i = 0; i >= -1; --i)
{
for (j = 0; j >= -1; --j)
{
if (this.isSameSaplingTypeIn(worldIn, pos, i, j, WoodType.SPRUCE))
{
worldgenerator = new WorldGenPine(false, rand.chance());
flag = true;
break label114;
}
}
}
if (!flag)
{
j = 0;
i = 0;
worldgenerator = new WorldGenTaiga2(true);
}
break;
case BIRCH:
worldgenerator = new WorldGenBirch(true, false);
break;
case TIAN:
worldgenerator = new WorldGenBigTree(true, Blocks.tian_log.getState(), Blocks.tian_leaves.getState())
.setHeightLimit(6, 20);
break;
case JUNGLE:
State iblockstate = Blocks.jungle_log.getState(); // .withProperty(BlockOldLog.VARIANT, BlockPlanks.EnumType.JUNGLE);
State iblockstate1 = Blocks.jungle_leaves.getState(); // .withProperty(BlockOldLeaf.VARIANT, BlockPlanks.EnumType.JUNGLE); // .withProperty(BlockLeaves.CHECK_DECAY, Boolean.valueOf(false));
label269:
for (i = 0; i >= -1; --i)
{
for (j = 0; j >= -1; --j)
{
if (this.isSameSaplingTypeIn(worldIn, pos, i, j, WoodType.JUNGLE))
{
worldgenerator = new WorldGenJungle(true, 10, 20, iblockstate, iblockstate1);
flag = true;
break label269;
}
}
}
if (!flag)
{
j = 0;
i = 0;
worldgenerator = new WorldGenBaseTree(true, rand.range(4, 10), iblockstate, iblockstate1, false);
}
break;
case ACACIA:
worldgenerator = new WorldGenSavanna(true);
break;
case DARK_OAK:
label390:
for (i = 0; i >= -1; --i)
{
for (j = 0; j >= -1; --j)
{
if (this.isSameSaplingTypeIn(worldIn, pos, i, j, WoodType.DARK_OAK))
{
worldgenerator = new WorldGenDarkOak(true);
flag = true;
break label390;
}
}
}
if (!flag)
{
return;
}
case OAK:
case CHERRY:
case MAPLE:
}
State iblockstate2 = Blocks.air.getState();
if (flag)
{
worldIn.setState(pos.add(i, 0, j), iblockstate2, 4);
worldIn.setState(pos.add(i + 1, 0, j), iblockstate2, 4);
worldIn.setState(pos.add(i, 0, j + 1), iblockstate2, 4);
worldIn.setState(pos.add(i + 1, 0, j + 1), iblockstate2, 4);
}
else
{
worldIn.setState(pos, iblockstate2, 4);
}
if (!worldgenerator.generate((WorldServer)worldIn, rand, pos.add(i, 0, j)))
{
if (flag)
{
worldIn.setState(pos.add(i, 0, j), state, 4);
worldIn.setState(pos.add(i + 1, 0, j), state, 4);
worldIn.setState(pos.add(i, 0, j + 1), state, 4);
worldIn.setState(pos.add(i + 1, 0, j + 1), state, 4);
}
else
{
worldIn.setState(pos, state, 4);
}
}
}
public void growGrass(AWorldServer worldIn, BlockPos pos, State state, Random rand)
{
BlockPos blockpos = pos.up();
for (int i = 0; i < 128; ++i)
{
BlockPos blockpos1 = blockpos;
int j = 0;
while (true)
{
if (j >= i / 16)
{
if (worldIn.getState(blockpos1).getBlock().getMaterial() == Material.air)
{
if (rand.chance(8))
{
BlockFlower.EnumFlowerType blockflower$enumflowertype = BIOMES[worldIn.getBiomeGenForCoords(blockpos1).id].pickRandomFlower(rand, blockpos1);
BlockFlower blockflower = blockflower$enumflowertype.getBlockType().getBlock();
State iblockstate = blockflower.getState().withProperty(blockflower.getTypeProperty(), blockflower$enumflowertype);
if (blockflower.canBlockStay(worldIn, blockpos1, iblockstate))
{
worldIn.setState(blockpos1, iblockstate, 3);
}
}
else
{
State iblockstate1 = Blocks.tallgrass.getState().withProperty(BlockTallGrass.TYPE, BlockTallGrass.EnumType.GRASS);
if (Blocks.tallgrass.canBlockStay(worldIn, blockpos1, iblockstate1))
{
worldIn.setState(blockpos1, iblockstate1, 3);
}
}
}
break;
}
blockpos1 = blockpos1.add(rand.zrange(3) - 1, (rand.zrange(3) - 1) * rand.zrange(3) / 2, rand.zrange(3) - 1);
if (worldIn.getState(blockpos1.down()).getBlock() != Blocks.grass || worldIn.getState(blockpos1).getBlock().isNormalCube())
{
break;
}
++j;
}
}
}
protected Biome createMutatedBiome(BaseBiome base)
{
return new BiomeMutated(base, this);
}
public Class <? extends Biome > getBiomeClass()
@ -685,88 +846,34 @@ public abstract class Biome {
public Temperature getTempCategory()
{
return this.temperature < -12.0f ? Temperature.COLD : (this.temperature < 20.0f ? Temperature.MEDIUM : Temperature.WARM);
return this.base.temperature < -12.0f ? Temperature.COLD : (this.base.temperature < 20.0f ? Temperature.MEDIUM : Temperature.WARM);
}
public static Biome getBiome(int id)
{
return getBiome(id, null);
}
public static Biome getBiome(int id, Biome def)
{
if (id >= 0 && id < BIOMES.length)
{
Biome biome = BIOMES[id];
return biome == null ? def : biome;
}
else
{
Log.JNI.warn("Biom-ID ist nicht im Bereich: " + id + ", verwende " + DEF_BIOME.id + " (" + DEF_BIOME.name + ")");
return DEF_BIOME;
}
}
public static List<Biome> getBiomes() {
return LIST;
}
public static List<String> getBiomeNames() {
return Lists.newArrayList(LOOKUP.keySet());
}
public static Biome findByName(String name) {
Biome biome = LOOKUP.get(name.toLowerCase().replace(" ", "").replace("_", ""));
if(biome == null) {
int z;
try {
z = Integer.parseInt(name);
}
catch(NumberFormatException e) {
return null;
}
return z < 0 || z >= BIOMES.length ? null : BIOMES[z];
}
return biome;
}
static
{
// plains.createMutation();
desert.createMutation();
forest.createMutation();
taiga.createMutation();
swampland.createMutation();
icePlains.createMutation();
jungle.createMutation();
jungleEdge.createMutation();
coldTaiga.createMutation();
savanna.createMutation();
savannaPlateau.createMutation();
mesa.createMutation();
mesaPlateau_F.createMutation();
mesaPlateau.createMutation();
birchForest.createMutation();
birchForestHills.createMutation();
roofedForest.createMutation();
megaTaiga.createMutation();
extremeHills.createMutation();
extremeHillsPlus.createMutation();
megaTaiga.createMutatedBiome(megaTaigaHills.id + 128).setBiomeName("redwoodTaigaHillsM", "Mammutbaumtaiga");
desert.createMutatedBiome(BaseBiome.DESERTM);
forest.createMutatedBiome(BaseBiome.FLOWERFOREST);
taiga.createMutatedBiome(BaseBiome.TAIGAM);
swampland.createMutatedBiome(BaseBiome.SWAMPLANDM);
icePlains.createMutatedBiome(BaseBiome.ICEPLAINSSPIKES);
jungle.createMutatedBiome(BaseBiome.JUNGLEM);
jungleEdge.createMutatedBiome(BaseBiome.JUNGLEEDGEM);
coldTaiga.createMutatedBiome(BaseBiome.COLDTAIGAM);
savanna.createMutatedBiome(BaseBiome.SAVANNAM);
savannaPlateau.createMutatedBiome(BaseBiome.SAVANNAPLATEAUM);
mesa.createMutatedBiome(BaseBiome.MESABRYCE);
mesaPlateau_F.createMutatedBiome(BaseBiome.MESAPLATEAUFM);
mesaPlateau.createMutatedBiome(BaseBiome.MESAPLATEAUM);
birchForest.createMutatedBiome(BaseBiome.BIRCHFORESTM);
birchForestHills.createMutatedBiome(BaseBiome.BIRCHFORESTHILLSM);
roofedForest.createMutatedBiome(BaseBiome.ROOFEDFORESTM);
megaTaiga.createMutatedBiome(BaseBiome.MEGASPRUCETAIGA);
extremeHills.createMutatedBiome(BaseBiome.EXTREMEHILLSM);
extremeHillsPlus.createMutatedBiome(BaseBiome.EXTREMEHILLSPLUSM);
megaTaiga.createMutatedBiome(BaseBiome.REDWOODTAIGAHILLSM);
TEMP_NOISE = new PerlinGen(new Random(1234L), 1);
TREE_NOISE = new PerlinGen(new Random(667L), 8);
GRASS_NOISE = new PerlinGen(new Random(2345L), 1);
DOUBLE_PLANT_GEN = new FeatureDoublePlant();
for(Biome biome : BIOMES) {
if(biome == null)
continue;
if(LOOKUP.containsKey(biome.name.toLowerCase()))
throw new IllegalStateException("Biom \"" + biome.name + "\" ist als ID " + LOOKUP.get(biome.name.toLowerCase()).id + " und " + biome.id + " definiert");
LOOKUP.put(biome.name.toLowerCase(), biome);
LIST.add(biome);
System.out.printf("%s(%d, \"%s\", \"%s\", 0x%06x, %.1ff, %.1ff),\n", biome.name.toUpperCase(), biome.id, biome.name, biome.display, biome.color, biome.temperature, biome.humidity);
}
}
}

View file

@ -1,13 +1,14 @@
package common.biome;
package server.biome;
import common.biome.BaseBiome;
import common.init.Blocks;
import common.rng.WeightedList;
public class BiomeBeach extends Biome
{
public BiomeBeach(int id)
public BiomeBeach(boolean cold)
{
super(id);
super(cold ? BaseBiome.COLDBEACH : BaseBiome.BEACH);
this.topBlock = Blocks.sand.getState();
this.fillerBlock = Blocks.sand.getState();
this.treesPerChunk = -999;

View file

@ -1,19 +1,20 @@
package common.biome;
package server.biome;
import common.biome.BaseBiome;
import common.block.BlockFlower;
import common.entity.npc.EntityMetalhead;
import common.init.Blocks;
import common.rng.Random;
import common.rng.WeightedList;
import common.util.BlockPos;
import common.worldgen.tree.WorldGenBaseTree;
import common.worldgen.tree.WorldGenTree;
import server.worldgen.tree.WorldGenBaseTree;
import server.worldgen.tree.WorldGenTree;
public class BiomeBlackened extends Biome {
protected final WorldGenTree treeGen = new WorldGenBaseTree(false, Blocks.blackwood_log.getState(), Blocks.blackwood_leaves.getState());
public BiomeBlackened(int id) {
super(id);
public BiomeBlackened() {
super(BaseBiome.BLACKENED);
this.topBlock = Blocks.blackened_soil.getState();
this.fillerBlock = Blocks.blackened_dirt.getState();
this.treesPerChunk = 3;

View file

@ -1,5 +1,6 @@
package common.biome;
package server.biome;
import common.biome.BaseBiome;
import common.entity.Entity;
import common.entity.types.EntityLiving;
import common.init.Blocks;
@ -7,17 +8,17 @@ import common.init.EntityRegistry;
import common.rng.Random;
import common.rng.WeightedList;
import common.util.BlockPos;
import common.world.AWorldServer;
import common.worldgen.FeatureGenerator;
import common.worldgen.foliage.WorldGenMushroom;
import server.world.WorldServer;
import server.worldgen.FeatureGenerator;
import server.worldgen.foliage.WorldGenMushroom;
public class BiomeChaos extends Biome
{
protected FeatureGenerator mushroomBlueGen = new WorldGenMushroom(Blocks.blue_mushroom);
public BiomeChaos(int id)
public BiomeChaos()
{
super(id);
super(BaseBiome.CHAOS);
this.topBlock = Blocks.obsidian.getState();
this.fillerBlock = Blocks.obsidian.getState();
}
@ -29,7 +30,7 @@ public class BiomeChaos extends Biome
}
}
public void decorate(AWorldServer worldIn, Random rand, BlockPos pos)
public void decorate(WorldServer worldIn, Random rand, BlockPos pos)
{
super.decorate(worldIn, rand, pos);

View file

@ -1,17 +1,18 @@
package common.biome;
package server.biome;
import common.biome.BaseBiome;
import common.init.Blocks;
import common.rng.Random;
import common.rng.WeightedList;
import common.util.BlockPos;
import common.world.AWorldServer;
import common.worldgen.feature.WorldGenDesertWells;
import server.world.WorldServer;
import server.worldgen.feature.WorldGenDesertWells;
public class BiomeDesert extends Biome
{
public BiomeDesert(int id)
public BiomeDesert(boolean hills)
{
super(id);
super(hills ? BaseBiome.DESERTHILLS : BaseBiome.DESERT);
this.topBlock = Blocks.sand.getState();
this.fillerBlock = Blocks.sand.getState();
this.treesPerChunk = -999;
@ -24,7 +25,7 @@ public class BiomeDesert extends Biome
protected void addMobs(WeightedList<RngSpawn> mobs) {
}
public void decorate(AWorldServer worldIn, Random rand, BlockPos pos)
public void decorate(WorldServer worldIn, Random rand, BlockPos pos)
{
super.decorate(worldIn, rand, pos);

View file

@ -0,0 +1,22 @@
package server.biome;
import common.biome.BaseBiome;
import common.init.Blocks;
import common.rng.Random;
import common.rng.WeightedList;
import common.util.BlockPos;
import server.world.WorldServer;
public class BiomeExterminated extends Biome {
public BiomeExterminated() {
super(BaseBiome.EXTERMINATED);
this.topBlock = Blocks.air.getState();
this.fillerBlock = Blocks.air.getState();
}
protected void addMobs(WeightedList<RngSpawn> mobs) {
}
public void decorate(WorldServer worldIn, Random rand, BlockPos pos) {
}
}

View file

@ -1,8 +1,8 @@
package common.biome;
package server.biome;
import common.biome.BaseBiome;
import common.block.BlockDoublePlant;
import common.block.BlockFlower;
import common.color.Colorizer;
import common.entity.animal.EntityWolf;
import common.entity.npc.EntityElf;
import common.entity.npc.EntityWoodElf;
@ -10,13 +10,13 @@ import common.init.Blocks;
import common.rng.Random;
import common.util.BlockPos;
import common.util.ExtMath;
import common.world.AWorldServer;
import common.worldgen.foliage.WorldGenBigMushroom;
import common.worldgen.tree.WorldGenBaseTree;
import common.worldgen.tree.WorldGenBigTree;
import common.worldgen.tree.WorldGenBirch;
import common.worldgen.tree.WorldGenDarkOak;
import common.worldgen.tree.WorldGenTree;
import server.world.WorldServer;
import server.worldgen.foliage.WorldGenBigMushroom;
import server.worldgen.tree.WorldGenBaseTree;
import server.worldgen.tree.WorldGenBigTree;
import server.worldgen.tree.WorldGenBirch;
import server.worldgen.tree.WorldGenDarkOak;
import server.worldgen.tree.WorldGenTree;
public class BiomeForest extends Biome
{
@ -42,9 +42,9 @@ public class BiomeForest extends Biome
protected WorldGenBigTree mapleBig = new WorldGenBigTree(false, Blocks.maple_log.getState(), // .withProperty(BlockNewLog.VARIANT, BlockPlanks.EnumType.MAPLE),
Blocks.maple_leaves.getState()); // .withProperty(BlockLeaves.TYPE, worldIn.getLeavesGen()));
public BiomeForest(int id, int type)
public BiomeForest(BaseBiome base, int type)
{
super(id);
super(base);
this.subType = type;
this.treesPerChunk = 10;
this.grassPerChunk = 2;
@ -65,14 +65,6 @@ public class BiomeForest extends Biome
this.waterlilyPerChunk = 4;
}
this.setTemperature(8.0f).setHumidity(80.0f);
if (this.subType == 2)
{
this.setColor(3175492);
this.setTemperature(4.0f).setHumidity(60.0f);
}
if (this.subType == 0)
{
this.mobs.add(new RngSpawn(EntityWolf.class, 5, 4, 4));
@ -120,7 +112,7 @@ public class BiomeForest extends Biome
}
}
public void decorate(AWorldServer worldIn, Random rand, BlockPos pos)
public void decorate(WorldServer worldIn, Random rand, BlockPos pos)
{
// if(worldIn.getLeavesGen() != this.leavesType) {
// this.leavesType = worldIn.getLeavesGen();
@ -203,37 +195,23 @@ public class BiomeForest extends Biome
super.decorate(worldIn, rand, pos);
}
public int getGrassColorAtPos(BlockPos pos)
protected Biome createMutatedBiome(BaseBiome base)
{
return this.subType == 4 ? Colorizer.getGrassColor(1.0f, this.humidity * 0.01f) :
(this.subType == 3 ? (super.getGrassColorAtPos(pos) & 16711422) + 2634762 >> 1 :
super.getGrassColorAtPos(pos));
}
public int getFoliageColorAtPos(BlockPos pos)
{
return this.subType == 4 ? Colorizer.getFoliageColor(1.0f, this.humidity * 0.01f) : super.getFoliageColorAtPos(pos);
}
protected Biome createMutatedBiome(final int id)
{
if (this.id == Biome.forest.id)
if (this.base == BaseBiome.FOREST)
{
BiomeForest biomegenforest = new BiomeForest(id, 1);
BiomeForest biomegenforest = new BiomeForest(base, 1);
biomegenforest.setScaling(this.depth, this.scale + 0.2F);
biomegenforest.setBiomeName("flowerForest", "Blumenwald");
biomegenforest.setColor(6976549);
return biomegenforest;
}
else
{
return this.id != Biome.birchForest.id && this.id != Biome.birchForestHills.id ? new BiomeMutated(id, this)
return this.base != BaseBiome.BIRCHFOREST && this.base != BaseBiome.BIRCHFORESTHILLS ? new BiomeMutated(base, this)
{
public void decorate(AWorldServer worldIn, Random rand, BlockPos pos)
public void decorate(WorldServer worldIn, Random rand, BlockPos pos)
{
this.baseBiome.decorate(worldIn, rand, pos);
}
}: new BiomeMutated(id, this)
}: new BiomeMutated(base, this)
{
public WorldGenTree genBigTreeChance(Random rand)
{

View file

@ -1,5 +1,6 @@
package common.biome;
package server.biome;
import common.biome.BaseBiome;
import common.entity.npc.EntityBloodElf;
import common.entity.npc.EntityCultivator;
import common.entity.npc.EntityFireDemon;
@ -10,12 +11,12 @@ import common.init.Blocks;
import common.rng.Random;
import common.rng.WeightedList;
import common.util.BlockPos;
import common.world.AWorldServer;
import common.worldgen.FeatureOres;
import common.worldgen.feature.WorldGenFire;
import common.worldgen.feature.WorldGenGlowStone;
import common.worldgen.feature.WorldGenHellLava;
import common.worldgen.foliage.WorldGenMushroom;
import server.world.WorldServer;
import server.worldgen.FeatureOres;
import server.worldgen.feature.WorldGenFire;
import server.worldgen.feature.WorldGenGlowStone;
import server.worldgen.feature.WorldGenHellLava;
import server.worldgen.foliage.WorldGenMushroom;
public class BiomeHell extends Biome
{
@ -29,9 +30,9 @@ public class BiomeHell extends Biome
private final WorldGenMushroom brownMushroomGen;
private final WorldGenMushroom redMushroomGen;
public BiomeHell(int id, int subtype)
public BiomeHell(BaseBiome base, int subtype)
{
super(id);
super(base);
this.subtype = subtype;
if(this.subtype == 0) {
this.mobs.add(new RngSpawn(EntityBloodElf.class, 10, 1, 2));
@ -73,7 +74,7 @@ public class BiomeHell extends Biome
mobs.add(new RngSpawn(EntityMagma.class, 1, 4, 4));
}
public void decorate(AWorldServer worldIn, Random rand, BlockPos pos)
public void decorate(WorldServer worldIn, Random rand, BlockPos pos)
{
if(this.subtype == 0) {
for (int i = 0; i < 8; ++i)
@ -125,14 +126,4 @@ public class BiomeHell extends Biome
// {
// return this.subtype == 0 ? new DecoratorHell() : super.createBiomeDecorator();
// }
public int getGrassColorAtPos(BlockPos pos)
{
return 0;
}
public int getFoliageColorAtPos(BlockPos pos)
{
return 0;
}
}

View file

@ -1,13 +1,14 @@
package common.biome;
package server.biome;
import common.biome.BaseBiome;
import common.init.Blocks;
import common.rng.Random;
import common.util.BlockPos;
import common.world.AWorldServer;
import common.worldgen.ChunkPrimer;
import common.worldgen.FeatureOres;
import common.worldgen.tree.WorldGenTaiga2;
import common.worldgen.tree.WorldGenTree;
import server.world.WorldServer;
import server.worldgen.ChunkPrimer;
import server.worldgen.FeatureOres;
import server.worldgen.tree.WorldGenTaiga2;
import server.worldgen.tree.WorldGenTree;
public class BiomeHills extends Biome
{
@ -19,12 +20,12 @@ public class BiomeHills extends Biome
private int field_150637_aG = 2;
private int field_150638_aH;
protected BiomeHills(int id, boolean p_i45373_2_)
protected BiomeHills(BaseBiome base, boolean large)
{
super(id);
super(base);
this.field_150638_aH = this.field_150635_aE;
if (p_i45373_2_)
if (large)
{
this.treesPerChunk = 3;
this.field_150638_aH = this.field_150636_aF;
@ -36,7 +37,7 @@ public class BiomeHills extends Biome
return (WorldGenTree)(rand.rarity(3) ? this.field_150634_aD : super.genBigTreeChance(rand));
}
public void decorate(AWorldServer worldIn, Random rand, BlockPos pos)
public void decorate(WorldServer worldIn, Random rand, BlockPos pos)
{
super.decorate(worldIn, rand, pos);
// int i = 3 + rand.nextInt(6);
@ -64,7 +65,7 @@ public class BiomeHills extends Biome
// }
}
public void genTerrainBlocks(AWorldServer worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal)
public void genTerrainBlocks(WorldServer worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal)
{
this.topBlock = Blocks.grass.getState();
this.fillerBlock = Blocks.dirt.getState();
@ -89,16 +90,12 @@ public class BiomeHills extends Biome
private BiomeHills mutateHills(Biome p_150633_1_)
{
this.field_150638_aH = this.field_150637_aG;
this.setColor(p_150633_1_.color);
this.setBiomeName(p_150633_1_.name + "M", p_150633_1_.display + " M");
this.setScaling(p_150633_1_.depth, p_150633_1_.scale);
this.setTemperature(p_150633_1_.temperature);
this.setHumidity(p_150633_1_.humidity);
return this;
}
protected Biome createMutatedBiome(int p_180277_1_)
protected Biome createMutatedBiome(BaseBiome base)
{
return (new BiomeHills(p_180277_1_, false)).mutateHills(this);
return (new BiomeHills(base, false)).mutateHills(this);
}
}

View file

@ -1,5 +1,6 @@
package common.biome;
package server.biome;
import common.biome.BaseBiome;
import common.block.BlockTallGrass;
import common.entity.animal.EntityChicken;
import common.entity.animal.EntityOcelot;
@ -7,15 +8,15 @@ import common.init.Blocks;
import common.rng.Random;
import common.util.BlockPos;
import common.world.State;
import common.world.AWorldServer;
import common.worldgen.FeatureGenerator;
import common.worldgen.foliage.WorldGenMelon;
import common.worldgen.foliage.WorldGenShrub;
import common.worldgen.foliage.WorldGenTallGrass;
import common.worldgen.foliage.WorldGenVines;
import common.worldgen.tree.WorldGenBaseTree;
import common.worldgen.tree.WorldGenJungle;
import common.worldgen.tree.WorldGenTree;
import server.world.WorldServer;
import server.worldgen.FeatureGenerator;
import server.worldgen.foliage.WorldGenMelon;
import server.worldgen.foliage.WorldGenShrub;
import server.worldgen.foliage.WorldGenTallGrass;
import server.worldgen.foliage.WorldGenVines;
import server.worldgen.tree.WorldGenBaseTree;
import server.worldgen.tree.WorldGenJungle;
import server.worldgen.tree.WorldGenTree;
public class BiomeJungle extends Biome
{
@ -25,9 +26,9 @@ public class BiomeJungle extends Biome
private final boolean edge;
public BiomeJungle(int id, boolean edge)
public BiomeJungle(BaseBiome base, boolean edge)
{
super(id);
super(base);
this.edge = edge;
if (edge)
@ -63,7 +64,7 @@ public class BiomeJungle extends Biome
return rand.chance(4) ? new WorldGenTallGrass(BlockTallGrass.EnumType.FERN) : new WorldGenTallGrass(BlockTallGrass.EnumType.GRASS);
}
public void decorate(AWorldServer worldIn, Random rand, BlockPos pos)
public void decorate(WorldServer worldIn, Random rand, BlockPos pos)
{
super.decorate(worldIn, rand, pos);
int i = rand.chOffset();

View file

@ -1,7 +1,8 @@
package common.biome;
package server.biome;
import java.util.Arrays;
import common.biome.BaseBiome;
import common.block.Block;
import common.block.BlockColored;
import common.block.BlockDirt;
@ -14,9 +15,9 @@ import common.rng.Random;
import common.rng.WeightedList;
import common.util.BlockPos;
import common.world.State;
import common.world.AWorldServer;
import common.worldgen.ChunkPrimer;
import common.worldgen.tree.WorldGenTree;
import server.world.WorldServer;
import server.worldgen.ChunkPrimer;
import server.worldgen.tree.WorldGenTree;
public class BiomeMesa extends Biome
{
@ -29,14 +30,13 @@ public class BiomeMesa extends Biome
private PerlinGen highBryceGen;
private PerlinGen clayColorGen;
public BiomeMesa(int id, boolean bryce, boolean soil)
public BiomeMesa(BaseBiome base, boolean bryce, boolean soil)
{
super(id);
super(base);
this.bryce = bryce;
this.soil = soil;
// this.setDisableRain();
// this.setTemperatureLegacy(2.0F).setHumidity(0.0F);
this.setHumidity(0.0f);
// this.mobs.clear();
this.topBlock = Blocks.sand.getState().withProperty(BlockSand.VARIANT, BlockSand.EnumType.RED_SAND);
this.fillerBlock = Blocks.stained_hardened_clay.getState();
@ -61,22 +61,12 @@ public class BiomeMesa extends Biome
return this.worldGeneratorTrees;
}
public int getFoliageColorAtPos(BlockPos pos)
{
return 10387789;
}
public int getGrassColorAtPos(BlockPos pos)
{
return 9470285;
}
public void decorate(AWorldServer worldIn, Random rand, BlockPos pos)
public void decorate(WorldServer worldIn, Random rand, BlockPos pos)
{
super.decorate(worldIn, rand, pos);
}
public void genTerrainBlocks(AWorldServer worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal)
public void genTerrainBlocks(WorldServer worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal)
{
if (this.layers == null || this.layerSeed != worldIn.getSeed())
{
@ -327,22 +317,16 @@ public class BiomeMesa extends Biome
return this.layers[(y + i + 64) % 64];
}
protected Biome createMutatedBiome(int id)
protected Biome createMutatedBiome(BaseBiome base)
{
boolean bryce = this.id == Biome.mesa.id;
BiomeMesa mesa = new BiomeMesa(id, bryce, this.soil);
boolean bryce = this.base == BaseBiome.MESA;
BiomeMesa mesa = new BiomeMesa(base, bryce, this.soil);
if (!bryce)
{
mesa.setScaling(Scaling.HILLS_LOW);
mesa.setBiomeName(this.name + "M", this.display + " M");
}
else
{
mesa.setBiomeName(this.name + "Bryce", this.display + " (Bryce)");
}
mesa.setColor(this.color);
return mesa;
}
}

View file

@ -1,17 +1,18 @@
package common.biome;
package server.biome;
import common.biome.BaseBiome;
import common.init.Blocks;
import common.rng.Random;
import common.rng.WeightedList;
import common.util.BlockPos;
import common.world.AWorldServer;
import common.worldgen.FeatureOres;
import server.world.WorldServer;
import server.worldgen.FeatureOres;
public class BiomeMoon extends Biome {
private FeatureOres cheeseGenerator = new FeatureOres(Blocks.moon_cheese.getState(), 8, 8, 12, 24, 52, false);
public BiomeMoon(int id) {
super(id);
public BiomeMoon() {
super(BaseBiome.MOON);
this.topBlock = Blocks.moon_rock.getState();
this.fillerBlock = Blocks.moon_rock.getState();
}
@ -19,7 +20,7 @@ public class BiomeMoon extends Biome {
protected void addMobs(WeightedList<RngSpawn> mobs) {
}
public void decorate(AWorldServer worldIn, Random rand, BlockPos pos) {
public void decorate(WorldServer worldIn, Random rand, BlockPos pos) {
this.cheeseGenerator.generate(worldIn, rand, pos);
}
}

View file

@ -1,14 +1,15 @@
package common.biome;
package server.biome;
import common.biome.BaseBiome;
import common.entity.animal.EntityMooshroom;
import common.init.Blocks;
import common.rng.WeightedList;
public class BiomeMushroom extends Biome
{
public BiomeMushroom(int id)
public BiomeMushroom()
{
super(id);
super(BaseBiome.MUSHROOMPLAINS);
this.treesPerChunk = -100;
this.flowersPerChunk = -100;
this.grassPerChunk = -100;

View file

@ -1,30 +1,25 @@
package common.biome;
package server.biome;
import common.biome.BaseBiome;
import common.rng.Random;
import common.rng.WeightedList;
import common.util.BlockPos;
import common.world.AWorldServer;
import common.worldgen.ChunkPrimer;
import common.worldgen.tree.WorldGenTree;
import server.world.WorldServer;
import server.worldgen.ChunkPrimer;
import server.worldgen.tree.WorldGenTree;
public class BiomeMutated extends Biome
{
protected Biome baseBiome;
public BiomeMutated(int id, Biome biome)
public BiomeMutated(BaseBiome base, Biome biome)
{
super(id);
super(base);
this.baseBiome = biome;
this.setColor(biome.color);
this.name = biome.name + "M";
this.display = biome.display + " M";
this.topBlock = biome.topBlock;
this.fillerBlock = biome.fillerBlock;
// this.minHeight = biome.minHeight;
// this.maxHeight = biome.maxHeight;
this.temperature = biome.temperature;
this.humidity = biome.humidity;
this.waterColor = biome.waterColor;
this.allowColdBeach = biome.allowColdBeach;
// this.enableRain = biome.enableRain;
// this.mobs.clear();
@ -43,17 +38,17 @@ public class BiomeMutated extends Biome
protected void addMobs(WeightedList<RngSpawn> mobs) {
}
public void decorate(AWorldServer worldIn, Random rand, BlockPos pos)
public void decorate(WorldServer worldIn, Random rand, BlockPos pos)
{
this.baseBiome.decorate(worldIn, rand, pos); // TODO: check
}
public void decorateNormal(AWorldServer worldIn, Random rand, BlockPos pos)
public void decorateNormal(WorldServer worldIn, Random rand, BlockPos pos)
{
super.decorate(worldIn, rand, pos);
}
public void genTerrainBlocks(AWorldServer worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal)
public void genTerrainBlocks(WorldServer worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal)
{
this.baseBiome.genTerrainBlocks(worldIn, rand, chunkPrimerIn, x, z, noiseVal);
}
@ -68,16 +63,6 @@ public class BiomeMutated extends Biome
return this.baseBiome.genBigTreeChance(rand);
}
public int getFoliageColorAtPos(BlockPos pos)
{
return this.baseBiome.getFoliageColorAtPos(pos);
}
public int getGrassColorAtPos(BlockPos pos)
{
return this.baseBiome.getGrassColorAtPos(pos);
}
public Class <? extends Biome > getBiomeClass()
{
return this.baseBiome.getBiomeClass();

View file

@ -1,15 +1,16 @@
package common.biome;
package server.biome;
import common.biome.BaseBiome;
import common.init.Blocks;
import common.rng.Random;
import common.rng.WeightedList;
import common.util.BlockPos;
import common.world.AWorldServer;
import common.worldgen.ChunkPrimer;
import server.world.WorldServer;
import server.worldgen.ChunkPrimer;
public class BiomeNone extends Biome {
public BiomeNone(int id) {
super(id);
public BiomeNone() {
super(BaseBiome.NONE);
this.topBlock = Blocks.air.getState();
this.fillerBlock = Blocks.air.getState();
}
@ -17,10 +18,10 @@ public class BiomeNone extends Biome {
protected void addMobs(WeightedList<RngSpawn> mobs) {
}
public void genTerrainBlocks(AWorldServer worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal) {
public void genTerrainBlocks(WorldServer worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal) {
}
public void decorate(AWorldServer worldIn, Random rand, BlockPos pos) {
public void decorate(WorldServer worldIn, Random rand, BlockPos pos) {
}
public Temperature getTempCategory() {

View file

@ -1,11 +1,12 @@
package common.biome;
package server.biome;
import common.biome.BaseBiome;
import common.block.BlockDoublePlant;
import common.block.BlockFlower;
import common.entity.animal.EntityHorse;
import common.rng.Random;
import common.util.BlockPos;
import common.world.AWorldServer;
import server.world.WorldServer;
public class BiomePlains extends Biome
{
@ -20,10 +21,9 @@ public class BiomePlains extends Biome
// protected boolean field_150628_aC;
protected BiomePlains(int id)
protected BiomePlains()
{
super(id);
this.setTemperature(12.0f).setHumidity(40.0f);
super(BaseBiome.PLAINS);
this.setScaling(Scaling.PLAINS_LOW);
this.mobs.add(new RngSpawn(EntityHorse.class, 5, 2, 6));
this.treesPerChunk = -999;
@ -68,7 +68,7 @@ public class BiomePlains extends Biome
}
}
public void decorate(AWorldServer worldIn, Random rand, BlockPos pos)
public void decorate(WorldServer worldIn, Random rand, BlockPos pos)
{
double d0 = GRASS_NOISE.generate((double)(pos.getX() + 8) / 200.0D, (double)(pos.getZ() + 8) / 200.0D);

View file

@ -1,23 +1,24 @@
package common.biome;
package server.biome;
import common.biome.BaseBiome;
import common.block.BlockDirt;
import common.block.BlockDoublePlant;
import common.entity.animal.EntityHorse;
import common.init.Blocks;
import common.rng.Random;
import common.util.BlockPos;
import common.world.AWorldServer;
import common.worldgen.ChunkPrimer;
import common.worldgen.tree.WorldGenSavanna;
import common.worldgen.tree.WorldGenTree;
import server.world.WorldServer;
import server.worldgen.ChunkPrimer;
import server.worldgen.tree.WorldGenSavanna;
import server.worldgen.tree.WorldGenTree;
public class BiomeSavanna extends Biome
{
private static final WorldGenSavanna field_150627_aC = new WorldGenSavanna(false);
protected BiomeSavanna(int id)
protected BiomeSavanna(boolean plateau)
{
super(id);
super(plateau ? BaseBiome.SAVANNAPLATEAU : BaseBiome.SAVANNA);
this.mobs.add(new RngSpawn(EntityHorse.class, 1, 2, 6));
this.treesPerChunk = 1;
this.flowersPerChunk = 4;
@ -29,16 +30,15 @@ public class BiomeSavanna extends Biome
return (WorldGenTree)(rand.rarity(5) ? field_150627_aC : this.worldGeneratorTrees);
}
protected Biome createMutatedBiome(int p_180277_1_)
protected Biome createMutatedBiome(BaseBiome base)
{
Biome biomegenbase = new BiomeSavanna.Mutated(p_180277_1_, this);
biomegenbase.temperature = this.temperature == 28.0f ? 24.0f : 20.0f;
Biome biomegenbase = new BiomeSavanna.Mutated(base, this);
biomegenbase.depth = this.depth * 0.5F + 0.3F;
biomegenbase.scale = this.scale * 0.5F + 1.2F;
return biomegenbase;
}
public void decorate(AWorldServer worldIn, Random rand, BlockPos pos)
public void decorate(WorldServer worldIn, Random rand, BlockPos pos)
{
DOUBLE_PLANT_GEN.setPlantType(BlockDoublePlant.EnumPlantType.GRASS);
@ -55,15 +55,15 @@ public class BiomeSavanna extends Biome
public static class Mutated extends BiomeMutated
{
public Mutated(int p_i45382_1_, Biome p_i45382_2_)
public Mutated(BaseBiome base, Biome p_i45382_2_)
{
super(p_i45382_1_, p_i45382_2_);
super(base, p_i45382_2_);
this.treesPerChunk = 2;
this.flowersPerChunk = 2;
this.grassPerChunk = 5;
}
public void genTerrainBlocks(AWorldServer worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal)
public void genTerrainBlocks(WorldServer worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal)
{
this.topBlock = Blocks.grass.getState();
this.fillerBlock = Blocks.dirt.getState();
@ -81,7 +81,7 @@ public class BiomeSavanna extends Biome
this.generateBiomeTerrain(worldIn, rand, chunkPrimerIn, x, z, noiseVal);
}
public void decorate(AWorldServer worldIn, Random rand, BlockPos pos)
public void decorate(WorldServer worldIn, Random rand, BlockPos pos)
{
this.decorateNormal(worldIn, rand, pos);
}

View file

@ -1,14 +1,15 @@
package common.biome;
package server.biome;
import common.biome.BaseBiome;
import common.init.Blocks;
import common.rng.Random;
import common.rng.WeightedList;
import common.util.BlockPos;
import common.world.AWorldServer;
import common.worldgen.feature.WorldGenIcePath;
import common.worldgen.feature.WorldGenIceSpike;
import common.worldgen.tree.WorldGenTaiga2;
import common.worldgen.tree.WorldGenTree;
import server.world.WorldServer;
import server.worldgen.feature.WorldGenIcePath;
import server.worldgen.feature.WorldGenIceSpike;
import server.worldgen.tree.WorldGenTaiga2;
import server.worldgen.tree.WorldGenTree;
public class BiomeSnow extends Biome
{
@ -16,9 +17,9 @@ public class BiomeSnow extends Biome
private final WorldGenIcePath pathGen = new WorldGenIcePath(4);
private final boolean spiky;
public BiomeSnow(int id, boolean spiky)
public BiomeSnow(BaseBiome base, boolean spiky)
{
super(id);
super(base);
this.spiky = spiky;
if(spiky)
this.topBlock = Blocks.snow.getState();
@ -27,7 +28,7 @@ public class BiomeSnow extends Biome
protected void addMobs(WeightedList<RngSpawn> mobs) {
}
public void decorate(AWorldServer worldIn, Random rand, BlockPos pos)
public void decorate(WorldServer worldIn, Random rand, BlockPos pos)
{
if (this.spiky)
{
@ -54,9 +55,9 @@ public class BiomeSnow extends Biome
return new WorldGenTaiga2(false);
}
protected Biome createMutatedBiome(int p_180277_1_)
protected Biome createMutatedBiome(BaseBiome base)
{
Biome biomegenbase = (new BiomeSnow(p_180277_1_, true)).setColor(13828095).setBiomeName(this.name + "Spikes", this.display + " + Spitzen").enableColdBeach().setTemperature(-20.0f).setHumidity(50.0f).setScaling(this.depth + 0.1F, this.scale + 0.1F);
Biome biomegenbase = (new BiomeSnow(base, true)).enableColdBeach().setScaling(this.depth + 0.1F, this.scale + 0.1F);
biomegenbase.depth = this.depth + 0.3F;
biomegenbase.scale = this.scale + 0.4F;
return biomegenbase;

View file

@ -1,5 +1,6 @@
package common.biome;
package server.biome;
import common.biome.BaseBiome;
import common.entity.animal.EntitySheep;
import common.entity.npc.EntitySpirit;
import common.init.Blocks;
@ -7,9 +8,9 @@ import common.rng.WeightedList;
public class BiomeSnowLand extends Biome
{
public BiomeSnowLand(int id)
public BiomeSnowLand()
{
super(id);
super(BaseBiome.SNOWLAND);
this.topBlock = Blocks.snow.getState();
this.fillerBlock = Blocks.snow.getState();
this.mushroomsPerChunk = -1;

View file

@ -1,13 +1,14 @@
package common.biome;
package server.biome;
import common.biome.BaseBiome;
import common.block.BlockDirt;
import common.init.Blocks;
import common.rng.Random;
import common.rng.WeightedList;
import common.util.BlockPos;
import common.world.AWorldServer;
import common.worldgen.FeatureGenerator;
import common.worldgen.feature.WorldGenAsteroid;
import server.world.WorldServer;
import server.worldgen.FeatureGenerator;
import server.worldgen.feature.WorldGenAsteroid;
public class BiomeSpace extends Biome
{
@ -16,9 +17,9 @@ public class BiomeSpace extends Biome
protected FeatureGenerator asteroidGen2 = new WorldGenAsteroid(Blocks.dirt.getState(),
Blocks.dirt.getState().withProperty(BlockDirt.VARIANT, BlockDirt.DirtType.COARSE_DIRT));
public BiomeSpace(int id)
public BiomeSpace()
{
super(id);
super(BaseBiome.SPACE);
this.topBlock = Blocks.air.getState();
this.fillerBlock = Blocks.air.getState();
}
@ -26,7 +27,7 @@ public class BiomeSpace extends Biome
protected void addMobs(WeightedList<RngSpawn> mobs) {
}
public void decorate(AWorldServer worldIn, Random rand, BlockPos pos)
public void decorate(WorldServer worldIn, Random rand, BlockPos pos)
{
if(rand.chance(5)) {
int x = rand.chOffset();

View file

@ -1,13 +1,14 @@
package common.biome;
package server.biome;
import common.biome.BaseBiome;
import common.init.Blocks;
import common.rng.WeightedList;
public class BiomeStoneBeach extends Biome
{
public BiomeStoneBeach(int id)
public BiomeStoneBeach()
{
super(id);
super(BaseBiome.STONEBEACH);
// this.mobs.clear();
this.topBlock = Blocks.stone.getState();
this.fillerBlock = Blocks.stone.getState();

View file

@ -1,5 +1,6 @@
package common.biome;
package server.biome;
import common.biome.BaseBiome;
import common.block.BlockDirectional;
import common.block.BlockFlower;
import common.entity.npc.EntitySlime;
@ -8,15 +9,15 @@ import common.material.Material;
import common.rng.Random;
import common.util.BlockPos;
import common.util.Facing;
import common.world.AWorldServer;
import common.worldgen.ChunkPrimer;
import common.worldgen.tree.WorldGenTree;
import server.world.WorldServer;
import server.worldgen.ChunkPrimer;
import server.worldgen.tree.WorldGenTree;
public class BiomeSwamp extends Biome
{
protected BiomeSwamp(int id)
protected BiomeSwamp()
{
super(id);
super(BaseBiome.SWAMPLAND);
this.treesPerChunk = 2;
this.flowersPerChunk = 1;
this.deadBushPerChunk = 1;
@ -27,7 +28,6 @@ public class BiomeSwamp extends Biome
this.sandPerChunk2 = 0;
this.sandPerChunk = 0;
this.grassPerChunk = 5;
this.waterColor = 0xe0ffae;
this.mobs.add(new RngSpawn(EntitySlime.class, 1, 1, 1));
this.disableBeach();
}
@ -37,23 +37,12 @@ public class BiomeSwamp extends Biome
return this.worldGeneratorSwamp;
}
public int getGrassColorAtPos(BlockPos pos)
{
double d0 = GRASS_NOISE.generate((double)pos.getX() * 0.0225D, (double)pos.getZ() * 0.0225D);
return d0 < -0.1D ? 5011004 : 6975545;
}
public int getFoliageColorAtPos(BlockPos pos)
{
return 6975545;
}
public BlockFlower.EnumFlowerType pickRandomFlower(Random rand, BlockPos pos)
{
return BlockFlower.EnumFlowerType.BLUE_ORCHID;
}
public void genTerrainBlocks(AWorldServer worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal)
public void genTerrainBlocks(WorldServer worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal)
{
double d0 = GRASS_NOISE.generate((double)x * 0.25D, (double)z * 0.25D);

View file

@ -1,5 +1,6 @@
package common.biome;
package server.biome;
import common.biome.BaseBiome;
import common.block.BlockDirt;
import common.block.BlockDoublePlant;
import common.block.BlockTallGrass;
@ -7,15 +8,15 @@ import common.entity.animal.EntityWolf;
import common.init.Blocks;
import common.rng.Random;
import common.util.BlockPos;
import common.world.AWorldServer;
import common.worldgen.ChunkPrimer;
import common.worldgen.FeatureGenerator;
import common.worldgen.feature.WorldGenBlockBlob;
import common.worldgen.foliage.WorldGenTallGrass;
import common.worldgen.tree.WorldGenPine;
import common.worldgen.tree.WorldGenTaiga1;
import common.worldgen.tree.WorldGenTaiga2;
import common.worldgen.tree.WorldGenTree;
import server.world.WorldServer;
import server.worldgen.ChunkPrimer;
import server.worldgen.FeatureGenerator;
import server.worldgen.feature.WorldGenBlockBlob;
import server.worldgen.foliage.WorldGenTallGrass;
import server.worldgen.tree.WorldGenPine;
import server.worldgen.tree.WorldGenTaiga1;
import server.worldgen.tree.WorldGenTaiga2;
import server.worldgen.tree.WorldGenTree;
public class BiomeTaiga extends Biome
{
@ -26,9 +27,9 @@ public class BiomeTaiga extends Biome
private static final WorldGenBlockBlob field_150643_aG = new WorldGenBlockBlob(Blocks.mossy_cobblestone, 0);
private int field_150644_aH;
public BiomeTaiga(int id, int p_i45385_2_)
public BiomeTaiga(BaseBiome base, int p_i45385_2_)
{
super(id);
super(base);
this.field_150644_aH = p_i45385_2_;
this.mobs.add(new RngSpawn(EntityWolf.class, 8, 4, 4));
this.treesPerChunk = 10;
@ -59,7 +60,7 @@ public class BiomeTaiga extends Biome
return rand.rarity(5) ? new WorldGenTallGrass(BlockTallGrass.EnumType.FERN) : new WorldGenTallGrass(BlockTallGrass.EnumType.GRASS);
}
public void decorate(AWorldServer worldIn, Random rand, BlockPos pos)
public void decorate(WorldServer worldIn, Random rand, BlockPos pos)
{
if (this.field_150644_aH == 1 || this.field_150644_aH == 2)
{
@ -87,7 +88,7 @@ public class BiomeTaiga extends Biome
super.decorate(worldIn, rand, pos);
}
public void genTerrainBlocks(AWorldServer worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal)
public void genTerrainBlocks(WorldServer worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal)
{
if (this.field_150644_aH == 1 || this.field_150644_aH == 2)
{
@ -107,8 +108,8 @@ public class BiomeTaiga extends Biome
this.generateBiomeTerrain(worldIn, rand, chunkPrimerIn, x, z, noiseVal);
}
protected Biome createMutatedBiome(int p_180277_1_)
protected Biome createMutatedBiome(BaseBiome base)
{
return this.id == Biome.megaTaiga.id ? (new BiomeTaiga(p_180277_1_, 2)).setColor(5858897).setBiomeName("megaSpruceTaiga", "Hohe Fichtentaiga").setTemperature(-10.0f).setHumidity(80.0f).setScaling(this.depth, this.scale) : super.createMutatedBiome(p_180277_1_);
return this.base == BaseBiome.MEGATAIGA ? (new BiomeTaiga(base, 2)).setScaling(this.depth, this.scale) : super.createMutatedBiome(base);
}
}

View file

@ -1,5 +1,6 @@
package common.biome;
package server.biome;
import common.biome.BaseBiome;
import common.block.BlockFlower;
import common.entity.animal.EntityBat;
import common.entity.animal.EntityMouse;
@ -9,13 +10,13 @@ import common.init.Blocks;
import common.rng.Random;
import common.rng.WeightedList;
import common.util.BlockPos;
import common.world.AWorldServer;
import common.worldgen.FeatureGenerator;
import common.worldgen.feature.WorldGenSpikes;
import common.worldgen.foliage.WorldGenMushroom;
import common.worldgen.tree.WorldGenBaseTree;
import common.worldgen.tree.WorldGenBigTree;
import common.worldgen.tree.WorldGenTree;
import server.world.WorldServer;
import server.worldgen.FeatureGenerator;
import server.worldgen.feature.WorldGenSpikes;
import server.worldgen.foliage.WorldGenMushroom;
import server.worldgen.tree.WorldGenBaseTree;
import server.worldgen.tree.WorldGenBigTree;
import server.worldgen.tree.WorldGenTree;
public class BiomeTian extends Biome
{
@ -29,9 +30,9 @@ public class BiomeTian extends Biome
protected WorldGenTree treeGen4 = new WorldGenBigTree(false, Blocks.tian_log.getState(), Blocks.tian_leaves.getState())
.setHeightLimit(12, 15);
public BiomeTian(int id)
public BiomeTian()
{
super(id);
super(BaseBiome.TIAN);
this.topBlock = Blocks.tian_soil.getState();
this.fillerBlock = Blocks.tian.getState();
this.mushroomsPerChunk = -1;
@ -57,7 +58,7 @@ public class BiomeTian extends Biome
return rand.pick(rand.chance(this.treeGen2, this.treeGen1, 4), rand.chance(this.treeGen3, this.treeGen4, 15));
}
public void decorate(AWorldServer worldIn, Random rand, BlockPos pos)
public void decorate(WorldServer worldIn, Random rand, BlockPos pos)
{
super.decorate(worldIn, rand, pos);

View file

@ -1,13 +1,14 @@
package common.biome;
package server.biome;
import common.biome.BaseBiome;
import common.entity.animal.EntitySquid;
import common.rng.WeightedList;
public class BiomeWater extends Biome {
private final boolean river;
public BiomeWater(int id, boolean river) {
super(id);
public BiomeWater(BaseBiome base, boolean river) {
super(base);
this.river = river;
this.disableBeach();
}

View file

@ -1,4 +1,4 @@
package common.biome;
package server.biome;
import common.entity.types.EntityLiving;
import common.rng.RngItem;

View file

@ -1,4 +1,4 @@
package common.biome;
package server.biome;
public enum Scaling {
VARYING_LOW(0.1F, 0.2F),

View file

@ -1,4 +1,4 @@
package common.biome;
package server.biome;
public enum Temperature {
SEA, COLD, MEDIUM, WARM;

View file

@ -841,17 +841,17 @@ public class Player extends NetHandler implements ICrafting, Executor, IPlayer
public void onCriticalHit(Entity entityHit)
{
this.entity.getServerWorld().sendToAllTrackingAndSelf(this.entity, new SPacketAnimation(entityHit, 4));
this.getEntityWorld().sendToAllTrackingAndSelf(this.entity, new SPacketAnimation(entityHit, 4));
}
public void onEnchantmentCritical(Entity entityHit)
{
this.entity.getServerWorld().sendToAllTrackingAndSelf(this.entity, new SPacketAnimation(entityHit, 5));
this.getEntityWorld().sendToAllTrackingAndSelf(this.entity, new SPacketAnimation(entityHit, 5));
}
public void updateEffectMeta()
{
this.entity.getServerWorld().updateTrackedPlayer(this.entity);
this.getEntityWorld().updateTrackedPlayer(this.entity);
}
public void playSound(SoundEvent name, float volume)
@ -990,7 +990,7 @@ public class Player extends NetHandler implements ICrafting, Executor, IPlayer
for (Chunk chunk1 : list)
{
this.entity.getServerWorld().updateChunksForPlayer(this.entity, chunk1);
this.getEntityWorld().updateChunksForPlayer(this.entity, chunk1);
}
}
}
@ -1367,7 +1367,7 @@ public class Player extends NetHandler implements ICrafting, Executor, IPlayer
int ny = this.clipboard[0].length;
int nz = this.clipboard[0][0].length;
BlockPos to = this.entity.getPosition();
ClipboardPlacer placer = new ClipboardPlacer((WorldServer)this.entity.getServerWorld());
ClipboardPlacer placer = new ClipboardPlacer(this.getEntityWorld());
BlockTransform transform = null;
if(this.rotation != 0 || this.flipX || this.flipZ) {
transform = new BlockTransform();
@ -2125,7 +2125,7 @@ public class Player extends NetHandler implements ICrafting, Executor, IPlayer
this.entity.vehicle.updateRiderPosition();
}
this.entity.getServerWorld().updateMountedMovingPlayer(this.entity);
this.getEntityWorld().updateMountedMovingPlayer(this.entity);
if (this.entity.vehicle != null)
{
@ -2278,7 +2278,7 @@ public class Player extends NetHandler implements ICrafting, Executor, IPlayer
// }
this.entity.onGround = packetIn.isOnGround();
this.entity.getServerWorld().updateMountedMovingPlayer(this.entity);
this.getEntityWorld().updateMountedMovingPlayer(this.entity);
this.handleFalling(this.entity.posY - d7, packetIn.isOnGround());
}
else if (this.tickTime - this.lastMoved > 20)

View file

@ -15,7 +15,7 @@ import java.util.Map.Entry;
import java.util.zip.GZIPInputStream;
import java.util.zip.InflaterInputStream;
import common.biome.Biome;
import common.biome.BaseBiome;
import common.block.Block;
import common.block.BlockCactus;
import common.block.BlockCarpet;
@ -916,7 +916,7 @@ public abstract class Converter {
}
tag.setTag("Sections", sections);
byte[] biomes = new byte[256];
Arrays.fill(biomes, (byte)(Biome.DEF_BIOME.id & 255));
Arrays.fill(biomes, (byte)(BaseBiome.DEF_BIOME.id & 255));
tag.setByteArray("Biomes", biomes);
}
NBTTagList ents = tag.getTagList("Entities", 10);

View file

@ -2,8 +2,6 @@ package server.world;
import java.util.Set;
import common.biome.Biome;
import common.biome.RngSpawn;
import common.block.Block;
import common.collect.Sets;
import common.entity.npc.EntityNPC;
@ -18,6 +16,8 @@ import common.util.ChunkPos;
import common.util.ExtMath;
import common.world.Chunk;
import common.world.World;
import server.biome.Biome;
import server.biome.RngSpawn;
public abstract class Spawner {
private static final int MOB_COUNT_DIV = (int)Math.pow(17.0D, 2.0D);

View file

@ -13,8 +13,7 @@ import java.util.TreeSet;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Predicate;
import common.biome.Biome;
import common.biome.RngSpawn;
import common.biome.BaseBiome;
import common.block.Block;
import common.block.BlockDoor;
import common.block.BlockEventData;
@ -81,25 +80,41 @@ import common.world.LightType;
import common.world.State;
import common.world.Weather;
import common.world.World;
import common.worldgen.BiomeGenSingle;
import common.worldgen.BiomeGenerator;
import common.worldgen.BlockReplacer;
import common.worldgen.ChunkGenerator;
import common.worldgen.ChunkPrimer;
import common.worldgen.FeatureDungeons;
import common.worldgen.FeatureLakes;
import common.worldgen.FeatureLiquids;
import common.worldgen.FeatureOres;
import common.worldgen.GeneratorDebug;
import common.worldgen.GeneratorDestroyed;
import common.worldgen.LootConstants;
import common.worldgen.caves.MapGenBigCaves;
import common.worldgen.caves.MapGenCaves;
import common.worldgen.caves.MapGenRavine;
import common.worldgen.FeatureLake;
import common.worldgen.FeatureLiquid;
import common.worldgen.FeatureOre;
import server.Server;
import server.biome.Biome;
import server.biome.RngSpawn;
import server.clipboard.ClipboardBlock;
import server.network.Player;
import server.village.VillageCollection;
import server.worldgen.BiomeGenLayered;
import server.worldgen.BiomeGenPerlin;
import server.worldgen.BiomeGenSingle;
import server.worldgen.BlockReplacer;
import server.worldgen.ChunkGenerator;
import server.worldgen.ChunkPrimer;
import server.worldgen.FeatureDungeons;
import server.worldgen.FeatureLakes;
import server.worldgen.FeatureLiquids;
import server.worldgen.FeatureOres;
import server.worldgen.GeneratorCavern;
import server.worldgen.GeneratorDebug;
import server.worldgen.GeneratorDestroyed;
import server.worldgen.GeneratorFlat;
import server.worldgen.GeneratorIsland;
import server.worldgen.GeneratorPerlin;
import server.worldgen.GeneratorSimple;
import server.worldgen.MobConstants;
import server.worldgen.ReplacerAltBiome;
import server.worldgen.ReplacerAltSurface;
import server.worldgen.ReplacerBiome;
import server.worldgen.ReplacerTopLayer;
import server.worldgen.caves.MapGenBigCaves;
import server.worldgen.caves.MapGenCaves;
import server.worldgen.caves.MapGenRavine;
import server.worldgen.structure.MapGenBridge;
import server.worldgen.structure.MapGenMineshaft;
import server.worldgen.structure.MapGenScatteredFeature;
@ -131,7 +146,7 @@ public final class WorldServer extends AWorldServer {
private final IntHashMap<EntityTrackerEntry> trackMap = new IntHashMap();
private final Map<String, WorldSavedData> dataMap = Maps.<String, WorldSavedData>newHashMap();
private final List<WorldSavedData> dataList = Lists.<WorldSavedData>newArrayList();
private final Biome[] biomes = new Biome[256];
private final BaseBiome[] biomes = new BaseBiome[256];
private MapGenCaves caveGen;
private MapGenBigCaves bigCaveGen;
@ -176,6 +191,105 @@ public final class WorldServer extends AWorldServer {
return ExtMath.clampf(Config.gravity, -10.0f, 10.0f);
}
private BiomeGenerator createBiomeGenerator(Random rand) {
return this.dimension.getBiomeSize() > 0 ? new BiomeGenLayered(rand.longv(), this.dimension.getDefaultBiome(), this.dimension.isSemiFixed(), this.dimension.getBiomeSize(), this.dimension.getRiverSize(),
this.dimension.getSnowRarity(), this.dimension.getSeaRarity(), this.dimension.getAddBiomes() == null ? new BaseBiome[0] : this.dimension.getAddBiomes(), this.dimension.getAddRarity(),
this.dimension.getHotBiomes() == null ? new BaseBiome[] {this.dimension.getDefaultBiome()} : this.dimension.getHotBiomes(),
this.dimension.getMediumBiomes() == null ? new BaseBiome[] {this.dimension.getDefaultBiome()} : this.dimension.getMediumBiomes(),
this.dimension.getColdBiomes() == null ? new BaseBiome[] {this.dimension.getDefaultBiome()} : this.dimension.getColdBiomes(),
this.dimension.getFrostBiomes() == null ? new BaseBiome[] {this.dimension.getDefaultBiome()} : this.dimension.getFrostBiomes()) : new BiomeGenSingle(this.dimension.getDefaultBiome());
}
private ChunkGenerator createChunkGenerator(Random rand) {
switch(this.dimension.getGeneratorType()) {
case FLAT:
return this.dimension.getLayers() == null ? new GeneratorFlat(this.dimension.getSeaLevel(), this.dimension.getFiller()) : new GeneratorFlat(this.dimension.getLayers());
case PERLIN:
default:
return new GeneratorPerlin(rand, this.dimension.getFiller(), this.dimension.getLiquid(), this.dimension.getNoiseGen());
case SIMPLE:
return new GeneratorSimple(rand, this.dimension.getFiller(), this.dimension.getLiquid(),
this.dimension.getBiomeSize() > 0 ? null : new BiomeGenPerlin(rand.longv()));
case ISLAND:
return new GeneratorIsland(rand, this.dimension.getFiller());
case CAVERN:
return new GeneratorCavern(rand, this.dimension.getFiller(), this.dimension.getLiquid());
case DESTROYED:
return new GeneratorDestroyed(this.dimension.getSeaLevel());
}
}
private BlockReplacer createBlockReplacer(Random rand) {
switch(this.dimension.getReplacerType()) {
case BIOMES:
default:
return new ReplacerBiome(rand);
case SIMPLE:
return new ReplacerAltBiome(rand, this.dimension.getFiller(), this.dimension.getLiquid(), this.dimension.getAlt2(), this.dimension.getAlt1());
case ALTERNATE:
return new ReplacerAltSurface(rand, this.dimension.getFiller(), this.dimension.getAlt1(), this.dimension.getAlt2(), this.dimension.getLiquid());
case TOPLAYER:
return new ReplacerTopLayer(this.dimension.getSurface(), this.dimension.getFiller().getBlock());
case NONE:
return null;
}
}
private FeatureDungeons createDungeonGenerator() {
return this.dimension.getDungeons() > 0 ? new FeatureDungeons(this.dimension.getDungeons()) : null;
}
private MapGenCaves createCaveGenerator() {
return this.dimension.hasCaves() ?
(new MapGenCaves(this.dimension.getCaveFiller(), this.dimension.getFiller().getBlock(), this.dimension.getTop().getBlock(),
this.dimension.getSurface().getBlock(), this.dimension.getAlt1().getBlock())) : null;
}
private MapGenRavine createRavineGenerator() {
return this.dimension.hasRavines() ?
(new MapGenRavine(this.dimension.getCaveFiller(), this.dimension.getFiller().getBlock(),
this.dimension.getTop().getBlock(), this.dimension.getSurface().getBlock())) : null;
}
private MapGenBigCaves createBigCaveGenerator() {
return this.dimension.hasStrideCaves() ?
(new MapGenBigCaves(this.dimension.getFiller().getBlock(),
this.dimension.getTop().getBlock(), this.dimension.getSurface().getBlock())) : null;
}
private FeatureOres[] createOres() {
if(this.dimension.getOres().isEmpty())
return null;
FeatureOres[] gens = new FeatureOres[this.dimension.getOres().size()];
for(int z = 0; z < gens.length; z++) {
FeatureOre gen = this.dimension.getOres().get(z);
gens[z] = new FeatureOres(gen.state, gen.count, gen.more, gen.size, gen.min, gen.max, gen.dist);
}
return gens;
}
private FeatureLakes[] createLakes() {
if(this.dimension.getLakes().isEmpty())
return null;
FeatureLakes[] gens = new FeatureLakes[this.dimension.getLakes().size()];
for(int z = 0; z < gens.length; z++) {
FeatureLake gen = this.dimension.getLakes().get(z);
gens[z] = new FeatureLakes(gen.state, gen.filler, gen.top, gen.chance, gen.minHeight, gen.maxHeight, gen.ratiod);
}
return gens;
}
private FeatureLiquids[] createLiquids() {
if(this.dimension.getLiquids().isEmpty())
return null;
FeatureLiquids[] gens = new FeatureLiquids[this.dimension.getLiquids().size()];
for(int z = 0; z < gens.length; z++) {
FeatureLiquid gen = this.dimension.getLiquids().get(z);
gens[z] = new FeatureLiquids(gen.state, gen.chance, gen.minHeight, gen.maxHeight, gen.lower);
}
return gens;
}
public WorldServer(Server server, long dtime, Dimension dim, boolean debug) {
super(dim, debug);
this.server = server;
@ -220,7 +334,7 @@ public final class WorldServer extends AWorldServer {
// GeneratorSettings settings = !debug && !this.exterminated ? dim.getSettings() : null;
if(debug) {
this.liquid = Blocks.air.getState();
this.biomeGen = new BiomeGenSingle(Biome.none);
this.biomeGen = new BiomeGenSingle(BaseBiome.NONE);
this.generator = new GeneratorDebug();
this.replacer = null;
this.populate = false;
@ -301,13 +415,13 @@ public final class WorldServer extends AWorldServer {
// }
else {
this.liquid = this.dimension.getLiquid();
this.biomeGen = this.dimension.createBiomeGenerator(this.grng);
this.generator = this.dimension.createChunkGenerator(this.grng);
this.replacer = this.dimension.createBlockReplacer(this.grng);
this.biomeGen = this.createBiomeGenerator(this.grng);
this.generator = this.createChunkGenerator(this.grng);
this.replacer = this.createBlockReplacer(this.grng);
this.populate = this.dimension.hasPopulator();
this.caveGen = this.dimension.createCaveGenerator();
this.bigCaveGen = this.dimension.createBigCaveGenerator();
this.ravineGen = this.dimension.createRavineGenerator();
this.caveGen = this.createCaveGenerator();
this.bigCaveGen = this.createBigCaveGenerator();
this.ravineGen = this.createRavineGenerator();
this.base = this.dimension.getWorldFloor();
this.ceil = this.dimension.getWorldCeiling();
this.mobs = this.dimension.hasMobs();
@ -318,10 +432,10 @@ public final class WorldServer extends AWorldServer {
this.scatteredGen = this.dimension.hasScattered() ? new MapGenScatteredFeature() : null;
this.bridgeGen = this.dimension.hasFortresses() ? new MapGenBridge() : null;
this.seaLevel = this.dimension.getSeaLevel();
this.ores = this.dimension.getOres();
this.lakes = this.dimension.getLakes();
this.liquids = this.dimension.getLiquids();
this.dungeons = this.dimension.createDungeonGenerator();
this.ores = this.createOres();
this.lakes = this.createLakes();
this.liquids = this.createLiquids();
this.dungeons = this.createDungeonGenerator();
}
this.height = this.generator.getMaximumHeight();
// this.teleporter = new Teleporter(this);
@ -482,13 +596,13 @@ public final class WorldServer extends AWorldServer {
}
private WeightedList<RngSpawn> getSpawnTypes(BlockPos pos) {
Biome biome = this.getBiomeGenForCoords(pos);
BaseBiome biome = this.getBiomeGenForCoords(pos);
if(this.bridgeGen != null && (this.bridgeGen.isPresent(pos)
|| (this.bridgeGen.isPositionInStructure(this, pos) && this.getState(pos.down()).getBlock() == Blocks.blood_brick)))
return LootConstants.FORTRESS_MOBS;
return MobConstants.FORTRESS_MOBS;
else if(this.scatteredGen != null && this.scatteredGen.hasMageHut(pos))
return LootConstants.MAGEHUT_MOBS;
return biome.getMobs();
return MobConstants.MAGEHUT_MOBS;
return Biome.BIOMES[biome.id].getMobs();
}
public RngSpawn getSpawnListEntryForTypeAt(BlockPos pos) {
@ -509,11 +623,11 @@ public final class WorldServer extends AWorldServer {
return this.biomeGen;
}
public Biome getBiomeGenForCoords(final BlockPos pos) {
public BaseBiome getBiomeGenForCoords(final BlockPos pos) {
if(this.isBlockLoaded(pos))
return this.getChunk(pos).getBiome(pos, this.biomeGen);
else
return this.biomeGen.getBiomeGenerator(pos, Biome.DEF_BIOME);
return this.biomeGen.getBiomeGenerator(pos, BaseBiome.DEF_BIOME);
}
public void setItemData(String dataID, WorldSavedData worldSavedDataIn) {
@ -1423,7 +1537,7 @@ public final class WorldServer extends AWorldServer {
int bx = x * 16;
int bz = z * 16;
BlockPos pos = new BlockPos(bx, 0, bz);
Biome biome = this.getBiomeGenForCoords(pos.add(16, 0, 16));
Biome biome = Biome.BIOMES[this.getBiomeGenForCoords(pos.add(16, 0, 16)).id];
this.grng.setSeed(this.seed);
long sx = this.grng.longv() / 2L * 2L + 1L;
long sz = this.grng.longv() / 2L * 2L + 1L;
@ -1521,7 +1635,7 @@ public final class WorldServer extends AWorldServer {
if(this.scatteredGen != null) {
this.scatteredGen.generate(this, x, z, primer);
}
return new Chunk(this, primer, this.base, this.ceil, this.grng, this.biomes, x, z);
return new Chunk(this, primer.getData(), primer.height, this.base, this.ceil, this.grng, this.biomes, x, z);
}
public boolean isExterminated() {
@ -1627,7 +1741,7 @@ public final class WorldServer extends AWorldServer {
this.scatteredGen = null;
this.bridgeGen = null;
this.generator = new GeneratorDestroyed(this.dimension.getSeaLevel());
this.biomeGen = new BiomeGenSingle(Biome.exterminated);
this.biomeGen = new BiomeGenSingle(BaseBiome.EXTERMINATED);
this.replacer = null;
this.populate = false;
this.liquid = Blocks.air.getState();
@ -2131,7 +2245,7 @@ public final class WorldServer extends AWorldServer {
// return new LazyBlock(state, this, position);
// }
public final boolean setBiome(BlockPos position, Biome biome) {
public final boolean setBiome(BlockPos position, BaseBiome biome) {
Chunk chunk = this.getChunk(position);
if((chunk != null) && (chunk.isLoaded())) {
chunk.getBiomes()[((position.getZ() & 0xF) << 4 | position.getX() & 0xF)] = (byte)biome.id;
@ -2140,7 +2254,7 @@ public final class WorldServer extends AWorldServer {
return false;
}
public final void setBiomes(BlockPos start, BlockPos end, Biome biome) {
public final void setBiomes(BlockPos start, BlockPos end, BaseBiome biome) {
Set<ChunkPos> chunks = Sets.newHashSet();
for(int x = start.getX(); x <= end.getX(); x++) {
for(int z = start.getZ(); z <= end.getZ(); z++) {
@ -2185,7 +2299,7 @@ public final class WorldServer extends AWorldServer {
}
public boolean isBlockinHighHumidity(BlockPos pos) {
Biome biomegenbase = this.getBiomeGenForCoords(pos);
BaseBiome biomegenbase = this.getBiomeGenForCoords(pos);
return biomegenbase.isHighHumidity();
}

View file

@ -1,38 +1,39 @@
package common.worldgen;
package server.worldgen;
import java.util.List;
import java.util.Set;
import common.biome.Biome;
import common.biome.BaseBiome;
import common.collect.Lists;
import common.util.BlockPos;
import common.util.LongHashMap;
import common.worldgen.layer.GenLayer;
import common.worldgen.layer.GenLayerAddAreas;
import common.worldgen.layer.GenLayerAddExtra;
import common.worldgen.layer.GenLayerAddSea;
import common.worldgen.layer.GenLayerAddSnow;
import common.worldgen.layer.GenLayerBase;
import common.worldgen.layer.GenLayerBiome;
import common.worldgen.layer.GenLayerBiomeEdge;
import common.worldgen.layer.GenLayerEdge;
import common.worldgen.layer.GenLayerFuzzyZoom;
import common.worldgen.layer.GenLayerHills;
import common.worldgen.layer.GenLayerRemoveEmpty;
import common.worldgen.layer.GenLayerRiver;
import common.worldgen.layer.GenLayerRiverInit;
import common.worldgen.layer.GenLayerRiverMix;
import common.worldgen.layer.GenLayerShore;
import common.worldgen.layer.GenLayerSmooth;
import common.worldgen.layer.GenLayerVoronoiZoom;
import common.worldgen.layer.GenLayerZoom;
import common.worldgen.layer.IntCache;
import common.worldgen.BiomeGenerator;
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.GenLayerBiomeEdge;
import server.worldgen.layer.GenLayerEdge;
import server.worldgen.layer.GenLayerFuzzyZoom;
import server.worldgen.layer.GenLayerHills;
import server.worldgen.layer.GenLayerRemoveEmpty;
import server.worldgen.layer.GenLayerRiver;
import server.worldgen.layer.GenLayerRiverInit;
import server.worldgen.layer.GenLayerRiverMix;
import server.worldgen.layer.GenLayerShore;
import server.worldgen.layer.GenLayerSmooth;
import server.worldgen.layer.GenLayerVoronoiZoom;
import server.worldgen.layer.GenLayerZoom;
import server.worldgen.layer.IntCache;
public class BiomeGenLayered implements BiomeGenerator {
private class CacheBlock
{
public final double[] factors = new double[256];
public final Biome[] biomes = new Biome[256];
public final BaseBiome[] biomes = new BaseBiome[256];
public int xPosition;
public int zPosition;
public long lastAccessTime;
@ -45,7 +46,7 @@ public class BiomeGenLayered implements BiomeGenerator {
BiomeGenLayered.this.getBiomes(this.biomes, x << 4, z << 4, 16, 16, false);
}
public Biome getBiomeGenAt(int x, int z)
public BaseBiome getBiomeGenAt(int x, int z)
{
return this.biomes[x & 15 | (z & 15) << 4];
}
@ -66,8 +67,8 @@ public class BiomeGenLayered implements BiomeGenerator {
// this();
// }
public BiomeGenLayered(long seed, Biome def, boolean fixed, int biomeSize, int riverSize, int snowRarity, int seaRarity,
Biome[] add, int addRarity, Biome[] hot, Biome[] medium, Biome[] cold, Biome[] frost) {
public BiomeGenLayered(long seed, BaseBiome def, boolean fixed, int biomeSize, int riverSize, int snowRarity, int seaRarity,
BaseBiome[] add, int addRarity, BaseBiome[] hot, BaseBiome[] medium, BaseBiome[] cold, BaseBiome[] frost) {
// GenLayer[] layers = GenLayer.getLayers(seed, fixedBiome, biomeSize, riverSize, snowRarity, seaRarity, shroomRarity, biomeRarity);
GenLayer layer0t1 = new GenLayerBase(1L);
layer0t1 = new GenLayerFuzzyZoom(2000L, layer0t1);
@ -162,10 +163,10 @@ public class BiomeGenLayered implements BiomeGenerator {
}
}
public Biome getBiomeGenerator(BlockPos pos, Biome def) {
public BaseBiome getBiomeGenerator(BlockPos pos, BaseBiome def) {
int x = pos.getX();
int z = pos.getZ();
Biome biome = this.getBiomeCacheBlock(x, z).getBiomeGenAt(x, z);
BaseBiome biome = this.getBiomeCacheBlock(x, z).getBiomeGenAt(x, z);
return biome == null ? def : biome;
}
@ -175,7 +176,7 @@ public class BiomeGenLayered implements BiomeGenerator {
int[] aint = this.biomeIndexLayer.getInts(x, z, width, length);
for(int i = 0; i < width * length; ++i) {
Biome biome = Biome.getBiome(aint[i], Biome.DEF_BIOME);
BaseBiome biome = BaseBiome.getBiomeDef(aint[i]);
listToReuse[i] = (double)biome.getFactor();
}
}
@ -191,43 +192,43 @@ public class BiomeGenLayered implements BiomeGenerator {
int[] aint = this.biomeIndexLayer.getInts(xPos, zPos, sizeX, sizeZ);
for(int i = 0; i < sizeX * sizeZ; ++i) {
Biome biome = Biome.getBiome(aint[i], Biome.DEF_BIOME);
BaseBiome biome = BaseBiome.getBiomeDef(aint[i]);
factors[i] = (double)biome.getFactor();
}
}
}
public void getGenBiomes(Biome[] biomes, int x, int z, int width, int height) {
public void getGenBiomes(BaseBiome[] biomes, int x, int z, int width, int height) {
IntCache.resetIntCache();
int[] aint = this.genBiomes.getInts(x, z, width, height);
for(int i = 0; i < width * height; ++i) {
biomes[i] = Biome.getBiome(aint[i], Biome.DEF_BIOME);
biomes[i] = BaseBiome.getBiomeDef(aint[i]);
}
}
public void getChunkBiomes(Biome[] oldBiomeList, int x, int z, int width, int depth) {
public void getChunkBiomes(BaseBiome[] oldBiomeList, int x, int z, int width, int depth) {
this.getBiomes(oldBiomeList, x, z, width, depth, true);
}
public void getBiomes(Biome[] listToReuse, int x, int z, int width, int length, boolean cache) {
public void getBiomes(BaseBiome[] listToReuse, int x, int z, int width, int length, boolean cache) {
IntCache.resetIntCache();
if(cache && width == 16 && length == 16 && (x & 15) == 0 && (z & 15) == 0) {
Biome[] biomes = this.getBiomeCacheBlock(x, z).biomes;
BaseBiome[] biomes = this.getBiomeCacheBlock(x, z).biomes;
System.arraycopy(biomes, 0, listToReuse, 0, width * length);
}
else {
int[] aint = this.biomeIndexLayer.getInts(x, z, width, length);
for(int i = 0; i < width * length; ++i) {
listToReuse[i] = Biome.getBiome(aint[i], Biome.DEF_BIOME);
listToReuse[i] = BaseBiome.getBiomeDef(aint[i]);
}
}
}
public boolean areBiomesViable(int x, int z, int size, Set<Biome> allowed) {
public boolean areBiomesViable(int x, int z, int size, Set<BaseBiome> allowed) {
IntCache.resetIntCache();
int i = x - size >> 2;
int j = z - size >> 2;
@ -238,7 +239,7 @@ public class BiomeGenLayered implements BiomeGenerator {
int[] aint = this.genBiomes.getInts(i, j, i1, j1);
for(int k1 = 0; k1 < i1 * j1; ++k1) {
Biome biome = Biome.getBiome(aint[k1]);
BaseBiome biome = BaseBiome.getBiome(aint[k1]);
if(!allowed.contains(biome)) {
return false;

View file

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

View file

@ -1,31 +1,32 @@
package common.worldgen;
package server.worldgen;
import java.util.Arrays;
import java.util.Set;
import common.biome.Biome;
import common.biome.BaseBiome;
import common.util.BlockPos;
import common.worldgen.BiomeGenerator;
public class BiomeGenSingle implements BiomeGenerator {
private final Biome biome;
private final BaseBiome biome;
public BiomeGenSingle(Biome biome) {
public BiomeGenSingle(BaseBiome biome) {
this.biome = biome;
}
public Biome getBiomeGenerator(BlockPos pos, Biome def) {
public BaseBiome getBiomeGenerator(BlockPos pos, BaseBiome def) {
return this.biome;
}
public void getGenBiomes(Biome[] biomes, int x, int z, int width, int height) {
public void getGenBiomes(BaseBiome[] biomes, int x, int z, int width, int height) {
Arrays.fill(biomes, 0, width * height, this.biome);
}
public void getChunkBiomes(Biome[] oldBiomeList, int x, int z, int width, int depth) {
public void getChunkBiomes(BaseBiome[] oldBiomeList, int x, int z, int width, int depth) {
Arrays.fill(oldBiomeList, 0, width * depth, this.biome);
}
public void getBiomes(Biome[] listToReuse, int x, int z, int width, int length, boolean cache) {
public void getBiomes(BaseBiome[] listToReuse, int x, int z, int width, int length, boolean cache) {
Arrays.fill(listToReuse, 0, width * length, this.biome);
}
@ -34,7 +35,7 @@ public class BiomeGenSingle implements BiomeGenerator {
// : null;
// }
public boolean areBiomesViable(int x, int z, int size, Set<Biome> allowed) {
public boolean areBiomesViable(int x, int z, int size, Set<BaseBiome> allowed) {
return allowed.contains(this.biome);
}

View file

@ -0,0 +1,9 @@
package server.worldgen;
import common.biome.BaseBiome;
import common.rng.Random;
import server.world.WorldServer;
public interface BlockReplacer {
public void replaceBlocks(WorldServer world, int x, int z, ChunkPrimer primer, Random rand, BaseBiome[] biomes);
}

View file

@ -0,0 +1,8 @@
package server.worldgen;
import server.world.WorldServer;
public interface ChunkGenerator {
public void generateChunk(WorldServer world, int x, int z, ChunkPrimer primer);
public int getMaximumHeight();
}

View file

@ -1,4 +1,4 @@
package common.worldgen;
package server.worldgen;
import common.init.BlockRegistry;
import common.init.Blocks;
@ -13,6 +13,10 @@ public class ChunkPrimer {
this.height = height;
}
public short[] getData() {
return this.data;
}
public State get(int x, int y, int z) {
State state = BlockRegistry.STATEMAP.getByValue(this.data[x << 4 | z | y << 8]);
return state != null ? state : Blocks.air.getState();

View file

@ -1,4 +1,4 @@
package common.worldgen;
package server.worldgen;
import common.init.Blocks;
import common.init.Items;
@ -12,7 +12,7 @@ import common.tileentity.TileEntityChest;
import common.tileentity.TileEntityMobSpawner;
import common.util.BlockPos;
import common.util.Facing;
import common.world.AWorldServer;
import server.world.WorldServer;
public class FeatureDungeons
{
@ -25,7 +25,7 @@ public class FeatureDungeons
}
public boolean generate(AWorldServer worldIn, Random rand, BlockPos position) {
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()));
@ -33,7 +33,7 @@ public class FeatureDungeons
return flag;
}
private boolean generateDungeon(AWorldServer worldIn, Random rand, BlockPos position)
private boolean generateDungeon(WorldServer worldIn, Random rand, BlockPos position)
{
int i = 3;
int j = rand.zrange(2) + 2;

View file

@ -1,9 +1,9 @@
package common.worldgen;
package server.worldgen;
import common.rng.Random;
import common.util.BlockPos;
import common.world.State;
import common.world.AWorldServer;
import server.world.WorldServer;
public abstract class FeatureGenerator
{
@ -19,9 +19,9 @@ public abstract class FeatureGenerator
this.doBlockNotify = notify;
}
public abstract boolean generate(AWorldServer worldIn, Random rand, BlockPos position);
public abstract boolean generate(WorldServer worldIn, Random rand, BlockPos position);
protected void setBlockAndNotifyAdequately(AWorldServer worldIn, BlockPos pos, State state)
protected void setBlockAndNotifyAdequately(WorldServer worldIn, BlockPos pos, State state)
{
if (this.doBlockNotify)
{

View file

@ -1,6 +1,5 @@
package common.worldgen;
package server.worldgen;
import common.biome.Biome;
import common.block.Block;
import common.init.Blocks;
import common.material.Material;
@ -8,7 +7,8 @@ import common.rng.Random;
import common.util.BlockPos;
import common.world.LightType;
import common.world.State;
import common.world.AWorldServer;
import server.biome.Biome;
import server.world.WorldServer;
public class FeatureLakes
{
@ -47,7 +47,7 @@ public class FeatureLakes
// this(block, block == Blocks.lava ? Blocks.stone.getDefaultState() : null, Blocks.dirt, Blocks.grass.getDefaultState());
// }
public boolean generate(AWorldServer worldIn, Random rand, BlockPos position) {
public boolean generate(WorldServer worldIn, Random rand, BlockPos position) {
if(this.ratiod) {
if(this.chance >= 1 && rand.chance(this.chance)) {
int y = rand.range(this.minHeight, this.maxHeight); // rand.zrange(rand.zrange(248) + 8);
@ -63,7 +63,7 @@ public class FeatureLakes
return false;
}
private boolean generateLake(AWorldServer worldIn, Random rand, BlockPos position)
private boolean generateLake(WorldServer worldIn, Random rand, BlockPos position)
{
for (position = position.add(-8, 0, -8); position.getY() > 5 && worldIn.isAirBlock(position); position = position.down())
{
@ -163,7 +163,7 @@ public class FeatureLakes
if (worldIn.getState(blockpos).getBlock() == replace && worldIn.getLightFor(LightType.SKY, position.add(i2, j4, j3)) > 0)
{
Biome biomegenbase = worldIn.getBiomeGenForCoords(blockpos);
Biome biomegenbase = Biome.BIOMES[worldIn.getBiomeGenForCoords(blockpos).id];
if (biomegenbase.topBlock.getBlock() == Blocks.mycelium)
{

View file

@ -1,11 +1,11 @@
package common.worldgen;
package server.worldgen;
import common.block.Block;
import common.material.Material;
import common.rng.Random;
import common.util.BlockPos;
import common.world.State;
import common.world.AWorldServer;
import server.world.WorldServer;
public class FeatureLiquids
{
@ -40,7 +40,7 @@ public class FeatureLiquids
}
public boolean generate(AWorldServer worldIn, Random rand, BlockPos position) {
public boolean generate(WorldServer worldIn, Random rand, BlockPos position) {
Block replace = worldIn.dimension.getFiller().getBlock();
boolean flag = false;
for(int z = 0; z < this.chance; z++) {
@ -56,7 +56,7 @@ public class FeatureLiquids
return flag;
}
private boolean generateLiquid(AWorldServer worldIn, Random rand, BlockPos position, Block replace)
private boolean generateLiquid(WorldServer worldIn, Random rand, BlockPos position, Block replace)
{
if (worldIn.getState(position.up()).getBlock() != replace)
{

View file

@ -1,11 +1,11 @@
package common.worldgen;
package server.worldgen;
import common.block.Block;
import common.rng.Random;
import common.util.BlockPos;
import common.util.ExtMath;
import common.world.State;
import common.world.AWorldServer;
import server.world.WorldServer;
public class FeatureOres
{
@ -80,7 +80,7 @@ public class FeatureOres
// this.replace = replace;
}
public boolean generate(AWorldServer worldIn, Random rand, BlockPos position) {
public boolean generate(WorldServer worldIn, Random rand, BlockPos position) {
Block replace = /* this.replace != null ? this.replace : */ worldIn.dimension.getFiller().getBlock();
int tries = this.spawnTries == 0 ?
(rand.zrange(this.moreTries) == 0 ? 1 : 0) :
@ -106,7 +106,7 @@ public class FeatureOres
return true;
}
private void generateVein(AWorldServer worldIn, Random rand, BlockPos position, Block replace)
private void generateVein(WorldServer worldIn, Random rand, BlockPos position, Block replace)
{
float f = rand.floatv() * (float)Math.PI;
double d0 = (double)(/* (float)(position.getX() + 8) */ 8.0f + ExtMath.sin(f) * (float)this.numberOfBlocks / 8.0F);

View file

@ -1,10 +1,10 @@
package common.worldgen;
package server.worldgen;
import common.rng.OctaveGen;
import common.rng.Random;
import common.util.ExtMath;
import common.world.State;
import common.world.AWorldServer;
import server.world.WorldServer;
public class GeneratorCavern implements ChunkGenerator
{
@ -43,7 +43,7 @@ public class GeneratorCavern implements ChunkGenerator
return 128;
}
public void generateChunk(AWorldServer world, int x, int z, ChunkPrimer primer)
public void generateChunk(WorldServer world, int x, int z, ChunkPrimer primer)
{
int range = 4;
int lh = world.getSeaLevel() / 2 + 1;

View file

@ -0,0 +1,27 @@
package server.worldgen;
import common.world.State;
import common.worldgen.DebugStates;
import server.world.WorldServer;
public class GeneratorDebug implements ChunkGenerator
{
public int getMaximumHeight() {
return 72;
}
public void generateChunk(WorldServer world, int x, int z, ChunkPrimer primer)
{
for(int bx = 0; bx < 16; ++bx) {
for(int bz = 0; bz < 16; ++bz) {
int sx = x * 16 + bx;
int sz = z * 16 + bz;
// primer.set(bx, 60, bz, Blocks.glass.getDefaultState());
State state = DebugStates.getState(sx, sz);
if(state != null) {
primer.set(bx, 1, bz, state);
}
}
}
}
}

View file

@ -1,9 +1,9 @@
package common.worldgen;
package server.worldgen;
import common.init.Blocks;
import common.rng.Random;
import common.world.State;
import common.world.AWorldServer;
import server.world.WorldServer;
public class GeneratorDestroyed implements ChunkGenerator
{
@ -23,7 +23,7 @@ public class GeneratorDestroyed implements ChunkGenerator
return this.height;
}
public void generateChunk(AWorldServer world, int x, int z, ChunkPrimer primer)
public void generateChunk(WorldServer world, int x, int z, ChunkPrimer primer)
{
for(int by = 0; by < this.height; ++by) {
for(int bx = 0; bx < 16; ++bx) {

View file

@ -1,9 +1,9 @@
package common.worldgen;
package server.worldgen;
import java.util.Arrays;
import common.world.State;
import common.world.AWorldServer;
import server.world.WorldServer;
public class GeneratorFlat implements ChunkGenerator {
private final State[] layers;
@ -37,7 +37,7 @@ public class GeneratorFlat implements ChunkGenerator {
return this.layers.length;
}
public void generateChunk(AWorldServer world, int x, int z, ChunkPrimer primer) {
public void generateChunk(WorldServer world, int x, int z, ChunkPrimer primer) {
for(int by = 0; by < this.layers.length; by++) {
State state = this.layers[by];
for(int bx = 0; bx < 16; bx++) {

View file

@ -1,10 +1,10 @@
package common.worldgen;
package server.worldgen;
import common.rng.OctaveGen;
import common.rng.Random;
import common.util.ExtMath;
import common.world.State;
import common.world.AWorldServer;
import server.world.WorldServer;
public class GeneratorIsland implements ChunkGenerator
{
@ -41,7 +41,7 @@ public class GeneratorIsland implements ChunkGenerator
return 128;
}
public void generateChunk(AWorldServer world, int x, int z, ChunkPrimer primer)
public void generateChunk(WorldServer world, int x, int z, ChunkPrimer primer)
{
int range = 2;
int xr = range + 1;

View file

@ -1,13 +1,14 @@
package common.worldgen;
package server.worldgen;
import common.biome.Biome;
import common.biome.BaseBiome;
import common.dimension.Dimension;
import common.rng.NoiseGen;
import common.rng.OctaveGen;
import common.rng.Random;
import common.util.ExtMath;
import common.world.State;
import common.world.AWorldServer;
import server.biome.Biome;
import server.world.WorldServer;
public class GeneratorPerlin implements ChunkGenerator
{
@ -51,7 +52,7 @@ public class GeneratorPerlin implements ChunkGenerator
private final double[] lowerNoise = new double[825];
private final double[] upperNoise = new double[825];
private final double[] depthNoise = new double[25];
private final Biome[] biomes = new Biome[100];
private final BaseBiome[] biomes = new BaseBiome[100];
// public GeneratorNew(Random rand, GeneratorSettings settings)
// {
@ -105,7 +106,7 @@ public class GeneratorPerlin implements ChunkGenerator
return 256;
}
public void generateChunk(AWorldServer world, int x, int z, ChunkPrimer primer)
public void generateChunk(WorldServer world, int x, int z, ChunkPrimer primer)
{
int sea = world.getSeaLevel();
world.getBiomeGenerator().getGenBiomes(this.biomes, x * 4 - 2, z * 4 - 2, 10, 10);
@ -196,13 +197,13 @@ public class GeneratorPerlin implements ChunkGenerator
float min = 0.0F;
float sum = 0.0F;
int range = 2;
Biome biome = this.biomes[u + 2 + (v + 2) * 10];
Biome biome = Biome.BIOMES[this.biomes[u + 2 + (v + 2) * 10].id];
for (int a = -range; a <= range; ++a)
{
for (int b = -range; b <= range; ++b)
{
Biome biome2 = this.biomes[u + a + 2 + (v + b + 2) * 10];
Biome biome2 = Biome.BIOMES[this.biomes[u + a + 2 + (v + b + 2) * 10].id];
float bmin = this.biomeDepthOffset + biome2.depth * this.biomeDepthWeight;
float bmax = this.biomeScaleOffset + biome2.scale * this.biomeScaleWeight;

View file

@ -1,10 +1,10 @@
package common.worldgen;
package server.worldgen;
import common.rng.NoiseGen;
import common.rng.OctaveGen;
import common.rng.Random;
import common.world.State;
import common.world.AWorldServer;
import server.world.WorldServer;
public class GeneratorSimple implements ChunkGenerator
{
@ -54,7 +54,7 @@ public class GeneratorSimple implements ChunkGenerator
return 128;
}
public void generateChunk(AWorldServer world, int x, int z, ChunkPrimer primer)
public void generateChunk(WorldServer world, int x, int z, ChunkPrimer primer)
{
if(this.biomeGen == null)
world.getBiomeGenerator().genFactors(this.factors, x * 16, z * 16, 16, 16);

View file

@ -1,40 +1,13 @@
package common.worldgen;
package server.worldgen;
import common.biome.RngSpawn;
import common.color.DyeColor;
import common.entity.npc.EntityDarkMage;
import common.entity.npc.EntityMage;
import common.entity.npc.EntityMagma;
import common.entity.npc.EntityTiefling;
import common.entity.npc.EntityUndead;
import common.entity.projectile.RngFishable;
import common.init.Blocks;
import common.init.ItemRegistry;
import common.init.Items;
import common.item.ItemFishFood;
import common.item.ItemStack;
import common.item.RngLoot;
import common.rng.WeightedList;
public abstract class LootConstants {
public static final WeightedList<RngFishable> FISHING_JUNK = new WeightedList<RngFishable>(
(new RngFishable(new ItemStack(Items.leather_boots), 10)).setMaxDamagePercent(0.9F), new RngFishable(new ItemStack(Items.leather), 10),
new RngFishable(new ItemStack(Items.bone), 10), new RngFishable(new ItemStack(Items.potion), 10),
new RngFishable(new ItemStack(Items.string), 5), (new RngFishable(new ItemStack(Items.fishing_rod), 2)).setMaxDamagePercent(0.9F),
new RngFishable(new ItemStack(Items.bowl), 10), new RngFishable(new ItemStack(Items.stick), 5),
new RngFishable(new ItemStack(Items.dye, 10, DyeColor.BLACK.getDyeDamage()), 1),
new RngFishable(new ItemStack(Blocks.tripwire_hook), 10), new RngFishable(new ItemStack(Items.rotten_flesh), 10));
public static final WeightedList<RngFishable> FISHING_TREASURE = new WeightedList<RngFishable>(
new RngFishable(new ItemStack(Blocks.waterlily), 1), new RngFishable(new ItemStack(Items.name_tag), 1),
new RngFishable(new ItemStack(Items.saddle), 1),
(new RngFishable(new ItemStack(Items.bow), 1)).setMaxDamagePercent(0.25F).setEnchantable(),
(new RngFishable(new ItemStack(Items.fishing_rod), 1)).setMaxDamagePercent(0.25F).setEnchantable(),
(new RngFishable(new ItemStack(Items.book), 1)).setEnchantable());
public static final WeightedList<RngFishable> FISH_TYPES = new WeightedList<RngFishable>(
new RngFishable(new ItemStack(Items.fish, 1, ItemFishFood.FishType.COD.getMetadata()), 60),
new RngFishable(new ItemStack(Items.fish, 1, ItemFishFood.FishType.SALMON.getMetadata()), 25),
new RngFishable(new ItemStack(Items.fish, 1, ItemFishFood.FishType.CLOWNFISH.getMetadata()), 2),
new RngFishable(new ItemStack(Items.fish, 1, ItemFishFood.FishType.PUFFERFISH.getMetadata()), 13));
public static final WeightedList<RngLoot> VILLAGE_BLACKSMITH = new WeightedList(new RngLoot(Items.diamond, 0, 1, 3, 3),
new RngLoot(Items.iron_ingot, 0, 1, 5, 10), new RngLoot(Items.gold_ingot, 0, 1, 3, 5), new RngLoot(Items.bread, 0, 1, 3, 15),
new RngLoot(Items.apple, 0, 1, 3, 15), new RngLoot(Items.iron_pickaxe, 0, 1, 1, 5), new RngLoot(Items.iron_sword, 0, 1, 1, 5),
@ -95,8 +68,4 @@ public abstract class LootConstants {
new RngLoot(Items.wood_axe, 0, 1, 1, 5), new RngLoot(Items.stone_pickaxe, 0, 1, 1, 3), new RngLoot(Items.wood_pickaxe, 0, 1, 1, 5),
new RngLoot(Items.apple, 0, 2, 3, 5), new RngLoot(Items.bread, 0, 2, 3, 3),
new RngLoot(ItemRegistry.getItemFromBlock(Blocks.acacia_log), 0, 1, 3, 10));
public static final WeightedList<RngSpawn> MAGEHUT_MOBS = new WeightedList<RngSpawn>(new RngSpawn(EntityMage.class, 1, 1, 1));
public static final WeightedList<RngSpawn> FORTRESS_MOBS = new WeightedList<RngSpawn>(new RngSpawn(EntityDarkMage.class, 10, 2, 3),
new RngSpawn(EntityTiefling.class, 5, 4, 4), new RngSpawn(EntityUndead.class, 10, 4, 4),
new RngSpawn(EntityMagma.class, 3, 4, 4));
}

View file

@ -0,0 +1,16 @@
package server.worldgen;
import common.entity.npc.EntityDarkMage;
import common.entity.npc.EntityMage;
import common.entity.npc.EntityMagma;
import common.entity.npc.EntityTiefling;
import common.entity.npc.EntityUndead;
import common.rng.WeightedList;
import server.biome.RngSpawn;
public abstract class MobConstants {
public static final WeightedList<RngSpawn> MAGEHUT_MOBS = new WeightedList<RngSpawn>(new RngSpawn(EntityMage.class, 1, 1, 1));
public static final WeightedList<RngSpawn> FORTRESS_MOBS = new WeightedList<RngSpawn>(new RngSpawn(EntityDarkMage.class, 10, 2, 3),
new RngSpawn(EntityTiefling.class, 5, 4, 4), new RngSpawn(EntityUndead.class, 10, 4, 4),
new RngSpawn(EntityMagma.class, 3, 4, 4));
}

View file

@ -1,13 +1,14 @@
package common.worldgen;
package server.worldgen;
import common.biome.Biome;
import common.biome.BaseBiome;
import common.block.Block;
import common.init.Blocks;
import common.rng.NoiseGen;
import common.rng.OctaveGen;
import common.rng.Random;
import common.world.State;
import common.world.AWorldServer;
import server.biome.Biome;
import server.world.WorldServer;
public class ReplacerAltBiome implements BlockReplacer
{
@ -46,7 +47,7 @@ public class ReplacerAltBiome implements BlockReplacer
this.block = filler.getBlock();
}
public void replaceBlocks(AWorldServer world, int x, int z, ChunkPrimer primer, Random rand, Biome[] biomes)
public void replaceBlocks(WorldServer world, int x, int z, ChunkPrimer primer, Random rand, BaseBiome[] biomes)
{
int seaLevel = world.getSeaLevel();
double scale = 0.03125D;
@ -57,7 +58,7 @@ public class ReplacerAltBiome implements BlockReplacer
{
for(int px = 0; px < 16; px++)
{
Biome biome = biomes[pz * 16 + px];
Biome biome = Biome.BIOMES[biomes[pz * 16 + px].id];
boolean alt2 = this.alt2Noise[pz + px * 16] + rand.doublev() * 0.20000000000000001D > 0.0D;
boolean alt1 = this.alt1Noise[px + pz * 16] + rand.doublev() * 0.20000000000000001D > 3D;
int excl = (int)(this.exclNoise[pz + px * 16] / 3D + 3D + rand.doublev() * 0.25D);

View file

@ -1,12 +1,12 @@
package common.worldgen;
package server.worldgen;
import common.biome.Biome;
import common.biome.BaseBiome;
import common.block.Block;
import common.material.Material;
import common.rng.OctaveGen;
import common.rng.Random;
import common.world.State;
import common.world.AWorldServer;
import server.world.WorldServer;
public class ReplacerAltSurface implements BlockReplacer
{
@ -38,7 +38,7 @@ public class ReplacerAltSurface implements BlockReplacer
this.fillerBlock = filler.getBlock();
}
public void replaceBlocks(AWorldServer world, int x, int z, ChunkPrimer primer, Random rand, Biome[] biomes)
public void replaceBlocks(WorldServer world, int x, int z, ChunkPrimer primer, Random rand, BaseBiome[] biomes)
{
int i = world.getSeaLevel() + 1;
double d0 = 0.03125D;

View file

@ -1,9 +1,10 @@
package common.worldgen;
package server.worldgen;
import common.biome.Biome;
import common.biome.BaseBiome;
import common.rng.PerlinGen;
import common.rng.Random;
import common.world.AWorldServer;
import server.biome.Biome;
import server.world.WorldServer;
public class ReplacerBiome implements BlockReplacer
{
@ -15,7 +16,7 @@ public class ReplacerBiome implements BlockReplacer
this.stoneNoiseGen = new PerlinGen(rand, 4);
}
public void replaceBlocks(AWorldServer world, int x, int z, ChunkPrimer primer, Random rand, Biome[] biomes)
public void replaceBlocks(WorldServer world, int x, int z, ChunkPrimer primer, Random rand, BaseBiome[] biomes)
{
double d0 = 0.03125D;
this.stoneNoiseGen.generate(this.stoneNoise, (double)(x * 16), (double)(z * 16), 16, 16, d0 * 2.0D, d0 * 2.0D, 1.0D);
@ -24,7 +25,7 @@ public class ReplacerBiome implements BlockReplacer
{
for (int j = 0; j < 16; ++j)
{
Biome biome = biomes[j + i * 16];
Biome biome = Biome.BIOMES[biomes[j + i * 16].id];
biome.genTerrainBlocks(world, rand, primer, x * 16 + i, z * 16 + j, this.stoneNoise[j + i * 16]);
}
}

View file

@ -1,12 +1,12 @@
package common.worldgen;
package server.worldgen;
import common.biome.Biome;
import common.biome.BaseBiome;
import common.block.Block;
import common.init.Blocks;
import common.material.Material;
import common.rng.Random;
import common.world.State;
import common.world.AWorldServer;
import server.world.WorldServer;
public class ReplacerTopLayer implements BlockReplacer
{
@ -22,7 +22,7 @@ public class ReplacerTopLayer implements BlockReplacer
this.replace = replace;
}
public void replaceBlocks(AWorldServer world, int x, int z, ChunkPrimer primer, Random rand, Biome[] biomes)
public void replaceBlocks(WorldServer world, int x, int z, ChunkPrimer primer, Random rand, BaseBiome[] biomes)
{
for (int i = 0; i < 16; ++i)
{

View file

@ -1,8 +1,8 @@
package common.worldgen.caves;
package server.worldgen.caves;
import common.rng.Random;
import common.world.AWorldServer;
import common.worldgen.ChunkPrimer;
import server.world.WorldServer;
import server.worldgen.ChunkPrimer;
public class MapGenBase
{
@ -13,9 +13,9 @@ public class MapGenBase
protected Random rand = new Random();
/** This world object. */
protected AWorldServer worldObj;
protected WorldServer worldObj;
public void generate(AWorldServer worldIn, int x, int z, ChunkPrimer chunkPrimerIn)
public void generate(WorldServer worldIn, int x, int z, ChunkPrimer chunkPrimerIn)
{
int i = this.range;
this.worldObj = worldIn;
@ -38,7 +38,7 @@ public class MapGenBase
/**
* Recursively called by generate()
*/
protected void recursiveGenerate(AWorldServer worldIn, int chunkX, int chunkZ, int p_180701_4_, int p_180701_5_, ChunkPrimer chunkPrimerIn)
protected void recursiveGenerate(WorldServer worldIn, int chunkX, int chunkZ, int p_180701_4_, int p_180701_5_, ChunkPrimer chunkPrimerIn)
{
}
}

View file

@ -1,12 +1,12 @@
package common.worldgen.caves;
package server.worldgen.caves;
import common.block.Block;
import common.init.Blocks;
import common.rng.Random;
import common.util.ExtMath;
import common.world.State;
import common.world.AWorldServer;
import common.worldgen.ChunkPrimer;
import server.world.WorldServer;
import server.worldgen.ChunkPrimer;
public class MapGenBigCaves extends MapGenBase
{
@ -199,7 +199,7 @@ public class MapGenBigCaves extends MapGenBase
/**
* Recursively called by generate()
*/
protected void recursiveGenerate(AWorldServer worldIn, int chunkX, int chunkZ, int p_180701_4_, int p_180701_5_, ChunkPrimer chunkPrimerIn)
protected void recursiveGenerate(WorldServer worldIn, int chunkX, int chunkZ, int p_180701_4_, int p_180701_5_, ChunkPrimer chunkPrimerIn)
{
int i = this.rand.zrange(this.rand.zrange(this.rand.zrange(10) + 1) + 1);

View file

@ -1,4 +1,4 @@
package common.worldgen.caves;
package server.worldgen.caves;
import common.block.Block;
import common.block.BlockColored;
@ -9,8 +9,9 @@ import common.rng.Random;
import common.util.BlockPos;
import common.util.ExtMath;
import common.world.State;
import common.world.AWorldServer;
import common.worldgen.ChunkPrimer;
import server.biome.Biome;
import server.world.WorldServer;
import server.worldgen.ChunkPrimer;
public class MapGenCaves extends MapGenBase
{
@ -217,7 +218,7 @@ public class MapGenCaves extends MapGenBase
if (flag1 && p_180702_5_.get(j3, j2 - 1, i2).getBlock() == this.top)
{
blockpos$mutableblockpos.set(j3 + p_180702_3_ * 16, 0, i2 + p_180702_4_ * 16);
p_180702_5_.set(j3, j2 - 1, i2, this.worldObj.getBiomeGenForCoords(blockpos$mutableblockpos).topBlock.getBlock().getState());
p_180702_5_.set(j3, j2 - 1, i2, Biome.BIOMES[this.worldObj.getBiomeGenForCoords(blockpos$mutableblockpos).id].topBlock.getBlock().getState());
}
}
}
@ -245,7 +246,7 @@ public class MapGenCaves extends MapGenBase
/**
* Recursively called by generate()
*/
protected void recursiveGenerate(AWorldServer worldIn, int chunkX, int chunkZ, int p_180701_4_, int p_180701_5_, ChunkPrimer chunkPrimerIn)
protected void recursiveGenerate(WorldServer worldIn, int chunkX, int chunkZ, int p_180701_4_, int p_180701_5_, ChunkPrimer chunkPrimerIn)
{
int i = this.rand.zrange(this.rand.zrange(this.rand.zrange(15) + 1) + 1);

View file

@ -1,4 +1,4 @@
package common.worldgen.caves;
package server.worldgen.caves;
import common.block.Block;
import common.init.Blocks;
@ -6,8 +6,9 @@ import common.rng.Random;
import common.util.BlockPos;
import common.util.ExtMath;
import common.world.State;
import common.world.AWorldServer;
import common.worldgen.ChunkPrimer;
import server.biome.Biome;
import server.world.WorldServer;
import server.worldgen.ChunkPrimer;
public class MapGenRavine extends MapGenBase
{
@ -196,7 +197,7 @@ public class MapGenRavine extends MapGenBase
if (flag && p_180707_5_.get(j3, j2 - 1, i2).getBlock() == this.top)
{
blockpos$mutableblockpos.set(j3 + p_180707_3_ * 16, 0, i2 + p_180707_4_ * 16);
p_180707_5_.set(j3, j2 - 1, i2, this.worldObj.getBiomeGenForCoords(blockpos$mutableblockpos).topBlock);
p_180707_5_.set(j3, j2 - 1, i2, Biome.BIOMES[this.worldObj.getBiomeGenForCoords(blockpos$mutableblockpos).id].topBlock);
}
}
}
@ -219,7 +220,7 @@ public class MapGenRavine extends MapGenBase
/**
* Recursively called by generate()
*/
protected void recursiveGenerate(AWorldServer worldIn, int chunkX, int chunkZ, int p_180701_4_, int p_180701_5_, ChunkPrimer chunkPrimerIn)
protected void recursiveGenerate(WorldServer worldIn, int chunkX, int chunkZ, int p_180701_4_, int p_180701_5_, ChunkPrimer chunkPrimerIn)
{
if (this.rand.zrange(50) == 0)
{

View file

@ -1,4 +1,4 @@
package common.worldgen.feature;
package server.worldgen.feature;
import common.block.Block;
import common.init.Blocks;
@ -9,9 +9,9 @@ import common.rng.WeightedList;
import common.tileentity.TileEntity;
import common.tileentity.TileEntityChest;
import common.util.BlockPos;
import common.world.AWorldServer;
import common.worldgen.FeatureGenerator;
import common.worldgen.LootConstants;
import server.world.WorldServer;
import server.worldgen.FeatureGenerator;
import server.worldgen.LootConstants;
public class WorldGenAbandonedChest extends FeatureGenerator
{
@ -30,7 +30,7 @@ public class WorldGenAbandonedChest extends FeatureGenerator
this(LootConstants.ABANDONED_ITEMS, 10);
}
public boolean generate(AWorldServer worldIn, Random rand, BlockPos position)
public boolean generate(WorldServer worldIn, Random rand, BlockPos position)
{
Block block;
while (((block = worldIn.getState(position).getBlock()).getMaterial() == Material.air || block.getMaterial() == Material.leaves) && position.getY() > 1)

View file

@ -1,10 +1,10 @@
package common.worldgen.feature;
package server.worldgen.feature;
import common.rng.Random;
import common.util.BlockPos;
import common.world.State;
import common.world.AWorldServer;
import common.worldgen.FeatureGenerator;
import server.world.WorldServer;
import server.worldgen.FeatureGenerator;
public class WorldGenAsteroid extends FeatureGenerator {
private final State[] blocks;
@ -13,7 +13,7 @@ public class WorldGenAsteroid extends FeatureGenerator {
this.blocks = blocks;
}
public boolean generate(AWorldServer world, Random rand, BlockPos pos) {
public boolean generate(WorldServer world, Random rand, BlockPos pos) {
for(pos = pos.add(-8, 0, -8); pos.getY() > 9 && !world.isAirBlock(pos); pos = pos.down()) {
;
}

View file

@ -1,11 +1,11 @@
package common.worldgen.feature;
package server.worldgen.feature;
import common.block.Block;
import common.init.Blocks;
import common.rng.Random;
import common.util.BlockPos;
import common.world.AWorldServer;
import common.worldgen.FeatureGenerator;
import server.world.WorldServer;
import server.worldgen.FeatureGenerator;
public class WorldGenBlockBlob extends FeatureGenerator
{
@ -19,7 +19,7 @@ public class WorldGenBlockBlob extends FeatureGenerator
this.field_150544_b = p_i45450_2_;
}
public boolean generate(AWorldServer worldIn, Random rand, BlockPos position)
public boolean generate(WorldServer worldIn, Random rand, BlockPos position)
{
while (true)
{

View file

@ -1,11 +1,11 @@
package common.worldgen.feature;
package server.worldgen.feature;
import common.block.Block;
import common.init.Blocks;
import common.rng.Random;
import common.util.BlockPos;
import common.world.AWorldServer;
import common.worldgen.FeatureGenerator;
import server.world.WorldServer;
import server.worldgen.FeatureGenerator;
public class WorldGenClay extends FeatureGenerator
{
@ -19,7 +19,7 @@ public class WorldGenClay extends FeatureGenerator
this.numberOfBlocks = blocks;
}
public boolean generate(AWorldServer worldIn, Random rand, BlockPos position)
public boolean generate(WorldServer worldIn, Random rand, BlockPos position)
{
if (!worldIn.getState(position).getBlock().getMaterial().isColdLiquid())
{

View file

@ -1,18 +1,18 @@
package common.worldgen.feature;
package server.worldgen.feature;
import common.block.Block;
import common.init.Blocks;
import common.rng.Random;
import common.util.BlockPos;
import common.util.ExtMath;
import common.world.AWorldServer;
import server.world.WorldServer;
public class WorldGenClayExt extends WorldGenClay {
public WorldGenClayExt(int blocks) {
super(blocks);
}
public boolean generate(AWorldServer worldIn, Random rand, BlockPos position) {
public boolean generate(WorldServer worldIn, Random rand, BlockPos position) {
if(!worldIn.getState(position).getBlock().getMaterial().isColdLiquid()) {
return false;
}

View file

@ -1,4 +1,4 @@
package common.worldgen.feature;
package server.worldgen.feature;
import common.block.BlockSand;
import common.block.BlockSlab;
@ -9,8 +9,8 @@ import common.util.BlockPos;
import common.util.Facing;
import common.util.Predicates;
import common.world.State;
import common.world.AWorldServer;
import common.worldgen.FeatureGenerator;
import server.world.WorldServer;
import server.worldgen.FeatureGenerator;
public class WorldGenDesertWells extends FeatureGenerator
{
@ -19,7 +19,7 @@ public class WorldGenDesertWells extends FeatureGenerator
private final State field_175912_c = Blocks.sandstone.getState();
private final State field_175910_d = Blocks.flowing_water.getState();
public boolean generate(AWorldServer worldIn, Random rand, BlockPos position)
public boolean generate(WorldServer worldIn, Random rand, BlockPos position)
{
while (worldIn.isAirBlock(position) && position.getY() > 2)
{

View file

@ -1,14 +1,14 @@
package common.worldgen.feature;
package server.worldgen.feature;
import common.init.Blocks;
import common.rng.Random;
import common.util.BlockPos;
import common.world.AWorldServer;
import common.worldgen.FeatureGenerator;
import server.world.WorldServer;
import server.worldgen.FeatureGenerator;
public class WorldGenFire extends FeatureGenerator
{
public boolean generate(AWorldServer worldIn, Random rand, BlockPos position)
public boolean generate(WorldServer worldIn, Random rand, BlockPos position)
{
for (int i = 0; i < 64; ++i)
{

Some files were not shown because too many files have changed in this diff Show more