fix dimensions
This commit is contained in:
parent
0e848f01c4
commit
8b983f15c2
20 changed files with 789 additions and 527 deletions
|
@ -11,9 +11,11 @@ import common.init.BlockRegistry;
|
|||
import common.init.Blocks;
|
||||
import common.init.MetalType;
|
||||
import common.init.UniverseRegistry;
|
||||
import common.rng.Random;
|
||||
import common.tags.TagObject;
|
||||
import common.util.ExtMath;
|
||||
import common.util.Vec3;
|
||||
import common.vars.Vars;
|
||||
import common.world.State;
|
||||
import common.world.Weather;
|
||||
|
||||
|
@ -222,6 +224,9 @@ public abstract class Dimension extends Nameable {
|
|||
private final List<Liquid> liquids = Lists.newArrayList();
|
||||
|
||||
private long seed = 0L;
|
||||
private boolean exterminated = false;
|
||||
private long timeExisted = 0L;
|
||||
private Weather weather = this.defaultWeather;
|
||||
|
||||
public static void writeState(TagObject tag, String name, State state) {
|
||||
if(state != null)
|
||||
|
@ -246,11 +251,23 @@ public abstract class Dimension extends Nameable {
|
|||
|
||||
public abstract DimType getType();
|
||||
|
||||
|
||||
|
||||
public final void setSeed(long seed) {
|
||||
this.seed = seed;
|
||||
}
|
||||
|
||||
public final void setExterminated(boolean exterminated) {
|
||||
this.exterminated = exterminated;
|
||||
}
|
||||
|
||||
public final void setTimeExisted(long time) {
|
||||
this.timeExisted = time;
|
||||
}
|
||||
|
||||
public final void setCurrentWeather(Weather weather) {
|
||||
this.weather = weather;
|
||||
}
|
||||
|
||||
|
||||
// public final Dimension setLayers(List<FlatSettings> layers) {
|
||||
// this.seaLevel = 0;
|
||||
|
@ -575,8 +592,8 @@ public abstract class Dimension extends Nameable {
|
|||
return this;
|
||||
}
|
||||
|
||||
public final Dimension setWeather(Weather value) {
|
||||
this.defaultWeather = value;
|
||||
public final Dimension setDefaultWeather(Weather value) {
|
||||
this.defaultWeather = this.weather = value;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -640,11 +657,23 @@ public abstract class Dimension extends Nameable {
|
|||
return this;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public final long getSeed() {
|
||||
return this.seed;
|
||||
}
|
||||
|
||||
public final boolean isExterminated() {
|
||||
return this.exterminated;
|
||||
}
|
||||
|
||||
public final long getTimeExisted() {
|
||||
return this.timeExisted;
|
||||
}
|
||||
|
||||
public final Weather getCurrentWeather() {
|
||||
return this.weather;
|
||||
}
|
||||
|
||||
|
||||
public final long getOrbitalPeriod() {
|
||||
return this.orbitalPeriod;
|
||||
|
@ -677,7 +706,7 @@ public abstract class Dimension extends Nameable {
|
|||
// }
|
||||
|
||||
|
||||
public final Weather getWeather() {
|
||||
public final Weather getDefaultWeather() {
|
||||
return this.defaultWeather;
|
||||
}
|
||||
|
||||
|
@ -860,12 +889,11 @@ public abstract class Dimension extends Nameable {
|
|||
return null;
|
||||
}
|
||||
|
||||
public final Dimension copy() {
|
||||
public final Dimension makeCustomCopy() {
|
||||
Dimension dim = create(this.getType());
|
||||
TagObject tag = new TagObject();
|
||||
this.toTags(tag);
|
||||
dim.fromTags(tag);
|
||||
dim.setCustomName(this.getCustomName());
|
||||
return dim;
|
||||
}
|
||||
|
||||
|
@ -875,18 +903,47 @@ public abstract class Dimension extends Nameable {
|
|||
return tag;
|
||||
}
|
||||
|
||||
public final TagObject writeGenerator() {
|
||||
public final TagObject writeData() {
|
||||
TagObject tag = new TagObject();
|
||||
tag.setLong("Seed", this.seed);
|
||||
tag.setLong("Time", this.timeExisted);
|
||||
if(this == Space.INSTANCE)
|
||||
return tag;
|
||||
tag.setBool("Exterminated", this.exterminated);
|
||||
if(this.isCustom())
|
||||
this.toTags(tag);
|
||||
if(!this.exterminated && this.getType().weather)
|
||||
tag.setString("Weather", this.weather.getName());
|
||||
return tag;
|
||||
}
|
||||
|
||||
public final void readGenerator(TagObject tag) {
|
||||
this.seed = tag.getLong("Seed");
|
||||
public final void readData(TagObject tag) {
|
||||
if(tag.hasLong("Seed")) {
|
||||
this.seed = tag.getLong("Seed");
|
||||
}
|
||||
else {
|
||||
Random rand = new Random();
|
||||
if(!Vars.seed.isEmpty())
|
||||
rand.setSeed((long)Vars.seed.hashCode() ^ ~((long)UniverseRegistry.getName(this).hashCode()));
|
||||
this.seed = rand.longv();
|
||||
}
|
||||
this.timeExisted = tag.getLong("Time");
|
||||
if(this == Space.INSTANCE)
|
||||
return;
|
||||
this.exterminated = tag.getBool("Exterminated");
|
||||
if(this.isCustom())
|
||||
this.fromTags(tag);
|
||||
if(this.exterminated) {
|
||||
this.weather = Weather.CLEAR;
|
||||
}
|
||||
else if(this.getType().weather) {
|
||||
this.weather = Weather.getByName(tag.getString("Weather"));
|
||||
if(this.weather == null)
|
||||
this.weather = this.defaultWeather;
|
||||
}
|
||||
else {
|
||||
this.weather = this.defaultWeather;
|
||||
}
|
||||
}
|
||||
|
||||
public final void fromTags(TagObject tag) {
|
||||
|
@ -931,7 +988,7 @@ public abstract class Dimension extends Nameable {
|
|||
this.defaultBiome = Biome.findByName(tag.getString("DefaultBiome"));
|
||||
this.semiFixed = tag.getBool("SemiFixed");
|
||||
this.defaultWeather = Weather.getByName(tag.getString("DefaultWeather"));
|
||||
this.defaultWeather = this.defaultWeather == null ? Weather.CLEAR : this.defaultWeather;
|
||||
this.defaultWeather = this.weather = this.defaultWeather == null ? Weather.CLEAR : this.defaultWeather;
|
||||
this.defaultLeaves = LeavesType.getByName(tag.getString("DefaultLeaves"));
|
||||
this.defaultLeaves = this.defaultLeaves == null ? LeavesType.SPRING : this.defaultLeaves;
|
||||
this.top = readState(tag, "TopBlock", Blocks.dirt.getState());
|
||||
|
|
|
@ -24,11 +24,11 @@ public final class Moon extends Dimension {
|
|||
if(planet == null)
|
||||
return super.calcSunColor();
|
||||
Star star = UniverseRegistry.getStar(planet);
|
||||
return star == null ? super.calcSunColor() : star.getSkyColor();
|
||||
return star == null ? super.calcSunColor() : (star.getSkyColor() | (star.isExterminated() ? 0x80000000 : 0));
|
||||
}
|
||||
|
||||
protected int[] calcMoonColors() {
|
||||
Planet planet = UniverseRegistry.getPlanet(this);
|
||||
return planet == null ? super.calcMoonColors() : new int[] {planet.getSkyColor()};
|
||||
return planet == null ? super.calcMoonColors() : new int[] {planet.getSkyColor() | (planet.isExterminated() ? 0x80000000 : 0)};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,13 +44,13 @@ public final class Planet extends Dimension {
|
|||
|
||||
protected int calcSunColor() {
|
||||
Star star = UniverseRegistry.getStar(this);
|
||||
return star == null ? super.calcSunColor() : star.getSkyColor();
|
||||
return star == null ? super.calcSunColor() : (star.getSkyColor() | (star.isExterminated() ? 0x80000000 : 0));
|
||||
}
|
||||
|
||||
protected int[] calcMoonColors() {
|
||||
int[] colors = new int[this.moons.size()];
|
||||
for(int z = 0; z < colors.length; z++) {
|
||||
colors[z] = this.moons.get(z).getSkyColor();
|
||||
colors[z] = this.moons.get(z).getSkyColor() | (this.moons.get(z).isExterminated() ? 0x80000000 : 0);
|
||||
}
|
||||
return colors;
|
||||
}
|
||||
|
|
|
@ -23,7 +23,6 @@ import common.init.Blocks;
|
|||
import common.init.EntityRegistry;
|
||||
import common.init.ItemRegistry;
|
||||
import common.init.SoundEvent;
|
||||
import common.init.UniverseRegistry;
|
||||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.rng.Random;
|
||||
|
@ -270,7 +269,7 @@ public abstract class Entity
|
|||
if(this.inPortal != null) {
|
||||
if(this.vehicle == null && this.passenger == null && Vars.portals) {
|
||||
Dimension current = this.worldObj.dimension;
|
||||
Dimension dest = UniverseRegistry.getPortalDest(current, this.inPortal);
|
||||
Dimension dest = ((AWorldServer)this.worldObj).getPortalDest(this.inPortal);
|
||||
if(dest != current) {
|
||||
this.travelToDimension(dest, null, 0.0f, 0.0f, this.inPortal);
|
||||
this.inPortal = null;
|
||||
|
@ -359,7 +358,7 @@ public abstract class Entity
|
|||
if(!this.worldObj.client && this.worldObj.dimension.getType() != DimType.SPACE) {
|
||||
// this.worldObj.profiler.start("descent");
|
||||
Dimension current = this.worldObj.dimension;
|
||||
Dimension dim = Vars.voidPortal ? UniverseRegistry.getPortalDest(current, PortalType.VOID) : current;
|
||||
Dimension dim = Vars.voidPortal ? ((AWorldServer)this.worldObj).getPortalDest(PortalType.VOID) : current;
|
||||
if(dim == current) { // && (!(this.isPlayer()) || !((EntityNPCMP)this).creative)) {
|
||||
this.kill();
|
||||
}
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package common.init;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.IdentityHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import common.biome.Biome;
|
||||
import common.block.foliage.LeavesType;
|
||||
import common.collect.Lists;
|
||||
import common.collect.Maps;
|
||||
import common.collect.Sets;
|
||||
|
@ -20,15 +20,6 @@ import common.dimension.Sector;
|
|||
import common.dimension.Semi;
|
||||
import common.dimension.Space;
|
||||
import common.dimension.Star;
|
||||
import common.dimension.Dimension.GeneratorType;
|
||||
import common.dimension.Dimension.ReplacerType;
|
||||
import common.log.Log;
|
||||
import common.rng.Random;
|
||||
import common.tags.TagObject;
|
||||
import common.util.Pair;
|
||||
import common.util.PortalType;
|
||||
import common.util.Triplet;
|
||||
import common.world.State;
|
||||
import common.world.Weather;
|
||||
|
||||
import java.util.Set;
|
||||
|
@ -36,9 +27,6 @@ import java.util.Set;
|
|||
public abstract class UniverseRegistry {
|
||||
public static final long EARTH_YEAR = 8766144L;
|
||||
|
||||
private static final List<Dimension> BASE_DIMS = Lists.newArrayList();
|
||||
private static final Map<Integer, Integer> PORTALS = Maps.newHashMap();
|
||||
|
||||
private static final List<Dimension> DIMENSIONS = Lists.newArrayList();
|
||||
private static final Map<Integer, Dimension> ID_MAP = Maps.newTreeMap();
|
||||
private static final Map<Dimension, Integer> IDS = new IdentityHashMap();
|
||||
|
@ -55,238 +43,44 @@ public abstract class UniverseRegistry {
|
|||
private static final Map<Star, Sector> STAR_MAP = Maps.newHashMap();
|
||||
private static final Map<Sector, Galaxy> SECTOR_MAP = Maps.newHashMap();
|
||||
private static final Map<Area, Domain> AREA_MAP = Maps.newHashMap();
|
||||
|
||||
public static void fromTags(TagObject tag) {
|
||||
List<Pair<String, String>> galaxies = Lists.newArrayList();
|
||||
List<Triplet<String, String, String>> sectors = Lists.newArrayList();
|
||||
List<Triplet<String, String, String>> stars = Lists.newArrayList();
|
||||
List<Triplet<String, String, String>> planets = Lists.newArrayList();
|
||||
List<Triplet<String, String, String>> moons = Lists.newArrayList();
|
||||
List<Pair<String, String>> semis = Lists.newArrayList();
|
||||
List<Pair<String, String>> domains = Lists.newArrayList();
|
||||
List<Triplet<String, String, String>> areas = Lists.newArrayList();
|
||||
|
||||
List<TagObject> list = tag.getList("Dimensions");
|
||||
for(TagObject data : list) {
|
||||
String name = data.getString("Name");
|
||||
String type = data.getString("Type");
|
||||
String display = data.hasString("CustomName") ? data.getString("CustomName") : name;
|
||||
if(type.equals("galaxy"))
|
||||
galaxies.add(new Pair(name, display));
|
||||
else if(type.equals("sector"))
|
||||
sectors.add(new Triplet(name, display, data.getString("Galaxy")));
|
||||
else if(type.equals("domain"))
|
||||
domains.add(new Pair(name, display));
|
||||
else {
|
||||
DimType dim = DimType.getByName(type);
|
||||
if(dim != null) {
|
||||
switch(dim) {
|
||||
case SEMI:
|
||||
semis.add(new Pair(name, display));
|
||||
break;
|
||||
case AREA:
|
||||
areas.add(new Triplet(name, display, data.getString("Domain")));
|
||||
break;
|
||||
case MOON:
|
||||
moons.add(new Triplet(name, display, data.getString("Planet")));
|
||||
break;
|
||||
case PLANET:
|
||||
planets.add(new Triplet(name, display, data.getString("Star")));
|
||||
break;
|
||||
case STAR:
|
||||
stars.add(new Triplet(name, display, data.getString("Sector")));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for(Pair<String, String> galaxy : galaxies) {
|
||||
try {
|
||||
registerGalaxy(galaxy.first(), galaxy.second(), true);
|
||||
}
|
||||
catch(Exception e) {
|
||||
Log.IO.error(e, "Konnte Galaxie %s nicht hinzufügen", galaxy.first());
|
||||
}
|
||||
}
|
||||
|
||||
for(Triplet<String, String, String> sector : sectors) {
|
||||
try {
|
||||
registerSector(sector.first(), sector.second(), sector.third(), true);
|
||||
}
|
||||
catch(Exception e) {
|
||||
Log.IO.error(e, "Konnte Sektor %s nicht hinzufügen", sector.first());
|
||||
}
|
||||
}
|
||||
|
||||
for(Triplet<String, String, String> star : stars) {
|
||||
try {
|
||||
registerStar(star.first(), star.second(), Dimension.create(DimType.STAR), star.third());
|
||||
}
|
||||
catch(Exception e) {
|
||||
Log.IO.error(e, "Konnte Stern %s nicht hinzufügen", star.first());
|
||||
}
|
||||
}
|
||||
|
||||
for(Triplet<String, String, String> planet : planets) {
|
||||
try {
|
||||
registerPlanet(planet.first(), planet.second(), Dimension.create(DimType.PLANET), planet.third());
|
||||
}
|
||||
catch(Exception e) {
|
||||
Log.IO.error(e, "Konnte Planet %s nicht hinzufügen", planet.first());
|
||||
}
|
||||
}
|
||||
|
||||
for(Triplet<String, String, String> moon : moons) {
|
||||
try {
|
||||
registerMoon(moon.first(), moon.second(), Dimension.create(DimType.MOON), moon.third());
|
||||
}
|
||||
catch(Exception e) {
|
||||
Log.IO.error(e, "Konnte Mond %s nicht hinzufügen", moon.first());
|
||||
}
|
||||
}
|
||||
|
||||
for(Pair<String, String> semi : semis) {
|
||||
try {
|
||||
registerSemi(semi.first(), semi.second(), Dimension.create(DimType.SEMI));
|
||||
}
|
||||
catch(Exception e) {
|
||||
Log.IO.error(e, "Konnte Dimension %s nicht hinzufügen", semi.first());
|
||||
}
|
||||
}
|
||||
|
||||
for(Pair<String, String> domain : domains) {
|
||||
try {
|
||||
registerDomain(domain.first(), domain.second(), true);
|
||||
}
|
||||
catch(Exception e) {
|
||||
Log.IO.error(e, "Konnte Bereich %s nicht hinzufügen", domain.first());
|
||||
}
|
||||
}
|
||||
|
||||
for(Triplet<String, String, String> area : areas) {
|
||||
try {
|
||||
registerArea(area.first(), area.second(), Dimension.create(DimType.AREA), area.third());
|
||||
}
|
||||
catch(Exception e) {
|
||||
Log.IO.error(e, "Konnte Dimension %s nicht hinzufügen", area.first());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static TagObject toTags() {
|
||||
TagObject tag = new TagObject();
|
||||
|
||||
List<TagObject> list = Lists.newArrayList();
|
||||
for(Dimension dim : DIMENSIONS) {
|
||||
if(dim.isCustom()) {
|
||||
TagObject data = new TagObject();
|
||||
data.setString("Type", dim.getType().getName());
|
||||
data.setString("Name", getName(dim));
|
||||
data.setString("CustomName", dim.getCustomName());
|
||||
switch(dim.getType()) {
|
||||
case AREA:
|
||||
data.setString("Domain", AREA_MAP.get(dim).id);
|
||||
break;
|
||||
case MOON:
|
||||
data.setString("Planet", getName(MOON_MAP.get(dim)));
|
||||
break;
|
||||
case PLANET:
|
||||
data.setString("Star", getName(PLANET_MAP.get(dim)));
|
||||
break;
|
||||
case STAR:
|
||||
data.setString("Sector", STAR_MAP.get(dim).id);
|
||||
break;
|
||||
}
|
||||
list.add(data);
|
||||
}
|
||||
}
|
||||
for(Sector sector : SECTORS.values()) {
|
||||
if(sector.isCustom()) {
|
||||
TagObject data = new TagObject();
|
||||
data.setString("Type", "sector");
|
||||
data.setString("Name", sector.id);
|
||||
data.setString("CustomName", sector.getCustomName());
|
||||
data.setString("Galaxy", SECTOR_MAP.get(sector).id);
|
||||
list.add(data);
|
||||
}
|
||||
}
|
||||
for(Galaxy galaxy : GALAXIES.values()) {
|
||||
if(galaxy.isCustom()) {
|
||||
TagObject data = new TagObject();
|
||||
data.setString("Type", "galaxy");
|
||||
data.setString("Name", galaxy.id);
|
||||
data.setString("CustomName", galaxy.getCustomName());
|
||||
list.add(data);
|
||||
}
|
||||
}
|
||||
for(Domain domain : DOMAINS.values()) {
|
||||
if(domain.isCustom()) {
|
||||
TagObject data = new TagObject();
|
||||
data.setString("Type", "domain");
|
||||
data.setString("Name", domain.id);
|
||||
data.setString("CustomName", domain.getCustomName());
|
||||
list.add(data);
|
||||
}
|
||||
}
|
||||
if(!list.isEmpty())
|
||||
tag.setList("Dimensions", list);
|
||||
|
||||
return tag;
|
||||
}
|
||||
|
||||
public static Planet registerPlanet(String star, String name, String custom, int sky, int fog, int clouds, long orbit, long rotation,
|
||||
float offset, float gravity, float temperature, int brightness) {
|
||||
star = star == null ? getName(new Random().pick(Lists.newArrayList(STAR_MAP.keySet()))) : star;
|
||||
if(!NAME_MAP.containsKey(star) || NAME_MAP.get(star).getType() != DimType.STAR || NAME_MAP.containsKey(name))
|
||||
return null;
|
||||
Dimension dim = new Planet(sky, fog, clouds, orbit, rotation, offset, gravity, temperature, brightness).copy();
|
||||
dim.setTimeQualifier(3);
|
||||
registerPlanet(name, custom, dim, star);
|
||||
return (Planet)dim;
|
||||
}
|
||||
|
||||
public static void registerPreset(Dimension preset) {
|
||||
Random rand = new Random();
|
||||
String pname;
|
||||
do {
|
||||
pname = NameRegistry.FANTASY.generate(rand, rand.range(2, 5));
|
||||
} while(isRegistered(pname.toLowerCase()));
|
||||
if(preset.getType() == DimType.PLANET) {
|
||||
String galaxy;
|
||||
do {
|
||||
galaxy = NameRegistry.FANTASY.generate(rand, rand.range(2, 5));
|
||||
} while(isRegistered(galaxy.toLowerCase()));
|
||||
String sector;
|
||||
do {
|
||||
sector = NameRegistry.FANTASY.generate(rand, rand.range(2, 5));
|
||||
} while(isRegistered(sector.toLowerCase()));
|
||||
String sname;
|
||||
do {
|
||||
sname = NameRegistry.FANTASY.generate(rand, rand.range(2, 5));
|
||||
} while(isRegistered(sname.toLowerCase()));
|
||||
Dimension star = new Star(0xff0000 | (rand.range(0x60, 0xa0) << 8),
|
||||
rand.frange(200.0f, 400.0f), rand.frange(5000.0f, 7000.0f),
|
||||
rand.pick(Blocks.lava.getState(), Blocks.magma.getState()), rand.range(64, 212)).copy();
|
||||
registerGalaxy(galaxy.toLowerCase(), galaxy, true);
|
||||
registerSector(sector.toLowerCase(), sector, galaxy.toLowerCase(), true);
|
||||
registerStar(sname.toLowerCase(), sname, star, galaxy.toLowerCase());
|
||||
registerPlanet(pname.toLowerCase(), pname, preset.copy(), sname.toLowerCase());
|
||||
}
|
||||
else if(preset.getType() == DimType.AREA) {
|
||||
String domain;
|
||||
do {
|
||||
domain = NameRegistry.FANTASY.generate(rand, rand.range(2, 5));
|
||||
} while(isRegistered(domain.toLowerCase()));
|
||||
registerDomain(domain.toLowerCase(), domain, true);
|
||||
registerArea(pname.toLowerCase(), pname, preset.copy(), domain.toLowerCase());
|
||||
}
|
||||
}
|
||||
private static final Set<Semi> SEMI_SET = Sets.newHashSet();
|
||||
|
||||
public static List<Dimension> getDimensions() {
|
||||
return DIMENSIONS;
|
||||
}
|
||||
|
||||
public static Collection<Galaxy> getGalaxies() {
|
||||
return GALAXIES.values();
|
||||
}
|
||||
|
||||
public static Collection<Sector> getSectors() {
|
||||
return SECTORS.values();
|
||||
}
|
||||
|
||||
public static Collection<Domain> getDomains() {
|
||||
return DOMAINS.values();
|
||||
}
|
||||
|
||||
public static Collection<Star> getStars() {
|
||||
return STAR_MAP.keySet();
|
||||
}
|
||||
|
||||
public static Collection<Planet> getPlanets() {
|
||||
return PLANET_MAP.keySet();
|
||||
}
|
||||
|
||||
public static Collection<Moon> getMoons() {
|
||||
return MOON_MAP.keySet();
|
||||
}
|
||||
|
||||
public static Collection<Area> getAreas() {
|
||||
return AREA_MAP.keySet();
|
||||
}
|
||||
|
||||
public static Collection<Semi> getSemis() {
|
||||
return SEMI_SET;
|
||||
}
|
||||
|
||||
public static Dimension getDimension(int dim) {
|
||||
return ID_MAP.get(dim);
|
||||
}
|
||||
|
@ -310,6 +104,18 @@ public abstract class UniverseRegistry {
|
|||
return MOON_MAP.get(moon);
|
||||
}
|
||||
|
||||
public static Sector getSector(Star star) {
|
||||
return STAR_MAP.get(star);
|
||||
}
|
||||
|
||||
public static Galaxy getGalaxy(Sector sector) {
|
||||
return SECTOR_MAP.get(sector);
|
||||
}
|
||||
|
||||
public static Domain getDomain(Area area) {
|
||||
return AREA_MAP.get(area);
|
||||
}
|
||||
|
||||
public static Dimension getDimension(String name) {
|
||||
return NAME_MAP.get(name);
|
||||
}
|
||||
|
@ -318,15 +124,6 @@ public abstract class UniverseRegistry {
|
|||
return NAME_LIST;
|
||||
}
|
||||
|
||||
public static List<Dimension> getBaseDimensions() {
|
||||
return BASE_DIMS;
|
||||
}
|
||||
|
||||
public static Dimension getPortalDest(Dimension src, PortalType portal) {
|
||||
return PORTALS.containsKey((portal.ordinal() << 20) | getId(src)) ? getDimension(PORTALS.get((portal.ordinal() << 20) | getId(src))) :
|
||||
(PORTALS.containsKey(portal.ordinal() | 0x7ff00000) ? getDimension(PORTALS.get(portal.ordinal() | 0x7ff00000)) : src);
|
||||
}
|
||||
|
||||
public static String getFormattedName(Dimension dim, boolean full) {
|
||||
String base = dim.getNameString();
|
||||
if(!full)
|
||||
|
@ -353,23 +150,75 @@ public abstract class UniverseRegistry {
|
|||
return GALAXIES.containsKey(name) || SECTORS.containsKey(name) || DOMAINS.containsKey(name) || NAME_MAP.containsKey(name);
|
||||
}
|
||||
|
||||
public static boolean isDimension(String name) {
|
||||
return NAME_MAP.containsKey(name);
|
||||
}
|
||||
|
||||
public static Galaxy registerCustomGalaxy(String name, String display) {
|
||||
return registerGalaxy(name, display, true);
|
||||
}
|
||||
|
||||
public static Sector registerCustomSector(String name, String display, String galaxy) {
|
||||
return registerSector(name, display, galaxy, true);
|
||||
}
|
||||
|
||||
public static Domain registerCustomDomain(String name, String display) {
|
||||
return registerDomain(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);
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
return dim;
|
||||
}
|
||||
|
||||
public static Semi registerCustomSemi(String name, String display, Semi dim) {
|
||||
if(!dim.isCustom())
|
||||
dim = (Semi)dim.makeCustomCopy();
|
||||
registerSemi(name, display, dim);
|
||||
return dim;
|
||||
}
|
||||
|
||||
private static void checkRegistered(String name) {
|
||||
if(isRegistered(name))
|
||||
throw new IllegalArgumentException("Objekt " + name + " ist bereits registriert");
|
||||
}
|
||||
|
||||
private static void registerGalaxy(String name, String display, boolean custom) {
|
||||
private static Galaxy registerGalaxy(String name, String display, boolean custom) {
|
||||
checkRegistered(name);
|
||||
Galaxy galaxy = new Galaxy(name, custom);
|
||||
galaxy.setCustomName(display);
|
||||
GALAXIES.put(name, galaxy);
|
||||
return galaxy;
|
||||
}
|
||||
|
||||
private static void registerGalaxy(String name, String display) {
|
||||
registerGalaxy(name, display, false);
|
||||
}
|
||||
|
||||
private static void registerSector(String name, String display, String galaxy, boolean custom) {
|
||||
private static Sector registerSector(String name, String display, String galaxy, boolean custom) {
|
||||
checkRegistered(name);
|
||||
Galaxy base = GALAXIES.get(galaxy);
|
||||
if(base == null)
|
||||
|
@ -379,17 +228,19 @@ public abstract class UniverseRegistry {
|
|||
SECTORS.put(name, sector);
|
||||
SECTOR_MAP.put(sector, base);
|
||||
base.addSector(sector);
|
||||
return sector;
|
||||
}
|
||||
|
||||
private static void registerSector(String name, String display, String galaxy) {
|
||||
registerSector(name, display, galaxy, false);
|
||||
}
|
||||
|
||||
private static void registerDomain(String name, String display, boolean custom) {
|
||||
private static Domain registerDomain(String name, String display, boolean custom) {
|
||||
checkRegistered(name);
|
||||
Domain domain = new Domain(name, custom);
|
||||
domain.setCustomName(display);
|
||||
DOMAINS.put(name, domain);
|
||||
return domain;
|
||||
}
|
||||
|
||||
private static void registerDomain(String name, String display) {
|
||||
|
@ -405,8 +256,6 @@ public abstract class UniverseRegistry {
|
|||
ID_MAP.put(DIMENSIONS.size(), dim);
|
||||
IDS.put(dim, DIMENSIONS.size());
|
||||
DIMENSIONS.add(dim);
|
||||
if(!dim.isCustom() && (dim.getType() == DimType.PLANET || dim.getType() == DimType.AREA || dim.getType() == DimType.SEMI))
|
||||
BASE_DIMS.add(dim);
|
||||
}
|
||||
|
||||
private static void registerStar(String name, String display, Dimension dim, String sector) {
|
||||
|
@ -447,14 +296,7 @@ public abstract class UniverseRegistry {
|
|||
|
||||
private static void registerSemi(String name, String display, Dimension dim) {
|
||||
registerDimension(name, display, dim);
|
||||
}
|
||||
|
||||
private static void registerPortal(PortalType portal, String src, String dest) {
|
||||
PORTALS.put((portal.ordinal() << 20) | getId(NAME_MAP.get(src)), getId(NAME_MAP.get(dest)));
|
||||
}
|
||||
|
||||
private static void registerPortal(PortalType portal, String dest) {
|
||||
PORTALS.put(portal.ordinal() | 0x7ff00000, getId(NAME_MAP.get(dest)));
|
||||
SEMI_SET.add((Semi)dim);
|
||||
}
|
||||
|
||||
public static void register() {
|
||||
|
@ -554,7 +396,7 @@ public abstract class UniverseRegistry {
|
|||
.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)
|
||||
.setPerlinGen(Blocks.snow.getState(), Blocks.ice.getState(), 63).setBiome(Biome.SNOWLAND)
|
||||
.enableMobs().enableSnow().setWeather(Weather.SNOW), "transylvania");
|
||||
.enableMobs().enableSnow().setDefaultWeather(Weather.SNOW), "transylvania");
|
||||
registerPlanet("mesar", "'Wüstenplanet Me'sar'", new Planet(0xff7f3f, 0xff6022, 0xff6f00, 56643366L, 87340L, 11.0f, 333.15f)
|
||||
.setTimeQualifier(5).setPerlinGen(Blocks.rock.getState(), Blocks.air.getState(), 63)
|
||||
.setBiomeReplacer(Blocks.red_sand.getState())
|
||||
|
@ -630,132 +472,5 @@ public abstract class UniverseRegistry {
|
|||
.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");
|
||||
|
||||
setPresets();
|
||||
}
|
||||
|
||||
private static Dimension addPreset(String name, String data) {
|
||||
return addPreset(name, "terra", data);
|
||||
}
|
||||
|
||||
private static Dimension addPreset(String name, String base, String data) {
|
||||
Dimension dim = NAME_MAP.get(base).copy();
|
||||
TagObject ptag;
|
||||
try {
|
||||
ptag = TagObject.parse("{" + data + "}");
|
||||
}
|
||||
catch(IllegalArgumentException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
TagObject dtag = dim.writeGenerator();
|
||||
if(ptag.getBool("ClearGenerator")) {
|
||||
ptag.remove("ClearGenerator");
|
||||
dtag.remove("FloorBlock");
|
||||
dtag.remove("CeilingBlock");
|
||||
dtag.remove("Layers");
|
||||
dtag.remove("AddBiomes");
|
||||
dtag.remove("FrostBiomes");
|
||||
dtag.remove("ColdBiomes");
|
||||
dtag.remove("MediumBiomes");
|
||||
dtag.remove("HotBiomes");
|
||||
dtag.remove("Ores");
|
||||
dtag.remove("Lakes");
|
||||
dtag.remove("Liquids");
|
||||
dtag.setString("Generator", GeneratorType.FLAT.getName());
|
||||
dtag.setString("Replacer", ReplacerType.NONE.getName());
|
||||
// dtag.setBoolean("MobGen", false);
|
||||
// dtag.setBoolean("SnowGen", false);
|
||||
dtag.setBool("Caves", false);
|
||||
dtag.setBool("Ravines", false);
|
||||
dtag.setBool("AltCaves", false);
|
||||
dtag.setBool("Strongholds", false);
|
||||
dtag.setBool("Villages", false);
|
||||
dtag.setBool("Mineshafts", false);
|
||||
dtag.setBool("Scattered", false);
|
||||
dtag.setBool("Fortresses", false);
|
||||
dtag.setInt("Dungeons", 0);
|
||||
dtag.setInt("BiomeSize", 0);
|
||||
dtag.setInt("RiverSize", 4);
|
||||
dtag.setInt("SnowRarity", 6);
|
||||
dtag.setInt("SeaRarity", 50);
|
||||
dtag.setInt("AddRarity", 50);
|
||||
dtag.setInt("SeaLevel", 0);
|
||||
dtag.setString("DefaultBiome", Biome.NONE.name.toLowerCase());
|
||||
dtag.setBool("SemiFixed", false);
|
||||
// dtag.setString("DefaultWeather", Weather.CLEAR.getName());
|
||||
dtag.setString("DefaultLeaves", LeavesType.SPRING.getName());
|
||||
Dimension.writeState(dtag, "FillerBlock", Blocks.air.getState());
|
||||
Dimension.writeState(dtag, "TopBlock", Blocks.air.getState());
|
||||
Dimension.writeState(dtag, "SurfaceBlock", Blocks.air.getState());
|
||||
Dimension.writeState(dtag, "AltBlock1", Blocks.air.getState());
|
||||
Dimension.writeState(dtag, "AltBlock2", Blocks.air.getState());
|
||||
Dimension.writeState(dtag, "LiquidBlock", Blocks.air.getState());
|
||||
Dimension.writeState(dtag, "CaveFillBlock", Blocks.air.getState());
|
||||
}
|
||||
dtag.merge(ptag);
|
||||
dim.readGenerator(dtag);
|
||||
dim.setCustomName(name);
|
||||
// BASE_DIMS.add(dim);
|
||||
return dim;
|
||||
}
|
||||
|
||||
private static Dimension addFlatPreset(String name, Biome biome, boolean populate, State main, Object ... layers) {
|
||||
return addFlatPreset(name, "terra", biome, populate, main, layers);
|
||||
}
|
||||
|
||||
private static Dimension addFlatPreset(String name, String base, Biome biome, boolean populate, State main, Object ... layers) {
|
||||
Dimension dim = addPreset("Flach - " + name, base, "ClearGenerator:1b" + (populate ? "" : ",NoPopulation:1b"));
|
||||
dim.setBiome(biome);
|
||||
if(main != null)
|
||||
dim.setFlatGen(main, layers);
|
||||
return dim;
|
||||
}
|
||||
|
||||
private static void setPresets()
|
||||
{
|
||||
addPreset("Standard", "");
|
||||
addPreset("Doppelte Höhe (128)", "BaseSize:17.0,Stretch:24.0,ScaleY:80.0,SeaLevel:127");
|
||||
addPreset("Große Biome", "BiomeSize:6");
|
||||
addPreset("Überdreht", "Amplification:2.0");
|
||||
addPreset("Wasserwelt", "ScaleX:5000.0,ScaleY:1000.0,ScaleZ:5000.0,Stretch:8.0,BDepthWeight:2.0,BDepthOffset:0.5,BScaleWeight:2.0,BScaleOffset:0.375,SeaLevel:511");
|
||||
addPreset("Inselland", "CoordScale:3000.0,HeightScale:6000.0,UpperLmtScale:250.0,Stretch:10.0");
|
||||
addPreset("Favorit des Gräbers", "ScaleX:5000.0,ScaleY:1000.0,ScaleZ:5000.0,Stretch:5.0,BDepthWeight:2.0,BDepthOffset:1.0,BScaleWeight:4.0,BScaleOffset:1.0");
|
||||
addPreset("Verrückte Berge", "CoordScale:738.41864,HeightScale:157.69133,UpperLmtScale:801.4267,LowerLmtScale:1254.1643,DepthScaleX:374.93652,DepthScaleZ:288.65228,"
|
||||
+ "ScaleX:1355.9908,ScaleY:745.5343,ScaleZ:1183.464,BaseSize:1.8758626,Stretch:1.7137525,BDepthWeight:1.7553768,BDepthOffset:3.4701107,BScaleOffset:2.535211");
|
||||
addPreset("Trockenheit", "ScaleX:1000.0,ScaleY:3000.0,ScaleZ:1000.0,Stretch:10.0,SeaLevel:20");
|
||||
addPreset("Chaotische Höhlen", "UpperLmtScale:2.0,LowerLmtScale:64.0,SeaLevel:6");
|
||||
addPreset("Viel Glück", "LiquidBlock:lava,SeaLevel:40");
|
||||
|
||||
addFlatPreset("Klassisch", Biome.PLAINS, false, Blocks.dirt.getState(), Blocks.bedrock.getState(), 2, Blocks.dirt.getState(),
|
||||
Blocks.grass.getState()).enableVillages();
|
||||
|
||||
addFlatPreset("Abbauwelt", Biome.EXTREMEHILLS, true, Blocks.stone.getState(), Blocks.bedrock.getState(), 230, Blocks.stone.getState(),
|
||||
5, Blocks.dirt.getState(), Blocks.grass.getState()).enableStrongholds().enableMineshafts().setDungeons(8);
|
||||
|
||||
addFlatPreset("Wasserwelt", Biome.SEA, false, Blocks.stone.getState(), Blocks.bedrock.getState(), 5, Blocks.stone.getState(),
|
||||
52, Blocks.dirt.getState(), 5, Blocks.sand.getState(), 90, Blocks.water.getState());
|
||||
|
||||
addFlatPreset("Oberfläche", Biome.PLAINS, true, Blocks.stone.getState(), Blocks.bedrock.getState(), 59, Blocks.stone.getState(),
|
||||
3, Blocks.dirt.getState(), Blocks.grass.getState()).setBiomeReplacer(Blocks.gravel.getState()).enableVillages().enableStrongholds().enableMineshafts().setDungeons(8)
|
||||
.addLake(Blocks.water.getState(), null, Blocks.grass.getState(), 4, 0, 255, false).addLake(Blocks.lava.getState(), Blocks.stone.getState(), null, 8, 8, 255, true);
|
||||
|
||||
addFlatPreset("Verschneites Königreich", Biome.ICEPLAINS, false, Blocks.stone.getState(), Blocks.bedrock.getState(), 59, Blocks.stone.getState(),
|
||||
3, Blocks.dirt.getState(), Blocks.grass.getState(), Blocks.snow_layer.getState()).enableVillages();
|
||||
|
||||
addFlatPreset("Verschneites Königreich +", Biome.ICEPLAINS, true, Blocks.stone.getState(), Blocks.bedrock.getState(), 59, Blocks.stone.getState(),
|
||||
3, Blocks.dirt.getState(), Blocks.grass.getState(), Blocks.snow_layer.getState()).setBiomeReplacer(Blocks.gravel.getState()).enableVillages()
|
||||
.addLake(Blocks.water.getState(), null, Blocks.grass.getState(), 4, 0, 255, false);
|
||||
|
||||
addFlatPreset("Unendliche Grube", Biome.PLAINS, false, Blocks.dirt.getState(), 2, Blocks.cobblestone.getState(), 3, Blocks.dirt.getState(), Blocks.grass.getState())
|
||||
.setBiomeReplacer(Blocks.gravel.getState()).enableVillages();
|
||||
|
||||
addFlatPreset("Wüste", Biome.DESERT, false, Blocks.stone.getState(), Blocks.bedrock.getState(), 3, Blocks.stone.getState(), 52, Blocks.sandstone.getState())
|
||||
.enableVillages().enableScattered();
|
||||
|
||||
addFlatPreset("Redstonewelt", Biome.DESERT, false, Blocks.sandstone.getState(), Blocks.bedrock.getState(), 3, Blocks.stone.getState(),
|
||||
52, Blocks.sandstone.getState());
|
||||
|
||||
addPreset("Leer", "ClearGenerator:1b");
|
||||
addPreset("Alpha 1.2", "Strongholds:0b,Villages:0b,MineShafts:0b,Scattered:0b,Generator:simple,Replacer:simple,Ravines:0b,SeaLevel:64,AltBlock2:sand");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,6 +34,7 @@ import common.packet.SPacketBlockAction;
|
|||
import common.packet.SPacketBlockBreakAnim;
|
||||
import common.packet.SPacketBlockChange;
|
||||
import common.packet.SPacketCamera;
|
||||
import common.packet.SPacketCelestials;
|
||||
import common.packet.SPacketCharacterList;
|
||||
import common.packet.SPacketChunkData;
|
||||
import common.packet.SPacketCollectItem;
|
||||
|
@ -141,4 +142,5 @@ public interface IClientPlayer extends NetHandler {
|
|||
void handleDimName(SPacketDimensionName packet);
|
||||
void handleForm(SPacketDisplayForm packet);
|
||||
void handleServerConfig(SPacketServerConfig packet);
|
||||
void handleCelestials(SPacketCelestials packet);
|
||||
}
|
|
@ -71,6 +71,7 @@ import common.packet.SPacketBlockAction;
|
|||
import common.packet.SPacketBlockBreakAnim;
|
||||
import common.packet.SPacketBlockChange;
|
||||
import common.packet.SPacketCamera;
|
||||
import common.packet.SPacketCelestials;
|
||||
import common.packet.SPacketCharacterList;
|
||||
import common.packet.SPacketChunkData;
|
||||
import common.packet.SPacketCollectItem;
|
||||
|
@ -186,6 +187,7 @@ public enum PacketRegistry {
|
|||
this.server(SPacketLoading.class);
|
||||
this.server(SPacketDisplayForm.class);
|
||||
this.server(SPacketServerConfig.class);
|
||||
this.server(SPacketCelestials.class);
|
||||
|
||||
this.client(CPacketKeepAlive.class);
|
||||
this.client(CPacketMessage.class);
|
||||
|
|
49
common/src/main/java/common/packet/SPacketCelestials.java
Normal file
49
common/src/main/java/common/packet/SPacketCelestials.java
Normal file
|
@ -0,0 +1,49 @@
|
|||
package common.packet;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import common.dimension.Dimension;
|
||||
import common.network.IClientPlayer;
|
||||
import common.network.Packet;
|
||||
import common.network.PacketBuffer;
|
||||
|
||||
public class SPacketCelestials implements Packet<IClientPlayer> {
|
||||
private int sunColor;
|
||||
private int[] moonColors;
|
||||
|
||||
public SPacketCelestials() {
|
||||
}
|
||||
|
||||
public SPacketCelestials(Dimension dim) {
|
||||
this.sunColor = dim.getSunColor();
|
||||
this.moonColors = dim.getMoonColors();
|
||||
}
|
||||
|
||||
public void processPacket(IClientPlayer handler) {
|
||||
handler.handleCelestials(this);
|
||||
}
|
||||
|
||||
public void readPacketData(PacketBuffer buf) throws IOException {
|
||||
this.sunColor = buf.readInt();
|
||||
this.moonColors = new int[buf.readVarInt()];
|
||||
for(int z = 0; z < this.moonColors.length; z++) {
|
||||
this.moonColors[z] = buf.readInt();
|
||||
}
|
||||
}
|
||||
|
||||
public void writePacketData(PacketBuffer buf) throws IOException {
|
||||
buf.writeInt(this.sunColor);
|
||||
buf.writeVarInt(this.moonColors.length);
|
||||
for(int z = 0; z < this.moonColors.length; z++) {
|
||||
buf.writeInt(this.moonColors[z]);
|
||||
}
|
||||
}
|
||||
|
||||
public int getSunColor() {
|
||||
return this.sunColor;
|
||||
}
|
||||
|
||||
public int[] getMoonColors() {
|
||||
return this.moonColors;
|
||||
}
|
||||
}
|
|
@ -12,7 +12,6 @@ import common.tags.TagObject;
|
|||
|
||||
public class SPacketRespawn implements Packet<IClientPlayer> {
|
||||
private int dimId;
|
||||
private long seed;
|
||||
private DimType dimType;
|
||||
private TagObject dimData;
|
||||
private String dimName;
|
||||
|
@ -31,11 +30,9 @@ public class SPacketRespawn implements Packet<IClientPlayer> {
|
|||
this.dimId = -2;
|
||||
}
|
||||
else {
|
||||
this.seed = dim.getSeed();
|
||||
this.dimData = dim.writeData();
|
||||
if(dim.isCustom()) {
|
||||
this.dimType = dim.getType();
|
||||
this.dimData = new TagObject();
|
||||
dim.toTags(this.dimData);
|
||||
this.dimName = UniverseRegistry.getName(dim);
|
||||
this.dimDisplay = dim.getCustomName();
|
||||
this.dimFull = dim.getFormattedName(true);
|
||||
|
@ -60,10 +57,9 @@ public class SPacketRespawn implements Packet<IClientPlayer> {
|
|||
public void readPacketData(PacketBuffer buf) throws IOException {
|
||||
this.dimId = buf.readVarInt();
|
||||
if(this.dimId >= -1)
|
||||
this.seed = buf.readLong();
|
||||
this.dimData = buf.readTag();
|
||||
if(this.dimId == -1) {
|
||||
this.dimType = buf.readEnumValue(DimType.class);
|
||||
this.dimData = buf.readTag();
|
||||
this.dimName = buf.readString(1024);
|
||||
this.dimDisplay = buf.readString(1024);
|
||||
this.dimFull = buf.readString(4096);
|
||||
|
@ -82,10 +78,9 @@ public class SPacketRespawn implements Packet<IClientPlayer> {
|
|||
public void writePacketData(PacketBuffer buf) throws IOException {
|
||||
buf.writeVarInt(this.dimId);
|
||||
if(this.dimId >= -1)
|
||||
buf.writeLong(this.seed);
|
||||
buf.writeTag(this.dimData);
|
||||
if(this.dimId == -1) {
|
||||
buf.writeEnumValue(this.dimType);
|
||||
buf.writeTag(this.dimData);
|
||||
buf.writeString(this.dimName);
|
||||
buf.writeString(this.dimDisplay);
|
||||
buf.writeString(this.dimFull);
|
||||
|
@ -105,10 +100,9 @@ public class SPacketRespawn implements Packet<IClientPlayer> {
|
|||
if(this.dimId < -1)
|
||||
return null;
|
||||
Dimension dim = this.dimId >= 0 ? UniverseRegistry.getDimension(this.dimId) : Dimension.create(this.dimType);
|
||||
dim.setSeed(this.seed);
|
||||
dim.readData(this.dimData);
|
||||
if(!dim.isCustom())
|
||||
return dim;
|
||||
dim.fromTags(this.dimData);
|
||||
dim.setCustomName(this.dimDisplay);
|
||||
dim.setDisplayName(this.dimFull);
|
||||
if(this.dimType.celestials) {
|
||||
|
|
|
@ -23,6 +23,7 @@ public abstract class AWorldServer extends World {
|
|||
|
||||
public abstract List<IPlayer> getAllPlayers();
|
||||
public abstract AWorldServer getOtherWorld(Dimension dimension);
|
||||
public abstract Dimension getPortalDest(PortalType portal);
|
||||
public abstract void placeInDimension(Entity entity, AWorldServer oldWorld, AWorldServer world, BlockPos pos, PortalType portal);
|
||||
public abstract boolean addLoader(BlockPos pos);
|
||||
public abstract boolean removeLoader(BlockPos pos);
|
||||
|
|
|
@ -123,7 +123,7 @@ public abstract class World implements IWorldAccess {
|
|||
this.dimension = dim;
|
||||
// this.storage = storage;
|
||||
this.client = client;
|
||||
this.weather = dim.getWeather();
|
||||
this.weather = dim.getCurrentWeather();
|
||||
}
|
||||
|
||||
public void updatePhysics() {
|
||||
|
@ -1972,7 +1972,7 @@ public abstract class World implements IWorldAccess {
|
|||
}
|
||||
|
||||
public void setWeather(Weather weather) {
|
||||
this.weather = weather;
|
||||
this.dimension.setCurrentWeather(this.weather = weather);
|
||||
}
|
||||
|
||||
public void setDayTime(long time) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue