misc refactoring

This commit is contained in:
Sen 2025-05-14 15:12:11 +02:00
parent eba8f6ea98
commit 10ba39c70b
85 changed files with 512 additions and 526 deletions

View file

@ -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", "<Keins>", 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<String, BaseBiome> 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<String, Biome> 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);
}

View file

@ -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);
}

View file

@ -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;

View file

@ -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;
}
};

View file

@ -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<Dimension
private int addRarity = 50; // b.layered
private int seaLevel = 0; // g.perlin, g.cavern, g.simple, g.destroyed, lake (r), r.biome, r.simple, r.alternate, ...
private BaseBiome defaultBiome = BaseBiome.NONE; // biomegen
private Biome defaultBiome = Biome.NONE; // biomegen
private State filler = Blocks.air.getState(); // caves+rav, liquid, ore, g.perlin, g.cavern, g.island,
// g.simple, g.flat (sealevel), r.biome, r.simple, r.alternate, r.toplayer
@ -283,11 +283,11 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
private State ceiling = null; // chunk
private State caveFiller = Blocks.air.getState(); // cavebase, ravine
private State[] layers = null; // g.flat
private BaseBiome[] frostBiomes = null; // b.layered
private BaseBiome[] coldBiomes = null; // b.layered
private BaseBiome[] mediumBiomes = null; // b.layered
private BaseBiome[] hotBiomes = null; // b.layered
private BaseBiome[] addBiomes = null; // b.layered
private Biome[] frostBiomes = null; // b.layered
private Biome[] coldBiomes = null; // b.layered
private Biome[] mediumBiomes = null; // b.layered
private Biome[] hotBiomes = null; // b.layered
private Biome[] addBiomes = null; // b.layered
private final List<FeatureOre> ores = Lists.newArrayList();
private final List<FeatureLake> lakes = Lists.newArrayList();
@ -462,12 +462,12 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
return this;
}
public final Dimension setBiomeGen(BaseBiome mainBiome, boolean semiFixed, int biomeSize, int riverSize, int snowRarity, int seaRarity) {
public final Dimension setBiomeGen(Biome mainBiome, boolean semiFixed, int biomeSize, int riverSize, int snowRarity, int seaRarity) {
return this.setBiomeGen(mainBiome, semiFixed, biomeSize, riverSize, snowRarity, seaRarity, 1);
}
public final Dimension setBiomeGen(BaseBiome mainBiome, boolean semiFixed, int biomeSize, int riverSize, int snowRarity, int seaRarity,
int addRarity, BaseBiome ... add) {
public final Dimension setBiomeGen(Biome mainBiome, boolean semiFixed, int biomeSize, int riverSize, int snowRarity, int seaRarity,
int addRarity, Biome ... add) {
this.defaultBiome = mainBiome;
IBiome biome = IBiome.getBiome(mainBiome);
this.top = biome.getFiller();
@ -482,27 +482,27 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
return this;
}
public final Dimension setFrostBiomes(BaseBiome ... biomes) {
public final Dimension setFrostBiomes(Biome ... biomes) {
this.frostBiomes = biomes;
return this;
}
public final Dimension setColdBiomes(BaseBiome ... biomes) {
public final Dimension setColdBiomes(Biome ... biomes) {
this.coldBiomes = biomes;
return this;
}
public final Dimension setMediumBiomes(BaseBiome ... biomes) {
public final Dimension setMediumBiomes(Biome ... biomes) {
this.mediumBiomes = biomes;
return this;
}
public final Dimension setHotBiomes(BaseBiome ... biomes) {
public final Dimension setHotBiomes(Biome ... biomes) {
this.hotBiomes = biomes;
return this;
}
public final Dimension setBiome(BaseBiome value) {
public final Dimension setBiome(Biome value) {
this.defaultBiome = value;
IBiome biome = IBiome.getBiome(value);
this.top = biome.getFiller();
@ -1010,7 +1010,7 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
this.addRarity = tag.getInteger("AddRarity");
// this.biomeRarity = tag.getInteger("BiomeRarity");
this.seaLevel = tag.getInteger("SeaLevel");
this.defaultBiome = BaseBiome.findByName(tag.getString("DefaultBiome"));
this.defaultBiome = Biome.findByName(tag.getString("DefaultBiome"));
this.semiFixed = tag.getBoolean("SemiFixed");
this.defaultWeather = Weather.getByName(tag.getString("DefaultWeather"));
this.defaultWeather = this.defaultWeather == null ? Weather.CLEAR : this.defaultWeather;
@ -1043,9 +1043,9 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
this.addBiomes = null;
}
else {
this.addBiomes = new BaseBiome[list.tagCount()];
this.addBiomes = new Biome[list.tagCount()];
for(int z = 0; z < this.addBiomes.length; z++) {
this.addBiomes[z] = BaseBiome.findByName(list.getStringTagAt(z));
this.addBiomes[z] = Biome.findByName(list.getStringTagAt(z));
}
}
}
@ -1058,9 +1058,9 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
this.frostBiomes = null;
}
else {
this.frostBiomes = new BaseBiome[list.tagCount()];
this.frostBiomes = new Biome[list.tagCount()];
for(int z = 0; z < this.frostBiomes.length; z++) {
this.frostBiomes[z] = BaseBiome.findByName(list.getStringTagAt(z));
this.frostBiomes[z] = Biome.findByName(list.getStringTagAt(z));
}
}
}
@ -1073,9 +1073,9 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
this.coldBiomes = null;
}
else {
this.coldBiomes = new BaseBiome[list.tagCount()];
this.coldBiomes = new Biome[list.tagCount()];
for(int z = 0; z < this.coldBiomes.length; z++) {
this.coldBiomes[z] = BaseBiome.findByName(list.getStringTagAt(z));
this.coldBiomes[z] = Biome.findByName(list.getStringTagAt(z));
}
}
}
@ -1088,9 +1088,9 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
this.mediumBiomes = null;
}
else {
this.mediumBiomes = new BaseBiome[list.tagCount()];
this.mediumBiomes = new Biome[list.tagCount()];
for(int z = 0; z < this.mediumBiomes.length; z++) {
this.mediumBiomes[z] = BaseBiome.findByName(list.getStringTagAt(z));
this.mediumBiomes[z] = Biome.findByName(list.getStringTagAt(z));
}
}
}
@ -1103,9 +1103,9 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
this.hotBiomes = null;
}
else {
this.hotBiomes = new BaseBiome[list.tagCount()];
this.hotBiomes = new Biome[list.tagCount()];
for(int z = 0; z < this.hotBiomes.length; z++) {
this.hotBiomes[z] = BaseBiome.findByName(list.getStringTagAt(z));
this.hotBiomes[z] = Biome.findByName(list.getStringTagAt(z));
}
}
}
@ -1272,35 +1272,35 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
}
if(this.addBiomes != null) {
NBTTagList list = new NBTTagList();
for(BaseBiome biome : this.addBiomes) {
for(Biome biome : this.addBiomes) {
list.appendTag(new NBTTagString(biome.name.toLowerCase()));
}
tag.setTag("AddBiomes", list);
}
if(this.frostBiomes != null) {
NBTTagList list = new NBTTagList();
for(BaseBiome biome : this.frostBiomes) {
for(Biome biome : this.frostBiomes) {
list.appendTag(new NBTTagString(biome.name.toLowerCase()));
}
tag.setTag("FrostBiomes", list);
}
if(this.coldBiomes != null) {
NBTTagList list = new NBTTagList();
for(BaseBiome biome : this.coldBiomes) {
for(Biome biome : this.coldBiomes) {
list.appendTag(new NBTTagString(biome.name.toLowerCase()));
}
tag.setTag("ColdBiomes", list);
}
if(this.mediumBiomes != null) {
NBTTagList list = new NBTTagList();
for(BaseBiome biome : this.mediumBiomes) {
for(Biome biome : this.mediumBiomes) {
list.appendTag(new NBTTagString(biome.name.toLowerCase()));
}
tag.setTag("MediumBiomes", list);
}
if(this.hotBiomes != null) {
NBTTagList list = new NBTTagList();
for(BaseBiome biome : this.hotBiomes) {
for(Biome biome : this.hotBiomes) {
list.appendTag(new NBTTagString(biome.name.toLowerCase()));
}
tag.setTag("HotBiomes", list);
@ -1430,7 +1430,7 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
return this.biomeSize;
}
public BaseBiome getDefaultBiome() {
public Biome getDefaultBiome() {
return this.defaultBiome;
}
@ -1450,7 +1450,7 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
return this.seaRarity;
}
public BaseBiome[] getAddBiomes() {
public Biome[] getAddBiomes() {
return this.addBiomes;
}
@ -1458,19 +1458,19 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
return this.addRarity;
}
public BaseBiome[] getHotBiomes() {
public Biome[] getHotBiomes() {
return this.hotBiomes;
}
public BaseBiome[] getMediumBiomes() {
public Biome[] getMediumBiomes() {
return this.mediumBiomes;
}
public BaseBiome[] getColdBiomes() {
public Biome[] getColdBiomes() {
return this.coldBiomes;
}
public BaseBiome[] getFrostBiomes() {
public Biome[] getFrostBiomes() {
return this.frostBiomes;
}

View file

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

View file

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

View file

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

View file

@ -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 {

View file

@ -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()

View file

@ -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");
}
}
public EntityEggInfo(String id, String origin, int color1, int color2) {
this.id = id;
this.origin = origin;
this.color1 = color1;
this.color2 = color2;
}
}

View file

@ -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) {

View file

@ -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");
}

View file

@ -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");

View file

@ -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)));

View file

@ -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<String> tooltip) {

View file

@ -1,4 +1,4 @@
package common.init;
package common.util;
public interface IObjectIntIterable<T> extends Iterable<T>
{

View file

@ -1,4 +1,4 @@
package common.init;
package common.util;
public interface IRegistry<K, V> extends Iterable<V>
{

View file

@ -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<T> implements IObjectIntIterable<T>
{

View file

@ -1,4 +1,4 @@
package common.init;
package common.util;
public class RegistryDefaulted<K, V> extends RegistrySimple<K, V>
{

View file

@ -1,4 +1,4 @@
package common.init;
package common.util;
import java.util.Iterator;
import java.util.Map;

View file

@ -1,4 +1,4 @@
package common.init;
package common.util;
public class RegistryNamespacedDefaultedByKey<K, V> extends RegistryNamespaced<K, V>
{

View file

@ -1,4 +1,4 @@
package common.init;
package common.util;
import java.util.Collections;
import java.util.Iterator;

View file

@ -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() {

View file

@ -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);
}

View file

@ -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) {

View file

@ -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<BaseBiome> 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<Biome> allowed);
public void cleanupCache();
}