universe cleanup
This commit is contained in:
parent
cf37d48292
commit
9b5eab4f57
68 changed files with 553 additions and 369 deletions
|
@ -71,7 +71,7 @@ public class BlockBed extends Block implements Rotatable {
|
|||
&& Math.abs(player.posY - (double)pos.getY()) <= 2.0D && Math.abs(player.posZ - (double)pos.getZ()) <= 3.0D) {
|
||||
player.setSpawnPoint(new WorldPos(pos, player.worldObj));
|
||||
player.connection.addHotbar(TextColor.DGREEN + "Dein Einstiegspunkt wurde auf %s bei [%s, %s, %s] gesetzt",
|
||||
player.worldObj.dimension.getNameString(), player.getSpawnPoint().getX(),
|
||||
player.worldObj.dimension.getDisplay(), player.getSpawnPoint().getX(),
|
||||
player.getSpawnPoint().getY(), player.getSpawnPoint().getZ());
|
||||
}
|
||||
// else if(!Config.bedSpawn) {
|
||||
|
|
|
@ -8,7 +8,6 @@ import common.entity.Entity;
|
|||
import common.init.Blocks;
|
||||
import common.item.CheatTab;
|
||||
import common.item.Item;
|
||||
import common.item.block.ItemBlock;
|
||||
import common.model.BlockLayer;
|
||||
import common.model.Model;
|
||||
import common.model.ModelProvider;
|
||||
|
|
|
@ -5,14 +5,10 @@ import common.block.Rotatable;
|
|||
import common.block.Material;
|
||||
import common.entity.Entity;
|
||||
import common.entity.types.EntityLiving;
|
||||
import common.init.Items;
|
||||
import common.item.CheatTab;
|
||||
import common.item.Item;
|
||||
import common.model.Model;
|
||||
import common.model.ModelProvider;
|
||||
import common.model.ModelRotation;
|
||||
import common.properties.Property;
|
||||
import common.rng.Random;
|
||||
import common.util.BlockPos;
|
||||
import common.util.Facing;
|
||||
import common.world.State;
|
||||
|
|
|
@ -5,7 +5,6 @@ import common.block.Material;
|
|||
import common.entity.Entity;
|
||||
import common.entity.types.EntityLiving;
|
||||
import common.init.Blocks;
|
||||
import common.init.Items;
|
||||
import common.item.Item;
|
||||
import common.model.Model;
|
||||
import common.model.ModelProvider;
|
||||
|
|
|
@ -3,8 +3,6 @@ package common.block.foliage;
|
|||
import common.block.Block;
|
||||
import common.block.Material;
|
||||
import common.init.Blocks;
|
||||
import common.init.Items;
|
||||
import common.item.CheatTab;
|
||||
import common.item.Item;
|
||||
import common.item.StackSize;
|
||||
import common.model.BlockLayer;
|
||||
|
|
|
@ -3,9 +3,6 @@ package common.block.tech;
|
|||
import java.util.Arrays;
|
||||
|
||||
import common.entity.npc.EntityNPC;
|
||||
import common.init.BlockRegistry;
|
||||
import common.item.Item;
|
||||
import common.item.block.ItemBlock;
|
||||
import common.tileentity.TileEntity;
|
||||
import common.tileentity.TileEntityDisplay;
|
||||
import common.util.BlockPos;
|
||||
|
|
|
@ -15,6 +15,10 @@ public final class Area extends Dimension {
|
|||
this.setPhysics(widthToSize(width), 1L, 1L, 0.0f, 10.0f, temperature, brightness);
|
||||
this.setSkyColor(sky).setFogColor(fog);
|
||||
}
|
||||
|
||||
public Area(int color, int width, float temperature, int brightness) {
|
||||
this(color, color, width, temperature, brightness);
|
||||
}
|
||||
|
||||
public final DimType getType() {
|
||||
return DimType.AREA;
|
||||
|
|
|
@ -5,17 +5,16 @@ import java.util.Map;
|
|||
import common.collect.Maps;
|
||||
|
||||
public enum DimType {
|
||||
STAR("star", "Stern %s", true, false, false, false, false, true),
|
||||
PLANET("planet", "Planet %s", true, true, true, true, true, true),
|
||||
MOON("moon", "Mond %s", true, false, false, true, false, true),
|
||||
SPACE("space", "%s", false, false, false, false, false, true),
|
||||
SEMI("semi", "%s", false, false, true, false, true, true),
|
||||
AREA("area", "%s", false, false, false, false, false, false);
|
||||
STAR("star", true, false, false, false, false, true),
|
||||
PLANET("planet", true, true, true, true, true, true),
|
||||
MOON("moon", true, false, false, true, false, true),
|
||||
SPACE("space", false, false, false, false, false, true),
|
||||
SEMI("semi", false, false, true, false, true, true),
|
||||
AREA("area", false, false, false, false, false, false);
|
||||
|
||||
private static final Map<String, DimType> LOOKUP = Maps.newHashMap();
|
||||
|
||||
private final String name;
|
||||
public final String format;
|
||||
public final boolean celestial;
|
||||
public final boolean days;
|
||||
public final boolean weather;
|
||||
|
@ -23,9 +22,8 @@ public enum DimType {
|
|||
public final boolean clouds;
|
||||
public final boolean sky;
|
||||
|
||||
private DimType(String name, String format, boolean time, boolean days, boolean weather, boolean celestials, boolean clouds, boolean sky) {
|
||||
private DimType(String name, boolean time, boolean days, boolean weather, boolean celestials, boolean clouds, boolean sky) {
|
||||
this.name = name;
|
||||
this.format = format;
|
||||
this.celestial = time;
|
||||
this.days = days;
|
||||
this.weather = weather;
|
||||
|
|
|
@ -171,7 +171,6 @@ public abstract class Dimension extends Nameable {
|
|||
private float orbitOffset = 0.0f;
|
||||
private long orbitalPeriod = 1L;
|
||||
private long rotationPeriod = 1L;
|
||||
private int timeQualifier = 9;
|
||||
private int brightness = 0;
|
||||
private int size = World.MAX_SIZE;
|
||||
|
||||
|
@ -590,11 +589,6 @@ public abstract class Dimension extends Nameable {
|
|||
}
|
||||
|
||||
|
||||
public final Dimension setTimeQualifier(int value) {
|
||||
this.timeQualifier = value;
|
||||
return this;
|
||||
}
|
||||
|
||||
public final Dimension setDefaultWeather(Weather value) {
|
||||
this.defaultWeather = this.weather = value;
|
||||
return this;
|
||||
|
@ -703,11 +697,6 @@ public abstract class Dimension extends Nameable {
|
|||
}
|
||||
|
||||
|
||||
|
||||
public final int getTimeQualifier() {
|
||||
return this.timeQualifier;
|
||||
}
|
||||
|
||||
// public final String getCustomName() {
|
||||
// return this.customName;
|
||||
// }
|
||||
|
@ -886,14 +875,14 @@ public abstract class Dimension extends Nameable {
|
|||
switch(this.getType()) {
|
||||
case MOON:
|
||||
dim = UniverseRegistry.getPlanet((Moon)dim);
|
||||
planet = dim.getNameString();
|
||||
planet = dim.getDisplay();
|
||||
case PLANET:
|
||||
dim = UniverseRegistry.getStar((Planet)dim);
|
||||
star = dim.getNameString();
|
||||
star = dim.getDisplay();
|
||||
case STAR:
|
||||
Sector sector = UniverseRegistry.getSector((Star)dim);
|
||||
String sect = sector.getNameString();
|
||||
String galaxy = UniverseRegistry.getGalaxy(sector).getNameString();
|
||||
String sect = sector.getDisplay();
|
||||
String galaxy = UniverseRegistry.getGalaxy(sector).getDisplay();
|
||||
if(planet != null)
|
||||
return new String[] {planet, star, sect, galaxy};
|
||||
else if(star != null)
|
||||
|
@ -901,7 +890,7 @@ public abstract class Dimension extends Nameable {
|
|||
else
|
||||
return new String[] {sect, galaxy};
|
||||
case AREA:
|
||||
return new String[] {UniverseRegistry.getDomain((Area)dim).getNameString()};
|
||||
return new String[] {UniverseRegistry.getDomain((Area)dim).getDisplay()};
|
||||
default:
|
||||
return new String[0];
|
||||
}
|
||||
|
@ -1151,7 +1140,6 @@ public abstract class Dimension extends Nameable {
|
|||
}
|
||||
this.populated = !tag.hasBool("NoPopulation") || !tag.getBool("NoPopulation");
|
||||
this.denseFog = tag.getBool("DenseFog");
|
||||
this.timeQualifier = tag.getInt("ImperialTime");
|
||||
this.brightness = tag.getInt("Brightness");
|
||||
this.skyColor = tag.getInt("SkyColor");
|
||||
this.fogColor = tag.getInt("FogColor");
|
||||
|
@ -1331,7 +1319,6 @@ public abstract class Dimension extends Nameable {
|
|||
if(!this.populated)
|
||||
tag.setBool("NoPopulation", true);
|
||||
tag.setBool("DenseFog", this.denseFog);
|
||||
tag.setInt("ImperialTime", this.timeQualifier);
|
||||
tag.setInt("Brightness", this.brightness);
|
||||
tag.setInt("SkyColor", this.skyColor);
|
||||
tag.setInt("FogColor", this.fogColor);
|
||||
|
@ -1378,10 +1365,6 @@ public abstract class Dimension extends Nameable {
|
|||
tag.setObject("DStarColorFnc", fnc);
|
||||
}
|
||||
}
|
||||
|
||||
protected String getNameIdentifier() {
|
||||
return this.getType().format;
|
||||
}
|
||||
|
||||
public int getBiomeSize() {
|
||||
return this.biomeSize;
|
||||
|
|
|
@ -11,8 +11,4 @@ public final class Domain extends Nameable implements Comparable<Domain> {
|
|||
public int compareTo(Domain other) {
|
||||
return other == null ? -1 : this.id.compareTo(other.id);
|
||||
}
|
||||
|
||||
protected String getNameIdentifier() {
|
||||
return "%s";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,8 +11,4 @@ public final class Galaxy extends Nameable implements Comparable<Galaxy> {
|
|||
public int compareTo(Galaxy other) {
|
||||
return other == null ? -1 : this.id.compareTo(other.id);
|
||||
}
|
||||
|
||||
protected String getNameIdentifier() {
|
||||
return "Galaxie %s";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
package common.dimension;
|
||||
|
||||
import common.biome.Biome;
|
||||
import common.block.Block;
|
||||
import common.init.Blocks;
|
||||
import common.init.UniverseRegistry;
|
||||
|
||||
public final class Moon extends Dimension {
|
||||
|
@ -7,12 +10,25 @@ public final class Moon extends Dimension {
|
|||
super(true);
|
||||
}
|
||||
|
||||
public Moon(int sky, int fog, int radius, 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, Block surface, Block liquid) {
|
||||
super(false);
|
||||
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);
|
||||
this.setPerlinGen(surface.getState(), liquid.getState(), 63);
|
||||
this.setBiome(Biome.MOON);
|
||||
}
|
||||
|
||||
public Moon(int color, int radius, long orbit, long rotation, float gravity, float temperature, Block surface, Block liquid) {
|
||||
this(color, color, radius, orbit, rotation, gravity, temperature, 8, surface, liquid);
|
||||
}
|
||||
|
||||
public Moon(int radius, long orbit, long rotation, float gravity, float temperature) {
|
||||
this(0x333333, radius, orbit, rotation, gravity, temperature, Blocks.moon_rock, Blocks.air);
|
||||
}
|
||||
|
||||
public Moon(int radius, long orbitRotation, float gravity, float temperature) {
|
||||
this(radius, orbitRotation, orbitRotation, gravity, temperature);
|
||||
}
|
||||
|
||||
public final DimType getType() {
|
||||
|
|
|
@ -9,23 +9,15 @@ public abstract class Nameable {
|
|||
this.custom = custom;
|
||||
}
|
||||
|
||||
public final String getCustomName() {
|
||||
return this.display;
|
||||
}
|
||||
|
||||
public final void setCustomName(String name) {
|
||||
this.display = name;
|
||||
}
|
||||
|
||||
public final boolean isCustom() {
|
||||
return this.custom;
|
||||
}
|
||||
|
||||
public final void setDisplay(String name) {
|
||||
this.display = name;
|
||||
}
|
||||
|
||||
protected abstract String getNameIdentifier();
|
||||
|
||||
public final String getNameString() {
|
||||
return this.display.startsWith("'") && this.display.endsWith("'") && this.display.length() > 2
|
||||
? this.display.substring(1, this.display.length() - 1) :
|
||||
String.format(this.getNameIdentifier(), this.display);
|
||||
public final String getDisplay() {
|
||||
return this.display;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,15 +23,22 @@ public final class Planet extends Dimension {
|
|||
this(sky, fog, clouds, radius, orbit, rotation, offset, gravity, temperature, 0);
|
||||
}
|
||||
|
||||
public Planet(int radius, long orbit, long rotation, float offset, float gravity, float temperature) {
|
||||
this(0xffffffff, 0xc0d8ff, 0xffffff, radius, orbit, rotation, offset, 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 radius, long orbit, long rotation, float gravity, float temperature) {
|
||||
this(radius, orbit, rotation, 0.0f, gravity, temperature);
|
||||
}
|
||||
|
||||
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(radiusToSize(Math.min(radius, 36750000)), orbit, rotation, offset, gravity, temperature, brightness);
|
||||
this.setTimeQualifier(7);
|
||||
this.setStarBrightness(0.5f).setDeepStarBrightness(0.0f);
|
||||
this.setSkyColor(sky).setFogColor(fog).setCloudColor(clouds);
|
||||
}
|
||||
|
|
|
@ -11,8 +11,4 @@ public final class Sector extends Nameable implements Comparable<Sector> {
|
|||
public int compareTo(Sector other) {
|
||||
return other == null ? -1 : this.id.compareTo(other.id);
|
||||
}
|
||||
|
||||
protected String getNameIdentifier() {
|
||||
return "Sektor %s";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,6 +11,10 @@ public final class Semi extends Dimension {
|
|||
this.setStarBrightness(0.5f).setDeepStarBrightness(0.5f);
|
||||
this.setSkyColor(sky).setFogColor(fog).setCloudColor(clouds);
|
||||
}
|
||||
|
||||
public Semi(int color, int clouds, int width, float temperature, int brightness) {
|
||||
this(color, color, clouds, width, temperature, brightness);
|
||||
}
|
||||
|
||||
public final DimType getType() {
|
||||
return DimType.SEMI;
|
||||
|
|
|
@ -8,7 +8,7 @@ public final class Space extends Dimension {
|
|||
|
||||
private Space() {
|
||||
super(false);
|
||||
this.setPhysics(World.MAX_SIZE, 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);
|
||||
this.setBiome(Biome.SPACE).setStarBrightness(1.0f).setDeepStarBrightness(1.0f);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,18 +1,22 @@
|
|||
package common.dimension;
|
||||
|
||||
import common.world.State;
|
||||
import common.block.liquid.BlockStaticLiquid;
|
||||
import common.init.Blocks;
|
||||
|
||||
public final class Star extends Dimension {
|
||||
Star() {
|
||||
super(true);
|
||||
}
|
||||
|
||||
public Star(int color, int radius, float gravity, float temp, State surface, int height) {
|
||||
public Star(int color, int radius, float gravity, float temp, BlockStaticLiquid filler) {
|
||||
super(false);
|
||||
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);
|
||||
this.setSkyColor(color).setFogColor(color).setFlatGen(filler.getState(), 128);
|
||||
}
|
||||
|
||||
public Star(int radius, float gravity, float temp) {
|
||||
this(0xff7f00, radius, gravity, temp, Blocks.plasma);
|
||||
}
|
||||
|
||||
public final DimType getType() {
|
||||
|
|
|
@ -2,5 +2,5 @@ package common.entity.npc;
|
|||
|
||||
import common.util.BlockPos;
|
||||
|
||||
public record PlayerCharacter(String name, String info, Alignment align, String dim, BlockPos pos, String type, int level) {
|
||||
public record PlayerCharacter(String name, String info, Alignment align, String dim, BlockPos pos, String type, int level, String origin) {
|
||||
}
|
||||
|
|
|
@ -292,6 +292,7 @@ public abstract class BlockRegistry {
|
|||
registerFluid("water", "Wasser", true, LiquidType.WATER, false, 0, 5, 0.0f, TextureAnimation.WATER, TextureAnimation.WATERFLOW);
|
||||
registerFluid("lava", "Lava", false, LiquidType.LAVA, true, 15, -30, 0.0f, 2, 3);
|
||||
registerFluid("magma", "Magma", false, LiquidType.HOT, true, 15, 40, 0.0f, TextureAnimation.LAVA, TextureAnimation.LAVAFLOW);
|
||||
registerFluid("plasma", "Plasma", false, LiquidType.HOT, false, 15, 15, 0.0f, 2, 2);
|
||||
registerFluid("mercury", "Quecksilber", false, LiquidType.COLD, true, 0, 40, 0.0f, 8, 4);
|
||||
registerFluid("hydrogen", "Wasserstoff", false, LiquidType.COLD, true, 0, 50, 0.0f, 8, 4);
|
||||
registerFluid("acid", "Säure", false, LiquidType.HOT, false, 0, 5, 0.0f, 1, 1);
|
||||
|
|
|
@ -593,6 +593,8 @@ public abstract class Blocks {
|
|||
public static final BlockToggleableLight lamp = get("lamp");
|
||||
public static final BlockToggleableLight lit_lamp = get("lit_lamp");
|
||||
public static final BlockWire wire = get("wire");
|
||||
public static final BlockStaticLiquid plasma = get("plasma");
|
||||
public static final BlockDynamicLiquid flowing_plasma = get("flowing_plasma");
|
||||
|
||||
private static <T extends Block> T get(String id) {
|
||||
T block = (T)BlockRegistry.byNameExact(id);
|
||||
|
|
|
@ -1007,6 +1007,8 @@ public abstract class Items {
|
|||
public static final ItemBlock torch = get("torch");
|
||||
public static final ItemBlock soul_torch = get("soul_torch");
|
||||
public static final ItemBlock tian_torch = get("tian_torch");
|
||||
public static final ItemBucket plasma_bucket = get("plasma_bucket");
|
||||
public static final ItemBucket recursive_plasma_bucket = get("recursive_plasma_bucket");
|
||||
|
||||
private static <T extends Item> T get(String id) {
|
||||
T item = (T)ItemRegistry.byName(id);
|
||||
|
|
|
@ -157,49 +157,49 @@ public abstract class UniverseRegistry {
|
|||
}
|
||||
|
||||
public static Galaxy registerCustomGalaxy(String name, String display) {
|
||||
return registerGalaxy(name, display, true);
|
||||
return registerGalaxyInt(name, display, true);
|
||||
}
|
||||
|
||||
public static Sector registerCustomSector(String name, String display, String galaxy) {
|
||||
return registerSector(name, display, galaxy, true);
|
||||
return registerSectorInt(name, display, galaxy, true);
|
||||
}
|
||||
|
||||
public static Domain registerCustomDomain(String name, String display) {
|
||||
return registerDomain(name, display, true);
|
||||
return registerDomainInt(name, display, true);
|
||||
}
|
||||
|
||||
public static Star registerCustomStar(String name, String display, Star dim, String sector) {
|
||||
if(!dim.isCustom())
|
||||
dim = (Star)dim.makeCustomCopy();
|
||||
registerStar(name, display, dim, sector);
|
||||
registerStarInt(name, display, dim, sector);
|
||||
return dim;
|
||||
}
|
||||
|
||||
public static Planet registerCustomPlanet(String name, String display, Planet dim, String star) {
|
||||
if(!dim.isCustom())
|
||||
dim = (Planet)dim.makeCustomCopy();
|
||||
registerPlanet(name, display, dim, star);
|
||||
registerPlanetInt(name, display, dim, star);
|
||||
return dim;
|
||||
}
|
||||
|
||||
public static Moon registerCustomMoon(String name, String display, Moon dim, String planet) {
|
||||
if(!dim.isCustom())
|
||||
dim = (Moon)dim.makeCustomCopy();
|
||||
registerMoon(name, display, dim, planet);
|
||||
registerMoonInt(name, display, dim, planet);
|
||||
return dim;
|
||||
}
|
||||
|
||||
public static Area registerCustomArea(String name, String display, Area dim, String domain) {
|
||||
if(!dim.isCustom())
|
||||
dim = (Area)dim.makeCustomCopy();
|
||||
registerArea(name, display, dim, domain);
|
||||
registerAreaInt(name, display, dim, domain);
|
||||
return dim;
|
||||
}
|
||||
|
||||
public static Semi registerCustomSemi(String name, String display, Semi dim) {
|
||||
if(!dim.isCustom())
|
||||
dim = (Semi)dim.makeCustomCopy();
|
||||
registerSemi(name, display, dim);
|
||||
registerSemiInt(name, display, dim);
|
||||
return dim;
|
||||
}
|
||||
|
||||
|
@ -208,53 +208,41 @@ public abstract class UniverseRegistry {
|
|||
throw new IllegalArgumentException("Objekt " + name + " ist bereits registriert");
|
||||
}
|
||||
|
||||
private static Galaxy registerGalaxy(String name, String display, boolean custom) {
|
||||
private static Galaxy registerGalaxyInt(String name, String display, boolean custom) {
|
||||
checkRegistered(name);
|
||||
Galaxy galaxy = new Galaxy(name, custom);
|
||||
galaxy.setCustomName(display);
|
||||
galaxy.setDisplay(display);
|
||||
GALAXIES.put(name, galaxy);
|
||||
SECTORS_MAP.put(galaxy, Lists.newArrayList());
|
||||
return galaxy;
|
||||
}
|
||||
|
||||
private static void registerGalaxy(String name, String display) {
|
||||
registerGalaxy(name, display, false);
|
||||
}
|
||||
|
||||
private static Sector registerSector(String name, String display, String galaxy, boolean custom) {
|
||||
private static Sector registerSectorInt(String name, String display, String galaxy, boolean custom) {
|
||||
checkRegistered(name);
|
||||
Galaxy base = GALAXIES.get(galaxy);
|
||||
if(base == null)
|
||||
throw new IllegalArgumentException("Galaxie " + galaxy + " existiert nicht");
|
||||
Sector sector = new Sector(name, custom);
|
||||
sector.setCustomName(display);
|
||||
sector.setDisplay(display);
|
||||
SECTORS.put(name, sector);
|
||||
SECTOR_MAP.put(sector, base);
|
||||
STARS_MAP.put(sector, Lists.newArrayList());
|
||||
SECTORS_MAP.get(base).add(sector);
|
||||
return sector;
|
||||
}
|
||||
|
||||
private static void registerSector(String name, String display, String galaxy) {
|
||||
registerSector(name, display, galaxy, false);
|
||||
}
|
||||
|
||||
private static Domain registerDomain(String name, String display, boolean custom) {
|
||||
private static Domain registerDomainInt(String name, String display, boolean custom) {
|
||||
checkRegistered(name);
|
||||
Domain domain = new Domain(name, custom);
|
||||
domain.setCustomName(display);
|
||||
domain.setDisplay(display);
|
||||
DOMAINS.put(name, domain);
|
||||
AREAS_MAP.put(domain, Lists.newArrayList());
|
||||
return domain;
|
||||
}
|
||||
|
||||
private static void registerDomain(String name, String display) {
|
||||
registerDomain(name, display, false);
|
||||
}
|
||||
|
||||
private static void registerDimension(String name, String display, Dimension dim) {
|
||||
checkRegistered(name);
|
||||
dim.setCustomName(display);
|
||||
dim.setDisplay(display);
|
||||
NAME_MAP.put(name, dim);
|
||||
NAMES.put(dim, name);
|
||||
NAME_LIST.add(name);
|
||||
|
@ -263,7 +251,7 @@ public abstract class UniverseRegistry {
|
|||
DIMENSIONS.add(dim);
|
||||
}
|
||||
|
||||
private static void registerStar(String name, String display, Dimension dim, String sector) {
|
||||
private static void registerStarInt(String name, String display, Dimension dim, String sector) {
|
||||
Sector base = SECTORS.get(sector);
|
||||
if(base == null)
|
||||
throw new IllegalArgumentException("Sektor " + sector + " existiert nicht");
|
||||
|
@ -273,7 +261,7 @@ public abstract class UniverseRegistry {
|
|||
STARS_MAP.get(base).add((Star)dim);
|
||||
}
|
||||
|
||||
private static void registerPlanet(String name, String display, Dimension dim, String star) {
|
||||
private static void registerPlanetInt(String name, String display, Dimension dim, String star) {
|
||||
Dimension base = NAME_MAP.get(star);
|
||||
if(base == null || base.getType() != DimType.STAR)
|
||||
throw new IllegalArgumentException("Stern " + star + " existiert nicht");
|
||||
|
@ -283,7 +271,7 @@ public abstract class UniverseRegistry {
|
|||
PLANETS_MAP.get((Star)base).add((Planet)dim);
|
||||
}
|
||||
|
||||
private static void registerMoon(String name, String display, Dimension dim, String planet) {
|
||||
private static void registerMoonInt(String name, String display, Dimension dim, String planet) {
|
||||
Dimension base = NAME_MAP.get(planet);
|
||||
if(base == null || base.getType() != DimType.PLANET)
|
||||
throw new IllegalArgumentException("Planet " + planet + " existiert nicht");
|
||||
|
@ -292,7 +280,7 @@ public abstract class UniverseRegistry {
|
|||
MOONS_MAP.get((Planet)base).add((Moon)dim);
|
||||
}
|
||||
|
||||
private static void registerArea(String name, String display, Dimension dim, String domain) {
|
||||
private static void registerAreaInt(String name, String display, Dimension dim, String domain) {
|
||||
Domain base = DOMAINS.get(domain);
|
||||
if(base == null)
|
||||
throw new IllegalArgumentException("Bereich " + domain + " existiert nicht");
|
||||
|
@ -301,138 +289,270 @@ public abstract class UniverseRegistry {
|
|||
AREAS_MAP.get(base).add((Area)dim);
|
||||
}
|
||||
|
||||
private static void registerSemi(String name, String display, Dimension dim) {
|
||||
private static void registerSemiInt(String name, String display, Dimension dim) {
|
||||
registerDimension(name, display, dim);
|
||||
SEMI_SET.add((Semi)dim);
|
||||
}
|
||||
|
||||
|
||||
private static String lastGalaxy;
|
||||
private static String lastSector;
|
||||
private static String lastDomain;
|
||||
private static String lastStar;
|
||||
private static String lastPlanet;
|
||||
|
||||
private static String fromDisplay(String display) {
|
||||
return display.toLowerCase().replace("'", "").replace(' ', '_');
|
||||
}
|
||||
|
||||
private static void registerGalaxy(String name, String display, Runnable sub) {
|
||||
registerGalaxyInt(name, display, false);
|
||||
lastGalaxy = name;
|
||||
sub.run();
|
||||
lastGalaxy = null;
|
||||
}
|
||||
|
||||
private static void registerSector(String name, String display, Runnable sub) {
|
||||
registerSectorInt(name, display, lastGalaxy, false);
|
||||
lastSector = name;
|
||||
sub.run();
|
||||
lastSector = null;
|
||||
}
|
||||
|
||||
private static void registerDomain(String name, String display, Runnable sub) {
|
||||
registerDomainInt(name, display, false);
|
||||
lastDomain = name;
|
||||
sub.run();
|
||||
lastDomain = null;
|
||||
}
|
||||
|
||||
private static void registerStar(String name, String display, Dimension dim, Runnable sub) {
|
||||
registerStarInt(name, display, dim, lastSector);
|
||||
lastStar = name;
|
||||
sub.run();
|
||||
lastStar = null;
|
||||
}
|
||||
|
||||
private static void registerPlanet(String name, String display, Dimension dim) {
|
||||
registerPlanetInt(name, display, dim, lastStar);
|
||||
}
|
||||
|
||||
private static void registerPlanet(String name, String display, Dimension dim, Runnable sub) {
|
||||
registerPlanet(name, display, dim);
|
||||
lastPlanet = name;
|
||||
sub.run();
|
||||
lastPlanet = null;
|
||||
}
|
||||
|
||||
private static void registerMoon(String name, String display, Dimension dim) {
|
||||
registerMoonInt(name, display, dim, lastPlanet);
|
||||
}
|
||||
|
||||
private static void registerArea(String name, String display, Dimension dim) {
|
||||
registerAreaInt(name, display, dim, lastDomain);
|
||||
}
|
||||
|
||||
private static void registerSemi(String name, String display, Dimension dim) {
|
||||
registerSemiInt(name, display, dim);
|
||||
}
|
||||
|
||||
private static void registerGalaxy(String display, Runnable sub) {
|
||||
registerGalaxy(fromDisplay(display), "Galaxie " + display, sub);
|
||||
}
|
||||
|
||||
private static void registerSector(String display, Runnable sub) {
|
||||
registerSector(fromDisplay(display), "Sektor " + display, sub);
|
||||
}
|
||||
|
||||
private static void registerDomain(String display, Runnable sub) {
|
||||
registerDomain(fromDisplay(display), display, sub);
|
||||
}
|
||||
|
||||
private static void registerStar(String display, Dimension dim, Runnable sub) {
|
||||
registerStar(fromDisplay(display), "Stern " + display, dim, sub);
|
||||
}
|
||||
|
||||
private static void registerPlanet(String display, Dimension dim) {
|
||||
registerPlanet(fromDisplay(display), "Planet " + display, dim);
|
||||
}
|
||||
|
||||
private static void registerPlanet(String display, Dimension dim, Runnable sub) {
|
||||
registerPlanet(fromDisplay(display), "Planet " + display, dim, sub);
|
||||
}
|
||||
|
||||
private static void registerMoon(String display, Dimension dim) {
|
||||
registerMoon(fromDisplay(display), "Mond " + display, dim);
|
||||
}
|
||||
|
||||
private static void registerArea(String display, Dimension dim) {
|
||||
registerArea(fromDisplay(display), display, dim);
|
||||
}
|
||||
|
||||
private static void registerSemi(String display, Dimension dim) {
|
||||
registerSemi(fromDisplay(display), display, dim);
|
||||
}
|
||||
|
||||
private static void registerStar(String display, int radius, float gravity, float temp, Runnable sub) {
|
||||
registerStar(display, new Star(radius, gravity, temp), sub);
|
||||
}
|
||||
|
||||
private static void registerMoon(String display, int radius, long orbit, long rotation, float gravity, float temperature) {
|
||||
registerMoon(display, new Moon(radius, orbit, rotation, gravity, temperature));
|
||||
}
|
||||
|
||||
private static void registerMoon(String display, int radius, long orbitRotation, float gravity, float temperature) {
|
||||
registerMoon(display, new Moon(radius, orbitRotation, gravity, temperature));
|
||||
}
|
||||
|
||||
public static void register() {
|
||||
registerDimension("space", "Der Weltraum", Space.INSTANCE);
|
||||
registerGalaxy("milkyway", "Milchstraße");
|
||||
registerSector("solar", "Solar", "milkyway");
|
||||
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())
|
||||
.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)
|
||||
.setMediumBiomes(Biome.FOREST, Biome.ROOFEDFOREST, Biome.EXTREMEHILLS, Biome.PLAINS, Biome.BIRCHFOREST,
|
||||
Biome.SWAMPLAND, Biome.JUNGLE)
|
||||
.setHotBiomes(Biome.DESERT, Biome.DESERT, Biome.DESERT, Biome.SAVANNA, Biome.SAVANNA, Biome.PLAINS)
|
||||
.enableCavesRavines(Blocks.lava.getState()).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)
|
||||
.addLiquid(Blocks.flowing_water.getState(), 50, 8, 255, false)
|
||||
.addLiquid(Blocks.flowing_lava.getState(), 20, 8, 255, true)
|
||||
.addMetalOres(MetalType.values())
|
||||
.addOre(Blocks.dirt.getState(), 10, 0, 33, 0, 256, false)
|
||||
.addOre(Blocks.gravel.getState(), 8, 0, 33, 0, 256, false)
|
||||
.addOre(Blocks.rock.getState(), 6, 0, 22, 24, 72, false)
|
||||
.addOre(Blocks.coal_ore.getState(), 20, 0, 17, 0, 128, false)
|
||||
.addOre(Blocks.charge_ore.getState(), 8, 0, 8, 0, 16, false)
|
||||
.addOre(Blocks.lapis_ore.getState(), 1, 0, 7, 16, 16, true)
|
||||
.addOre(Blocks.diamond_ore.getState(), 1, 0, 8, 0, 16, false)
|
||||
.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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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()
|
||||
.addLake(Blocks.water.getState(), null, Blocks.grass.getState(), 4, 0, 255, false)
|
||||
.addLake(Blocks.lava.getState(), null, null, 8, 8, 255, true)
|
||||
.addLiquid(Blocks.flowing_water.getState(), 50, 8, 255, false)
|
||||
.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, 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()
|
||||
.addLake(Blocks.water.getState(), null, Blocks.grass.getState(), 4, 0, 255, false)
|
||||
.addLake(Blocks.lava.getState(), null, null, 8, 8, 255, true)
|
||||
.addLiquid(Blocks.flowing_water.getState(), 50, 8, 255, false)
|
||||
.addLiquid(Blocks.flowing_lava.getState(), 20, 8, 255, true)
|
||||
.addOre(Blocks.coal_ore.getState(), 12, 0, 14, 4, 28, false)
|
||||
.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, 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, 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, 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)
|
||||
.enableCavesRavines(Blocks.lava.getState()).enableMobs()
|
||||
.addLake(Blocks.lava.getState(), null, null, 8, 8, 255, true)
|
||||
.addLiquid(Blocks.flowing_lava.getState(), 20, 8, 255, true)
|
||||
.addOre(Blocks.iron_ore.getState(), 6, 2, 24, 0, 64, false)
|
||||
.addOre(Blocks.gold_ore.getState(), 4, 2, 20, 0, 48, false)
|
||||
.addOre(Blocks.lead_ore.getState(), 6, 0, 14, 0, 32, false)
|
||||
.addOre(Blocks.copper_ore.getState(), 8, 2, 12, 0, 52, false)
|
||||
.addOre(Blocks.coal_ore.getState(), 8, 4, 30, 0, 16, false)
|
||||
.addOre(Blocks.stone.getState(), 8, 4, 33, 0, 80, false), "girok");
|
||||
registerGalaxy("milkyway", "Galaxie Milchstraße", () -> {
|
||||
registerSector("Solar", () -> {
|
||||
registerStar("Sol", 695508000, 274.0f, 5778.0f, () -> {
|
||||
registerPlanet("Terra", new Planet(6378136, 8766144L, 24000L, 28.0f, 9.81f, 259.15f)
|
||||
.setPerlinGen(Blocks.stone.getState(), Blocks.water.getState(), 63)
|
||||
.setBiomeReplacer(Blocks.gravel.getState())
|
||||
.setBiomeGen(Biome.FOREST, false, 4, 4, 6, 50, 50, Biome.MUSHROOMPLAINS).enableMobs().enableSnow()
|
||||
.setFrostBiomes(Biome.ICEPLAINS, Biome.ICEPLAINS, Biome.ICEPLAINS, Biome.COLDTAIGA, Biome.MEGATAIGA)
|
||||
.setColdBiomes(Biome.FOREST, Biome.EXTREMEHILLS, Biome.TAIGA, Biome.PLAINS)
|
||||
.setMediumBiomes(Biome.FOREST, Biome.ROOFEDFOREST, Biome.EXTREMEHILLS, Biome.PLAINS, Biome.BIRCHFOREST,
|
||||
Biome.SWAMPLAND, Biome.JUNGLE)
|
||||
.setHotBiomes(Biome.DESERT, Biome.DESERT, Biome.DESERT, Biome.SAVANNA, Biome.SAVANNA, Biome.PLAINS)
|
||||
.enableCavesRavines(Blocks.lava.getState()).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)
|
||||
.addLiquid(Blocks.flowing_water.getState(), 50, 8, 255, false)
|
||||
.addLiquid(Blocks.flowing_lava.getState(), 20, 8, 255, true)
|
||||
.addMetalOres(MetalType.values())
|
||||
.addOre(Blocks.dirt.getState(), 10, 0, 33, 0, 256, false)
|
||||
.addOre(Blocks.gravel.getState(), 8, 0, 33, 0, 256, false)
|
||||
.addOre(Blocks.rock.getState(), 6, 0, 22, 24, 72, false)
|
||||
.addOre(Blocks.coal_ore.getState(), 20, 0, 17, 0, 128, false)
|
||||
.addOre(Blocks.charge_ore.getState(), 8, 0, 8, 0, 16, false)
|
||||
.addOre(Blocks.lapis_ore.getState(), 1, 0, 7, 16, 16, true)
|
||||
.addOre(Blocks.diamond_ore.getState(), 1, 0, 8, 0, 16, false)
|
||||
.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(), () -> {
|
||||
registerMoon("Luna", 1737100, 655728L, 1.62f, 210.0f);
|
||||
});
|
||||
registerPlanet("mercury", "Planet Merkur", new Planet(0x666666, 0x535353, 0x858585, 2440530, 2111297L, 1407509L, 3.7f, 440.0f)
|
||||
.setPerlinGen(Blocks.moon_rock.getState(), Blocks.air.getState(), 63));
|
||||
registerPlanet("Venus", new Planet(0xc0c0c0, 0xa0a0a0, 0xe0e0e0, 6051800, 5392908L, 5832449L, 8.87f, 737.0f)
|
||||
.setPerlinGen(Blocks.sand.getState(), Blocks.air.getState(), 63));
|
||||
registerPlanet("Mars", new Planet(0xd6905b, 0xbd723a, 0xbd9273, 3396190, 16487781L, 24623L, 3.71f, 208.0f)
|
||||
.setPerlinGen(Blocks.red_sand.getState(), Blocks.air.getState(), 63), () -> {
|
||||
registerMoon("Phobos", 11080, 7654L, 0.0057f, 233.0f);
|
||||
registerMoon("Deimos", 6270, 30312L, 0.003f, 233.0f);
|
||||
});
|
||||
registerPlanet("Jupiter", new Planet(0xffd5ba, 0xb89f90, 0xc7b5a9, 71492000, 103989391L, 9925L, 24.79f, 163.0f).enableDenseFog()
|
||||
.setFlatGen(Blocks.hydrogen.getState(), 256).setCloudHeight(576.0f), () -> {
|
||||
|
||||
});
|
||||
registerPlanet("Saturn", new Planet(0xf1d1a1, 0xd3b385, 0xeed7b5, 60268000, 258141008L, 10656L, 10.44f, 133.0f).enableDenseFog()
|
||||
.setFlatGen(Blocks.hydrogen.getState(), 256).setCloudHeight(576.0f), () -> {
|
||||
|
||||
});
|
||||
registerPlanet("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), () -> {
|
||||
|
||||
});
|
||||
registerPlanet("neptune", "Planet 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), () -> {
|
||||
registerMoon("Triton", 1353400, 141044L, 0.779f, 38.0f);
|
||||
// registerMoon("Nereid", , L, f, .0f);
|
||||
// registerMoon("Naiad", , L, f, .0f);
|
||||
// registerMoon("Thalassa", , L, f, .0f);
|
||||
// registerMoon("Despina", , L, f, .0f);
|
||||
// registerMoon("Galatea", , L, f, .0f);
|
||||
// registerMoon("Larissa", , L, f, .0f);
|
||||
// registerMoon("Proteus", , L, f, .0f);
|
||||
// registerMoon("Halimede", , L, f, .0f);
|
||||
// registerMoon("Psamathe", , L, f, .0f);
|
||||
// registerMoon("Sao", , L, f, .0f);
|
||||
// registerMoon("Laomedeia", , L, f, .0f);
|
||||
// registerMoon("Neso", , L, f, .0f);
|
||||
// registerMoon("Hippocamp", , L, f, .0f);
|
||||
});
|
||||
registerPlanet("Ceres", new Planet(0x666666, 0x535353, 0x858585, 473000, 40315496L, 9074L, 0.27f, 167.0f)
|
||||
.setPerlinGen(Blocks.moon_rock.getState(), Blocks.air.getState(), 63));
|
||||
registerPlanet("Pluto", new Planet(0x666666, 0x535353, 0x858585, 1188300, 2173127098L, 153293L, 0.62f, 40.0f)
|
||||
.setPerlinGen(Blocks.moon_rock.getState(), Blocks.air.getState(), 63), () -> {
|
||||
registerMoon("Charon", 606000, 153293L, 0.288f, 53.0f);
|
||||
registerMoon("Nix", 22500, 596511L, 0.0028f, 38.0f);
|
||||
registerMoon("Hydra", 27500, 916842L, 0.051f, 23.0f);
|
||||
registerMoon("Kerberos", 7000, 772021L, 0.0015f, 19.0f);
|
||||
registerMoon("Styx", 5500, 483877L, 77760L, 0.0013f, 18.0f);
|
||||
});
|
||||
registerPlanet("Haumea", new Planet(0x666666, 0x535353, 0x858585, 816000, 2487831667L, 3914L, 0.63f, 48.0f)
|
||||
.setPerlinGen(Blocks.moon_rock.getState(), Blocks.air.getState(), 63));
|
||||
registerPlanet("Makemake", new Planet(0x666666, 0x535353, 0x858585, 715000, 2684193293L, 22826L, 0.4f, 30.0f)
|
||||
.setPerlinGen(Blocks.moon_rock.getState(), Blocks.air.getState(), 63));
|
||||
registerPlanet("Eris", new Planet(0x666666, 0x535353, 0x858585, 1163000, 4900274496L, 378862L, 0.82f, 30.0f)
|
||||
.setPerlinGen(Blocks.moon_rock.getState(), Blocks.air.getState(), 63));
|
||||
});
|
||||
registerStar("Gi'rok", 603421976, 232.0f, 5220.0f, () -> {
|
||||
registerPlanet("gharoth", "Elbenplanet Gharoth", new Planet(2806382, 4837386L, 52960L, 30.0f, 10.0f, 257.3f)
|
||||
.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()
|
||||
.addLake(Blocks.water.getState(), null, Blocks.grass.getState(), 4, 0, 255, false)
|
||||
.addLake(Blocks.lava.getState(), null, null, 8, 8, 255, true)
|
||||
.addLiquid(Blocks.flowing_water.getState(), 50, 8, 255, false)
|
||||
.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));
|
||||
registerPlanet("transylvania", "Vampirplanet Transsylvanien", new Planet(8374921, 33850466L, 49760L, 20.0f, 10.0f, 255.5f)
|
||||
.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()
|
||||
.addLake(Blocks.water.getState(), null, Blocks.grass.getState(), 4, 0, 255, false)
|
||||
.addLake(Blocks.lava.getState(), null, null, 8, 8, 255, true)
|
||||
.addLiquid(Blocks.flowing_water.getState(), 50, 8, 255, false)
|
||||
.addLiquid(Blocks.flowing_lava.getState(), 20, 8, 255, true)
|
||||
.addOre(Blocks.coal_ore.getState(), 12, 0, 14, 4, 28, false)
|
||||
.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), () -> {
|
||||
registerMoon("yrdinath", "Eismond Yrdinath", new Moon(0xccccff, 2503812, 46743637L, 17460L, 2.5f, 239.15f, Blocks.snow, Blocks.ice)
|
||||
.setBiome(Biome.SNOWLAND).enableMobs().enableSnow().setDefaultWeather(Weather.SNOW));
|
||||
registerMoon("mythril", "Eismond Mythril", new Moon(0xbbbbff, 2213749, 42659432L, 15330L, 2.25f, 221.65f, Blocks.snow, Blocks.ice)
|
||||
.setBiome(Biome.SNOWLAND).enableMobs().enableSnow().setDefaultWeather(Weather.SNOW));
|
||||
});
|
||||
registerPlanet("mesar", "Wüstenplanet Me'sar", new Planet(0xff7f3f, 0xff6022, 0xff6f00, 9823183, 56643366L, 87340L, 11.0f, 333.15f)
|
||||
.setPerlinGen(Blocks.rock.getState(), Blocks.air.getState(), 63)
|
||||
.setBiomeReplacer(Blocks.red_sand.getState())
|
||||
.setBiomeGen(Biome.MESA, true, 3, 1000, 100000, 100000)
|
||||
.enableCavesRavines(Blocks.lava.getState()).enableMobs()
|
||||
.addLake(Blocks.lava.getState(), null, null, 8, 8, 255, true)
|
||||
.addLiquid(Blocks.flowing_lava.getState(), 20, 8, 255, true)
|
||||
.addOre(Blocks.iron_ore.getState(), 6, 2, 24, 0, 64, false)
|
||||
.addOre(Blocks.gold_ore.getState(), 4, 2, 20, 0, 48, false)
|
||||
.addOre(Blocks.lead_ore.getState(), 6, 0, 14, 0, 32, false)
|
||||
.addOre(Blocks.copper_ore.getState(), 8, 2, 12, 0, 52, false)
|
||||
.addOre(Blocks.coal_ore.getState(), 8, 4, 30, 0, 16, false)
|
||||
.addOre(Blocks.stone.getState(), 8, 4, 33, 0, 80, false));
|
||||
});
|
||||
});
|
||||
});
|
||||
registerGalaxy("Drkthrn", () -> {
|
||||
registerSector("blvck", "Sectvr Blvck", () -> {
|
||||
registerStar("Ov'rol", new Star(0x000000, 832718528, 302.0f, 12666.0f, Blocks.goo), () -> {
|
||||
registerPlanet("blackplanet", "Der Schwarze Planet", 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()
|
||||
.addLake(Blocks.goo.getState(), null, null, 8, 8, 255, true)
|
||||
// .addOre(Blocks.PLACEHOLDER_ore.getState(), 0, 2, 3, 0, 12, false)
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
registerGalaxy("drkthrn", "Drkthrn");
|
||||
registerSector("blvck", "Blvck", "drkthrn");
|
||||
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()
|
||||
.addLake(Blocks.goo.getState(), null, null, 8, 8, 255, true)
|
||||
// .addOre(Blocks.PLACEHOLDER_ore.getState(), 0, 2, 3, 0, 12, false)
|
||||
, "ovrol");
|
||||
|
||||
registerSemi("warp", "Der Warp", new Semi(0x0c001f, 0x0c001f, 0x190033, 124072917, 285.0f, 3).setCloudTexture(CloudType.DENSE).setCloudHeight(238.0f)
|
||||
registerSemi("warp", "Der Warp", new Semi(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)
|
||||
|
@ -442,45 +562,46 @@ public abstract class UniverseRegistry {
|
|||
.setStarBrightness(0.9f).setDeepStarBrightness(0.6f)
|
||||
.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, 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, 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, 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, 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, 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, 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, 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, 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(),
|
||||
2, 8, 255, false).addLiquid(Blocks.flowing_lava.getState(), 80, 8, 255, true), "hell");
|
||||
registerDomain("Tian'Xin", () -> {
|
||||
registerArea("Ni'enrath", new Area(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));
|
||||
});
|
||||
registerDomain("Digital", () -> {
|
||||
registerArea("Cyberspace", new Area(0x000000, 16777216, 293.15f, 15).setLightColor(0x00ff00).setBlockColor(0xff0000).enableBlockLightSubtraction()
|
||||
.setFlatGen(Blocks.green_clay.getState(), 2)
|
||||
.enableMobs());
|
||||
});
|
||||
registerDomain("hell", "Hölle", () -> {
|
||||
registerArea("thedric", "Kreis Thedric", new Area(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));
|
||||
registerArea("kyroth", "Kreis Kyroth", new Area(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));
|
||||
registerArea("ahrd", "Kreis Ahrd", new Area(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));
|
||||
registerArea("mizorath", "Kreis Mizorath", new Area(0xff0000, 54029584, 1067.15f, 15).enableMobs()
|
||||
.setPerlinGen(Blocks.hellrock.getState(), Blocks.blood.getState(), 63)
|
||||
.setBiomeReplacer(Blocks.soul_sand.getState()).setBiome(Biome.SOULPLAINS));
|
||||
registerArea("dargoth", "Kreis Dargoth", new Area(0xff3f0c, 43293629, 1707.15f, 15).enableMobs()
|
||||
.setPerlinGen(Blocks.hellrock.getState(), Blocks.magma.getState(), 63)
|
||||
.setBiomeReplacer(Blocks.soul_sand.getState()).setBiome(Biome.SOULPLAINS));
|
||||
registerArea("aasirith", "Kreis Aasirith", new Area(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(),
|
||||
2, 8, 255, false).addLiquid(Blocks.flowing_lava.getState(), 80, 8, 255, true));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -65,7 +65,7 @@ public class ItemCharTemplate extends Item
|
|||
|
||||
public void addInformation(ItemStack stack, EntityNPC player, List<String> tooltip) {
|
||||
Dimension dim = this.spawned.species.origin == null ? null : UniverseRegistry.getDimension(this.spawned.species.origin);
|
||||
tooltip.add(TextColor.ORANGE + "Herkunft: " + (dim == null ? "???" : dim.getNameString()));
|
||||
tooltip.add(TextColor.ORANGE + "Herkunft: " + (dim == null ? "???" : dim.getDisplay()));
|
||||
}
|
||||
|
||||
public boolean onItemUse(ItemStack stack, EntityNPC playerIn, World worldIn, BlockPos pos, Facing side, float hitX, float hitY, float hitZ)
|
||||
|
|
|
@ -57,7 +57,7 @@ public class ItemMobTemplate extends Item
|
|||
EntityInfo egg = EntityRegistry.DNA.get(this.entityId);
|
||||
if(egg != null) {
|
||||
Dimension dim = egg.origin() == null ? null : UniverseRegistry.getDimension(egg.origin());
|
||||
tooltip.add(TextColor.ORANGE + "Herkunft: " + (dim == null ? "???" : dim.getNameString()));
|
||||
tooltip.add(TextColor.ORANGE + "Herkunft: " + (dim == null ? "???" : dim.getDisplay()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -23,9 +23,9 @@ public class ItemExterminator extends ItemMagnetic {
|
|||
if(world.dimension == Space.INSTANCE)
|
||||
player.connection.addHotbar(TextColor.RED + "Der Weltraum kann nicht zerstört werden (lol)");
|
||||
else if(!((AWorldServer)world).exterminate())
|
||||
player.connection.addHotbar(TextColor.YELLOW + "Die Welt %s ist bereits zerstört", world.dimension.getNameString());
|
||||
player.connection.addHotbar(TextColor.YELLOW + "Die Welt %s ist bereits zerstört", world.dimension.getDisplay());
|
||||
else
|
||||
player.connection.addHotbar(TextColor.CRIMSON + "Die Welt %s wurde vernichtet >:)-", world.dimension.getNameString());
|
||||
player.connection.addHotbar(TextColor.CRIMSON + "Die Welt %s wurde vernichtet >:)-", world.dimension.getDisplay());
|
||||
|
||||
// if (!playerIn.capabilities.isCreativeMode)
|
||||
// {
|
||||
|
|
|
@ -16,7 +16,7 @@ public class ItemScanner extends ItemWand {
|
|||
public void onUse(ItemStack stack, EntityNPC player, AWorldServer world, Vec3 vec)
|
||||
{
|
||||
Biome biome = world.getBiomeGenForCoords(new BlockPos(vec.xCoord, 0, vec.zCoord));
|
||||
player.connection.addHotbar(TextColor.NEON + "* Position in %s: %.3f %.3f %.3f, %s, %.2f °C", world.dimension.getNameString(),
|
||||
player.connection.addHotbar(TextColor.NEON + "* Position in %s: %.3f %.3f %.3f, %s, %.2f °C", world.dimension.getDisplay(),
|
||||
vec.xCoord, vec.yCoord, vec.zCoord,
|
||||
biome.display, world.getTemperatureC(new BlockPos(vec)));
|
||||
}
|
||||
|
|
|
@ -16,19 +16,19 @@ public class ItemSpaceNavigator extends ItemMagnetic {
|
|||
|
||||
public String getHotbarText(EntityNPC player, ItemStack stack) {
|
||||
BlockPos pos = player.getPosition();
|
||||
return TextColor.ORANGE + player.worldObj.formatImperialTime(false) + " / " +
|
||||
String.format("%s bei %d, %d, %d", player.worldObj.dimension.getNameString() + TextColor.ORANGE,
|
||||
return TextColor.ORANGE + player.worldObj.formatImperialTime(player, false) + " / " +
|
||||
String.format("%s bei %d, %d, %d", player.worldObj.dimension.getDisplay() + TextColor.ORANGE,
|
||||
pos.getX(), pos.getY(), pos.getZ());
|
||||
}
|
||||
|
||||
public void addInformation(ItemStack stack, EntityNPC player, List<String> tooltip) {
|
||||
tooltip.add(TextColor.ORANGE + player.worldObj.formatImperialTime(true));
|
||||
tooltip.add(TextColor.ORANGE + player.worldObj.formatImperialTime(player, true));
|
||||
String[] dims = player.worldObj.dimension.getBaseNames();
|
||||
for(int z = dims.length - 1; z >= 0; z--) {
|
||||
tooltip.add(TextColor.ORANGE + dims[z]);
|
||||
}
|
||||
BlockPos pos = player.getPosition();
|
||||
tooltip.add(TextColor.ORANGE + String.format("%s bei %d, %d, %d", player.worldObj.dimension.getNameString()
|
||||
tooltip.add(TextColor.ORANGE + String.format("%s bei %d, %d, %d", player.worldObj.dimension.getDisplay()
|
||||
+ TextColor.ORANGE, pos.getX(), pos.getY(), pos.getZ()));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -55,7 +55,8 @@ public class SPacketCharacterList implements Packet<IClientPlayer> {
|
|||
BlockPos pos = buf.readBlockPos();
|
||||
String type = buf.readString(256);
|
||||
int level = buf.readVarInt();
|
||||
this.players.put(id, new PlayerCharacter(name, info, align, dim, pos, type, level));
|
||||
String origin = buf.readString(256);
|
||||
this.players.put(id, new PlayerCharacter(name, info, align, dim, pos, type, level, origin));
|
||||
}
|
||||
this.selected = buf.readVarInt();
|
||||
}
|
||||
|
@ -76,6 +77,7 @@ public class SPacketCharacterList implements Packet<IClientPlayer> {
|
|||
buf.writeBlockPos(chr.pos());
|
||||
buf.writeString(chr.type());
|
||||
buf.writeVarInt(chr.level());
|
||||
buf.writeString(chr.origin());
|
||||
}
|
||||
buf.writeVarInt(this.selected);
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ public class SPacketDimensionName implements Packet<IClientPlayer> {
|
|||
|
||||
public SPacketDimensionName(Dimension dim) {
|
||||
this.fullName = dim.getBaseNames();
|
||||
this.customName = dim.getCustomName();
|
||||
this.customName = dim.getDisplay();
|
||||
}
|
||||
|
||||
public void processPacket(IClientPlayer handler) {
|
||||
|
|
|
@ -38,7 +38,7 @@ public class SPacketRespawn implements Packet<IClientPlayer> {
|
|||
}
|
||||
if(dim.isCustom()) {
|
||||
this.dimName = UniverseRegistry.getName(dim);
|
||||
this.dimDisplay = dim.getCustomName();
|
||||
this.dimDisplay = dim.getDisplay();
|
||||
this.dimFull = dim.getBaseNames();
|
||||
this.dimId = -1;
|
||||
}
|
||||
|
@ -115,7 +115,7 @@ public class SPacketRespawn implements Packet<IClientPlayer> {
|
|||
}
|
||||
if(!dim.isCustom())
|
||||
return dim;
|
||||
dim.setCustomName(this.dimDisplay);
|
||||
dim.setDisplay(this.dimDisplay);
|
||||
dim.setBaseNames(this.dimFull);
|
||||
return dim;
|
||||
}
|
||||
|
|
|
@ -5,19 +5,25 @@ import common.world.AWorldServer;
|
|||
|
||||
public class TileEntityDaylightDetector extends TileEntity implements ITickable
|
||||
{
|
||||
/**
|
||||
* Like the old updateEntity(), except more generic.
|
||||
*/
|
||||
private int updateTimer;
|
||||
|
||||
public void update()
|
||||
{
|
||||
if (this.worldObj != null && !this.worldObj.client && ((AWorldServer)this.worldObj).getTime() % 20L == 0L)
|
||||
if (this.worldObj != null && !this.worldObj.client)
|
||||
{
|
||||
this.blockType = this.getBlockType();
|
||||
|
||||
if (this.blockType instanceof BlockDaylightDetector)
|
||||
{
|
||||
((BlockDaylightDetector)this.blockType).updatePower((AWorldServer)this.worldObj, this.pos);
|
||||
}
|
||||
if(this.updateTimer <= 0) {
|
||||
this.blockType = this.getBlockType();
|
||||
|
||||
if (this.blockType instanceof BlockDaylightDetector)
|
||||
{
|
||||
((BlockDaylightDetector)this.blockType).updatePower((AWorldServer)this.worldObj, this.pos);
|
||||
}
|
||||
|
||||
this.updateTimer = 20;
|
||||
}
|
||||
else {
|
||||
--this.updateTimer;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -47,7 +47,6 @@ public abstract class AWorldServer extends World {
|
|||
public abstract int getSkylightSubtracted();
|
||||
public abstract boolean isBlockinHighHumidity(BlockPos pos);
|
||||
public abstract <T extends Entity> T findNearestEntityWithinAABB(Class<? extends T> entityType, BoundingBox aabb, T closestTo);
|
||||
public abstract long getTime();
|
||||
public abstract void setBiome(BlockPos pos, Biome biome);
|
||||
public abstract void markChunkDirty(BlockPos pos);
|
||||
}
|
||||
|
|
|
@ -20,12 +20,19 @@ import common.collect.Lists;
|
|||
import common.collect.Sets;
|
||||
import common.dimension.DimType;
|
||||
import common.dimension.Dimension;
|
||||
import common.dimension.Galaxy;
|
||||
import common.dimension.Moon;
|
||||
import common.dimension.Planet;
|
||||
import common.dimension.Sector;
|
||||
import common.dimension.Space;
|
||||
import common.dimension.Star;
|
||||
import common.entity.Entity;
|
||||
import common.entity.item.EntityExplosion;
|
||||
import common.entity.npc.EntityNPC;
|
||||
import common.init.BlockRegistry;
|
||||
import common.init.Blocks;
|
||||
import common.init.SoundEvent;
|
||||
import common.init.UniverseRegistry;
|
||||
import common.item.ItemStack;
|
||||
import common.rng.Random;
|
||||
import common.tileentity.ITickable;
|
||||
|
@ -57,7 +64,6 @@ public abstract class World implements IWorldAccess {
|
|||
public static final int MAX_SIZE_Y = 4096;
|
||||
public static final long START_TIME = 4385238000L;
|
||||
public static final float ABSOLUTE_ZERO = -273.15f;
|
||||
public static final long EARTH_YEAR = 8766144L;
|
||||
|
||||
public final boolean client;
|
||||
public final Random rand = new Random();
|
||||
|
@ -131,20 +137,65 @@ public abstract class World implements IWorldAccess {
|
|||
if(Math.abs(this.gravity) < 0.075)
|
||||
this.gravity = 0.0;
|
||||
}
|
||||
|
||||
private int getTimeQualifier(Planet homePlanet) {
|
||||
if(this.dimension == Space.INSTANCE)
|
||||
return 7;
|
||||
else if(this.dimension.getType() == DimType.SEMI)
|
||||
return 8;
|
||||
else if(this.dimension.getType() == DimType.AREA)
|
||||
return 9;
|
||||
if(this.dimension == homePlanet)
|
||||
return 0;
|
||||
Star homeStar = UniverseRegistry.getStar(homePlanet);
|
||||
if(this.dimension == homeStar)
|
||||
return 3;
|
||||
Moon moon = this.dimension.getType() == DimType.MOON ? (Moon)this.dimension : null;
|
||||
Planet planet = this.dimension.getType() == DimType.PLANET ? (Planet)this.dimension : (moon != null ? UniverseRegistry.getPlanet(moon) : null);
|
||||
if(planet == homePlanet)
|
||||
return 1;
|
||||
Star star = this.dimension.getType() == DimType.STAR ? (Star)this.dimension : (planet != null ? UniverseRegistry.getStar(planet) : null);
|
||||
if(star == homeStar)
|
||||
return 2;
|
||||
Sector homeSector = UniverseRegistry.getSector(homeStar);
|
||||
Sector sector = star != null ? UniverseRegistry.getSector(star) : null;
|
||||
if(sector == homeSector)
|
||||
return 4;
|
||||
if(sector != null && UniverseRegistry.getGalaxy(sector) == UniverseRegistry.getGalaxy(homeSector))
|
||||
return 5;
|
||||
return 6;
|
||||
}
|
||||
|
||||
public String formatImperialTime(boolean days) {
|
||||
public String formatImperialTime(Dimension home, boolean days) {
|
||||
String qualifier = home != null ? (home.getType() == DimType.PLANET ? this.getTimeQualifier((Planet)home) + "." : "?.") : "";
|
||||
long time = this.daytime;
|
||||
long year = time / EARTH_YEAR;
|
||||
long frac = (time * 1000L / EARTH_YEAR) % 1000L;
|
||||
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);
|
||||
String gtime;
|
||||
if((home == null || !home.getType().celestial) && !this.dimension.getType().celestial) {
|
||||
gtime = "???.???.M?";
|
||||
}
|
||||
long day = time / this.dimension.getRotationalPeriod();
|
||||
time = time % this.dimension.getRotationalPeriod();
|
||||
return String.format("%d.%03d.%03d.M%d" + (days ? " T%03d.%03d D%03d.%03d.G%d" : ""), this.dimension.getTimeQualifier(),
|
||||
frac, year % 1000L, year / 1000L + 1L,
|
||||
time / 1000L, time % 1000L, (day / 1000L) % 1000L, day % 1000L, day / 1000000L);
|
||||
else {
|
||||
long yearTime = (home != null && home.getType().celestial ? home : this.dimension).getOrbitalPeriod();
|
||||
long year = time / yearTime;
|
||||
long frac = (time * 1000L / yearTime) % 1000L;
|
||||
gtime = String.format("%03d.%03d.M%d", frac, year % 1000L, year / 1000L + 1L);
|
||||
}
|
||||
if(!days)
|
||||
return qualifier + gtime;
|
||||
String ltime;
|
||||
if(!this.dimension.getType().celestial) {
|
||||
ltime = " T???.??? D???.???.G?";
|
||||
}
|
||||
else {
|
||||
long day = time / this.dimension.getRotationalPeriod();
|
||||
time = time % this.dimension.getRotationalPeriod();
|
||||
ltime = String.format(" T%03d.%03d D%03d.%03d.G%d",
|
||||
time / 1000L, time % 1000L, (day / 1000L) % 1000L, day % 1000L, day / 1000000L);
|
||||
}
|
||||
return qualifier + gtime + ltime;
|
||||
}
|
||||
|
||||
public String formatImperialTime(EntityNPC player, boolean days) {
|
||||
return this.formatImperialTime(player == null ? null : player.getOrigin().getDimension(), days);
|
||||
}
|
||||
|
||||
public abstract Biome getBiomeGenForCoords(BlockPos pos);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue