From 10ba39c70b0b8a90d3f71b4278b3c3c13c07c4da Mon Sep 17 00:00:00 2001 From: Sen Date: Wed, 14 May 2025 15:12:11 +0200 Subject: [PATCH] misc refactoring --- client/src/client/Client.java | 4 +- .../src/client/renderer/EntityRenderer.java | 6 +- .../client/renderer/RegionRenderCache.java | 4 +- .../renderer/blockmodel/ModelBakery.java | 4 +- .../renderer/blockmodel/ModelManager.java | 2 +- client/src/client/world/WorldClient.java | 8 +- .../biome/{BaseBiome.java => Biome.java} | 34 ++-- common/src/common/biome/IBiome.java | 6 +- common/src/common/block/BlockDispenser.java | 2 +- common/src/common/color/Colorizer.java | 10 +- common/src/common/dimension/Dimension.java | 74 +++---- common/src/common/dimension/Space.java | 4 +- .../src/common/entity/animal/EntitySheep.java | 6 +- common/src/common/entity/npc/EntitySlime.java | 6 +- common/src/common/init/BlockRegistry.java | 2 + common/src/common/init/DispenserRegistry.java | 3 +- common/src/common/init/EntityEggInfo.java | 31 ++- common/src/common/init/ItemRegistry.java | 3 +- common/src/common/init/TileRegistry.java | 5 - common/src/common/init/UniverseRegistry.java | 66 +++--- common/src/common/item/ItemInfoWand.java | 4 +- common/src/common/item/ItemMonsterPlacer.java | 2 +- .../{init => util}/IObjectIntIterable.java | 2 +- .../src/common/{init => util}/IRegistry.java | 2 +- .../{init => util}/ObjectIntIdentityMap.java | 3 +- .../{init => util}/RegistryDefaulted.java | 2 +- .../{init => util}/RegistryNamespaced.java | 2 +- .../RegistryNamespacedDefaultedByKey.java | 2 +- .../common/{init => util}/RegistrySimple.java | 2 +- common/src/common/world/Chunk.java | 10 +- common/src/common/world/IWorldAccess.java | 4 +- common/src/common/world/World.java | 6 +- .../src/common/worldgen/BiomeGenerator.java | 12 +- server/src/server/Server.java | 4 +- server/src/server/biome/BiomeBeach.java | 6 +- server/src/server/biome/BiomeBlackened.java | 6 +- server/src/server/biome/BiomeChaos.java | 6 +- server/src/server/biome/BiomeDesert.java | 6 +- .../src/server/biome/BiomeExterminated.java | 6 +- server/src/server/biome/BiomeForest.java | 12 +- server/src/server/biome/BiomeHell.java | 6 +- server/src/server/biome/BiomeHills.java | 10 +- server/src/server/biome/BiomeJungle.java | 6 +- server/src/server/biome/BiomeMesa.java | 10 +- server/src/server/biome/BiomeMoon.java | 6 +- server/src/server/biome/BiomeMushroom.java | 6 +- server/src/server/biome/BiomeMutated.java | 12 +- server/src/server/biome/BiomeNone.java | 6 +- server/src/server/biome/BiomePlains.java | 6 +- server/src/server/biome/BiomeSavanna.java | 12 +- server/src/server/biome/BiomeSnow.java | 10 +- server/src/server/biome/BiomeSnowLand.java | 6 +- server/src/server/biome/BiomeSpace.java | 6 +- server/src/server/biome/BiomeStoneBeach.java | 6 +- server/src/server/biome/BiomeSwamp.java | 6 +- server/src/server/biome/BiomeTaiga.java | 10 +- server/src/server/biome/BiomeTian.java | 6 +- server/src/server/biome/BiomeWater.java | 6 +- .../biome/{Biome.java => GenBiome.java} | 189 +++++++++--------- server/src/server/world/Converter.java | 4 +- server/src/server/world/Spawner.java | 4 +- server/src/server/world/WorldServer.java | 36 ++-- .../src/server/worldgen/BiomeGenLayered.java | 34 ++-- .../src/server/worldgen/BiomeGenSingle.java | 16 +- server/src/server/worldgen/BlockReplacer.java | 4 +- server/src/server/worldgen/FeatureLakes.java | 4 +- .../src/server/worldgen/GeneratorPerlin.java | 10 +- .../src/server/worldgen/ReplacerAltBiome.java | 8 +- .../server/worldgen/ReplacerAltSurface.java | 4 +- server/src/server/worldgen/ReplacerBiome.java | 8 +- .../src/server/worldgen/ReplacerTopLayer.java | 4 +- .../server/worldgen/caves/MapGenCaves.java | 4 +- .../server/worldgen/caves/MapGenRavine.java | 4 +- .../src/server/worldgen/layer/GenLayer.java | 10 +- .../worldgen/layer/GenLayerAddExtra.java | 4 +- .../server/worldgen/layer/GenLayerAddSea.java | 4 +- .../server/worldgen/layer/GenLayerBiome.java | 12 +- .../worldgen/layer/GenLayerBiomeEdge.java | 26 +-- .../server/worldgen/layer/GenLayerHills.java | 66 +++--- .../server/worldgen/layer/GenLayerRiver.java | 4 +- .../worldgen/layer/GenLayerRiverMix.java | 16 +- .../server/worldgen/layer/GenLayerShore.java | 22 +- .../structure/MapGenScatteredFeature.java | 16 +- .../worldgen/structure/MapGenVillage.java | 4 +- .../worldgen/structure/StructureVillage.java | 6 +- 85 files changed, 512 insertions(+), 526 deletions(-) rename common/src/common/biome/{BaseBiome.java => Biome.java} (89%) rename common/src/common/{init => util}/IObjectIntIterable.java (75%) rename common/src/common/{init => util}/IRegistry.java (89%) rename common/src/common/{init => util}/ObjectIntIdentityMap.java (95%) rename common/src/common/{init => util}/RegistryDefaulted.java (95%) rename common/src/common/{init => util}/RegistryNamespaced.java (99%) rename common/src/common/{init => util}/RegistryNamespacedDefaultedByKey.java (98%) rename common/src/common/{init => util}/RegistrySimple.java (98%) rename server/src/server/biome/{Biome.java => GenBiome.java} (79%) diff --git a/client/src/client/Client.java b/client/src/client/Client.java index 0d67257..8535a7d 100755 --- a/client/src/client/Client.java +++ b/client/src/client/Client.java @@ -95,7 +95,7 @@ import client.window.Wheel; import client.window.Window; import client.window.WindowEvent; import client.world.WorldClient; -import common.biome.BaseBiome; +import common.biome.Biome; import common.block.Block; import common.collect.Lists; import common.collect.Maps; @@ -1730,7 +1730,7 @@ public class Client implements IThreadListener { break; } - BaseBiome biome = null; + Biome biome = null; String bline; String lline; if(this.world.isBlockLoaded(blockpos)) { diff --git a/client/src/client/renderer/EntityRenderer.java b/client/src/client/renderer/EntityRenderer.java index 0e7be20..9e5bf48 100755 --- a/client/src/client/renderer/EntityRenderer.java +++ b/client/src/client/renderer/EntityRenderer.java @@ -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.BaseBiome; +import common.biome.Biome; 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))); - BaseBiome biomegenbase = world.getBiomeGenForCoords(blockpos1); + Biome 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); - BaseBiome biomegenbase = world.getBiomeGenForCoords(blockpos$mutableblockpos); + Biome biomegenbase = world.getBiomeGenForCoords(blockpos$mutableblockpos); // if (biomegenbase.canRain() || biomegenbase.isSnowyBiome()) // { diff --git a/client/src/client/renderer/RegionRenderCache.java b/client/src/client/renderer/RegionRenderCache.java index f5157cc..635a77a 100755 --- a/client/src/client/renderer/RegionRenderCache.java +++ b/client/src/client/renderer/RegionRenderCache.java @@ -2,7 +2,7 @@ package client.renderer; import java.util.Arrays; -import common.biome.BaseBiome; +import common.biome.Biome; 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 BaseBiome getBiomeGenForCoords(BlockPos pos) + public Biome getBiomeGenForCoords(BlockPos pos) { return this.worldObj.getBiomeGenForCoords(pos); } diff --git a/client/src/client/renderer/blockmodel/ModelBakery.java b/client/src/client/renderer/blockmodel/ModelBakery.java index aaa55a3..5b58a45 100755 --- a/client/src/client/renderer/blockmodel/ModelBakery.java +++ b/client/src/client/renderer/blockmodel/ModelBakery.java @@ -15,13 +15,13 @@ import common.collect.Maps; import common.collect.Sets; import common.init.BlockRegistry; import common.init.FluidRegistry; -import common.init.IRegistry; import common.init.ItemRegistry; -import common.init.RegistrySimple; import common.item.Item; import common.item.ItemStack; import common.model.ModelRotation; import common.util.Facing; +import common.util.IRegistry; +import common.util.RegistrySimple; import common.world.State; public abstract class ModelBakery diff --git a/client/src/client/renderer/blockmodel/ModelManager.java b/client/src/client/renderer/blockmodel/ModelManager.java index 810b25d..5984f9a 100755 --- a/client/src/client/renderer/blockmodel/ModelManager.java +++ b/client/src/client/renderer/blockmodel/ModelManager.java @@ -13,8 +13,8 @@ import common.collect.Maps; import common.init.BlockRegistry; import common.init.Blocks; import common.init.FluidRegistry; -import common.init.IRegistry; import common.properties.IProperty; +import common.util.IRegistry; import common.world.State; public class ModelManager diff --git a/client/src/client/world/WorldClient.java b/client/src/client/world/WorldClient.java index 497f744..7e8f142 100755 --- a/client/src/client/world/WorldClient.java +++ b/client/src/client/world/WorldClient.java @@ -6,7 +6,7 @@ import java.util.Set; import client.Client; import client.renderer.particle.EntityFX; import client.renderer.particle.EntityFirework; -import common.biome.BaseBiome; +import common.biome.Biome; import common.block.Block; import common.collect.Lists; import common.collect.Sets; @@ -759,7 +759,7 @@ 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)); - BaseBiome biome = this.getBiomeGenForCoords(pos); + Biome biome = this.getBiomeGenForCoords(pos); Vec3 vec; if(biome.skyColor != 0xffffffff) vec = new Vec3(biome.skyColor); @@ -815,7 +815,7 @@ public class WorldClient extends AWorldClient public Vec3 getCloudColour(Entity entity, float partialTicks) { Vec3 color = new Vec3(this.dimension.getCloudColor()); - BaseBiome biome = this.getBiomeGenForCoords(new BlockPos(ExtMath.floord(entity.posX), ExtMath.floord(entity.posY), + Biome biome = this.getBiomeGenForCoords(new BlockPos(ExtMath.floord(entity.posX), ExtMath.floord(entity.posY), ExtMath.floord(entity.posZ))); if(biome.cloudColor != 0xffffffff) color = new Vec3(biome.cloudColor); @@ -854,7 +854,7 @@ public class WorldClient extends AWorldClient public Vec3 getFogColor(Entity entity, float partialTicks) { Vec3 color = new Vec3(this.dimension.getFogColor()); - BaseBiome biome = this.getBiomeGenForCoords(new BlockPos(ExtMath.floord(entity.posX), ExtMath.floord(entity.posY), + Biome biome = this.getBiomeGenForCoords(new BlockPos(ExtMath.floord(entity.posX), ExtMath.floord(entity.posY), ExtMath.floord(entity.posZ))); if(biome.fogColor != 0xffffffff) color = new Vec3(biome.fogColor); diff --git a/common/src/common/biome/BaseBiome.java b/common/src/common/biome/Biome.java similarity index 89% rename from common/src/common/biome/BaseBiome.java rename to common/src/common/biome/Biome.java index 81c9b42..b02260c 100644 --- a/common/src/common/biome/BaseBiome.java +++ b/common/src/common/biome/Biome.java @@ -12,7 +12,7 @@ import common.rng.Random; import common.util.BlockPos; import common.util.ExtMath; -public enum BaseBiome { +public enum Biome { NONE(0, "none", "", 0x000000), PLAINS(1, "plains", "Ebene", 0x8db360, 12.0f, 40.0f), DESERT(2, "desert", "Wüste", 0xfa9418, 60.0f, 0.0f), @@ -85,11 +85,11 @@ public enum BaseBiome { 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 LOOKUP = Maps.newTreeMap(); + public static final Biome DEF_BIOME = FOREST; + private static final PerlinGen TEMP_NOISE = new PerlinGen(new Random(836430928262265276L), 1); + private static final PerlinGen COLOR_NOISE = new PerlinGen(new Random(6549321755809421L), 1); + private static final Biome[] BIOMES = new Biome[256]; + private static final Map LOOKUP = Maps.newTreeMap(); public final int id; public final String name; @@ -105,7 +105,7 @@ public enum BaseBiome { public final int cloudColor; static { - for(BaseBiome biome : values()) { + for(Biome 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"); @@ -113,7 +113,7 @@ public enum BaseBiome { } } - public static BaseBiome getBiome(int id) + public static Biome getBiome(int id) { if (id >= 0 && id < BIOMES.length) { @@ -126,11 +126,11 @@ public enum BaseBiome { } } - public static BaseBiome getBiomeDef(int id) + public static Biome getBiomeDef(int id) { if (id >= 0 && id < BIOMES.length) { - BaseBiome biome = BIOMES[id]; + Biome biome = BIOMES[id]; return biome == null ? DEF_BIOME : biome; } else @@ -144,8 +144,8 @@ public enum BaseBiome { return Lists.newArrayList(LOOKUP.keySet()); } - public static BaseBiome findByName(String name) { - BaseBiome biome = LOOKUP.get(name.toLowerCase().replace(" ", "").replace("_", "")); + public static Biome findByName(String name) { + Biome biome = LOOKUP.get(name.toLowerCase().replace(" ", "").replace("_", "")); if(biome == null) { int z; try { @@ -159,7 +159,7 @@ public enum BaseBiome { 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) { + private Biome(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; @@ -174,19 +174,19 @@ public enum BaseBiome { this.cloudColor = cloudColor; } - private BaseBiome(int id, String name, String display, int color, float temperature, float humidity, int waterColor, int grassColor, int foliageColor) { + private Biome(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) { + private Biome(int id, String name, String display, int color, float temperature, float humidity) { 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) { + private Biome(int id, String name, String display, int color, float temperature) { this(id, name, display, color, temperature, 50.0f, 0xffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff); } - private BaseBiome(int id, String name, String display, int color) { + private Biome(int id, String name, String display, int color) { this(id, name, display, color, 0.0f, 50.0f, 0xffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff); } diff --git a/common/src/common/biome/IBiome.java b/common/src/common/biome/IBiome.java index c46503f..27027f1 100644 --- a/common/src/common/biome/IBiome.java +++ b/common/src/common/biome/IBiome.java @@ -9,7 +9,7 @@ import common.world.State; public interface IBiome { public static abstract class BiomeProvider { private static BiomeProvider provider = new BiomeProvider() { - public IBiome getBiome(BaseBiome base) { + public IBiome getBiome(Biome base) { return new IBiome() { public State getFiller() { return BlockRegistry.getRegisteredBlock("air").getState(); @@ -28,14 +28,14 @@ public interface IBiome { } }; - public abstract IBiome getBiome(BaseBiome base); + public abstract IBiome getBiome(Biome base); } public static void setProvider(BiomeProvider provider) { BiomeProvider.provider = provider; } - public static IBiome getBiome(BaseBiome base) { + public static IBiome getBiome(Biome base) { return BiomeProvider.provider.getBiome(base); } diff --git a/common/src/common/block/BlockDispenser.java b/common/src/common/block/BlockDispenser.java index 98595fe..1a80d27 100755 --- a/common/src/common/block/BlockDispenser.java +++ b/common/src/common/block/BlockDispenser.java @@ -8,7 +8,6 @@ import common.dispenser.PositionImpl; import common.entity.npc.EntityNPC; import common.entity.types.EntityLiving; import common.init.DispenserRegistry; -import common.init.RegistryDefaulted; import common.inventory.Container; import common.inventory.InventoryHelper; import common.item.CheatTab; @@ -26,6 +25,7 @@ import common.tileentity.TileEntity; import common.tileentity.TileEntityDispenser; import common.util.BlockPos; import common.util.Facing; +import common.util.RegistryDefaulted; import common.world.State; import common.world.World; import common.world.AWorldServer; diff --git a/common/src/common/color/Colorizer.java b/common/src/common/color/Colorizer.java index 468793a..dcae2c9 100755 --- a/common/src/common/color/Colorizer.java +++ b/common/src/common/color/Colorizer.java @@ -1,6 +1,6 @@ package common.color; -import common.biome.BaseBiome; +import common.biome.Biome; 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(BaseBiome biome, BlockPos pos); + int getColorAtPos(Biome biome, BlockPos pos); } private static final ColorResolver GRASS_COLOR = new ColorResolver() { - public int getColorAtPos(BaseBiome biome, BlockPos pos) { + public int getColorAtPos(Biome biome, BlockPos pos) { return biome.getGrassColorAtPos(pos); } }; private static final ColorResolver FOLIAGE_COLOR = new ColorResolver() { - public int getColorAtPos(BaseBiome biome, BlockPos pos) { + public int getColorAtPos(Biome biome, BlockPos pos) { return biome.getFoliageColorAtPos(pos); } }; private static final ColorResolver WATER_COLOR_MULTIPLIER = new ColorResolver() { - public int getColorAtPos(BaseBiome biome, BlockPos pos) { + public int getColorAtPos(Biome biome, BlockPos pos) { return biome.waterColor; } }; diff --git a/common/src/common/dimension/Dimension.java b/common/src/common/dimension/Dimension.java index b3ef389..bcb9137 100755 --- a/common/src/common/dimension/Dimension.java +++ b/common/src/common/dimension/Dimension.java @@ -4,7 +4,7 @@ import java.util.List; import java.util.Map; import java.util.Set; -import common.biome.BaseBiome; +import common.biome.Biome; import common.biome.IBiome; import common.block.LeavesType; import common.collect.Lists; @@ -270,7 +270,7 @@ public abstract class Dimension extends Nameable implements Comparable ores = Lists.newArrayList(); private final List lakes = Lists.newArrayList(); @@ -462,12 +462,12 @@ public abstract class Dimension extends Nameable implements Comparable 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 == 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)) { return super.getCanSpawnHere(); } diff --git a/common/src/common/init/BlockRegistry.java b/common/src/common/init/BlockRegistry.java index 2486248..2139cff 100755 --- a/common/src/common/init/BlockRegistry.java +++ b/common/src/common/init/BlockRegistry.java @@ -5,6 +5,8 @@ import common.color.DyeColor; import common.init.FluidRegistry.LiquidType; import common.item.CheatTab; import common.material.Material; +import common.util.ObjectIntIdentityMap; +import common.util.RegistryNamespacedDefaultedByKey; import common.world.State; public abstract class BlockRegistry { diff --git a/common/src/common/init/DispenserRegistry.java b/common/src/common/init/DispenserRegistry.java index 64bc258..3f161a1 100755 --- a/common/src/common/init/DispenserRegistry.java +++ b/common/src/common/init/DispenserRegistry.java @@ -38,6 +38,7 @@ import common.tileentity.TileEntityDispenser; import common.util.BlockPos; import common.util.ExtMath; import common.util.Facing; +import common.util.RegistryDefaulted; import common.world.State; import common.world.World; @@ -149,7 +150,7 @@ public abstract class DispenserRegistry { } }; for(EntityEggInfo egg : EntityRegistry.SPAWN_EGGS.values()) { - REGISTRY.putObject(ItemRegistry.getRegisteredItem(egg.spawnedID.toLowerCase() + "_spawner"), + REGISTRY.putObject(ItemRegistry.getRegisteredItem(egg.id.toLowerCase() + "_spawner"), disp); } REGISTRY.putObject(Items.fireworks, new BehaviorDefaultDispenseItem() diff --git a/common/src/common/init/EntityEggInfo.java b/common/src/common/init/EntityEggInfo.java index 8f7b708..87351b9 100755 --- a/common/src/common/init/EntityEggInfo.java +++ b/common/src/common/init/EntityEggInfo.java @@ -1,22 +1,15 @@ package common.init; -public class EntityEggInfo -{ - public final String spawnedID; - public final String origin; - public final int primaryColor; - public final int secondaryColor; -// public final StatBase killStat; -// public final StatBase killedByStat; +public class EntityEggInfo { + public final String id; + public final String origin; + public final int color1; + public final int color2; - public EntityEggInfo(String id, String origin, int baseColor, int spotColor) - { - this.spawnedID = id; - this.origin = origin; - this.primaryColor = baseColor; - this.secondaryColor = spotColor; -// this.killStat = new StatBase("stat.killEntity." + this.spawnedID, EntityRegistry.getEntityName(this.spawnedID) + " getötet"); -// this.killedByStat = new StatBase("stat.entityKilledBy." + this.spawnedID, -// "Von " + EntityRegistry.getEntityName(this.spawnedID) + " getötet"); - } -} \ No newline at end of file + public EntityEggInfo(String id, String origin, int color1, int color2) { + this.id = id; + this.origin = origin; + this.color1 = color1; + this.color2 = color2; + } +} diff --git a/common/src/common/init/ItemRegistry.java b/common/src/common/init/ItemRegistry.java index 1621698..18a101d 100755 --- a/common/src/common/init/ItemRegistry.java +++ b/common/src/common/init/ItemRegistry.java @@ -123,6 +123,7 @@ import common.item.ItemWall; import common.item.ItemWeatherToken; import common.potion.Potion; import common.potion.PotionHelper; +import common.util.RegistryNamespaced; import common.world.Weather; public abstract class ItemRegistry { @@ -371,7 +372,7 @@ public abstract class ItemRegistry { registerItem("tnt_minecart", (new ItemMinecart(EntityCart.EnumMinecartType.TNT)).setDisplay("TNT-Lore") .setColor(TextColor.RED)); for(EntityEggInfo egg : EntityRegistry.SPAWN_EGGS.values()) { - registerItem(egg.spawnedID.toLowerCase() + "_spawner", (new ItemMonsterPlacer(egg.spawnedID)) + registerItem(egg.id.toLowerCase() + "_spawner", (new ItemMonsterPlacer(egg.id)) .setDisplay("Spawner").setMaxStackSize(ItemStack.MAX_SIZE)); } for(SpeciesInfo species : SpeciesRegistry.SPECIMEN) { diff --git a/common/src/common/init/TileRegistry.java b/common/src/common/init/TileRegistry.java index 2f74da8..6af28ba 100755 --- a/common/src/common/init/TileRegistry.java +++ b/common/src/common/init/TileRegistry.java @@ -39,8 +39,6 @@ public abstract class TileRegistry { static void register() { addMapping(TileEntityFurnace.class, "Furnace"); addMapping(TileEntityChest.class, "Chest"); -// addMapping(TileEntityWarpChest.class, "WarpChest"); -// addMapping(BlockJukebox.TileEntityJukebox.class, "RecordPlayer"); addMapping(TileEntityDispenser.class, "Trap"); addMapping(TileEntityDropper.class, "Dropper"); addMapping(TileEntitySign.class, "Sign"); @@ -49,14 +47,11 @@ public abstract class TileRegistry { addMapping(TileEntityPiston.class, "Piston"); addMapping(TileEntityBrewingStand.class, "Cauldron"); addMapping(TileEntityEnchantmentTable.class, "EnchantTable"); -// addMapping(TileEntityPortal.class, "Portal"); -// addMapping(TileEntityCommandBlock.class, "Control"); addMapping(TileEntityBeacon.class, "Beacon"); addMapping(TileEntitySkull.class, "Skull"); addMapping(TileEntityDaylightDetector.class, "DLDetector"); addMapping(TileEntityHopper.class, "Hopper"); addMapping(TileEntityComparator.class, "Comparator"); -// addMapping(TileEntityFlowerPot.class, "FlowerPot"); addMapping(TileEntityBanner.class, "Banner"); addMapping(TileEntityTianReactor.class, "TianReactor"); } diff --git a/common/src/common/init/UniverseRegistry.java b/common/src/common/init/UniverseRegistry.java index dd02b2c..e8e2d4c 100755 --- a/common/src/common/init/UniverseRegistry.java +++ b/common/src/common/init/UniverseRegistry.java @@ -4,7 +4,7 @@ import java.util.List; import java.util.Map; import java.util.Map.Entry; -import common.biome.BaseBiome; +import common.biome.Biome; import common.block.BlockColored; import common.block.BlockSand; import common.block.LeavesType; @@ -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(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) + .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) .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(BaseBiome.MOON) + .setPerlinGen(Blocks.moon_rock.getState(), Blocks.air.getState(), 63).setBiome(Biome.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(BaseBiome.ELVENFOREST) + .setSimpleReplacer(Blocks.gravel.getState(), Blocks.sand.getState()).setBiome(Biome.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(BaseBiome.FOREST, true, 5, 3, 3, 30) + .setBiomeReplacer(Blocks.gravel.getState()).setBiomeGen(Biome.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(BaseBiome.SNOWLAND) + .setPerlinGen(Blocks.snow.getState(), Blocks.ice.getState(), 63).setBiome(Biome.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(BaseBiome.MESA, true, 3, 1000, 100000, 100000) + .setBiomeGen(Biome.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(BaseBiome.BLACKENED) + .setBiomeReplacer(Blocks.blackened_cobble.getState()).setBiome(Biome.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(BaseBiome.CHAOS).enableCavesRavines(Blocks.air.getState()).enableLongCaves().enableMobs().enableSnow() + .setBiome(Biome.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(BaseBiome.TIAN) + .setPerlinGen(Blocks.tian.getState(), Blocks.water.getState(), 63).setBiome(Biome.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(BaseBiome.UPPERHELL), "hell"); + .setBiome(Biome.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(BaseBiome.LOWERHELL) + .setBiome(Biome.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(BaseBiome.HELLHILLS) + .setBiomeReplacer(Blocks.soul_sand.getState()).setBiome(Biome.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(BaseBiome.SOULPLAINS), "hell"); + .setBiomeReplacer(Blocks.soul_sand.getState()).setBiome(Biome.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(BaseBiome.SOULPLAINS), "hell"); + .setBiomeReplacer(Blocks.soul_sand.getState()).setBiome(Biome.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(BaseBiome.ASHLAND) + .setBiomeReplacer(Blocks.ash.getState()).setBiome(Biome.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", BaseBiome.NONE.name.toLowerCase()); + dtag.setString("DefaultBiome", Biome.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, BaseBiome biome, boolean populate, State main, Object ... layers) { + private static Dimension addFlatPreset(String name, Biome biome, boolean populate, State main, Object ... layers) { return addFlatPreset(name, "terra", biome, populate, main, layers); } - private static Dimension addFlatPreset(String name, String base, BaseBiome biome, boolean populate, State main, Object ... layers) { + private static Dimension addFlatPreset(String name, String base, Biome 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", BaseBiome.PLAINS, false, Blocks.dirt.getState(), Blocks.bedrock.getState(), 2, Blocks.dirt.getState(), + addFlatPreset("Klassisch", Biome.PLAINS, false, Blocks.dirt.getState(), Blocks.bedrock.getState(), 2, Blocks.dirt.getState(), Blocks.grass.getState()).enableVillages(); - addFlatPreset("Abbauwelt", BaseBiome.EXTREMEHILLS, true, Blocks.stone.getState(), Blocks.bedrock.getState(), 230, Blocks.stone.getState(), + addFlatPreset("Abbauwelt", Biome.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", BaseBiome.SEA, false, Blocks.stone.getState(), Blocks.bedrock.getState(), 5, Blocks.stone.getState(), + addFlatPreset("Wasserwelt", Biome.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", BaseBiome.PLAINS, true, Blocks.stone.getState(), Blocks.bedrock.getState(), 59, Blocks.stone.getState(), + addFlatPreset("Oberfläche", Biome.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", BaseBiome.ICEPLAINS, false, Blocks.stone.getState(), Blocks.bedrock.getState(), 59, Blocks.stone.getState(), + addFlatPreset("Verschneites Königreich", Biome.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 +", BaseBiome.ICEPLAINS, true, Blocks.stone.getState(), Blocks.bedrock.getState(), 59, Blocks.stone.getState(), + addFlatPreset("Verschneites Königreich +", Biome.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", BaseBiome.PLAINS, false, Blocks.dirt.getState(), 2, Blocks.cobblestone.getState(), 3, Blocks.dirt.getState(), Blocks.grass.getState()) + addFlatPreset("Unendliche Grube", Biome.PLAINS, false, Blocks.dirt.getState(), 2, Blocks.cobblestone.getState(), 3, Blocks.dirt.getState(), Blocks.grass.getState()) .setBiomeReplacer(Blocks.gravel.getState()).enableVillages(); - addFlatPreset("Wüste", BaseBiome.DESERT, false, Blocks.stone.getState(), Blocks.bedrock.getState(), 3, Blocks.stone.getState(), 52, Blocks.sandstone.getState()) + addFlatPreset("Wüste", Biome.DESERT, false, Blocks.stone.getState(), Blocks.bedrock.getState(), 3, Blocks.stone.getState(), 52, Blocks.sandstone.getState()) .enableVillages().enableScattered(); - addFlatPreset("Redstonewelt", BaseBiome.DESERT, false, Blocks.sandstone.getState(), Blocks.bedrock.getState(), 3, Blocks.stone.getState(), + addFlatPreset("Redstonewelt", Biome.DESERT, false, Blocks.sandstone.getState(), Blocks.bedrock.getState(), 3, Blocks.stone.getState(), 52, Blocks.sandstone.getState()); addPreset("Leer", "ClearGenerator:1b"); diff --git a/common/src/common/item/ItemInfoWand.java b/common/src/common/item/ItemInfoWand.java index a0250f0..6370462 100755 --- a/common/src/common/item/ItemInfoWand.java +++ b/common/src/common/item/ItemInfoWand.java @@ -1,6 +1,6 @@ package common.item; -import common.biome.BaseBiome; +import common.biome.Biome; 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) { - BaseBiome biome = world.getBiomeGenForCoords(new BlockPos(vec.xCoord, 0, vec.zCoord)); + Biome 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))); diff --git a/common/src/common/item/ItemMonsterPlacer.java b/common/src/common/item/ItemMonsterPlacer.java index 45a1c85..b5e0d4d 100755 --- a/common/src/common/item/ItemMonsterPlacer.java +++ b/common/src/common/item/ItemMonsterPlacer.java @@ -55,7 +55,7 @@ public class ItemMonsterPlacer extends Item public int getColorFromItemStack(ItemStack stack, int renderPass) { EntityEggInfo egg = EntityRegistry.SPAWN_EGGS.get(this.entityId); - return egg != null ? (renderPass == 0 ? egg.primaryColor : egg.secondaryColor) : 16777215; + return egg != null ? (renderPass == 0 ? egg.color1 : egg.color2) : 16777215; } public void addInformation(ItemStack stack, EntityNPC player, List tooltip) { diff --git a/common/src/common/init/IObjectIntIterable.java b/common/src/common/util/IObjectIntIterable.java similarity index 75% rename from common/src/common/init/IObjectIntIterable.java rename to common/src/common/util/IObjectIntIterable.java index 20e5fbf..970ee52 100755 --- a/common/src/common/init/IObjectIntIterable.java +++ b/common/src/common/util/IObjectIntIterable.java @@ -1,4 +1,4 @@ -package common.init; +package common.util; public interface IObjectIntIterable extends Iterable { diff --git a/common/src/common/init/IRegistry.java b/common/src/common/util/IRegistry.java similarity index 89% rename from common/src/common/init/IRegistry.java rename to common/src/common/util/IRegistry.java index 9dc54b3..eaf299b 100755 --- a/common/src/common/init/IRegistry.java +++ b/common/src/common/util/IRegistry.java @@ -1,4 +1,4 @@ -package common.init; +package common.util; public interface IRegistry extends Iterable { diff --git a/common/src/common/init/ObjectIntIdentityMap.java b/common/src/common/util/ObjectIntIdentityMap.java similarity index 95% rename from common/src/common/init/ObjectIntIdentityMap.java rename to common/src/common/util/ObjectIntIdentityMap.java index c6cb6b2..88b9234 100755 --- a/common/src/common/init/ObjectIntIdentityMap.java +++ b/common/src/common/util/ObjectIntIdentityMap.java @@ -1,4 +1,4 @@ -package common.init; +package common.util; import java.util.IdentityHashMap; import java.util.Iterator; @@ -6,7 +6,6 @@ import java.util.List; import common.collect.Iterators; import common.collect.Lists; -import common.util.Predicates; public class ObjectIntIdentityMap implements IObjectIntIterable { diff --git a/common/src/common/init/RegistryDefaulted.java b/common/src/common/util/RegistryDefaulted.java similarity index 95% rename from common/src/common/init/RegistryDefaulted.java rename to common/src/common/util/RegistryDefaulted.java index 9b313bc..8a5d13a 100755 --- a/common/src/common/init/RegistryDefaulted.java +++ b/common/src/common/util/RegistryDefaulted.java @@ -1,4 +1,4 @@ -package common.init; +package common.util; public class RegistryDefaulted extends RegistrySimple { diff --git a/common/src/common/init/RegistryNamespaced.java b/common/src/common/util/RegistryNamespaced.java similarity index 99% rename from common/src/common/init/RegistryNamespaced.java rename to common/src/common/util/RegistryNamespaced.java index e7c7806..e6e40d7 100755 --- a/common/src/common/init/RegistryNamespaced.java +++ b/common/src/common/util/RegistryNamespaced.java @@ -1,4 +1,4 @@ -package common.init; +package common.util; import java.util.Iterator; import java.util.Map; diff --git a/common/src/common/init/RegistryNamespacedDefaultedByKey.java b/common/src/common/util/RegistryNamespacedDefaultedByKey.java similarity index 98% rename from common/src/common/init/RegistryNamespacedDefaultedByKey.java rename to common/src/common/util/RegistryNamespacedDefaultedByKey.java index f616966..cd41360 100755 --- a/common/src/common/init/RegistryNamespacedDefaultedByKey.java +++ b/common/src/common/util/RegistryNamespacedDefaultedByKey.java @@ -1,4 +1,4 @@ -package common.init; +package common.util; public class RegistryNamespacedDefaultedByKey extends RegistryNamespaced { diff --git a/common/src/common/init/RegistrySimple.java b/common/src/common/util/RegistrySimple.java similarity index 98% rename from common/src/common/init/RegistrySimple.java rename to common/src/common/util/RegistrySimple.java index 9bc6efc..8e75927 100755 --- a/common/src/common/init/RegistrySimple.java +++ b/common/src/common/util/RegistrySimple.java @@ -1,4 +1,4 @@ -package common.init; +package common.util; import java.util.Collections; import java.util.Iterator; diff --git a/common/src/common/world/Chunk.java b/common/src/common/world/Chunk.java index 84ed58c..6a5fdf7 100755 --- a/common/src/common/world/Chunk.java +++ b/common/src/common/world/Chunk.java @@ -6,7 +6,7 @@ import java.util.Map; import java.util.concurrent.ConcurrentLinkedQueue; import java.util.function.Predicate; -import common.biome.BaseBiome; +import common.biome.Biome; import common.block.Block; import common.block.ITileEntityProvider; import common.collect.Maps; @@ -63,7 +63,7 @@ public class Chunk { Arrays.fill(this.biomes, (byte)-1); } - public Chunk(World world, short[] data, int height, State base, State ceil, Random rand, BaseBiome[] biomes, int x, int z) { + public Chunk(World world, short[] data, int height, State base, State ceil, Random rand, Biome[] biomes, int x, int z) { this(world, x, z); boolean sky = !world.dimension.hasNoLight(); for(int bx = 0; bx < 16; ++bx) { @@ -956,18 +956,18 @@ public class Chunk { } } - public BaseBiome getBiome(BlockPos pos, BiomeGenerator gen) { + public Biome 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) { - BaseBiome biome = gen == null ? BaseBiome.DEF_BIOME : gen.getBiomeGenerator(pos, BaseBiome.DEF_BIOME); + Biome biome = gen == null ? Biome.DEF_BIOME : gen.getBiomeGenerator(pos, Biome.DEF_BIOME); o = biome.id; this.biomes[z << 4 | x] = (byte)(o & 255); } - return BaseBiome.getBiomeDef(o); + return Biome.getBiomeDef(o); } public byte[] getBiomes() { diff --git a/common/src/common/world/IWorldAccess.java b/common/src/common/world/IWorldAccess.java index e90b74f..b798152 100755 --- a/common/src/common/world/IWorldAccess.java +++ b/common/src/common/world/IWorldAccess.java @@ -1,6 +1,6 @@ package common.world; -import common.biome.BaseBiome; +import common.biome.Biome; 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); - BaseBiome getBiomeGenForCoords(BlockPos pos); + Biome getBiomeGenForCoords(BlockPos pos); } diff --git a/common/src/common/world/World.java b/common/src/common/world/World.java index 7597092..519dc36 100755 --- a/common/src/common/world/World.java +++ b/common/src/common/world/World.java @@ -6,7 +6,7 @@ import java.util.List; import java.util.Set; import java.util.function.Predicate; -import common.biome.BaseBiome; +import common.biome.Biome; import common.block.Block; import common.block.BlockHopper; import common.block.BlockLiquid; @@ -133,11 +133,11 @@ public abstract class World implements IWorldAccess { this.gravity = Math.signum(this.gravity) * 0.075; } - public BaseBiome getBiomeGenForCoords(final BlockPos pos) { + public Biome getBiomeGenForCoords(final BlockPos pos) { if(this.isBlockLoaded(pos)) return this.getChunk(pos).getBiome(pos, null); else - return BaseBiome.DEF_BIOME; + return Biome.DEF_BIOME; } public boolean isAirBlock(BlockPos pos) { diff --git a/common/src/common/worldgen/BiomeGenerator.java b/common/src/common/worldgen/BiomeGenerator.java index c8db4d7..b6ef4e9 100755 --- a/common/src/common/worldgen/BiomeGenerator.java +++ b/common/src/common/worldgen/BiomeGenerator.java @@ -2,15 +2,15 @@ package common.worldgen; import java.util.Set; -import common.biome.BaseBiome; +import common.biome.Biome; import common.util.BlockPos; public interface BiomeGenerator { public void genFactors(double[] factors, int xPos, int zPos, int sizeX, int sizeZ); - 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 allowed); + 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 allowed); public void cleanupCache(); } diff --git a/server/src/server/Server.java b/server/src/server/Server.java index a85b8b8..188151c 100755 --- a/server/src/server/Server.java +++ b/server/src/server/Server.java @@ -87,7 +87,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.biome.GenBiome; import server.clipboard.ReorderRegistry; import server.clipboard.RotationRegistry; import server.command.CommandEnvironment; @@ -148,7 +148,7 @@ public final class Server implements IThreadListener { public static void main(String[] args) { Util.checkOs(); Registry.setup("Server thread"); - Biome.setAsProvider(); + GenBiome.setAsProvider(); UniverseRegistry.register(); RotationRegistry.register(); ReorderRegistry.register(); diff --git a/server/src/server/biome/BiomeBeach.java b/server/src/server/biome/BiomeBeach.java index e6fac04..a4dbee5 100755 --- a/server/src/server/biome/BiomeBeach.java +++ b/server/src/server/biome/BiomeBeach.java @@ -1,14 +1,14 @@ package server.biome; -import common.biome.BaseBiome; +import common.biome.Biome; import common.init.Blocks; import common.rng.WeightedList; -public class BiomeBeach extends Biome +public class BiomeBeach extends GenBiome { public BiomeBeach(boolean cold) { - super(cold ? BaseBiome.COLDBEACH : BaseBiome.BEACH); + super(cold ? Biome.COLDBEACH : Biome.BEACH); this.topBlock = Blocks.sand.getState(); this.fillerBlock = Blocks.sand.getState(); this.treesPerChunk = -999; diff --git a/server/src/server/biome/BiomeBlackened.java b/server/src/server/biome/BiomeBlackened.java index c917b39..f03f41f 100644 --- a/server/src/server/biome/BiomeBlackened.java +++ b/server/src/server/biome/BiomeBlackened.java @@ -1,6 +1,6 @@ package server.biome; -import common.biome.BaseBiome; +import common.biome.Biome; import common.block.BlockFlower; import common.entity.npc.EntityMetalhead; import common.init.Blocks; @@ -10,11 +10,11 @@ import common.util.BlockPos; import server.worldgen.tree.WorldGenBaseTree; import server.worldgen.tree.WorldGenTree; -public class BiomeBlackened extends Biome { +public class BiomeBlackened extends GenBiome { protected final WorldGenTree treeGen = new WorldGenBaseTree(false, Blocks.blackwood_log.getState(), Blocks.blackwood_leaves.getState()); public BiomeBlackened() { - super(BaseBiome.BLACKENED); + super(Biome.BLACKENED); this.topBlock = Blocks.blackened_soil.getState(); this.fillerBlock = Blocks.blackened_dirt.getState(); this.treesPerChunk = 3; diff --git a/server/src/server/biome/BiomeChaos.java b/server/src/server/biome/BiomeChaos.java index 7613c41..0bd3c45 100755 --- a/server/src/server/biome/BiomeChaos.java +++ b/server/src/server/biome/BiomeChaos.java @@ -1,6 +1,6 @@ package server.biome; -import common.biome.BaseBiome; +import common.biome.Biome; import common.entity.Entity; import common.entity.types.EntityLiving; import common.init.Blocks; @@ -12,13 +12,13 @@ import server.world.WorldServer; import server.worldgen.FeatureGenerator; import server.worldgen.foliage.WorldGenMushroom; -public class BiomeChaos extends Biome +public class BiomeChaos extends GenBiome { protected FeatureGenerator mushroomBlueGen = new WorldGenMushroom(Blocks.blue_mushroom); public BiomeChaos() { - super(BaseBiome.CHAOS); + super(Biome.CHAOS); this.topBlock = Blocks.obsidian.getState(); this.fillerBlock = Blocks.obsidian.getState(); } diff --git a/server/src/server/biome/BiomeDesert.java b/server/src/server/biome/BiomeDesert.java index e6b445d..0171ff5 100755 --- a/server/src/server/biome/BiomeDesert.java +++ b/server/src/server/biome/BiomeDesert.java @@ -1,6 +1,6 @@ package server.biome; -import common.biome.BaseBiome; +import common.biome.Biome; import common.init.Blocks; import common.rng.Random; import common.rng.WeightedList; @@ -8,11 +8,11 @@ import common.util.BlockPos; import server.world.WorldServer; import server.worldgen.feature.WorldGenDesertWells; -public class BiomeDesert extends Biome +public class BiomeDesert extends GenBiome { public BiomeDesert(boolean hills) { - super(hills ? BaseBiome.DESERTHILLS : BaseBiome.DESERT); + super(hills ? Biome.DESERTHILLS : Biome.DESERT); this.topBlock = Blocks.sand.getState(); this.fillerBlock = Blocks.sand.getState(); this.treesPerChunk = -999; diff --git a/server/src/server/biome/BiomeExterminated.java b/server/src/server/biome/BiomeExterminated.java index cf386f8..78b55fd 100755 --- a/server/src/server/biome/BiomeExterminated.java +++ b/server/src/server/biome/BiomeExterminated.java @@ -1,15 +1,15 @@ package server.biome; -import common.biome.BaseBiome; +import common.biome.Biome; 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 class BiomeExterminated extends GenBiome { public BiomeExterminated() { - super(BaseBiome.EXTERMINATED); + super(Biome.EXTERMINATED); this.topBlock = Blocks.air.getState(); this.fillerBlock = Blocks.air.getState(); } diff --git a/server/src/server/biome/BiomeForest.java b/server/src/server/biome/BiomeForest.java index e77f451..c0ecc14 100755 --- a/server/src/server/biome/BiomeForest.java +++ b/server/src/server/biome/BiomeForest.java @@ -1,6 +1,6 @@ package server.biome; -import common.biome.BaseBiome; +import common.biome.Biome; import common.block.BlockDoublePlant; import common.block.BlockFlower; import common.entity.animal.EntityWolf; @@ -18,7 +18,7 @@ import server.worldgen.tree.WorldGenBirch; import server.worldgen.tree.WorldGenDarkOak; import server.worldgen.tree.WorldGenTree; -public class BiomeForest extends Biome +public class BiomeForest extends GenBiome { private static final BlockDoublePlant.EnumPlantType[] FLOWER_TYPES = new BlockDoublePlant.EnumPlantType[] { BlockDoublePlant.EnumPlantType.SYRINGA, BlockDoublePlant.EnumPlantType.ROSE, BlockDoublePlant.EnumPlantType.PAEONIA @@ -42,7 +42,7 @@ 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(BaseBiome base, int type) + public BiomeForest(Biome base, int type) { super(base); this.subType = type; @@ -195,9 +195,9 @@ public class BiomeForest extends Biome super.decorate(worldIn, rand, pos); } - protected Biome createMutatedBiome(BaseBiome base) + protected GenBiome createMutatedBiome(Biome base) { - if (this.base == BaseBiome.FOREST) + if (this.base == Biome.FOREST) { BiomeForest biomegenforest = new BiomeForest(base, 1); biomegenforest.setScaling(this.depth, this.scale + 0.2F); @@ -205,7 +205,7 @@ public class BiomeForest extends Biome } else { - return this.base != BaseBiome.BIRCHFOREST && this.base != BaseBiome.BIRCHFORESTHILLS ? new BiomeMutated(base, this) + return this.base != Biome.BIRCHFOREST && this.base != Biome.BIRCHFORESTHILLS ? new BiomeMutated(base, this) { public void decorate(WorldServer worldIn, Random rand, BlockPos pos) { diff --git a/server/src/server/biome/BiomeHell.java b/server/src/server/biome/BiomeHell.java index 39fc07e..7e82667 100755 --- a/server/src/server/biome/BiomeHell.java +++ b/server/src/server/biome/BiomeHell.java @@ -1,6 +1,6 @@ package server.biome; -import common.biome.BaseBiome; +import common.biome.Biome; import common.entity.npc.EntityBloodElf; import common.entity.npc.EntityCultivator; import common.entity.npc.EntityFireDemon; @@ -18,7 +18,7 @@ import server.worldgen.feature.WorldGenGlowStone; import server.worldgen.feature.WorldGenHellLava; import server.worldgen.foliage.WorldGenMushroom; -public class BiomeHell extends Biome +public class BiomeHell extends GenBiome { private final int subtype; private final WorldGenFire fireGen; @@ -30,7 +30,7 @@ public class BiomeHell extends Biome private final WorldGenMushroom brownMushroomGen; private final WorldGenMushroom redMushroomGen; - public BiomeHell(BaseBiome base, int subtype) + public BiomeHell(Biome base, int subtype) { super(base); this.subtype = subtype; diff --git a/server/src/server/biome/BiomeHills.java b/server/src/server/biome/BiomeHills.java index dacd5c1..1ec2ed9 100755 --- a/server/src/server/biome/BiomeHills.java +++ b/server/src/server/biome/BiomeHills.java @@ -1,6 +1,6 @@ package server.biome; -import common.biome.BaseBiome; +import common.biome.Biome; import common.init.Blocks; import common.rng.Random; import common.util.BlockPos; @@ -10,7 +10,7 @@ import server.worldgen.FeatureOres; import server.worldgen.tree.WorldGenTaiga2; import server.worldgen.tree.WorldGenTree; -public class BiomeHills extends Biome +public class BiomeHills extends GenBiome { // private FeatureGenerator theWorldGenerator = new FeatureOres(Blocks.monster_egg.getDefaultState().withProperty(BlockSilverfish.VARIANT, BlockSilverfish.EnumType.STONE), false, 7, 9, 0, 64); private FeatureOres theEmeraldGenerator = new FeatureOres(Blocks.emerald_ore.getState(), 3, 5, 1, 4, 32, false); @@ -20,7 +20,7 @@ public class BiomeHills extends Biome private int field_150637_aG = 2; private int field_150638_aH; - protected BiomeHills(BaseBiome base, boolean large) + protected BiomeHills(Biome base, boolean large) { super(base); this.field_150638_aH = this.field_150635_aE; @@ -87,14 +87,14 @@ public class BiomeHills extends Biome /** * this creates a mutation specific to Hills biomes */ - private BiomeHills mutateHills(Biome p_150633_1_) + private BiomeHills mutateHills(GenBiome p_150633_1_) { this.field_150638_aH = this.field_150637_aG; this.setScaling(p_150633_1_.depth, p_150633_1_.scale); return this; } - protected Biome createMutatedBiome(BaseBiome base) + protected GenBiome createMutatedBiome(Biome base) { return (new BiomeHills(base, false)).mutateHills(this); } diff --git a/server/src/server/biome/BiomeJungle.java b/server/src/server/biome/BiomeJungle.java index 84517f2..e871913 100755 --- a/server/src/server/biome/BiomeJungle.java +++ b/server/src/server/biome/BiomeJungle.java @@ -1,6 +1,6 @@ package server.biome; -import common.biome.BaseBiome; +import common.biome.Biome; import common.block.BlockTallGrass; import common.entity.animal.EntityChicken; import common.entity.animal.EntityOcelot; @@ -18,7 +18,7 @@ import server.worldgen.tree.WorldGenBaseTree; import server.worldgen.tree.WorldGenJungle; import server.worldgen.tree.WorldGenTree; -public class BiomeJungle extends Biome +public class BiomeJungle extends GenBiome { private static final State LOG = Blocks.jungle_log.getState(); // .withProperty(BlockOldLog.VARIANT, BlockPlanks.EnumType.JUNGLE); private static final State LEAVES = Blocks.jungle_leaves.getState(); // .withProperty(BlockOldLeaf.VARIANT, BlockPlanks.EnumType.JUNGLE); // .withProperty(BlockLeaves.CHECK_DECAY, Boolean.valueOf(false)); @@ -26,7 +26,7 @@ public class BiomeJungle extends Biome private final boolean edge; - public BiomeJungle(BaseBiome base, boolean edge) + public BiomeJungle(Biome base, boolean edge) { super(base); this.edge = edge; diff --git a/server/src/server/biome/BiomeMesa.java b/server/src/server/biome/BiomeMesa.java index 90dca55..6651be2 100755 --- a/server/src/server/biome/BiomeMesa.java +++ b/server/src/server/biome/BiomeMesa.java @@ -2,7 +2,7 @@ package server.biome; import java.util.Arrays; -import common.biome.BaseBiome; +import common.biome.Biome; import common.block.Block; import common.block.BlockColored; import common.block.BlockDirt; @@ -19,7 +19,7 @@ import server.world.WorldServer; import server.worldgen.ChunkPrimer; import server.worldgen.tree.WorldGenTree; -public class BiomeMesa extends Biome +public class BiomeMesa extends GenBiome { private final boolean bryce; private final boolean soil; @@ -30,7 +30,7 @@ public class BiomeMesa extends Biome private PerlinGen highBryceGen; private PerlinGen clayColorGen; - public BiomeMesa(BaseBiome base, boolean bryce, boolean soil) + public BiomeMesa(Biome base, boolean bryce, boolean soil) { super(base); this.bryce = bryce; @@ -317,9 +317,9 @@ public class BiomeMesa extends Biome return this.layers[(y + i + 64) % 64]; } - protected Biome createMutatedBiome(BaseBiome base) + protected GenBiome createMutatedBiome(Biome base) { - boolean bryce = this.base == BaseBiome.MESA; + boolean bryce = this.base == Biome.MESA; BiomeMesa mesa = new BiomeMesa(base, bryce, this.soil); if (!bryce) diff --git a/server/src/server/biome/BiomeMoon.java b/server/src/server/biome/BiomeMoon.java index 2263900..cab5cfc 100755 --- a/server/src/server/biome/BiomeMoon.java +++ b/server/src/server/biome/BiomeMoon.java @@ -1,6 +1,6 @@ package server.biome; -import common.biome.BaseBiome; +import common.biome.Biome; import common.init.Blocks; import common.rng.Random; import common.rng.WeightedList; @@ -8,11 +8,11 @@ import common.util.BlockPos; import server.world.WorldServer; import server.worldgen.FeatureOres; -public class BiomeMoon extends Biome { +public class BiomeMoon extends GenBiome { private FeatureOres cheeseGenerator = new FeatureOres(Blocks.moon_cheese.getState(), 8, 8, 12, 24, 52, false); public BiomeMoon() { - super(BaseBiome.MOON); + super(Biome.MOON); this.topBlock = Blocks.moon_rock.getState(); this.fillerBlock = Blocks.moon_rock.getState(); } diff --git a/server/src/server/biome/BiomeMushroom.java b/server/src/server/biome/BiomeMushroom.java index 755e52b..1e00da7 100755 --- a/server/src/server/biome/BiomeMushroom.java +++ b/server/src/server/biome/BiomeMushroom.java @@ -1,15 +1,15 @@ package server.biome; -import common.biome.BaseBiome; +import common.biome.Biome; import common.entity.animal.EntityMooshroom; import common.init.Blocks; import common.rng.WeightedList; -public class BiomeMushroom extends Biome +public class BiomeMushroom extends GenBiome { public BiomeMushroom() { - super(BaseBiome.MUSHROOMPLAINS); + super(Biome.MUSHROOMPLAINS); this.treesPerChunk = -100; this.flowersPerChunk = -100; this.grassPerChunk = -100; diff --git a/server/src/server/biome/BiomeMutated.java b/server/src/server/biome/BiomeMutated.java index a422fda..91b3dfb 100755 --- a/server/src/server/biome/BiomeMutated.java +++ b/server/src/server/biome/BiomeMutated.java @@ -1,6 +1,6 @@ package server.biome; -import common.biome.BaseBiome; +import common.biome.Biome; import common.rng.Random; import common.rng.WeightedList; import common.util.BlockPos; @@ -8,11 +8,11 @@ import server.world.WorldServer; import server.worldgen.ChunkPrimer; import server.worldgen.tree.WorldGenTree; -public class BiomeMutated extends Biome +public class BiomeMutated extends GenBiome { - protected Biome baseBiome; + protected GenBiome baseBiome; - public BiomeMutated(BaseBiome base, Biome biome) + public BiomeMutated(Biome base, GenBiome biome) { super(base); this.baseBiome = biome; @@ -63,7 +63,7 @@ public class BiomeMutated extends Biome return this.baseBiome.genBigTreeChance(rand); } - public Class getBiomeClass() + public Class getBiomeClass() { return this.baseBiome.getBiomeClass(); } @@ -71,7 +71,7 @@ public class BiomeMutated extends Biome /** * returns true if the biome specified is equal to this biome */ - public boolean isEqualTo(Biome biome) + public boolean isEqualTo(GenBiome biome) { return this.baseBiome.isEqualTo(biome); } diff --git a/server/src/server/biome/BiomeNone.java b/server/src/server/biome/BiomeNone.java index 4ae060c..f3ef796 100755 --- a/server/src/server/biome/BiomeNone.java +++ b/server/src/server/biome/BiomeNone.java @@ -1,6 +1,6 @@ package server.biome; -import common.biome.BaseBiome; +import common.biome.Biome; import common.init.Blocks; import common.rng.Random; import common.rng.WeightedList; @@ -8,9 +8,9 @@ import common.util.BlockPos; import server.world.WorldServer; import server.worldgen.ChunkPrimer; -public class BiomeNone extends Biome { +public class BiomeNone extends GenBiome { public BiomeNone() { - super(BaseBiome.NONE); + super(Biome.NONE); this.topBlock = Blocks.air.getState(); this.fillerBlock = Blocks.air.getState(); } diff --git a/server/src/server/biome/BiomePlains.java b/server/src/server/biome/BiomePlains.java index d9b1c03..2732ac8 100755 --- a/server/src/server/biome/BiomePlains.java +++ b/server/src/server/biome/BiomePlains.java @@ -1,6 +1,6 @@ package server.biome; -import common.biome.BaseBiome; +import common.biome.Biome; import common.block.BlockDoublePlant; import common.block.BlockFlower; import common.entity.animal.EntityHorse; @@ -8,7 +8,7 @@ import common.rng.Random; import common.util.BlockPos; import server.world.WorldServer; -public class BiomePlains extends Biome +public class BiomePlains extends GenBiome { private static final BlockFlower.EnumFlowerType[] TULIP_TYPES = new BlockFlower.EnumFlowerType[] { BlockFlower.EnumFlowerType.ORANGE_TULIP, BlockFlower.EnumFlowerType.RED_TULIP, @@ -23,7 +23,7 @@ public class BiomePlains extends Biome protected BiomePlains() { - super(BaseBiome.PLAINS); + super(Biome.PLAINS); this.setScaling(Scaling.PLAINS_LOW); this.mobs.add(new RngSpawn(EntityHorse.class, 5, 2, 6)); this.treesPerChunk = -999; diff --git a/server/src/server/biome/BiomeSavanna.java b/server/src/server/biome/BiomeSavanna.java index d35f6d9..1063529 100755 --- a/server/src/server/biome/BiomeSavanna.java +++ b/server/src/server/biome/BiomeSavanna.java @@ -1,6 +1,6 @@ package server.biome; -import common.biome.BaseBiome; +import common.biome.Biome; import common.block.BlockDirt; import common.block.BlockDoublePlant; import common.entity.animal.EntityHorse; @@ -12,13 +12,13 @@ import server.worldgen.ChunkPrimer; import server.worldgen.tree.WorldGenSavanna; import server.worldgen.tree.WorldGenTree; -public class BiomeSavanna extends Biome +public class BiomeSavanna extends GenBiome { private static final WorldGenSavanna field_150627_aC = new WorldGenSavanna(false); protected BiomeSavanna(boolean plateau) { - super(plateau ? BaseBiome.SAVANNAPLATEAU : BaseBiome.SAVANNA); + super(plateau ? Biome.SAVANNAPLATEAU : Biome.SAVANNA); this.mobs.add(new RngSpawn(EntityHorse.class, 1, 2, 6)); this.treesPerChunk = 1; this.flowersPerChunk = 4; @@ -30,9 +30,9 @@ public class BiomeSavanna extends Biome return (WorldGenTree)(rand.rarity(5) ? field_150627_aC : this.worldGeneratorTrees); } - protected Biome createMutatedBiome(BaseBiome base) + protected GenBiome createMutatedBiome(Biome base) { - Biome biomegenbase = new BiomeSavanna.Mutated(base, this); + GenBiome biomegenbase = new BiomeSavanna.Mutated(base, this); biomegenbase.depth = this.depth * 0.5F + 0.3F; biomegenbase.scale = this.scale * 0.5F + 1.2F; return biomegenbase; @@ -55,7 +55,7 @@ public class BiomeSavanna extends Biome public static class Mutated extends BiomeMutated { - public Mutated(BaseBiome base, Biome p_i45382_2_) + public Mutated(Biome base, GenBiome p_i45382_2_) { super(base, p_i45382_2_); this.treesPerChunk = 2; diff --git a/server/src/server/biome/BiomeSnow.java b/server/src/server/biome/BiomeSnow.java index 134f190..ea236f2 100755 --- a/server/src/server/biome/BiomeSnow.java +++ b/server/src/server/biome/BiomeSnow.java @@ -1,6 +1,6 @@ package server.biome; -import common.biome.BaseBiome; +import common.biome.Biome; import common.init.Blocks; import common.rng.Random; import common.rng.WeightedList; @@ -11,13 +11,13 @@ import server.worldgen.feature.WorldGenIceSpike; import server.worldgen.tree.WorldGenTaiga2; import server.worldgen.tree.WorldGenTree; -public class BiomeSnow extends Biome +public class BiomeSnow extends GenBiome { private final WorldGenIceSpike spikeGen = new WorldGenIceSpike(); private final WorldGenIcePath pathGen = new WorldGenIcePath(4); private final boolean spiky; - public BiomeSnow(BaseBiome base, boolean spiky) + public BiomeSnow(Biome base, boolean spiky) { super(base); this.spiky = spiky; @@ -55,9 +55,9 @@ public class BiomeSnow extends Biome return new WorldGenTaiga2(false); } - protected Biome createMutatedBiome(BaseBiome base) + protected GenBiome createMutatedBiome(Biome base) { - Biome biomegenbase = (new BiomeSnow(base, true)).enableColdBeach().setScaling(this.depth + 0.1F, this.scale + 0.1F); + GenBiome 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; diff --git a/server/src/server/biome/BiomeSnowLand.java b/server/src/server/biome/BiomeSnowLand.java index 0ba4b65..37295ea 100755 --- a/server/src/server/biome/BiomeSnowLand.java +++ b/server/src/server/biome/BiomeSnowLand.java @@ -1,16 +1,16 @@ package server.biome; -import common.biome.BaseBiome; +import common.biome.Biome; import common.entity.animal.EntitySheep; import common.entity.npc.EntitySpirit; import common.init.Blocks; import common.rng.WeightedList; -public class BiomeSnowLand extends Biome +public class BiomeSnowLand extends GenBiome { public BiomeSnowLand() { - super(BaseBiome.SNOWLAND); + super(Biome.SNOWLAND); this.topBlock = Blocks.snow.getState(); this.fillerBlock = Blocks.snow.getState(); this.mushroomsPerChunk = -1; diff --git a/server/src/server/biome/BiomeSpace.java b/server/src/server/biome/BiomeSpace.java index ad2708a..93f8d1f 100755 --- a/server/src/server/biome/BiomeSpace.java +++ b/server/src/server/biome/BiomeSpace.java @@ -1,6 +1,6 @@ package server.biome; -import common.biome.BaseBiome; +import common.biome.Biome; import common.block.BlockDirt; import common.init.Blocks; import common.rng.Random; @@ -10,7 +10,7 @@ import server.world.WorldServer; import server.worldgen.FeatureGenerator; import server.worldgen.feature.WorldGenAsteroid; -public class BiomeSpace extends Biome +public class BiomeSpace extends GenBiome { protected FeatureGenerator asteroidGen1 = new WorldGenAsteroid(Blocks.stone.getState(), Blocks.rock.getState()); @@ -19,7 +19,7 @@ public class BiomeSpace extends Biome public BiomeSpace() { - super(BaseBiome.SPACE); + super(Biome.SPACE); this.topBlock = Blocks.air.getState(); this.fillerBlock = Blocks.air.getState(); } diff --git a/server/src/server/biome/BiomeStoneBeach.java b/server/src/server/biome/BiomeStoneBeach.java index 9c6fa69..47a4c5b 100755 --- a/server/src/server/biome/BiomeStoneBeach.java +++ b/server/src/server/biome/BiomeStoneBeach.java @@ -1,14 +1,14 @@ package server.biome; -import common.biome.BaseBiome; +import common.biome.Biome; import common.init.Blocks; import common.rng.WeightedList; -public class BiomeStoneBeach extends Biome +public class BiomeStoneBeach extends GenBiome { public BiomeStoneBeach() { - super(BaseBiome.STONEBEACH); + super(Biome.STONEBEACH); // this.mobs.clear(); this.topBlock = Blocks.stone.getState(); this.fillerBlock = Blocks.stone.getState(); diff --git a/server/src/server/biome/BiomeSwamp.java b/server/src/server/biome/BiomeSwamp.java index 6b10c37..eb5cdd0 100755 --- a/server/src/server/biome/BiomeSwamp.java +++ b/server/src/server/biome/BiomeSwamp.java @@ -1,6 +1,6 @@ package server.biome; -import common.biome.BaseBiome; +import common.biome.Biome; import common.block.BlockDirectional; import common.block.BlockFlower; import common.entity.npc.EntitySlime; @@ -13,11 +13,11 @@ import server.world.WorldServer; import server.worldgen.ChunkPrimer; import server.worldgen.tree.WorldGenTree; -public class BiomeSwamp extends Biome +public class BiomeSwamp extends GenBiome { protected BiomeSwamp() { - super(BaseBiome.SWAMPLAND); + super(Biome.SWAMPLAND); this.treesPerChunk = 2; this.flowersPerChunk = 1; this.deadBushPerChunk = 1; diff --git a/server/src/server/biome/BiomeTaiga.java b/server/src/server/biome/BiomeTaiga.java index e892d05..d7a9c5f 100755 --- a/server/src/server/biome/BiomeTaiga.java +++ b/server/src/server/biome/BiomeTaiga.java @@ -1,6 +1,6 @@ package server.biome; -import common.biome.BaseBiome; +import common.biome.Biome; import common.block.BlockDirt; import common.block.BlockDoublePlant; import common.block.BlockTallGrass; @@ -18,7 +18,7 @@ import server.worldgen.tree.WorldGenTaiga1; import server.worldgen.tree.WorldGenTaiga2; import server.worldgen.tree.WorldGenTree; -public class BiomeTaiga extends Biome +public class BiomeTaiga extends GenBiome { private static final WorldGenTaiga1 field_150639_aC = new WorldGenTaiga1(); private static final WorldGenTaiga2 field_150640_aD = new WorldGenTaiga2(false); @@ -27,7 +27,7 @@ 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(BaseBiome base, int p_i45385_2_) + public BiomeTaiga(Biome base, int p_i45385_2_) { super(base); this.field_150644_aH = p_i45385_2_; @@ -108,8 +108,8 @@ public class BiomeTaiga extends Biome this.generateBiomeTerrain(worldIn, rand, chunkPrimerIn, x, z, noiseVal); } - protected Biome createMutatedBiome(BaseBiome base) + protected GenBiome createMutatedBiome(Biome base) { - return this.base == BaseBiome.MEGATAIGA ? (new BiomeTaiga(base, 2)).setScaling(this.depth, this.scale) : super.createMutatedBiome(base); + return this.base == Biome.MEGATAIGA ? (new BiomeTaiga(base, 2)).setScaling(this.depth, this.scale) : super.createMutatedBiome(base); } } diff --git a/server/src/server/biome/BiomeTian.java b/server/src/server/biome/BiomeTian.java index c7a52c3..58c7d45 100755 --- a/server/src/server/biome/BiomeTian.java +++ b/server/src/server/biome/BiomeTian.java @@ -1,6 +1,6 @@ package server.biome; -import common.biome.BaseBiome; +import common.biome.Biome; import common.block.BlockFlower; import common.entity.animal.EntityBat; import common.entity.animal.EntityMouse; @@ -18,7 +18,7 @@ import server.worldgen.tree.WorldGenBaseTree; import server.worldgen.tree.WorldGenBigTree; import server.worldgen.tree.WorldGenTree; -public class BiomeTian extends Biome +public class BiomeTian extends GenBiome { protected FeatureGenerator spikeGen = new WorldGenSpikes(Blocks.tian_soil, 128, 2, 3, Blocks.obsidian.getState(), true); protected FeatureGenerator mushroomBlueGen = new WorldGenMushroom(Blocks.blue_mushroom); @@ -32,7 +32,7 @@ public class BiomeTian extends Biome public BiomeTian() { - super(BaseBiome.TIAN); + super(Biome.TIAN); this.topBlock = Blocks.tian_soil.getState(); this.fillerBlock = Blocks.tian.getState(); this.mushroomsPerChunk = -1; diff --git a/server/src/server/biome/BiomeWater.java b/server/src/server/biome/BiomeWater.java index acf45c1..48c853b 100755 --- a/server/src/server/biome/BiomeWater.java +++ b/server/src/server/biome/BiomeWater.java @@ -1,13 +1,13 @@ package server.biome; -import common.biome.BaseBiome; +import common.biome.Biome; import common.entity.animal.EntitySquid; import common.rng.WeightedList; -public class BiomeWater extends Biome { +public class BiomeWater extends GenBiome { private final boolean river; - public BiomeWater(BaseBiome base, boolean river) { + public BiomeWater(Biome base, boolean river) { super(base); this.river = river; this.disableBeach(); diff --git a/server/src/server/biome/Biome.java b/server/src/server/biome/GenBiome.java similarity index 79% rename from server/src/server/biome/Biome.java rename to server/src/server/biome/GenBiome.java index a8564f4..825b630 100755 --- a/server/src/server/biome/Biome.java +++ b/server/src/server/biome/GenBiome.java @@ -1,6 +1,6 @@ package server.biome; -import common.biome.BaseBiome; +import common.biome.Biome; import common.biome.IBiome; import common.block.Block; import common.block.BlockColored; @@ -61,70 +61,70 @@ import server.worldgen.tree.WorldGenSwamp; import server.worldgen.tree.WorldGenTaiga2; import server.worldgen.tree.WorldGenTree; -public abstract class Biome implements IBiome { - public static final Biome[] BIOMES = new Biome[256]; +public abstract class GenBiome implements IBiome { + public static final GenBiome[] BIOMES = new GenBiome[256]; - public static final Biome none = (new BiomeNone()); + public static final GenBiome none = (new BiomeNone()); - 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 GenBiome plains = (new BiomePlains()); + public static final GenBiome desert = (new BiomeDesert(false)).setScaling(Scaling.PLAINS_LOW); + public static final GenBiome extremeHills = (new BiomeHills(Biome.EXTREMEHILLS, false)).setScaling(Scaling.HILLS_LARGE); + public static final GenBiome forest = (new BiomeForest(Biome.FOREST, 0)); + public static final GenBiome taiga = (new BiomeTaiga(Biome.TAIGA, 0)).setScaling(Scaling.PLAINS_MEDIUM); + public static final GenBiome swampland = (new BiomeSwamp()).setScaling(Scaling.SEA_POND); + public static final GenBiome river = (new BiomeWater(Biome.RIVER, true)).setScaling(Scaling.SEA_SHALLOW); - public static final Biome exterminated = (new BiomeExterminated()); - public static final Biome space = (new BiomeSpace()); + public static final GenBiome exterminated = (new BiomeExterminated()); + public static final GenBiome space = (new BiomeSpace()); - 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 GenBiome frozenSea = (new BiomeWater(Biome.FROZENSEA, false)).enableColdBeach().setScaling(Scaling.SEA_MEDIUM); + public static final GenBiome frozenRiver = (new BiomeWater(Biome.FROZENRIVER, true)).enableColdBeach().setScaling(Scaling.SEA_SHALLOW); + public static final GenBiome icePlains = (new BiomeSnow(Biome.ICEPLAINS, false)).enableColdBeach().setScaling(Scaling.PLAINS_LOW); + public static final GenBiome iceMountains = (new BiomeSnow(Biome.ICEMOUNTAINS, false)).enableColdBeach().setScaling(Scaling.HILLS_LOW); + public static final GenBiome mushroomPlains = (new BiomeMushroom()).setScaling(Scaling.PLAINS_VARYING); + public static final GenBiome blackened = (new BiomeBlackened()); + public static final GenBiome beach = (new BiomeBeach(false)).setScaling(Scaling.SEA_SHORE); + public static final GenBiome desertHills = (new BiomeDesert(true)).setScaling(Scaling.HILLS_LOW); + public static final GenBiome forestHills = (new BiomeForest(Biome.FORESTHILLS, 0)).setScaling(Scaling.HILLS_LOW); + public static final GenBiome taigaHills = (new BiomeTaiga(Biome.TAIGAHILLS, 0)).setScaling(Scaling.HILLS_LOW); + public static final GenBiome extremeHillsEdge = (new BiomeHills(Biome.EXTREMEHILLSEDGE, true)).setScaling(Scaling.HILLS_MEDIUM); + public static final GenBiome jungle = (new BiomeJungle(Biome.JUNGLE, false)); + public static final GenBiome jungleHills = (new BiomeJungle(Biome.JUNGLEHILLS, false)).setScaling(Scaling.HILLS_LOW); + public static final GenBiome jungleEdge = (new BiomeJungle(Biome.JUNGLEEDGE, true)); + public static final GenBiome sea = (new BiomeWater(Biome.SEA, false)).setScaling(Scaling.SEA_MEDIUM); + public static final GenBiome stoneBeach = (new BiomeStoneBeach()).setScaling(Scaling.SEA_VARYING); + public static final GenBiome coldBeach = (new BiomeBeach(true)).setScaling(Scaling.SEA_SHORE).enableColdBeach(); + public static final GenBiome birchForest = (new BiomeForest(Biome.BIRCHFOREST, 2)); + public static final GenBiome birchForestHills = (new BiomeForest(Biome.BIRCHFORESTHILLS, 2)).setScaling(Scaling.HILLS_LOW); + public static final GenBiome roofedForest = (new BiomeForest(Biome.ROOFEDFOREST, 3)); + public static final GenBiome coldTaiga = (new BiomeTaiga(Biome.COLDTAIGA, 0)).enableColdBeach().setScaling(Scaling.PLAINS_MEDIUM); + public static final GenBiome coldTaigaHills = (new BiomeTaiga(Biome.COLDTAIGAHILLS, 0)).enableColdBeach().setScaling(Scaling.HILLS_LOW); + public static final GenBiome megaTaiga = (new BiomeTaiga(Biome.MEGATAIGA, 1)).setScaling(Scaling.PLAINS_MEDIUM); + public static final GenBiome megaTaigaHills = (new BiomeTaiga(Biome.MEGATAIGAHILLS, 1)).setScaling(Scaling.HILLS_LOW); + public static final GenBiome extremeHillsPlus = (new BiomeHills(Biome.EXTREMEHILLSPLUS, true)).setScaling(Scaling.HILLS_LARGE); + public static final GenBiome savanna = (new BiomeSavanna(false)).setScaling(Scaling.PLAINS_LOW); + public static final GenBiome savannaPlateau = (new BiomeSavanna(true)).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 GenBiome mesa = (new BiomeMesa(Biome.MESA, false, false)); + public static final GenBiome mesaPlateau_F = (new BiomeMesa(Biome.MESAPLATEAUF, false, true)).setScaling(Scaling.HILLS_PLATEAU); + public static final GenBiome mesaPlateau = (new BiomeMesa(Biome.MESAPLATEAU, false, false)).setScaling(Scaling.HILLS_PLATEAU); - 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 GenBiome snowLand = (new BiomeSnowLand()).enableColdBeach(); + public static final GenBiome tian = (new BiomeTian()).setScaling(Scaling.VARYING_MEDIUM); + public static final GenBiome elvenForest = (new BiomeForest(Biome.ELVENFOREST, 4)); + public static final GenBiome upperHell = (new BiomeHell(Biome.UPPERHELL, 0)); + public static final GenBiome lowerHell = (new BiomeHell(Biome.LOWERHELL, 1)); + public static final GenBiome hellHills = (new BiomeHell(Biome.HELLHILLS, 1)).setScaling(Scaling.HILLS_LARGE); + public static final GenBiome soulPlains = (new BiomeHell(Biome.SOULPLAINS, 1)).setScaling(Scaling.SEA_POND); + public static final GenBiome ashLand = (new BiomeHell(Biome.ASHLAND, 2)).setScaling(Scaling.PLAINS_LOW); + public static final GenBiome moon = (new BiomeMoon()).setScaling(Scaling.PLAINS_LOW); + public static final GenBiome chaos = (new BiomeChaos()).setScaling(Scaling.VARYING_CHAOTIC); - protected static final PerlinGen TREE_NOISE; - protected static final PerlinGen GRASS_NOISE; - protected static final FeatureDoublePlant DOUBLE_PLANT_GEN; + protected static final PerlinGen TREE_NOISE = new PerlinGen(new Random(726528729282625L), 8); + protected static final PerlinGen GRASS_NOISE = new PerlinGen(new Random(297363826225L), 1); + protected static final FeatureDoublePlant DOUBLE_PLANT_GEN = new FeatureDoublePlant(); - public final BaseBiome base; + public final Biome base; protected final WeightedList mobs = new WeightedList(); protected final WorldGenBaseTree worldGeneratorTrees = new WorldGenBaseTree(false); @@ -165,7 +165,7 @@ public abstract class Biome implements IBiome { protected int clayExtPerChunk = 0; // 10 protected int bigMushroomsPerChunk = 0; - public static Biome getBiome(int id) + public static GenBiome getBiome(int id) { if (id >= 0 && id < BIOMES.length) { @@ -173,20 +173,43 @@ public abstract class Biome implements IBiome { } 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]; + Log.JNI.warn("Biom-ID ist nicht im Bereich: " + id + ", verwende " + Biome.DEF_BIOME.id + " (" + Biome.DEF_BIOME.name + ")"); + return BIOMES[Biome.DEF_BIOME.id]; } } public static void setAsProvider() { IBiome.setProvider(new IBiome.BiomeProvider() { - public final IBiome getBiome(BaseBiome base) { + public final IBiome getBiome(Biome base) { return BIOMES[base.id]; } }); } - protected Biome(BaseBiome base) { + static { + desert.createMutatedBiome(Biome.DESERTM); + forest.createMutatedBiome(Biome.FLOWERFOREST); + taiga.createMutatedBiome(Biome.TAIGAM); + swampland.createMutatedBiome(Biome.SWAMPLANDM); + icePlains.createMutatedBiome(Biome.ICEPLAINSSPIKES); + jungle.createMutatedBiome(Biome.JUNGLEM); + jungleEdge.createMutatedBiome(Biome.JUNGLEEDGEM); + coldTaiga.createMutatedBiome(Biome.COLDTAIGAM); + savanna.createMutatedBiome(Biome.SAVANNAM); + savannaPlateau.createMutatedBiome(Biome.SAVANNAPLATEAUM); + mesa.createMutatedBiome(Biome.MESABRYCE); + mesaPlateau_F.createMutatedBiome(Biome.MESAPLATEAUFM); + mesaPlateau.createMutatedBiome(Biome.MESAPLATEAUM); + birchForest.createMutatedBiome(Biome.BIRCHFORESTM); + birchForestHills.createMutatedBiome(Biome.BIRCHFORESTHILLSM); + roofedForest.createMutatedBiome(Biome.ROOFEDFORESTM); + megaTaiga.createMutatedBiome(Biome.MEGASPRUCETAIGA); + extremeHills.createMutatedBiome(Biome.EXTREMEHILLSM); + extremeHillsPlus.createMutatedBiome(Biome.EXTREMEHILLSPLUSM); + megaTaiga.createMutatedBiome(Biome.REDWOODTAIGAHILLSM); + } + + protected GenBiome(Biome base) { BIOMES[base.id] = this; this.base = base; this.addMobs(this.mobs); @@ -210,12 +233,12 @@ public abstract class Biome implements IBiome { mobs.add(new RngSpawn(EntityMouse.class, 10, 8, 8)); } - protected final Biome setScaling(Scaling scaling) + protected final GenBiome setScaling(Scaling scaling) { return this.setScaling(scaling.depth, scaling.scale); } - protected final Biome setScaling(float depth, float scale) + protected final GenBiome setScaling(float depth, float scale) { this.depth = depth; this.scale = scale; @@ -252,13 +275,13 @@ public abstract class Biome implements IBiome { return this.topBlock; } - protected Biome enableColdBeach() + protected GenBiome enableColdBeach() { this.allowColdBeach = true; return this; } - protected Biome disableBeach() + protected GenBiome disableBeach() { this.disallowBeach = true; return this; @@ -829,17 +852,17 @@ public abstract class Biome implements IBiome { } } - protected Biome createMutatedBiome(BaseBiome base) + protected GenBiome createMutatedBiome(Biome base) { return new BiomeMutated(base, this); } - public Class getBiomeClass() + public Class getBiomeClass() { return this.getClass(); } - public boolean isEqualTo(Biome biome) + public boolean isEqualTo(GenBiome biome) { return biome == this ? true : (biome == null ? false : this.getBiomeClass() == biome.getBiomeClass()); } @@ -848,32 +871,4 @@ public abstract class Biome implements IBiome { { return this.base.temperature < -12.0f ? Temperature.COLD : (this.base.temperature < 20.0f ? Temperature.MEDIUM : Temperature.WARM); } - - static - { - 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); - - TREE_NOISE = new PerlinGen(new Random(667L), 8); - GRASS_NOISE = new PerlinGen(new Random(2345L), 1); - DOUBLE_PLANT_GEN = new FeatureDoublePlant(); - } } diff --git a/server/src/server/world/Converter.java b/server/src/server/world/Converter.java index 4ce09ac..34001e7 100644 --- a/server/src/server/world/Converter.java +++ b/server/src/server/world/Converter.java @@ -15,7 +15,7 @@ import java.util.Map.Entry; import java.util.zip.GZIPInputStream; import java.util.zip.InflaterInputStream; -import common.biome.BaseBiome; +import common.biome.Biome; 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)(BaseBiome.DEF_BIOME.id & 255)); + Arrays.fill(biomes, (byte)(Biome.DEF_BIOME.id & 255)); tag.setByteArray("Biomes", biomes); } NBTTagList ents = tag.getTagList("Entities", 10); diff --git a/server/src/server/world/Spawner.java b/server/src/server/world/Spawner.java index 307d605..5133cf3 100755 --- a/server/src/server/world/Spawner.java +++ b/server/src/server/world/Spawner.java @@ -16,7 +16,7 @@ import common.util.ChunkPos; import common.util.ExtMath; import common.world.Chunk; import common.world.World; -import server.biome.Biome; +import server.biome.GenBiome; import server.biome.RngSpawn; public abstract class Spawner { @@ -162,7 +162,7 @@ public abstract class Spawner { return spawned; } - public static void generate(WorldServer world, Biome biome, int x, int z, int sx, int sz, Random rand) { + public static void generate(WorldServer world, GenBiome biome, int x, int z, int sx, int sz, Random rand) { int iters = 0; while(rand.floatv() < biome.getMobGenChance()) { if(iters++ == 10) diff --git a/server/src/server/world/WorldServer.java b/server/src/server/world/WorldServer.java index d20dce3..84c1cf1 100755 --- a/server/src/server/world/WorldServer.java +++ b/server/src/server/world/WorldServer.java @@ -13,7 +13,7 @@ import java.util.TreeSet; import java.util.concurrent.ConcurrentHashMap; import java.util.function.Predicate; -import common.biome.BaseBiome; +import common.biome.Biome; import common.block.Block; import common.block.BlockDoor; import common.block.BlockEventData; @@ -85,7 +85,7 @@ import common.worldgen.FeatureLake; import common.worldgen.FeatureLiquid; import common.worldgen.FeatureOre; import server.Server; -import server.biome.Biome; +import server.biome.GenBiome; import server.biome.RngSpawn; import server.clipboard.ClipboardBlock; import server.network.Player; @@ -146,7 +146,7 @@ public final class WorldServer extends AWorldServer { private final IntHashMap trackMap = new IntHashMap(); private final Map dataMap = Maps.newHashMap(); private final List dataList = Lists.newArrayList(); - private final BaseBiome[] biomes = new BaseBiome[256]; + private final Biome[] biomes = new Biome[256]; private MapGenCaves caveGen; private MapGenBigCaves bigCaveGen; @@ -193,11 +193,11 @@ public final class WorldServer extends AWorldServer { 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()); + this.dimension.getSnowRarity(), this.dimension.getSeaRarity(), this.dimension.getAddBiomes() == null ? new Biome[0] : this.dimension.getAddBiomes(), this.dimension.getAddRarity(), + this.dimension.getHotBiomes() == null ? new Biome[] {this.dimension.getDefaultBiome()} : this.dimension.getHotBiomes(), + this.dimension.getMediumBiomes() == null ? new Biome[] {this.dimension.getDefaultBiome()} : this.dimension.getMediumBiomes(), + this.dimension.getColdBiomes() == null ? new Biome[] {this.dimension.getDefaultBiome()} : this.dimension.getColdBiomes(), + this.dimension.getFrostBiomes() == null ? new Biome[] {this.dimension.getDefaultBiome()} : this.dimension.getFrostBiomes()) : new BiomeGenSingle(this.dimension.getDefaultBiome()); } private ChunkGenerator createChunkGenerator(Random rand) { @@ -334,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(BaseBiome.NONE); + this.biomeGen = new BiomeGenSingle(Biome.NONE); this.generator = new GeneratorDebug(); this.replacer = null; this.populate = false; @@ -596,13 +596,13 @@ public final class WorldServer extends AWorldServer { } private WeightedList getSpawnTypes(BlockPos pos) { - BaseBiome biome = this.getBiomeGenForCoords(pos); + Biome 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 MobConstants.FORTRESS_MOBS; else if(this.scatteredGen != null && this.scatteredGen.hasMageHut(pos)) return MobConstants.MAGEHUT_MOBS; - return Biome.BIOMES[biome.id].getMobs(); + return GenBiome.BIOMES[biome.id].getMobs(); } public RngSpawn getSpawnListEntryForTypeAt(BlockPos pos) { @@ -623,11 +623,11 @@ public final class WorldServer extends AWorldServer { return this.biomeGen; } - public BaseBiome getBiomeGenForCoords(final BlockPos pos) { + public Biome getBiomeGenForCoords(final BlockPos pos) { if(this.isBlockLoaded(pos)) return this.getChunk(pos).getBiome(pos, this.biomeGen); else - return this.biomeGen.getBiomeGenerator(pos, BaseBiome.DEF_BIOME); + return this.biomeGen.getBiomeGenerator(pos, Biome.DEF_BIOME); } public void setItemData(String dataID, WorldSavedData worldSavedDataIn) { @@ -1537,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 = Biome.BIOMES[this.getBiomeGenForCoords(pos.add(16, 0, 16)).id]; + GenBiome biome = GenBiome.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; @@ -1741,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(BaseBiome.EXTERMINATED); + this.biomeGen = new BiomeGenSingle(Biome.EXTERMINATED); this.replacer = null; this.populate = false; this.liquid = Blocks.air.getState(); @@ -2245,7 +2245,7 @@ public final class WorldServer extends AWorldServer { // return new LazyBlock(state, this, position); // } - public final boolean setBiome(BlockPos position, BaseBiome biome) { + public final boolean setBiome(BlockPos position, Biome biome) { Chunk chunk = this.getChunk(position); if((chunk != null) && (chunk.isLoaded())) { chunk.getBiomes()[((position.getZ() & 0xF) << 4 | position.getX() & 0xF)] = (byte)biome.id; @@ -2254,7 +2254,7 @@ public final class WorldServer extends AWorldServer { return false; } - public final void setBiomes(BlockPos start, BlockPos end, BaseBiome biome) { + public final void setBiomes(BlockPos start, BlockPos end, Biome biome) { Set chunks = Sets.newHashSet(); for(int x = start.getX(); x <= end.getX(); x++) { for(int z = start.getZ(); z <= end.getZ(); z++) { @@ -2299,7 +2299,7 @@ public final class WorldServer extends AWorldServer { } public boolean isBlockinHighHumidity(BlockPos pos) { - BaseBiome biomegenbase = this.getBiomeGenForCoords(pos); + Biome biomegenbase = this.getBiomeGenForCoords(pos); return biomegenbase.isHighHumidity(); } diff --git a/server/src/server/worldgen/BiomeGenLayered.java b/server/src/server/worldgen/BiomeGenLayered.java index 3718e9a..bdf9230 100755 --- a/server/src/server/worldgen/BiomeGenLayered.java +++ b/server/src/server/worldgen/BiomeGenLayered.java @@ -3,7 +3,7 @@ package server.worldgen; import java.util.List; import java.util.Set; -import common.biome.BaseBiome; +import common.biome.Biome; import common.collect.Lists; import common.util.BlockPos; import common.util.LongHashMap; @@ -33,7 +33,7 @@ public class BiomeGenLayered implements BiomeGenerator { private class CacheBlock { public final double[] factors = new double[256]; - public final BaseBiome[] biomes = new BaseBiome[256]; + public final Biome[] biomes = new Biome[256]; public int xPosition; public int zPosition; public long lastAccessTime; @@ -46,7 +46,7 @@ public class BiomeGenLayered implements BiomeGenerator { BiomeGenLayered.this.getBiomes(this.biomes, x << 4, z << 4, 16, 16, false); } - public BaseBiome getBiomeGenAt(int x, int z) + public Biome getBiomeGenAt(int x, int z) { return this.biomes[x & 15 | (z & 15) << 4]; } @@ -67,8 +67,8 @@ public class BiomeGenLayered implements BiomeGenerator { // this(); // } - 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) { + 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) { // GenLayer[] layers = GenLayer.getLayers(seed, fixedBiome, biomeSize, riverSize, snowRarity, seaRarity, shroomRarity, biomeRarity); GenLayer layer0t1 = new GenLayerBase(1L); layer0t1 = new GenLayerFuzzyZoom(2000L, layer0t1); @@ -163,10 +163,10 @@ public class BiomeGenLayered implements BiomeGenerator { } } - public BaseBiome getBiomeGenerator(BlockPos pos, BaseBiome def) { + public Biome getBiomeGenerator(BlockPos pos, Biome def) { int x = pos.getX(); int z = pos.getZ(); - BaseBiome biome = this.getBiomeCacheBlock(x, z).getBiomeGenAt(x, z); + Biome biome = this.getBiomeCacheBlock(x, z).getBiomeGenAt(x, z); return biome == null ? def : biome; } @@ -176,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) { - BaseBiome biome = BaseBiome.getBiomeDef(aint[i]); + Biome biome = Biome.getBiomeDef(aint[i]); listToReuse[i] = (double)biome.getFactor(); } } @@ -192,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) { - BaseBiome biome = BaseBiome.getBiomeDef(aint[i]); + Biome biome = Biome.getBiomeDef(aint[i]); factors[i] = (double)biome.getFactor(); } } } - public void getGenBiomes(BaseBiome[] biomes, int x, int z, int width, int height) { + public void getGenBiomes(Biome[] 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] = BaseBiome.getBiomeDef(aint[i]); + biomes[i] = Biome.getBiomeDef(aint[i]); } } - public void getChunkBiomes(BaseBiome[] oldBiomeList, int x, int z, int width, int depth) { + public void getChunkBiomes(Biome[] oldBiomeList, int x, int z, int width, int depth) { this.getBiomes(oldBiomeList, x, z, width, depth, true); } - public void getBiomes(BaseBiome[] listToReuse, int x, int z, int width, int length, boolean cache) { + public void getBiomes(Biome[] 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) { - BaseBiome[] biomes = this.getBiomeCacheBlock(x, z).biomes; + Biome[] 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] = BaseBiome.getBiomeDef(aint[i]); + listToReuse[i] = Biome.getBiomeDef(aint[i]); } } } - public boolean areBiomesViable(int x, int z, int size, Set allowed) { + public boolean areBiomesViable(int x, int z, int size, Set allowed) { IntCache.resetIntCache(); int i = x - size >> 2; int j = z - size >> 2; @@ -239,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) { - BaseBiome biome = BaseBiome.getBiome(aint[k1]); + Biome biome = Biome.getBiome(aint[k1]); if(!allowed.contains(biome)) { return false; diff --git a/server/src/server/worldgen/BiomeGenSingle.java b/server/src/server/worldgen/BiomeGenSingle.java index 9af3ed9..586058f 100755 --- a/server/src/server/worldgen/BiomeGenSingle.java +++ b/server/src/server/worldgen/BiomeGenSingle.java @@ -3,30 +3,30 @@ package server.worldgen; import java.util.Arrays; import java.util.Set; -import common.biome.BaseBiome; +import common.biome.Biome; import common.util.BlockPos; import common.worldgen.BiomeGenerator; public class BiomeGenSingle implements BiomeGenerator { - private final BaseBiome biome; + private final Biome biome; - public BiomeGenSingle(BaseBiome biome) { + public BiomeGenSingle(Biome biome) { this.biome = biome; } - public BaseBiome getBiomeGenerator(BlockPos pos, BaseBiome def) { + public Biome getBiomeGenerator(BlockPos pos, Biome def) { return this.biome; } - public void getGenBiomes(BaseBiome[] biomes, int x, int z, int width, int height) { + public void getGenBiomes(Biome[] biomes, int x, int z, int width, int height) { Arrays.fill(biomes, 0, width * height, this.biome); } - public void getChunkBiomes(BaseBiome[] oldBiomeList, int x, int z, int width, int depth) { + public void getChunkBiomes(Biome[] oldBiomeList, int x, int z, int width, int depth) { Arrays.fill(oldBiomeList, 0, width * depth, this.biome); } - public void getBiomes(BaseBiome[] listToReuse, int x, int z, int width, int length, boolean cache) { + public void getBiomes(Biome[] listToReuse, int x, int z, int width, int length, boolean cache) { Arrays.fill(listToReuse, 0, width * length, this.biome); } @@ -35,7 +35,7 @@ public class BiomeGenSingle implements BiomeGenerator { // : null; // } - public boolean areBiomesViable(int x, int z, int size, Set allowed) { + public boolean areBiomesViable(int x, int z, int size, Set allowed) { return allowed.contains(this.biome); } diff --git a/server/src/server/worldgen/BlockReplacer.java b/server/src/server/worldgen/BlockReplacer.java index 2350409..ab5cb4e 100755 --- a/server/src/server/worldgen/BlockReplacer.java +++ b/server/src/server/worldgen/BlockReplacer.java @@ -1,9 +1,9 @@ package server.worldgen; -import common.biome.BaseBiome; +import common.biome.Biome; 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); + public void replaceBlocks(WorldServer world, int x, int z, ChunkPrimer primer, Random rand, Biome[] biomes); } diff --git a/server/src/server/worldgen/FeatureLakes.java b/server/src/server/worldgen/FeatureLakes.java index a930b0e..98fe8bd 100755 --- a/server/src/server/worldgen/FeatureLakes.java +++ b/server/src/server/worldgen/FeatureLakes.java @@ -7,7 +7,7 @@ import common.rng.Random; import common.util.BlockPos; import common.world.LightType; import common.world.State; -import server.biome.Biome; +import server.biome.GenBiome; import server.world.WorldServer; public class FeatureLakes @@ -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 = Biome.BIOMES[worldIn.getBiomeGenForCoords(blockpos).id]; + GenBiome biomegenbase = GenBiome.BIOMES[worldIn.getBiomeGenForCoords(blockpos).id]; if (biomegenbase.topBlock.getBlock() == Blocks.mycelium) { diff --git a/server/src/server/worldgen/GeneratorPerlin.java b/server/src/server/worldgen/GeneratorPerlin.java index 659347f..e02d8ee 100755 --- a/server/src/server/worldgen/GeneratorPerlin.java +++ b/server/src/server/worldgen/GeneratorPerlin.java @@ -1,13 +1,13 @@ package server.worldgen; -import common.biome.BaseBiome; +import common.biome.Biome; 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 server.biome.Biome; +import server.biome.GenBiome; import server.world.WorldServer; public class GeneratorPerlin implements ChunkGenerator @@ -52,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 BaseBiome[] biomes = new BaseBiome[100]; + private final Biome[] biomes = new Biome[100]; // public GeneratorNew(Random rand, GeneratorSettings settings) // { @@ -197,13 +197,13 @@ public class GeneratorPerlin implements ChunkGenerator float min = 0.0F; float sum = 0.0F; int range = 2; - Biome biome = Biome.BIOMES[this.biomes[u + 2 + (v + 2) * 10].id]; + GenBiome biome = GenBiome.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 = Biome.BIOMES[this.biomes[u + a + 2 + (v + b + 2) * 10].id]; + GenBiome biome2 = GenBiome.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; diff --git a/server/src/server/worldgen/ReplacerAltBiome.java b/server/src/server/worldgen/ReplacerAltBiome.java index 6bb6890..8543e23 100755 --- a/server/src/server/worldgen/ReplacerAltBiome.java +++ b/server/src/server/worldgen/ReplacerAltBiome.java @@ -1,13 +1,13 @@ package server.worldgen; -import common.biome.BaseBiome; +import common.biome.Biome; 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 server.biome.Biome; +import server.biome.GenBiome; import server.world.WorldServer; public class ReplacerAltBiome implements BlockReplacer @@ -47,7 +47,7 @@ public class ReplacerAltBiome implements BlockReplacer this.block = filler.getBlock(); } - public void replaceBlocks(WorldServer world, int x, int z, ChunkPrimer primer, Random rand, BaseBiome[] biomes) + public void replaceBlocks(WorldServer world, int x, int z, ChunkPrimer primer, Random rand, Biome[] biomes) { int seaLevel = world.getSeaLevel(); double scale = 0.03125D; @@ -58,7 +58,7 @@ public class ReplacerAltBiome implements BlockReplacer { for(int px = 0; px < 16; px++) { - Biome biome = Biome.BIOMES[biomes[pz * 16 + px].id]; + GenBiome biome = GenBiome.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); diff --git a/server/src/server/worldgen/ReplacerAltSurface.java b/server/src/server/worldgen/ReplacerAltSurface.java index eb03789..23043ac 100755 --- a/server/src/server/worldgen/ReplacerAltSurface.java +++ b/server/src/server/worldgen/ReplacerAltSurface.java @@ -1,6 +1,6 @@ package server.worldgen; -import common.biome.BaseBiome; +import common.biome.Biome; import common.block.Block; import common.material.Material; import common.rng.OctaveGen; @@ -38,7 +38,7 @@ public class ReplacerAltSurface implements BlockReplacer this.fillerBlock = filler.getBlock(); } - public void replaceBlocks(WorldServer world, int x, int z, ChunkPrimer primer, Random rand, BaseBiome[] biomes) + public void replaceBlocks(WorldServer world, int x, int z, ChunkPrimer primer, Random rand, Biome[] biomes) { int i = world.getSeaLevel() + 1; double d0 = 0.03125D; diff --git a/server/src/server/worldgen/ReplacerBiome.java b/server/src/server/worldgen/ReplacerBiome.java index 536639a..894b8df 100755 --- a/server/src/server/worldgen/ReplacerBiome.java +++ b/server/src/server/worldgen/ReplacerBiome.java @@ -1,9 +1,9 @@ package server.worldgen; -import common.biome.BaseBiome; +import common.biome.Biome; import common.rng.PerlinGen; import common.rng.Random; -import server.biome.Biome; +import server.biome.GenBiome; import server.world.WorldServer; public class ReplacerBiome implements BlockReplacer @@ -16,7 +16,7 @@ public class ReplacerBiome implements BlockReplacer this.stoneNoiseGen = new PerlinGen(rand, 4); } - public void replaceBlocks(WorldServer world, int x, int z, ChunkPrimer primer, Random rand, BaseBiome[] biomes) + public void replaceBlocks(WorldServer world, int x, int z, ChunkPrimer primer, Random rand, Biome[] 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); @@ -25,7 +25,7 @@ public class ReplacerBiome implements BlockReplacer { for (int j = 0; j < 16; ++j) { - Biome biome = Biome.BIOMES[biomes[j + i * 16].id]; + GenBiome biome = GenBiome.BIOMES[biomes[j + i * 16].id]; biome.genTerrainBlocks(world, rand, primer, x * 16 + i, z * 16 + j, this.stoneNoise[j + i * 16]); } } diff --git a/server/src/server/worldgen/ReplacerTopLayer.java b/server/src/server/worldgen/ReplacerTopLayer.java index b229a04..8514527 100755 --- a/server/src/server/worldgen/ReplacerTopLayer.java +++ b/server/src/server/worldgen/ReplacerTopLayer.java @@ -1,6 +1,6 @@ package server.worldgen; -import common.biome.BaseBiome; +import common.biome.Biome; import common.block.Block; import common.init.Blocks; import common.material.Material; @@ -22,7 +22,7 @@ public class ReplacerTopLayer implements BlockReplacer this.replace = replace; } - public void replaceBlocks(WorldServer world, int x, int z, ChunkPrimer primer, Random rand, BaseBiome[] biomes) + public void replaceBlocks(WorldServer world, int x, int z, ChunkPrimer primer, Random rand, Biome[] biomes) { for (int i = 0; i < 16; ++i) { diff --git a/server/src/server/worldgen/caves/MapGenCaves.java b/server/src/server/worldgen/caves/MapGenCaves.java index 368c9ed..18346a0 100755 --- a/server/src/server/worldgen/caves/MapGenCaves.java +++ b/server/src/server/worldgen/caves/MapGenCaves.java @@ -9,7 +9,7 @@ import common.rng.Random; import common.util.BlockPos; import common.util.ExtMath; import common.world.State; -import server.biome.Biome; +import server.biome.GenBiome; import server.world.WorldServer; import server.worldgen.ChunkPrimer; @@ -218,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, Biome.BIOMES[this.worldObj.getBiomeGenForCoords(blockpos$mutableblockpos).id].topBlock.getBlock().getState()); + p_180702_5_.set(j3, j2 - 1, i2, GenBiome.BIOMES[this.worldObj.getBiomeGenForCoords(blockpos$mutableblockpos).id].topBlock.getBlock().getState()); } } } diff --git a/server/src/server/worldgen/caves/MapGenRavine.java b/server/src/server/worldgen/caves/MapGenRavine.java index 160d9d3..8ac2336 100755 --- a/server/src/server/worldgen/caves/MapGenRavine.java +++ b/server/src/server/worldgen/caves/MapGenRavine.java @@ -6,7 +6,7 @@ import common.rng.Random; import common.util.BlockPos; import common.util.ExtMath; import common.world.State; -import server.biome.Biome; +import server.biome.GenBiome; import server.world.WorldServer; import server.worldgen.ChunkPrimer; @@ -197,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, Biome.BIOMES[this.worldObj.getBiomeGenForCoords(blockpos$mutableblockpos).id].topBlock); + p_180707_5_.set(j3, j2 - 1, i2, GenBiome.BIOMES[this.worldObj.getBiomeGenForCoords(blockpos$mutableblockpos).id].topBlock); } } } diff --git a/server/src/server/worldgen/layer/GenLayer.java b/server/src/server/worldgen/layer/GenLayer.java index a696537..675f884 100755 --- a/server/src/server/worldgen/layer/GenLayer.java +++ b/server/src/server/worldgen/layer/GenLayer.java @@ -1,7 +1,7 @@ package server.worldgen.layer; -import common.biome.BaseBiome; -import server.biome.Biome; +import common.biome.Biome; +import server.biome.GenBiome; public abstract class GenLayer { private long worldGenSeed; @@ -14,8 +14,8 @@ public abstract class GenLayer { return true; } else { // if(id1 != Biome.mesaPlateau_F.id && id1 != Biome.mesaPlateau.id) { - final Biome biome1 = Biome.getBiome(id1); - final Biome biome2 = Biome.getBiome(id2); + final GenBiome biome1 = GenBiome.getBiome(id1); + final GenBiome biome2 = GenBiome.getBiome(id2); return biome1 != null && biome2 != null ? biome1.isEqualTo(biome2) : false; } // else { @@ -24,7 +24,7 @@ public abstract class GenLayer { } protected static boolean isSea(int id) { - return id == BaseBiome.SEA.id || id == BaseBiome.FROZENSEA.id; + return id == Biome.SEA.id || id == Biome.FROZENSEA.id; } public GenLayer(long base) { diff --git a/server/src/server/worldgen/layer/GenLayerAddExtra.java b/server/src/server/worldgen/layer/GenLayerAddExtra.java index 67444a6..54a1d4a 100755 --- a/server/src/server/worldgen/layer/GenLayerAddExtra.java +++ b/server/src/server/worldgen/layer/GenLayerAddExtra.java @@ -1,13 +1,13 @@ package server.worldgen.layer; -import common.biome.BaseBiome; +import common.biome.Biome; public class GenLayerAddExtra extends GenLayer { private final int[] biomes; private final int rarity; - public GenLayerAddExtra(long base, GenLayer parent, BaseBiome[] biomes, int rarity) + public GenLayerAddExtra(long base, GenLayer parent, Biome[] biomes, int rarity) { super(base); this.parent = parent; diff --git a/server/src/server/worldgen/layer/GenLayerAddSea.java b/server/src/server/worldgen/layer/GenLayerAddSea.java index 67123e3..f958542 100755 --- a/server/src/server/worldgen/layer/GenLayerAddSea.java +++ b/server/src/server/worldgen/layer/GenLayerAddSea.java @@ -1,6 +1,6 @@ package server.worldgen.layer; -import common.biome.BaseBiome; +import common.biome.Biome; public class GenLayerAddSea extends GenLayer { @@ -60,7 +60,7 @@ public class GenLayerAddSea extends GenLayer this.initChunkSeed((long)(areaX + j1), (long)(areaY + i1)); if (k2 == 0 && this.nextInt(this.rarity) == 0) { - aint1[j1 + i1 * areaWidth] = l2 > 1 ? BaseBiome.FROZENSEA.id : BaseBiome.SEA.id; + aint1[j1 + i1 * areaWidth] = l2 > 1 ? Biome.FROZENSEA.id : Biome.SEA.id; } else { diff --git a/server/src/server/worldgen/layer/GenLayerBiome.java b/server/src/server/worldgen/layer/GenLayerBiome.java index ca2fc39..a61c14f 100755 --- a/server/src/server/worldgen/layer/GenLayerBiome.java +++ b/server/src/server/worldgen/layer/GenLayerBiome.java @@ -1,17 +1,17 @@ package server.worldgen.layer; -import common.biome.BaseBiome; +import common.biome.Biome; public class GenLayerBiome extends GenLayer { - private final BaseBiome[] hot; - private final BaseBiome[] medium; - private final BaseBiome[] cold; - private final BaseBiome[] frost; + private final Biome[] hot; + private final Biome[] medium; + private final Biome[] cold; + private final Biome[] frost; private final int def; private final int fixed; - public GenLayerBiome(long base, GenLayer parent, BaseBiome[] hot, BaseBiome[] medium, BaseBiome[] cold, BaseBiome[] frost, BaseBiome def, boolean fixed) + public GenLayerBiome(long base, GenLayer parent, Biome[] hot, Biome[] medium, Biome[] cold, Biome[] frost, Biome def, boolean fixed) { super(base); this.parent = parent; diff --git a/server/src/server/worldgen/layer/GenLayerBiomeEdge.java b/server/src/server/worldgen/layer/GenLayerBiomeEdge.java index 41abf0c..b2ae7be 100755 --- a/server/src/server/worldgen/layer/GenLayerBiomeEdge.java +++ b/server/src/server/worldgen/layer/GenLayerBiomeEdge.java @@ -1,7 +1,7 @@ package server.worldgen.layer; -import common.biome.BaseBiome; -import server.biome.Biome; +import common.biome.Biome; +import server.biome.GenBiome; import server.biome.Temperature; public class GenLayerBiomeEdge extends GenLayer @@ -28,45 +28,45 @@ public class GenLayerBiomeEdge extends GenLayer this.initChunkSeed((long)(j + areaX), (long)(i + areaY)); int k = aint[j + 1 + (i + 1) * (areaWidth + 2)]; - if (!this.replaceBiomeEdgeIfNecessary(aint, aint1, j, i, areaWidth, k, BaseBiome.EXTREMEHILLS.id, BaseBiome.EXTREMEHILLSEDGE.id) && /* !this.replaceBiomeEdge(aint, aint1, j, i, areaWidth, k, Biome.mesaPlateau_F.id, Biome.mesa.id) && !this.replaceBiomeEdge(aint, aint1, j, i, areaWidth, k, Biome.mesaPlateau.id, Biome.mesa.id) && */ !this.replaceBiomeEdge(aint, aint1, j, i, areaWidth, k, BaseBiome.MEGATAIGA.id, BaseBiome.TAIGA.id)) + if (!this.replaceBiomeEdgeIfNecessary(aint, aint1, j, i, areaWidth, k, Biome.EXTREMEHILLS.id, Biome.EXTREMEHILLSEDGE.id) && /* !this.replaceBiomeEdge(aint, aint1, j, i, areaWidth, k, Biome.mesaPlateau_F.id, Biome.mesa.id) && !this.replaceBiomeEdge(aint, aint1, j, i, areaWidth, k, Biome.mesaPlateau.id, Biome.mesa.id) && */ !this.replaceBiomeEdge(aint, aint1, j, i, areaWidth, k, Biome.MEGATAIGA.id, Biome.TAIGA.id)) { - if (k == BaseBiome.DESERT.id) + if (k == Biome.DESERT.id) { int l1 = aint[j + 1 + (i + 1 - 1) * (areaWidth + 2)]; int i2 = aint[j + 1 + 1 + (i + 1) * (areaWidth + 2)]; int j2 = aint[j + 1 - 1 + (i + 1) * (areaWidth + 2)]; int k2 = aint[j + 1 + (i + 1 + 1) * (areaWidth + 2)]; - if (l1 != BaseBiome.ICEPLAINS.id && i2 != BaseBiome.ICEPLAINS.id && j2 != BaseBiome.ICEPLAINS.id && k2 != BaseBiome.ICEPLAINS.id) + if (l1 != Biome.ICEPLAINS.id && i2 != Biome.ICEPLAINS.id && j2 != Biome.ICEPLAINS.id && k2 != Biome.ICEPLAINS.id) { aint1[j + i * areaWidth] = k; } else { - aint1[j + i * areaWidth] = BaseBiome.EXTREMEHILLSPLUS.id; + aint1[j + i * areaWidth] = Biome.EXTREMEHILLSPLUS.id; } } - else if (k == BaseBiome.SWAMPLAND.id) + else if (k == Biome.SWAMPLAND.id) { int l = aint[j + 1 + (i + 1 - 1) * (areaWidth + 2)]; int i1 = aint[j + 1 + 1 + (i + 1) * (areaWidth + 2)]; int j1 = aint[j + 1 - 1 + (i + 1) * (areaWidth + 2)]; int k1 = aint[j + 1 + (i + 1 + 1) * (areaWidth + 2)]; - if (l != BaseBiome.DESERT.id && i1 != BaseBiome.DESERT.id && j1 != BaseBiome.DESERT.id && k1 != BaseBiome.DESERT.id && l != BaseBiome.COLDTAIGA.id && i1 != BaseBiome.COLDTAIGA.id && j1 != BaseBiome.COLDTAIGA.id && k1 != BaseBiome.COLDTAIGA.id && l != BaseBiome.ICEPLAINS.id && i1 != BaseBiome.ICEPLAINS.id && j1 != BaseBiome.ICEPLAINS.id && k1 != BaseBiome.ICEPLAINS.id) + if (l != Biome.DESERT.id && i1 != Biome.DESERT.id && j1 != Biome.DESERT.id && k1 != Biome.DESERT.id && l != Biome.COLDTAIGA.id && i1 != Biome.COLDTAIGA.id && j1 != Biome.COLDTAIGA.id && k1 != Biome.COLDTAIGA.id && l != Biome.ICEPLAINS.id && i1 != Biome.ICEPLAINS.id && j1 != Biome.ICEPLAINS.id && k1 != Biome.ICEPLAINS.id) { - if (l != BaseBiome.JUNGLE.id && k1 != BaseBiome.JUNGLE.id && i1 != BaseBiome.JUNGLE.id && j1 != BaseBiome.JUNGLE.id) + if (l != Biome.JUNGLE.id && k1 != Biome.JUNGLE.id && i1 != Biome.JUNGLE.id && j1 != Biome.JUNGLE.id) { aint1[j + i * areaWidth] = k; } else { - aint1[j + i * areaWidth] = BaseBiome.JUNGLEEDGE.id; + aint1[j + i * areaWidth] = Biome.JUNGLEEDGE.id; } } else { - aint1[j + i * areaWidth] = BaseBiome.PLAINS.id; + aint1[j + i * areaWidth] = Biome.PLAINS.id; } } else @@ -150,8 +150,8 @@ public class GenLayerBiomeEdge extends GenLayer } else { - Biome biomegenbase = Biome.getBiome(p_151634_1_); - Biome biomegenbase1 = Biome.getBiome(p_151634_2_); + GenBiome biomegenbase = GenBiome.getBiome(p_151634_1_); + GenBiome biomegenbase1 = GenBiome.getBiome(p_151634_2_); if (biomegenbase != null && biomegenbase1 != null) { diff --git a/server/src/server/worldgen/layer/GenLayerHills.java b/server/src/server/worldgen/layer/GenLayerHills.java index 832f2c8..c92a1f0 100755 --- a/server/src/server/worldgen/layer/GenLayerHills.java +++ b/server/src/server/worldgen/layer/GenLayerHills.java @@ -1,6 +1,6 @@ package server.worldgen.layer; -import common.biome.BaseBiome; +import common.biome.Biome; import common.log.Log; public class GenLayerHills extends GenLayer @@ -8,7 +8,7 @@ public class GenLayerHills extends GenLayer private GenLayer field_151628_d; private final int def; - public GenLayerHills(long p_i45479_1_, GenLayer p_i45479_3_, GenLayer p_i45479_4_, BaseBiome def) + public GenLayerHills(long p_i45479_1_, GenLayer p_i45479_3_, GenLayer p_i45479_4_, Biome def) { super(p_i45479_1_); this.parent = p_i45479_3_; @@ -42,7 +42,7 @@ public class GenLayerHills extends GenLayer if (k != 0 && l >= 2 && (l - 2) % 29 == 1 && k < 128) { - if (BaseBiome.getBiome(k + 128) != null) + if (Biome.getBiome(k + 128) != null) { aint2[j + i * areaWidth] = k + 128; } @@ -59,86 +59,86 @@ public class GenLayerHills extends GenLayer { int i1 = k; - if (k == BaseBiome.DESERT.id) + if (k == Biome.DESERT.id) { - i1 = BaseBiome.DESERTHILLS.id; + i1 = Biome.DESERTHILLS.id; } - else if (k == BaseBiome.FOREST.id) + else if (k == Biome.FOREST.id) { - i1 = BaseBiome.FORESTHILLS.id; + i1 = Biome.FORESTHILLS.id; } - else if (k == BaseBiome.BIRCHFOREST.id) + else if (k == Biome.BIRCHFOREST.id) { - i1 = BaseBiome.BIRCHFORESTHILLS.id; + i1 = Biome.BIRCHFORESTHILLS.id; } - else if (k == BaseBiome.ROOFEDFOREST.id) + else if (k == Biome.ROOFEDFOREST.id) { - i1 = BaseBiome.PLAINS.id; + i1 = Biome.PLAINS.id; } - else if (k == BaseBiome.TAIGA.id) + else if (k == Biome.TAIGA.id) { - i1 = BaseBiome.TAIGAHILLS.id; + i1 = Biome.TAIGAHILLS.id; } - else if (k == BaseBiome.MEGATAIGA.id) + else if (k == Biome.MEGATAIGA.id) { - i1 = BaseBiome.MEGATAIGAHILLS.id; + i1 = Biome.MEGATAIGAHILLS.id; } - else if (k == BaseBiome.COLDTAIGA.id) + else if (k == Biome.COLDTAIGA.id) { - i1 = BaseBiome.COLDTAIGAHILLS.id; + i1 = Biome.COLDTAIGAHILLS.id; } - else if (k == BaseBiome.PLAINS.id) + else if (k == Biome.PLAINS.id) { if (this.nextInt(3) == 0) { - i1 = BaseBiome.FORESTHILLS.id; + i1 = Biome.FORESTHILLS.id; } else { - i1 = BaseBiome.FOREST.id; + i1 = Biome.FOREST.id; } } - else if (k == BaseBiome.ICEPLAINS.id) + else if (k == Biome.ICEPLAINS.id) { - i1 = BaseBiome.ICEMOUNTAINS.id; + i1 = Biome.ICEMOUNTAINS.id; } - else if (k == BaseBiome.JUNGLE.id) + else if (k == Biome.JUNGLE.id) { - i1 = BaseBiome.JUNGLEHILLS.id; + i1 = Biome.JUNGLEHILLS.id; } - else if (k == BaseBiome.NONE.id) + else if (k == Biome.NONE.id) { i1 = this.def; } - else if (k == BaseBiome.EXTREMEHILLS.id) + else if (k == Biome.EXTREMEHILLS.id) { - i1 = BaseBiome.EXTREMEHILLSPLUS.id; + i1 = Biome.EXTREMEHILLSPLUS.id; } - else if (k == BaseBiome.SAVANNA.id) + else if (k == Biome.SAVANNA.id) { - i1 = BaseBiome.SAVANNAPLATEAU.id; + i1 = Biome.SAVANNAPLATEAU.id; } // else if (canBeNearby(k, Biome.mesaPlateau_F.id)) // { // i1 = Biome.mesa.id; // } - else if (k == BaseBiome.SEA.id && this.nextInt(3) == 0) + else if (k == Biome.SEA.id && this.nextInt(3) == 0) { int j1 = this.nextInt(2); if (j1 == 0) { - i1 = BaseBiome.PLAINS.id; + i1 = Biome.PLAINS.id; } else { - i1 = BaseBiome.FOREST.id; + i1 = Biome.FOREST.id; } } if (flag && i1 != k) { - if (BaseBiome.getBiome(i1 + 128) != null) + if (Biome.getBiome(i1 + 128) != null) { i1 += 128; } diff --git a/server/src/server/worldgen/layer/GenLayerRiver.java b/server/src/server/worldgen/layer/GenLayerRiver.java index 0ea31ff..00a0348 100755 --- a/server/src/server/worldgen/layer/GenLayerRiver.java +++ b/server/src/server/worldgen/layer/GenLayerRiver.java @@ -1,6 +1,6 @@ package server.worldgen.layer; -import common.biome.BaseBiome; +import common.biome.Biome; public class GenLayerRiver extends GenLayer { @@ -39,7 +39,7 @@ public class GenLayerRiver extends GenLayer } else { - aint1[j1 + i1 * areaWidth] = BaseBiome.RIVER.id; + aint1[j1 + i1 * areaWidth] = Biome.RIVER.id; } } } diff --git a/server/src/server/worldgen/layer/GenLayerRiverMix.java b/server/src/server/worldgen/layer/GenLayerRiverMix.java index 8f34f59..05d47f8 100755 --- a/server/src/server/worldgen/layer/GenLayerRiverMix.java +++ b/server/src/server/worldgen/layer/GenLayerRiverMix.java @@ -1,6 +1,6 @@ package server.worldgen.layer; -import common.biome.BaseBiome; +import common.biome.Biome; public class GenLayerRiverMix extends GenLayer { @@ -8,7 +8,7 @@ public class GenLayerRiverMix extends GenLayer private GenLayer riverPatternGeneratorChain; private final int def; - public GenLayerRiverMix(long p_i2129_1_, GenLayer p_i2129_3_, GenLayer p_i2129_4_, BaseBiome def) + public GenLayerRiverMix(long p_i2129_1_, GenLayer p_i2129_3_, GenLayer p_i2129_4_, Biome def) { super(p_i2129_1_); this.biomePatternGeneratorChain = p_i2129_3_; @@ -39,23 +39,23 @@ public class GenLayerRiverMix extends GenLayer for (int i = 0; i < areaWidth * areaHeight; ++i) { - if(biome[i] == BaseBiome.NONE.id) + if(biome[i] == Biome.NONE.id) { out[i] = this.def; } - else if(biome[i] == BaseBiome.SEA.id || biome[i] == BaseBiome.FROZENSEA.id) + else if(biome[i] == Biome.SEA.id || biome[i] == Biome.FROZENSEA.id) { out[i] = biome[i]; } - else if (river[i] == BaseBiome.RIVER.id) + else if (river[i] == Biome.RIVER.id) { - if (biome[i] == BaseBiome.ICEPLAINS.id) + if (biome[i] == Biome.ICEPLAINS.id) { - out[i] = BaseBiome.FROZENRIVER.id; + out[i] = Biome.FROZENRIVER.id; } else // if (biome[i] != Biome.mushroomPlains.id && biome[i] != Biome.mushroomPlainsEdge.id) { - out[i] = BaseBiome.RIVER.id; + out[i] = Biome.RIVER.id; } // else // { diff --git a/server/src/server/worldgen/layer/GenLayerShore.java b/server/src/server/worldgen/layer/GenLayerShore.java index a51e8c1..715e37a 100755 --- a/server/src/server/worldgen/layer/GenLayerShore.java +++ b/server/src/server/worldgen/layer/GenLayerShore.java @@ -1,7 +1,7 @@ package server.worldgen.layer; -import common.biome.BaseBiome; -import server.biome.Biome; +import common.biome.Biome; +import server.biome.GenBiome; import server.biome.BiomeJungle; public class GenLayerShore extends GenLayer @@ -23,7 +23,7 @@ public class GenLayerShore extends GenLayer { this.initChunkSeed((long)(j + x), (long)(i + z)); int id = pre[j + 1 + (i + 1) * (width + 2)]; - Biome biome = Biome.getBiome(id); + GenBiome biome = GenBiome.getBiome(id); // if (id == Biome.mushroomPlains.id) // { @@ -57,19 +57,19 @@ public class GenLayerShore extends GenLayer } else { - data[j + i * width] = BaseBiome.BEACH.id; + data[j + i * width] = Biome.BEACH.id; } } else { - data[j + i * width] = BaseBiome.JUNGLEEDGE.id; + data[j + i * width] = Biome.JUNGLEEDGE.id; } } - else if (id != BaseBiome.EXTREMEHILLS.id && id != BaseBiome.EXTREMEHILLSPLUS.id && id != BaseBiome.EXTREMEHILLSEDGE.id) + else if (id != Biome.EXTREMEHILLS.id && id != Biome.EXTREMEHILLSPLUS.id && id != Biome.EXTREMEHILLSEDGE.id) { if (biome != null && biome.allowColdBeach) { - this.putBeach(pre, data, j, i, width, id, BaseBiome.COLDBEACH.id); + this.putBeach(pre, data, j, i, width, id, Biome.COLDBEACH.id); } else // if (id != Biome.mesa.id && id != Biome.mesaPlateau_F.id) // { @@ -86,7 +86,7 @@ public class GenLayerShore extends GenLayer } else { - data[j + i * width] = BaseBiome.BEACH.id; + data[j + i * width] = Biome.BEACH.id; } } else @@ -120,7 +120,7 @@ public class GenLayerShore extends GenLayer } else { - this.putBeach(pre, data, j, i, width, id, BaseBiome.STONEBEACH.id); + this.putBeach(pre, data, j, i, width, id, Biome.STONEBEACH.id); } } } @@ -154,8 +154,8 @@ public class GenLayerShore extends GenLayer private boolean canNBJungle(int id) { - Biome biome = Biome.getBiome(id); - return biome != null && biome.getBiomeClass() == BiomeJungle.class ? true : id == BaseBiome.JUNGLEEDGE.id || id == BaseBiome.JUNGLE.id || id == BaseBiome.JUNGLEHILLS.id || id == BaseBiome.FOREST.id || id == BaseBiome.TAIGA.id || isSea(id); + GenBiome biome = GenBiome.getBiome(id); + return biome != null && biome.getBiomeClass() == BiomeJungle.class ? true : id == Biome.JUNGLEEDGE.id || id == Biome.JUNGLE.id || id == Biome.JUNGLEHILLS.id || id == Biome.FOREST.id || id == Biome.TAIGA.id || isSea(id); } // private boolean canNBMesa(int id) diff --git a/server/src/server/worldgen/structure/MapGenScatteredFeature.java b/server/src/server/worldgen/structure/MapGenScatteredFeature.java index f731099..c0393ae 100755 --- a/server/src/server/worldgen/structure/MapGenScatteredFeature.java +++ b/server/src/server/worldgen/structure/MapGenScatteredFeature.java @@ -3,14 +3,14 @@ package server.worldgen.structure; import java.util.Arrays; import java.util.List; -import common.biome.BaseBiome; +import common.biome.Biome; import common.rng.Random; import common.util.BlockPos; import server.world.WorldServer; public class MapGenScatteredFeature extends MapGenStructure { - private static final List biomelist = Arrays.asList(BaseBiome.DESERT, BaseBiome.DESERTHILLS, BaseBiome.JUNGLE, BaseBiome.JUNGLEHILLS, BaseBiome.SWAMPLAND); + private static final List biomelist = Arrays.asList(Biome.DESERT, Biome.DESERTHILLS, Biome.JUNGLE, Biome.JUNGLEHILLS, Biome.SWAMPLAND); private static final int MAX_DISTANCE = 32; private static final int MIN_DISTANCE = 8; @@ -44,14 +44,14 @@ public class MapGenScatteredFeature extends MapGenStructure if (i == k && j == l) { - BaseBiome biomegenbase = this.worldObj.getBiomeGenerator().getBiomeGenerator(new BlockPos(i * 16 + 8, 0, j * 16 + 8), null); + Biome biomegenbase = this.worldObj.getBiomeGenerator().getBiomeGenerator(new BlockPos(i * 16 + 8, 0, j * 16 + 8), null); if (biomegenbase == null) { return false; } - for (BaseBiome biomegenbase1 : biomelist) + for (Biome biomegenbase1 : biomelist) { if (biomegenbase == biomegenbase1) { @@ -92,16 +92,16 @@ public class MapGenScatteredFeature extends MapGenStructure public Start(WorldServer worldIn, Random p_i2060_2_, int p_i2060_3_, int p_i2060_4_) { super(p_i2060_3_, p_i2060_4_); - BaseBiome biomegenbase = worldIn.getBiomeGenForCoords(new BlockPos(p_i2060_3_ * 16 + 8, 0, p_i2060_4_ * 16 + 8)); + Biome biomegenbase = worldIn.getBiomeGenForCoords(new BlockPos(p_i2060_3_ * 16 + 8, 0, p_i2060_4_ * 16 + 8)); - if (biomegenbase != BaseBiome.JUNGLE && biomegenbase != BaseBiome.JUNGLEHILLS) + if (biomegenbase != Biome.JUNGLE && biomegenbase != Biome.JUNGLEHILLS) { - if (biomegenbase == BaseBiome.SWAMPLAND) + if (biomegenbase == Biome.SWAMPLAND) { StructureScattered.SwampHut componentscatteredfeaturepieces$swamphut = new StructureScattered.SwampHut(p_i2060_2_, p_i2060_3_ * 16, p_i2060_4_ * 16); this.components.add(componentscatteredfeaturepieces$swamphut); } - else if (biomegenbase == BaseBiome.DESERT || biomegenbase == BaseBiome.DESERTHILLS) + else if (biomegenbase == Biome.DESERT || biomegenbase == Biome.DESERTHILLS) { StructureScattered.DesertPyramid componentscatteredfeaturepieces$desertpyramid = new StructureScattered.DesertPyramid(p_i2060_2_, p_i2060_3_ * 16, p_i2060_4_ * 16); this.components.add(componentscatteredfeaturepieces$desertpyramid); diff --git a/server/src/server/worldgen/structure/MapGenVillage.java b/server/src/server/worldgen/structure/MapGenVillage.java index 396d5a3..47f89ec 100755 --- a/server/src/server/worldgen/structure/MapGenVillage.java +++ b/server/src/server/worldgen/structure/MapGenVillage.java @@ -3,7 +3,7 @@ package server.worldgen.structure; import java.util.List; import java.util.Set; -import common.biome.BaseBiome; +import common.biome.Biome; import common.collect.Sets; import common.nbt.NBTTagCompound; import common.rng.Random; @@ -11,7 +11,7 @@ import server.world.WorldServer; public class MapGenVillage extends MapGenStructure { - public static final Set villageSpawnBiomes = Sets.newHashSet(BaseBiome.PLAINS, BaseBiome.DESERT, BaseBiome.SAVANNA); + public static final Set villageSpawnBiomes = Sets.newHashSet(Biome.PLAINS, Biome.DESERT, Biome.SAVANNA); /** World terrain type, 0 for normal, 1 for flat map */ private int terrainType; diff --git a/server/src/server/worldgen/structure/StructureVillage.java b/server/src/server/worldgen/structure/StructureVillage.java index 7d00750..498cec0 100755 --- a/server/src/server/worldgen/structure/StructureVillage.java +++ b/server/src/server/worldgen/structure/StructureVillage.java @@ -3,7 +3,7 @@ package server.worldgen.structure; import java.util.Iterator; import java.util.List; -import common.biome.BaseBiome; +import common.biome.Biome; import common.block.Block; import common.block.BlockLog; import common.block.BlockSandStone; @@ -1430,8 +1430,8 @@ public class StructureVillage this.biomeGen = genIn; this.structureVillageWeightedPieceList = p_i2104_6_; this.terrainType = p_i2104_7_; - BaseBiome biomegenbase = genIn.getBiomeGenerator(new BlockPos(p_i2104_4_, 0, p_i2104_5_), BaseBiome.DEF_BIOME); - this.inDesert = biomegenbase == BaseBiome.DESERT || biomegenbase == BaseBiome.DESERTHILLS; + Biome biomegenbase = genIn.getBiomeGenerator(new BlockPos(p_i2104_4_, 0, p_i2104_5_), Biome.DEF_BIOME); + this.inDesert = biomegenbase == Biome.DESERT || biomegenbase == Biome.DESERTHILLS; this.func_175846_a(this.inDesert); }