add world size, space around worlds

This commit is contained in:
Sen 2025-07-13 20:34:50 +02:00
parent 629e8aadc5
commit c2dc0e7247
Signed by: sen
GPG key ID: 3AC50A6F47D1B722
22 changed files with 214 additions and 123 deletions

View file

@ -1,13 +1,18 @@
package common.dimension;
public final class Area extends Dimension {
public static int widthToSize(int width) {
int size = width / 2;
return size - size % 16;
}
Area() {
super(true);
}
public Area(int sky, int fog, float temperature, int brightness) {
public Area(int sky, int fog, int width, float temperature, int brightness) {
super(false);
this.setPhysics(1L, 1L, 0.0f, 10.0f, temperature, brightness);
this.setPhysics(widthToSize(width), 1L, 1L, 0.0f, 10.0f, temperature, brightness);
this.setSkyColor(sky).setFogColor(fog);
}

View file

@ -16,7 +16,7 @@ public enum DimType {
private final String name;
public final String format;
public final boolean time;
public final boolean celestial;
public final boolean days;
public final boolean weather;
public final boolean celestials;
@ -26,7 +26,7 @@ public enum DimType {
private DimType(String name, String format, boolean time, boolean days, boolean weather, boolean celestials, boolean clouds, boolean sky) {
this.name = name;
this.format = format;
this.time = time;
this.celestial = time;
this.days = days;
this.weather = weather;
this.celestials = celestials;

View file

@ -18,6 +18,7 @@ import common.util.Vec3;
import common.vars.Vars;
import common.world.State;
import common.world.Weather;
import common.world.World;
public abstract class Dimension extends Nameable {
public class GeneratorSettings {
@ -172,6 +173,7 @@ public abstract class Dimension extends Nameable {
private long rotationPeriod = 1L;
private int timeQualifier = 9;
private int brightness = 0;
private int size = World.MAX_SIZE;
// server / gen
private Weather defaultWeather = Weather.CLEAR;
@ -545,8 +547,9 @@ public abstract class Dimension extends Nameable {
protected final Dimension setPhysics(long orbitalPeriod, long rotationPeriod, float orbitOffset, float gravity, float temperature,
protected final Dimension setPhysics(int size, long orbitalPeriod, long rotationPeriod, float orbitOffset, float gravity, float temperature,
int brightness) {
this.size = size;
this.orbitalPeriod = orbitalPeriod;
this.rotationPeriod = rotationPeriod;
this.orbitOffset = orbitOffset;
@ -695,6 +698,10 @@ public abstract class Dimension extends Nameable {
return this.gravity;
}
public final int getSize() {
return this.size;
}
public final int getTimeQualifier() {
@ -1153,6 +1160,7 @@ public abstract class Dimension extends Nameable {
this.blockColor = tag.getInt("BlockColor");
this.subtractBlock = tag.getBool("SubtractBlock");
this.gravity = tag.getFloat("Gravity");
this.size = tag.getInt("Size");
this.temperature = tag.getFloat("Temperature");
this.orbitOffset = tag.getFloat("OrbitOffset");
this.cloudHeight = tag.getFloat("CloudHeight");
@ -1332,6 +1340,7 @@ public abstract class Dimension extends Nameable {
tag.setInt("BlockColor", this.blockColor);
tag.setBool("SubtractBlock", this.subtractBlock);
tag.setFloat("Gravity", this.gravity);
tag.setInt("Size", this.size);
tag.setFloat("Temperature", this.temperature);
tag.setFloat("OrbitOffset", this.orbitOffset);
tag.setFloat("CloudHeight", this.cloudHeight);

View file

@ -7,9 +7,9 @@ public final class Moon extends Dimension {
super(true);
}
public Moon(int sky, int fog, long orbit, long rotation, float gravity, float temperature, int brightness) {
public Moon(int sky, int fog, int radius, long orbit, long rotation, float gravity, float temperature, int brightness) {
super(false);
this.setPhysics(orbit, rotation, 0.0f, gravity, temperature, brightness);
this.setPhysics(Planet.radiusToSize(Math.min(radius, 26000000)), orbit, rotation, 0.0f, gravity, temperature, brightness);
this.setTimeQualifier(7);
this.setStarBrightness(0.75f).setDeepStarBrightness(0.75f);
this.setSkyColor(sky).setFogColor(fog);

View file

@ -4,28 +4,33 @@ import java.util.List;
import common.init.UniverseRegistry;
public final class Planet extends Dimension {
public static int radiusToSize(int radius) {
int size = (int)(Math.sqrt((double)radius * (double)radius * 4.0 * Math.PI) / 2.0);
return size - size % 16;
}
Planet() {
super(true);
}
public Planet(int sky, int fog, int clouds, long orbit, long rotation, float gravity, float temperature,
public Planet(int sky, int fog, int clouds, int radius, long orbit, long rotation, float gravity, float temperature,
int brightness) {
this(sky, fog, clouds, orbit, rotation, 0.0f, gravity, temperature, brightness);
this(sky, fog, clouds, radius, orbit, rotation, 0.0f, gravity, temperature, brightness);
}
public Planet(int sky, int fog, int clouds, long orbit, long rotation, float offset, float gravity,
public Planet(int sky, int fog, int clouds, int radius, long orbit, long rotation, float offset, float gravity,
float temperature) {
this(sky, fog, clouds, orbit, rotation, offset, gravity, temperature, 0);
this(sky, fog, clouds, radius, orbit, rotation, offset, gravity, temperature, 0);
}
public Planet(int sky, int fog, int clouds, long orbit, long rotation, float gravity, float temperature) {
this(sky, fog, clouds, orbit, rotation, 0.0f, gravity, temperature, 0);
public Planet(int sky, int fog, int clouds, int radius, long orbit, long rotation, float gravity, float temperature) {
this(sky, fog, clouds, radius, orbit, rotation, 0.0f, gravity, temperature, 0);
}
public Planet(int sky, int fog, int clouds, long orbit, long rotation, float offset, float gravity,
public Planet(int sky, int fog, int clouds, int radius, long orbit, long rotation, float offset, float gravity,
float temperature, int brightness) {
super(false);
this.setPhysics(orbit, rotation, offset, gravity, temperature, brightness);
this.setPhysics(radiusToSize(Math.min(radius, 26000000)), orbit, rotation, offset, gravity, temperature, brightness);
this.setTimeQualifier(7);
this.setStarBrightness(0.5f).setDeepStarBrightness(0.0f);
this.setSkyColor(sky).setFogColor(fog).setCloudColor(clouds);

View file

@ -5,9 +5,9 @@ public final class Semi extends Dimension {
super(true);
}
public Semi(int sky, int fog, int clouds, float temperature, int brightness) {
public Semi(int sky, int fog, int clouds, int width, float temperature, int brightness) {
super(false);
this.setPhysics(1L, 1L, 0.0f, 10.0f, temperature, brightness);
this.setPhysics(Area.widthToSize(width), 1L, 1L, 0.0f, 10.0f, temperature, brightness);
this.setStarBrightness(0.5f).setDeepStarBrightness(0.5f);
this.setSkyColor(sky).setFogColor(fog).setCloudColor(clouds);
}

View file

@ -1,13 +1,14 @@
package common.dimension;
import common.biome.Biome;
import common.world.World;
public final class Space extends Dimension {
public static final Space INSTANCE = new Space();
private Space() {
super(false);
this.setPhysics(1L, 1L, 0.0f, 0.0f, 2.7f, 15).setTimeQualifier(8);
this.setPhysics(World.MAX_SIZE, 1L, 1L, 0.0f, 0.0f, 2.7f, 15).setTimeQualifier(8);
this.setBiome(Biome.SPACE).setStarBrightness(1.0f).setDeepStarBrightness(1.0f);
}

View file

@ -7,9 +7,9 @@ public final class Star extends Dimension {
super(true);
}
public Star(int color, float gravity, float temp, State surface, int height) {
public Star(int color, int radius, float gravity, float temp, State surface, int height) {
super(false);
this.setPhysics(1L, 1L, 0.0f, gravity, temp, 15);
this.setPhysics(Planet.radiusToSize(Math.min(radius, 945000000) / 25), 1L, 1L, 0.0f, gravity, temp, 15);
this.setTimeQualifier(7);
this.setStarBrightness(0.75f).setDeepStarBrightness(0.75f);
this.setSkyColor(color).setFogColor(color).setFlatGen(surface, height);

View file

@ -407,7 +407,7 @@ public class EntityHorse extends EntityAnimal implements IInvBasic
public void fall(float distance, float damageMultiplier)
{
damageMultiplier = Math.max(0.0f, damageMultiplier - (1.65f - (float)this.worldObj.gravity * 1.65f));
damageMultiplier = Math.max(0.0f, damageMultiplier - (1.65f - (float)this.worldObj.getGravity(this) * 1.65f));
if (distance > 1.0F)
{
this.playSound(SoundEvent.HORSE_LAND, 0.4F);

View file

@ -3966,7 +3966,7 @@ public abstract class EntityNPC extends EntityLiving
super.fall(distance, damageMultiplier);
return;
}
if (!this.noclip && this.worldObj.gravity != 0.0)
if (!this.noclip && this.worldObj.getGravity(this) != 0.0)
{
if (distance >= 2.0F)
{
@ -3980,7 +3980,7 @@ public abstract class EntityNPC extends EntityLiving
public void makeLandingParticles(BlockPos pos)
{
if (!this.isPlayer() || (!this.noclip && this.worldObj.gravity != 0.0))
if (!this.isPlayer() || (!this.noclip && this.worldObj.getGravity(this) != 0.0))
{
super.makeLandingParticles(pos);
}
@ -4241,7 +4241,7 @@ public abstract class EntityNPC extends EntityLiving
}
public boolean isFlying() {
return this.flying || this.worldObj.gravity == 0.0;
return this.flying || this.worldObj.getGravity(this) == 0.0;
}
public boolean canNaturallyFly() {

View file

@ -1111,7 +1111,7 @@ public abstract class EntityLiving extends Entity
public void fall(float distance, float damageMultiplier)
{
damageMultiplier = Math.max(0.0f, damageMultiplier - (1.65f - (float)this.worldObj.gravity * 1.65f));
damageMultiplier = Math.max(0.0f, damageMultiplier - (1.65f - (float)this.worldObj.getGravity(this) * 1.65f));
super.fall(distance, damageMultiplier);
StatusEffect potioneffect = this.getEffect(Effect.JUMP);
float f = potioneffect != null ? (float)(potioneffect.getAmplifier() + 1) : 0.0F;
@ -1602,7 +1602,7 @@ public abstract class EntityLiving extends Entity
}
else
{
this.motionY -= 0.08D * this.worldObj.gravity;
this.motionY -= 0.08D * this.worldObj.getGravity(this);
}
this.motionY *= 0.9800000190734863D;
@ -1617,7 +1617,7 @@ public abstract class EntityLiving extends Entity
this.motionX *= 0.5D;
this.motionY *= 0.5D;
this.motionZ *= 0.5D;
this.motionY -= 0.02D * this.worldObj.gravity;
this.motionY -= 0.02D * this.worldObj.getGravity(this);
if (this.collidedHorizontally && this.isOffsetPositionInLiquid(this.motionX, this.motionY + 0.6000000238418579D - this.posY + d1, this.motionZ))
{
@ -1654,7 +1654,7 @@ public abstract class EntityLiving extends Entity
this.motionX *= (double)f1;
this.motionY *= 0.800000011920929D;
this.motionZ *= (double)f1;
this.motionY -= 0.02D * this.worldObj.gravity;
this.motionY -= 0.02D * this.worldObj.getGravity(this);
if (this.collidedHorizontally && this.isOffsetPositionInLiquid(this.motionX, this.motionY + 0.6000000238418579D - this.posY + d0, this.motionZ))
{

View file

@ -310,8 +310,8 @@ public abstract class UniverseRegistry {
registerDimension("space", "Der Weltraum", Space.INSTANCE);
registerGalaxy("milkyway", "Milchstraße");
registerSector("solar", "Solar", "milkyway");
registerStar("sol", "Sol", new Star(0xff7f00, 274.0f, 5778.0f, Blocks.lava.getState(), 128).setTimeQualifier(1), "solar");
registerPlanet("terra", "Terra", new Planet(0xffffffff, 0xc0d8ff, 0xffffff, World.EARTH_YEAR, 24000L, 28.0f, 9.81f,
registerStar("sol", "Sol", new Star(0xff7f00, 695508000, 274.0f, 5778.0f, Blocks.lava.getState(), 128).setTimeQualifier(1), "solar");
registerPlanet("terra", "Terra", new Planet(0xffffffff, 0xc0d8ff, 0xffffff, 6378136, World.EARTH_YEAR, 24000L, 28.0f, 9.81f,
259.15f).setTimeQualifier(0)
.setPerlinGen(Blocks.stone.getState(), Blocks.water.getState(), 63)
.setBiomeReplacer(Blocks.gravel.getState())
@ -337,49 +337,49 @@ public abstract class UniverseRegistry {
.addOre(Blocks.ruby_ore.getState(), 1, 0, 4, 12, 8, true)
.addOre(Blocks.cinnabar_ore.getState(), 1, 0, 11, 0, 24, false)
.enableVillages().enableMineshafts().enableScattered().enableStrongholds(), "sol");
registerMoon("luna", "Luna", new Moon(0x333333, 0x333333, 655728L, 655728L, 1.62f, 210.0f, 8)
registerMoon("luna", "Luna", new Moon(0x333333, 0x333333, 1737100, 655728L, 655728L, 1.62f, 210.0f, 8)
.setPerlinGen(Blocks.moon_rock.getState(), Blocks.air.getState(), 63).setBiome(Biome.MOON)
.setTimeQualifier(1), "terra");
registerPlanet("mercury", "Merkur", new Planet(0x666666, 0x535353, 0x858585, 2111297L, 1407509L, 3.7f, 440.0f)
registerPlanet("mercury", "Merkur", new Planet(0x666666, 0x535353, 0x858585, 2440530, 2111297L, 1407509L, 3.7f, 440.0f)
.setPerlinGen(Blocks.moon_rock.getState(), Blocks.air.getState(), 63)
.setTimeQualifier(1), "sol");
registerPlanet("venus", "Venus", new Planet(0xc0c0c0, 0xa0a0a0, 0xe0e0e0, 5392908L, 5832449L, 8.87f, 737.0f)
registerPlanet("venus", "Venus", new Planet(0xc0c0c0, 0xa0a0a0, 0xe0e0e0, 6051800, 5392908L, 5832449L, 8.87f, 737.0f)
.setPerlinGen(Blocks.sand.getState(), Blocks.air.getState(), 63)
.setTimeQualifier(1), "sol");
registerPlanet("mars", "Mars", new Planet(0xd6905b, 0xbd723a, 0xbd9273, 16487781L, 24623L, 3.71f, 208.0f)
registerPlanet("mars", "Mars", new Planet(0xd6905b, 0xbd723a, 0xbd9273, 3396190, 16487781L, 24623L, 3.71f, 208.0f)
.setPerlinGen(Blocks.red_sand.getState(),
Blocks.air.getState(), 63).setTimeQualifier(1), "sol");
registerPlanet("jupiter", "Jupiter", new Planet(0xffd5ba, 0xb89f90, 0xc7b5a9, 103989391L, 9925L, 24.79f, 163.0f).enableDenseFog()
registerPlanet("jupiter", "Jupiter", new Planet(0xffd5ba, 0xb89f90, 0xc7b5a9, 71492000, 103989391L, 9925L, 24.79f, 163.0f).enableDenseFog()
.setFlatGen(Blocks.hydrogen.getState(), 256).setTimeQualifier(1).setCloudHeight(576.0f), "sol");
registerPlanet("saturn", "Saturn", new Planet(0xf1d1a1, 0xd3b385, 0xeed7b5, 258141008L, 10656L, 10.44f, 133.0f).enableDenseFog()
registerPlanet("saturn", "Saturn", new Planet(0xf1d1a1, 0xd3b385, 0xeed7b5, 60268000, 258141008L, 10656L, 10.44f, 133.0f).enableDenseFog()
.setFlatGen(Blocks.hydrogen.getState(), 256).setTimeQualifier(1).setCloudHeight(576.0f), "sol");
registerPlanet("uranus", "Uranus", new Planet(0xcee6ff, 0xadd2f9, 0x8eb0d3, 736503770L, 17240L, 8.87f, 78.0f)
registerPlanet("uranus", "Uranus", new Planet(0xcee6ff, 0xadd2f9, 0x8eb0d3, 25559000, 736503770L, 17240L, 8.87f, 78.0f)
.setPerlinGen(Blocks.packed_ice.getState(), Blocks.water.getState(), 70)
.addOre(Blocks.diamond_ore.getState(), 4, 4, 12, 0, 60, false)
.setTimeQualifier(1), "sol");
registerPlanet("neptune", "Neptun", new Planet(0xb4d9ff, 0x85bef9, 0x649bd3, 1444584441L, 16110L, 11.15f, 72.0f)
registerPlanet("neptune", "Neptun", new Planet(0xb4d9ff, 0x85bef9, 0x649bd3, 24764000, 1444584441L, 16110L, 11.15f, 72.0f)
.setPerlinGen(Blocks.packed_ice.getState(), Blocks.water.getState(), 70)
.addOre(Blocks.diamond_ore.getState(), 4, 2, 1, 0, 60, false)
.setTimeQualifier(1), "sol");
registerPlanet("ceres", "Ceres", new Planet(0x666666, 0x535353, 0x858585, 40315496L, 9074L, 0.27f, 167.0f)
registerPlanet("ceres", "Ceres", new Planet(0x666666, 0x535353, 0x858585, 473000, 40315496L, 9074L, 0.27f, 167.0f)
.setPerlinGen(Blocks.moon_rock.getState(), Blocks.air.getState(), 63)
.setTimeQualifier(1), "sol");
registerPlanet("pluto", "Pluto", new Planet(0x666666, 0x535353, 0x858585, 2173127098L, 153293L, 0.62f, 40.0f)
registerPlanet("pluto", "Pluto", new Planet(0x666666, 0x535353, 0x858585, 1188300, 2173127098L, 153293L, 0.62f, 40.0f)
.setPerlinGen(Blocks.moon_rock.getState(), Blocks.air.getState(), 63)
.setTimeQualifier(1), "sol");
registerPlanet("haumea", "Haumea", new Planet(0x666666, 0x535353, 0x858585, 2487831667L, 3914L, 0.63f, 48.0f)
registerPlanet("haumea", "Haumea", new Planet(0x666666, 0x535353, 0x858585, 816000, 2487831667L, 3914L, 0.63f, 48.0f)
.setPerlinGen(Blocks.moon_rock.getState(), Blocks.air.getState(), 63)
.setTimeQualifier(1), "sol");
registerPlanet("makemake", "Makemake", new Planet(0x666666, 0x535353, 0x858585, 2684193293L, 22826L, 0.4f, 30.0f)
registerPlanet("makemake", "Makemake", new Planet(0x666666, 0x535353, 0x858585, 715000, 2684193293L, 22826L, 0.4f, 30.0f)
.setPerlinGen(Blocks.moon_rock.getState(), Blocks.air.getState(), 63)
.setTimeQualifier(1), "sol");
registerPlanet("eris", "Eris", new Planet(0x666666, 0x535353, 0x858585, 4900274496L, 378862L, 0.82f, 30.0f)
registerPlanet("eris", "Eris", new Planet(0x666666, 0x535353, 0x858585, 1163000, 4900274496L, 378862L, 0.82f, 30.0f)
.setPerlinGen(Blocks.moon_rock.getState(), Blocks.air.getState(), 63)
.setTimeQualifier(1), "sol");
registerStar("girok", "Gi'rok", new Star(0xff8f00, 232.0f, 5220.0f, Blocks.lava.getState(), 112).setTimeQualifier(2), "solar");
registerPlanet("gharoth", "'Elbenplanet Gharoth'", new Planet(0xffffffff, 0xc0d8ff, 0xffffff, 4837386L, 52960L, 30.0f, 10.0f, 257.3f)
registerStar("girok", "Gi'rok", new Star(0xff8f00, 603421976, 232.0f, 5220.0f, Blocks.lava.getState(), 112).setTimeQualifier(2), "solar");
registerPlanet("gharoth", "'Elbenplanet Gharoth'", new Planet(0xffffffff, 0xc0d8ff, 0xffffff, 2806382, 4837386L, 52960L, 30.0f, 10.0f, 257.3f)
.setTimeQualifier(2).setSimpleGen(Blocks.dirt.getState(), Blocks.water.getState(), 64)
.setSimpleReplacer(Blocks.gravel.getState(), Blocks.sand.getState()).setBiome(Biome.ELVENFOREST)
.enableCaves(Blocks.air.getState()).setDungeons(4).enableMobs().enableSnow()
@ -389,7 +389,7 @@ public abstract class UniverseRegistry {
.addLiquid(Blocks.flowing_lava.getState(), 20, 8, 255, true)
.addOre(Blocks.thetium_ore.getState(), 1, 0, 3, 0, 14, false)
.addOre(Blocks.gyriyn_ore.getState(), 0, 2, 3, 0, 12, false), "girok");
registerPlanet("transylvania", "'Vampirplanet Transsylvanien'", new Planet(0xffffffff, 0xc0d8ff, 0xffffff, 33850466L, 49760L, 20.0f, 10.0f, 255.5f)
registerPlanet("transylvania", "'Vampirplanet Transsylvanien'", new Planet(0xffffffff, 0xc0d8ff, 0xffffff, 8374921, 33850466L, 49760L, 20.0f, 10.0f, 255.5f)
.setTimeQualifier(5).setPerlinGen(Blocks.rock.getState(), Blocks.water.getState(), 63)
.setBiomeReplacer(Blocks.gravel.getState()).setBiomeGen(Biome.FOREST, true, 5, 3, 3, 30)
.enableCavesRavines(Blocks.lava.getState()).setDungeons(10).enableMobs().enableSnow()
@ -401,13 +401,13 @@ public abstract class UniverseRegistry {
.addOre(Blocks.lead_ore.getState(), 2, 0, 8, 0, 8, false)
.addOre(Blocks.ardite_ore.getState(), 0, 2, 3, 0, 12, false)
.addOre(Blocks.nichun_ore.getState(), 0, 10, 1, 0, 10, false), "girok");
registerMoon("yrdinath", "'Eismond Yrdinath'", new Moon(0xccccff, 0xccccff, 46743637L, 17460L, 2.5f, 239.15f, 8).setTimeQualifier(4)
registerMoon("yrdinath", "'Eismond Yrdinath'", new Moon(0xccccff, 0xccccff, 2503812, 46743637L, 17460L, 2.5f, 239.15f, 8).setTimeQualifier(4)
.setPerlinGen(Blocks.snow.getState(), Blocks.ice.getState(), 63).setBiome(Biome.SNOWLAND)
.enableMobs().enableSnow().setDefaultWeather(Weather.SNOW), "transylvania");
registerMoon("mythril", "'Eismond Mythril'", new Moon(0xbbbbff, 0xbbbbff, 42659432L, 15330L, 2.25f, 221.65f, 8).setTimeQualifier(4)
registerMoon("mythril", "'Eismond Mythril'", new Moon(0xbbbbff, 0xbbbbff, 2213749, 42659432L, 15330L, 2.25f, 221.65f, 8).setTimeQualifier(4)
.setPerlinGen(Blocks.snow.getState(), Blocks.ice.getState(), 63).setBiome(Biome.SNOWLAND)
.enableMobs().enableSnow().setDefaultWeather(Weather.SNOW), "transylvania");
registerPlanet("mesar", "'Wüstenplanet Me'sar'", new Planet(0xff7f3f, 0xff6022, 0xff6f00, 56643366L, 87340L, 11.0f, 333.15f)
registerPlanet("mesar", "'Wüstenplanet Me'sar'", new Planet(0xff7f3f, 0xff6022, 0xff6f00, 9823183, 56643366L, 87340L, 11.0f, 333.15f)
.setTimeQualifier(5).setPerlinGen(Blocks.rock.getState(), Blocks.air.getState(), 63)
.setBiomeReplacer(Blocks.red_sand.getState())
.setBiomeGen(Biome.MESA, true, 3, 1000, 100000, 100000)
@ -423,8 +423,8 @@ public abstract class UniverseRegistry {
registerGalaxy("drkthrn", "Drkthrn");
registerSector("blvck", "Blvck", "drkthrn");
registerStar("ovrol", "Ov'rol", new Star(0x000000, 302.0f, 12666.0f, Blocks.goo.getState(), 192), "blvck");
registerPlanet("blackplanet", "'Schwarzplanet'", new Planet(0x000000, 0x000000, 0x000000, 4632918508L, 204556L, 12.0f, 0.0f)
registerStar("ovrol", "Ov'rol", new Star(0x000000, 832718528, 302.0f, 12666.0f, Blocks.goo.getState(), 192), "blvck");
registerPlanet("blackplanet", "'Schwarzplanet'", new Planet(0x000000, 0x000000, 0x000000, 13038204, 4632918508L, 204556L, 12.0f, 0.0f)
.setPerlinGen(Blocks.blackened_stone.getState(), Blocks.goo.getState(), 63)
.setBiomeReplacer(Blocks.blackened_cobble.getState()).setBiome(Biome.BLACKENED)
.enableCaves(Blocks.air.getState()).setDungeons(4).enableMobs()
@ -432,7 +432,7 @@ public abstract class UniverseRegistry {
// .addOre(Blocks.PLACEHOLDER_ore.getState(), 0, 2, 3, 0, 12, false)
, "ovrol");
registerSemi("warp", "Der Warp", new Semi(0x0c001f, 0x0c001f, 0x190033, 285.0f, 3).setCloudTexture(CloudType.DENSE).setCloudHeight(238.0f)
registerSemi("warp", "Der Warp", new Semi(0x0c001f, 0x0c001f, 0x190033, 124072917, 285.0f, 3).setCloudTexture(CloudType.DENSE).setCloudHeight(238.0f)
.setPerlinGen(Blocks.obsidian.getState(), Blocks.lava.getState(), 63)
.setBiome(Biome.CHAOS).enableCavesRavines(Blocks.air.getState()).enableLongCaves().enableMobs().enableSnow()
.addLake(Blocks.water.getState(), null, Blocks.obsidian.getState(), 8, 0, 255, false)
@ -443,41 +443,41 @@ public abstract class UniverseRegistry {
.setStarColorSin(25.0f, 0.1f, 0.25f, 0xff00ff, 1, 4).setDeepStarColorSin(25.0f, 0.1f, 0.5f, 0xff00ff, 1, 4));
registerDomain("tianxin", "Tian'Xin");
registerArea("nienrath", "Ni'enrath", new Area(0x7f00ff, 0x7f00ff, 276.15f, 1).setLightColor(0x07000f).setBlockColor(0xcf6fff)
registerArea("nienrath", "Ni'enrath", new Area(0x7f00ff, 0x7f00ff, 532109, 276.15f, 1).setLightColor(0x07000f).setBlockColor(0xcf6fff)
.setPerlinGen(Blocks.tian.getState(), Blocks.springwater.getState(), 63).setBiome(Biome.TIAN)
.setBiomeReplacer(Blocks.tian.getState()).enableLongCaves().enableMobs().enableSnow()
.addLake(Blocks.springwater.getState(), Blocks.tian.getState(), Blocks.tian.getState(), 4, 0, 255, false)
.addLiquid(Blocks.flowing_springwater.getState(), 50, 8, 255, false), "tianxin");
registerDomain("digital", "Digital");
registerArea("cyberspace", "Cyberspace", new Area(0x000000, 0x000000, 293.15f, 15).setLightColor(0x00ff00).setBlockColor(0xff0000).enableBlockLightSubtraction()
registerArea("cyberspace", "Cyberspace", new Area(0x000000, 0x000000, 16777216, 293.15f, 15).setLightColor(0x00ff00).setBlockColor(0xff0000).enableBlockLightSubtraction()
.setFlatGen(Blocks.green_clay.getState(), 2)
.enableMobs(), "digital");
registerDomain("hell", "Hölle");
registerArea("thedric", "Kreis Thedric", new Area(0x330707, 0x330707, 347.15f, 2).enableLongCaves().enableMobs().enableFortresses()
registerArea("thedric", "Kreis Thedric", new Area(0x330707, 0x330707, 105639735, 347.15f, 2).enableLongCaves().enableMobs().enableFortresses()
.enableWorldCeiling().enableDenseFog()
.setCavernGen(Blocks.hellrock.getState(), Blocks.lava.getState(), 63)
.setSurfaceReplacer(Blocks.gravel.getState(), Blocks.soul_sand.getState())
.setBiome(Biome.UPPERHELL), "hell");
registerArea("kyroth", "Kreis Kyroth", new Area(0x990000, 0x990000, 387.15f, 3).enableLongCaves().enableMobs()
registerArea("kyroth", "Kreis Kyroth", new Area(0x990000, 0x990000, 86742970, 387.15f, 3).enableLongCaves().enableMobs()
.setSimpleGen(Blocks.hellrock.getState(), Blocks.lava.getState(), 64)
.setSimpleReplacer(Blocks.obsidian.getState(), Blocks.soul_sand.getState())
.setBiome(Biome.LOWERHELL)
.addLake(Blocks.lava.getState(), null, null, 4, 8, 255, false)
.addLiquid(Blocks.flowing_lava.getState(), 40, 8, 255, true), "hell");
registerArea("ahrd", "Kreis Ahrd", new Area(0xcc0000, 0xcc0000, 467.15f, 15).enableLongCaves().enableMobs()
registerArea("ahrd", "Kreis Ahrd", new Area(0xcc0000, 0xcc0000, 67028432, 467.15f, 15).enableLongCaves().enableMobs()
.setPerlinGen(Blocks.hellrock.getState(), Blocks.lava.getState(), 63)
.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");
registerArea("mizorath", "Kreis Mizorath", new Area(0xff0000, 0xff0000, 1067.15f, 15).enableMobs()
registerArea("mizorath", "Kreis Mizorath", new Area(0xff0000, 0xff0000, 54029584, 1067.15f, 15).enableMobs()
.setPerlinGen(Blocks.hellrock.getState(), Blocks.blood.getState(), 63)
.setBiomeReplacer(Blocks.soul_sand.getState()).setBiome(Biome.SOULPLAINS), "hell");
registerArea("dargoth", "Kreis Dargoth", new Area(0xff3f0c, 0xff3f0c, 1707.15f, 15).enableMobs()
registerArea("dargoth", "Kreis Dargoth", new Area(0xff3f0c, 0xff3f0c, 43293629, 1707.15f, 15).enableMobs()
.setPerlinGen(Blocks.hellrock.getState(), Blocks.magma.getState(), 63)
.setBiomeReplacer(Blocks.soul_sand.getState()).setBiome(Biome.SOULPLAINS), "hell");
registerArea("aasirith", "Kreis Aasirith", new Area(0x191919, 0x191919, 2482.0f, 1).enableLongCaves().enableMobs()
registerArea("aasirith", "Kreis Aasirith", new Area(0x191919, 0x191919, 36291872, 2482.0f, 1).enableLongCaves().enableMobs()
.setPerlinGen(Blocks.rock.getState(), Blocks.magma.getState(), 63)
.setBiomeReplacer(Blocks.ash.getState()).setBiome(Biome.ASHLAND)
.addLake(Blocks.lava.getState(), Blocks.rock.getState(), Blocks.rock.getState(),

View file

@ -56,7 +56,8 @@ public abstract class Chunk {
this.world = world;
this.xPos = x;
this.zPos = z;
this.filler = world.dimension.isExterminated() ? Blocks.coal_block.getState() : world.dimension.getFiller();
int size = world.dimension.getSize() / 16;
this.filler = x < -size || z < -size || x >= size || z >= size ? Blocks.air.getState() : (world.dimension.isExterminated() ? Blocks.coal_block.getState() : world.dimension.getFiller());
this.fillerBlock = this.filler.getBlock();
for(int y = 0; y < this.entities.length; ++y) {
this.entities[y] = new InheritanceMultiMap(Entity.class);

View file

@ -18,6 +18,7 @@ import common.block.tech.BlockAnvil;
import common.block.tech.BlockHopper;
import common.collect.Lists;
import common.collect.Sets;
import common.dimension.DimType;
import common.dimension.Dimension;
import common.entity.Entity;
import common.entity.item.EntityExplosion;
@ -57,11 +58,8 @@ public abstract class World implements IWorldAccess {
public static final long START_TIME = 4385238000L;
public static final float ABSOLUTE_ZERO = -273.15f;
public static final long EARTH_YEAR = 8766144L;
// private static final Calendar calendar = Calendar.getInstance();
// private static long lastUpdate;
public final boolean client;
public double gravity = 1.0;
public final Random rand = new Random();
public final List<Entity> entities = Lists.<Entity>newArrayList();
protected final List<Entity> unloaded = Lists.<Entity>newArrayList();
@ -75,7 +73,8 @@ public abstract class World implements IWorldAccess {
protected final Set<ChunkPos> active = Sets.<ChunkPos>newHashSet();
protected final int[] lightUpdate = new int[32768];
public final Dimension dimension;
protected double gravity = 1.0;
protected boolean loadTiles;
protected int subtract;
protected float rain;
@ -130,14 +129,14 @@ public abstract class World implements IWorldAccess {
public void updatePhysics() {
this.gravity = (double)this.dimension.getGravity() * 0.1 * Vars.gravity;
if(Math.abs(this.gravity) < 0.075)
this.gravity = Math.signum(this.gravity) * 0.075;
this.gravity = 0.0;
}
public String formatImperialTime(boolean days) {
long time = this.daytime;
long year = time / EARTH_YEAR;
long frac = (time * 1000L / EARTH_YEAR) % 1000L;
if(!this.dimension.getType().time) {
if(!this.dimension.getType().celestial) {
return String.format("%d.%03d.%03d.M%d" + (days ? " T???.??? D???.???.G?" : ""), this.dimension.getTimeQualifier(),
frac, year % 1000L, year / 1000L + 1L);
}
@ -2054,6 +2053,28 @@ public abstract class World implements IWorldAccess {
// return biomegenbase.isSnowyBiome() ? false : ( ? false : biomegenbase.canRain());
// }
}
public double getSpaceFactor(double x, double y, double z) {
if(this.dimension.getType() == DimType.SEMI)
return ExtMath.clampd((y - (double)World.MAX_SIZE_Y) / 16384.0, 0.0, 1.0);
else if(!this.dimension.getType().celestial)
return 0.0;
double r = (double)this.dimension.getSize();
double xm = (Math.abs(x) - r) / 16384.0;
double ym = (Math.abs(y) - (double)World.MAX_SIZE_Y) / 16384.0;
double zm = (Math.abs(z) - r) / 16384.0;
return ExtMath.clampd(Math.max(Math.max(xm, zm), ym), 0.0, 1.0);
}
public double getGravity(double x, double y, double z) {
double gravity = this.gravity * (1.0 - this.getSpaceFactor(x, y, z));
return Math.abs(gravity) < 0.075 ? 0.0 : gravity;
}
public double getGravity(Entity entity) {
double gravity = this.gravity * (1.0 - this.getSpaceFactor(entity.posX, entity.posY, entity.posZ));
return Math.abs(gravity) < 0.075 ? 0.0 : gravity;
}
// public void setItemData(String dataID, WorldSavedData worldSavedDataIn) {
// }