fix exterminated state

This commit is contained in:
Sen 2025-07-13 13:53:53 +02:00
parent 8b983f15c2
commit d09b9516a8
Signed by: sen
GPG key ID: 3AC50A6F47D1B722
13 changed files with 88 additions and 64 deletions

View file

@ -1923,6 +1923,7 @@ public class ClientPlayer implements IClientPlayer
public void handleCelestials(SPacketCelestials packet) { public void handleCelestials(SPacketCelestials packet) {
NetHandler.checkThread(packet, this, this.gm, this.world); NetHandler.checkThread(packet, this, this.gm, this.world);
this.world.setExterminated(packet.getExterminated());
if(this.world.dimension.getType().celestials) { if(this.world.dimension.getType().celestials) {
this.world.dimension.setSunColor(packet.getSunColor()); this.world.dimension.setSunColor(packet.getSunColor());
this.world.dimension.setMoonColors(packet.getMoonColors()); this.world.dimension.setMoonColors(packet.getMoonColors());

View file

@ -1351,8 +1351,8 @@ public class EntityRenderer {
if (shift > 0.0F) if (shift > 0.0F)
{ {
float[] sun = world.dimension.getType().days ? float[] sun = world.dimension.getType().days && !world.dimension.isBaseDestroyed() ?
RenderGlobal.calcSunriseSunsetColors(world.getCelestialAngle(partial), partial) : null; RenderGlobal.calcSunriseSunsetColors(world.getCelestialAngleRadians(partial), partial) : null;
if (sun != null) if (sun != null)
{ {
shift = shift * sun[3]; shift = shift * sun[3];

View file

@ -1201,8 +1201,8 @@ public class RenderGlobal
GlState.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO); GlState.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO);
ItemRenderer.disableStandardItemLighting(); ItemRenderer.disableStandardItemLighting();
float[] afloat = this.theWorld.dimension.getType().days ? float[] afloat = this.theWorld.dimension.getType().days && !this.theWorld.dimension.isBaseDestroyed() ?
RenderGlobal.calcSunriseSunsetColors(this.theWorld.getCelestialAngle(partialTicks), partialTicks) : null; RenderGlobal.calcSunriseSunsetColors(this.theWorld.getCelestialAngleRadians(partialTicks), partialTicks) : null;
if (afloat != null) if (afloat != null)
{ {
GlState.disableTexture2D(); GlState.disableTexture2D();
@ -1865,9 +1865,9 @@ public class RenderGlobal
rand.setSeed(seed); rand.setSeed(seed);
} }
public static float[] calcSunriseSunsetColors(float celestialAngle, float partialTicks) { public static float[] calcSunriseSunsetColors(float radians, float partial) {
float f = 0.4F; float f = 0.4F;
float f1 = ExtMath.cos(celestialAngle * (float)Math.PI * 2.0F) - 0.0F; float f1 = ExtMath.cos(radians) - 0.0F;
float f2 = -0.0F; float f2 = -0.0F;
if(f1 >= f2 - f && f1 <= f2 + f) { if(f1 >= f2 - f && f1 <= f2 + f) {

View file

@ -59,7 +59,7 @@ public class ChunkEmpty extends ChunkClient {
super(world, 0, 0); super(world, 0, 0);
this.debug = debug; this.debug = debug;
this.liquidY = world.dimension.getSeaLevel() - 1; this.liquidY = world.dimension.getSeaLevel() - 1;
this.liquid = world.dimension.getLiquid(); this.liquid = world.dimension.isExterminated() ? Blocks.air.getState() : world.dimension.getLiquid();
this.liquidBlock = this.liquid.getBlock(); this.liquidBlock = this.liquid.getBlock();
this.dummyBlock = this.fillerBlock == Blocks.air ? Blocks.air : Blocks.bedrock; this.dummyBlock = this.fillerBlock == Blocks.air ? Blocks.air : Blocks.bedrock;
this.dummy = this.dummyBlock.getState(); this.dummy = this.dummyBlock.getState();

View file

@ -39,7 +39,6 @@ public class WorldClient extends AWorldClient
private static final int DISPLAY_RANGE = 16; private static final int DISPLAY_RANGE = 16;
private final Client gm; private final Client gm;
private final ChunkClient emptyChunk;
private final Set<Entity> entityList = Sets.<Entity>newHashSet(); private final Set<Entity> entityList = Sets.<Entity>newHashSet();
private final Set<Entity> spawnQueue = Sets.<Entity>newHashSet(); private final Set<Entity> spawnQueue = Sets.<Entity>newHashSet();
private final Set<ChunkPos> previousActive = Sets.<ChunkPos>newHashSet(); private final Set<ChunkPos> previousActive = Sets.<ChunkPos>newHashSet();
@ -47,7 +46,8 @@ public class WorldClient extends AWorldClient
private final List<ChunkClient> chunkListing = Lists.<ChunkClient>newArrayList(); private final List<ChunkClient> chunkListing = Lists.<ChunkClient>newArrayList();
private final Set<Long> emptyChunkListing = Sets.<Long>newHashSet(); private final Set<Long> emptyChunkListing = Sets.<Long>newHashSet();
private final Set<Long> nextEmptyChunkListing = Sets.<Long>newHashSet(); private final Set<Long> nextEmptyChunkListing = Sets.<Long>newHashSet();
// public final Profiler profiler;
private ChunkClient emptyChunk;
protected int lastLightning; protected int lastLightning;
protected Vec3 lightColor = new Vec3(0xffffff); protected Vec3 lightColor = new Vec3(0xffffff);
@ -94,6 +94,18 @@ public class WorldClient extends AWorldClient
if(this.gm.player != null && !this.gm.charEditor) if(this.gm.player != null && !this.gm.charEditor)
this.markReload((int)this.gm.player.posX >> 4, (int)this.gm.player.posZ >> 4, this.gm.renderDistance + 4); this.markReload((int)this.gm.player.posX >> 4, (int)this.gm.player.posZ >> 4, this.gm.renderDistance + 4);
} }
public void setExterminated(boolean exterminated) {
this.dimension.setExterminated(exterminated);
this.emptyChunk = new ChunkEmpty(this, this.gm.debugWorld);
this.markReload();
for(Long id : this.emptyChunkListing) {
this.chunkMapping.add(id, this.emptyChunk);
int x = LongHashMap.getX(id);
int z = LongHashMap.getZ(id);
this.markBlockRangeForRenderUpdate(x << 4, -World.MAX_SIZE_Y, z << 4, (x << 4) + 15, World.MAX_SIZE_Y, (z << 4) + 15);
}
}
public void tick() public void tick()
{ {
@ -668,8 +680,8 @@ public class WorldClient extends AWorldClient
} }
public float getSunBrightness(float p_72971_1_) { public float getSunBrightness(float p_72971_1_) {
float f = this.getCelestialAngle(p_72971_1_); float f = this.getCelestialAngleRadians(p_72971_1_);
float f1 = 1.0F - (ExtMath.cos(f * (float)Math.PI * 2.0F) * 2.0F + 0.2F); float f1 = 1.0F - (ExtMath.cos(f) * 2.0F + 0.2F);
f1 = ExtMath.clampf(f1, 0.0F, 1.0F); f1 = ExtMath.clampf(f1, 0.0F, 1.0F);
f1 = 1.0F - f1; f1 = 1.0F - f1;
f1 = (float)((double)f1 * (1.0D - (double)(this.getRainStrength() * 5.0F) / 16.0D)); f1 = (float)((double)f1 * (1.0D - (double)(this.getRainStrength() * 5.0F) / 16.0D));
@ -741,12 +753,12 @@ public class WorldClient extends AWorldClient
ExtMath.floord(entity.posZ)); ExtMath.floord(entity.posZ));
Biome biome = this.getBiomeGenForCoords(pos); Biome biome = this.getBiomeGenForCoords(pos);
Vec3 vec; Vec3 vec;
if(biome.skyColor != 0xffffffff) if(this.dimension.isExterminated())
vec = new Vec3(biome.skyColor); vec = new Vec3(0x101010);
else else
vec = new Vec3(this.dimension.getSkyColor()); vec = new Vec3(this.dimension.getSkyColor());
if(this.dimension.getType().days) { if(this.dimension.getType().days) {
float mult = ExtMath.clampf(ExtMath.cos(this.getCelestialAngle(partial) * (float)Math.PI * 2.0F) * 2.0F + 0.5F, float mult = ExtMath.clampf(ExtMath.cos(this.getCelestialAngleRadians(partial)) * 2.0F + 0.5F,
0.0F, 1.0F); 0.0F, 1.0F);
if(this.dimension.getSkyColor() == 0xffffffff) { if(this.dimension.getSkyColor() == 0xffffffff) {
float temp = ExtMath.clampf(((biome.getTemperature(pos) + 14.0f) / 40.0f + 0.15f) / 3.0F, float temp = ExtMath.clampf(((biome.getTemperature(pos) + 14.0f) / 40.0f + 0.15f) / 3.0F,
@ -797,8 +809,8 @@ public class WorldClient extends AWorldClient
Vec3 color = new Vec3(this.dimension.getCloudColor()); Vec3 color = new Vec3(this.dimension.getCloudColor());
Biome biome = this.getBiomeGenForCoords(new BlockPos(ExtMath.floord(entity.posX), ExtMath.floord(entity.posY), Biome biome = this.getBiomeGenForCoords(new BlockPos(ExtMath.floord(entity.posX), ExtMath.floord(entity.posY),
ExtMath.floord(entity.posZ))); ExtMath.floord(entity.posZ)));
if(biome.cloudColor != 0xffffffff) if(this.dimension.isExterminated())
color = new Vec3(biome.cloudColor); color = new Vec3(0x000000);
float r = (float)color.xCoord; float r = (float)color.xCoord;
float g = (float)color.yCoord; float g = (float)color.yCoord;
float b = (float)color.zCoord; float b = (float)color.zCoord;
@ -813,7 +825,7 @@ public class WorldClient extends AWorldClient
} }
if(this.dimension.getType().days) { if(this.dimension.getType().days) {
float sun = ExtMath.clampf(ExtMath.cos(this.getCelestialAngle(partialTicks) * (float)Math.PI * 2.0F) * 2.0F + 0.5F, float sun = ExtMath.clampf(ExtMath.cos(this.getCelestialAngleRadians(partialTicks)) * 2.0F + 0.5F,
0.0F, 1.0F); 0.0F, 1.0F);
r = r * (sun * 0.9F + 0.1F); r = r * (sun * 0.9F + 0.1F);
g = g * (sun * 0.9F + 0.1F); g = g * (sun * 0.9F + 0.1F);
@ -836,11 +848,11 @@ public class WorldClient extends AWorldClient
Vec3 color = new Vec3(this.dimension.getFogColor()); Vec3 color = new Vec3(this.dimension.getFogColor());
Biome biome = this.getBiomeGenForCoords(new BlockPos(ExtMath.floord(entity.posX), ExtMath.floord(entity.posY), Biome biome = this.getBiomeGenForCoords(new BlockPos(ExtMath.floord(entity.posX), ExtMath.floord(entity.posY),
ExtMath.floord(entity.posZ))); ExtMath.floord(entity.posZ)));
if(biome.fogColor != 0xffffffff) if(this.dimension.isExterminated())
color = new Vec3(biome.fogColor); color = new Vec3(0x303030);
if(!this.dimension.getType().days) if(!this.dimension.getType().days)
return color; return color;
float sun = ExtMath.clampf(ExtMath.cos(this.getCelestialAngle(partialTicks) * (float)Math.PI * 2.0F) * 2.0F + 0.5F, float sun = ExtMath.clampf(ExtMath.cos(this.getCelestialAngleRadians(partialTicks)) * 2.0F + 0.5F,
0.0F, 1.0F); 0.0F, 1.0F);
float r = (float)color.xCoord; float r = (float)color.xCoord;
float g = (float)color.yCoord; float g = (float)color.yCoord;
@ -852,15 +864,15 @@ public class WorldClient extends AWorldClient
} }
public float getStarBrightness(float partialTicks) { public float getStarBrightness(float partialTicks) {
float f = this.getCelestialAngle(partialTicks); float f = this.getCelestialAngleRadians(partialTicks);
float f1 = 1.0F - (ExtMath.cos(f * (float)Math.PI * 2.0F) * 2.0F + 0.25F); float f1 = 1.0F - (ExtMath.cos(f) * 2.0F + 0.25F);
f1 = ExtMath.clampf(f1, 0.0F, 1.0F); f1 = ExtMath.clampf(f1, 0.0F, 1.0F);
return f1 * f1 * this.dimension.getStarBrightness(); return f1 * f1 * this.dimension.getStarBrightness();
} }
public float getDeepStarBrightness(float partialTicks) { public float getDeepStarBrightness(float partialTicks) {
float f = this.getCelestialAngle(partialTicks); float f = this.getCelestialAngleRadians(partialTicks);
float f1 = 1.0F - (ExtMath.cos(f * (float)Math.PI * 2.0F) * 2.0F + 0.25F); float f1 = 1.0F - (ExtMath.cos(f) * 2.0F + 0.25F);
f1 = ExtMath.clampf(f1, 0.0F, 1.0F); f1 = ExtMath.clampf(f1, 0.0F, 1.0F);
return f1 * f1 * this.dimension.getDeepStarBrightness(); return f1 * f1 * this.dimension.getDeepStarBrightness();
} }

View file

@ -23,7 +23,7 @@ public enum Biome implements Identifyable, Displayable {
TAIGA(5, "taiga", "Taiga", 0x0b6659, -10.0f, 80.0f), TAIGA(5, "taiga", "Taiga", 0x0b6659, -10.0f, 80.0f),
SWAMPLAND(6, "swampland", "Sumpf", 0x07f9b2, 12.0f, 90.0f, 0xe0ffae, 0xffffffff, 6975545), SWAMPLAND(6, "swampland", "Sumpf", 0x07f9b2, 12.0f, 90.0f, 0xe0ffae, 0xffffffff, 6975545),
RIVER(7, "river", "Fluss", 0x0000ff), RIVER(7, "river", "Fluss", 0x0000ff),
EXTERMINATED(8, "exterminated", "Ausgelöscht", 0x000000, 150.0f, 0.0f, 0x202020, 0x303030, 0x303030, 0x101010, 0x303030, 0x000000), EXTERMINATED(8, "exterminated", "Ausgelöscht", 0x000000, 150.0f, 0.0f, 0x202020, 0x303030, 0x303030),
SPACE(9, "space", "Leere des Weltraums", 0x000000, 0.0f, 0.0f), SPACE(9, "space", "Leere des Weltraums", 0x000000, 0.0f, 0.0f),
FROZENSEA(10, "frozenSea", "Vereister See", 0x9090a0, -20.0f), FROZENSEA(10, "frozenSea", "Vereister See", 0x9090a0, -20.0f),
FROZENRIVER(11, "frozenRiver", "Vereister Fluss", 0xa0a0ff, -20.0f), FROZENRIVER(11, "frozenRiver", "Vereister Fluss", 0xa0a0ff, -20.0f),
@ -102,9 +102,6 @@ public enum Biome implements Identifyable, Displayable {
public final int waterColor; public final int waterColor;
public final int grassColor; public final int grassColor;
public final int foliageColor; public final int foliageColor;
public final int skyColor;
public final int fogColor;
public final int cloudColor;
static { static {
for(Biome biome : values()) { for(Biome biome : values()) {
@ -161,7 +158,7 @@ public enum Biome implements Identifyable, Displayable {
return biome; return biome;
} }
private Biome(int id, String name, String display, int color, float temperature, float humidity, int waterColor, int grassColor, int foliageColor, int skyColor, int fogColor, int cloudColor) { private Biome(int id, String name, String display, int color, float temperature, float humidity, int waterColor, int grassColor, int foliageColor) {
this.id = id; this.id = id;
this.name = name; this.name = name;
this.display = display; this.display = display;
@ -171,25 +168,18 @@ public enum Biome implements Identifyable, Displayable {
this.waterColor = waterColor; this.waterColor = waterColor;
this.grassColor = grassColor; this.grassColor = grassColor;
this.foliageColor = foliageColor; this.foliageColor = foliageColor;
this.skyColor = skyColor;
this.fogColor = fogColor;
this.cloudColor = cloudColor;
}
private Biome(int id, String name, String display, int color, float temperature, float humidity, int waterColor, int grassColor, int foliageColor) {
this(id, name, display, color, temperature, humidity, waterColor, grassColor, foliageColor, 0xffffffff, 0xffffffff, 0xffffffff);
} }
private Biome(int id, String name, String display, int color, float temperature, float humidity) { private Biome(int id, String name, String display, int color, float temperature, float humidity) {
this(id, name, display, color, temperature, humidity, 0xffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff); this(id, name, display, color, temperature, humidity, 0xffffff, 0xffffffff, 0xffffffff);
} }
private Biome(int id, String name, String display, int color, float temperature) { private Biome(int id, String name, String display, int color, float temperature) {
this(id, name, display, color, temperature, 50.0f, 0xffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff); this(id, name, display, color, temperature, 50.0f, 0xffffff, 0xffffffff, 0xffffffff);
} }
private Biome(int id, String name, String display, int color) { private Biome(int id, String name, String display, int color) {
this(id, name, display, color, 0.0f, 50.0f, 0xffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff); this(id, name, display, color, 0.0f, 50.0f, 0xffffff, 0xffffffff, 0xffffffff);
} }
public final float getTemperature(BlockPos pos) { public final float getTemperature(BlockPos pos) {

View file

@ -779,6 +779,10 @@ public abstract class Dimension extends Nameable {
protected int[] calcMoonColors() { protected int[] calcMoonColors() {
return new int[0]; return new int[0];
} }
public boolean isBaseDestroyed() {
return false;
}
public final int getSunColor() { public final int getSunColor() {
return this.sunColor != 0xffffffff ? this.sunColor : this.calcSunColor(); return this.sunColor != 0xffffffff ? this.sunColor : this.calcSunColor();

View file

@ -31,4 +31,8 @@ public final class Moon extends Dimension {
Planet planet = UniverseRegistry.getPlanet(this); Planet planet = UniverseRegistry.getPlanet(this);
return planet == null ? super.calcMoonColors() : new int[] {planet.getSkyColor() | (planet.isExterminated() ? 0x80000000 : 0)}; return planet == null ? super.calcMoonColors() : new int[] {planet.getSkyColor() | (planet.isExterminated() ? 0x80000000 : 0)};
} }
public boolean isBaseDestroyed() {
return (this.getSunColor() & 0xff000000) != 0;
}
} }

View file

@ -54,4 +54,8 @@ public final class Planet extends Dimension {
} }
return colors; return colors;
} }
public boolean isBaseDestroyed() {
return (this.getSunColor() & 0xff000000) != 0;
}
} }

View file

@ -8,6 +8,7 @@ import common.network.Packet;
import common.network.PacketBuffer; import common.network.PacketBuffer;
public class SPacketCelestials implements Packet<IClientPlayer> { public class SPacketCelestials implements Packet<IClientPlayer> {
private boolean exterminated;
private int sunColor; private int sunColor;
private int[] moonColors; private int[] moonColors;
@ -15,6 +16,7 @@ public class SPacketCelestials implements Packet<IClientPlayer> {
} }
public SPacketCelestials(Dimension dim) { public SPacketCelestials(Dimension dim) {
this.exterminated = dim.isExterminated();
this.sunColor = dim.getSunColor(); this.sunColor = dim.getSunColor();
this.moonColors = dim.getMoonColors(); this.moonColors = dim.getMoonColors();
} }
@ -24,6 +26,7 @@ public class SPacketCelestials implements Packet<IClientPlayer> {
} }
public void readPacketData(PacketBuffer buf) throws IOException { public void readPacketData(PacketBuffer buf) throws IOException {
this.exterminated = buf.readBoolean();
this.sunColor = buf.readInt(); this.sunColor = buf.readInt();
this.moonColors = new int[buf.readVarInt()]; this.moonColors = new int[buf.readVarInt()];
for(int z = 0; z < this.moonColors.length; z++) { for(int z = 0; z < this.moonColors.length; z++) {
@ -32,12 +35,17 @@ public class SPacketCelestials implements Packet<IClientPlayer> {
} }
public void writePacketData(PacketBuffer buf) throws IOException { public void writePacketData(PacketBuffer buf) throws IOException {
buf.writeBoolean(this.exterminated);
buf.writeInt(this.sunColor); buf.writeInt(this.sunColor);
buf.writeVarInt(this.moonColors.length); buf.writeVarInt(this.moonColors.length);
for(int z = 0; z < this.moonColors.length; z++) { for(int z = 0; z < this.moonColors.length; z++) {
buf.writeInt(this.moonColors[z]); buf.writeInt(this.moonColors[z]);
} }
} }
public boolean getExterminated() {
return this.exterminated;
}
public int getSunColor() { public int getSunColor() {
return this.sunColor; return this.sunColor;

View file

@ -30,16 +30,16 @@ public class SPacketRespawn implements Packet<IClientPlayer> {
this.dimId = -2; this.dimId = -2;
} }
else { else {
this.dimType = dim.getType();
this.dimData = dim.writeData(); this.dimData = dim.writeData();
if(this.dimType.celestials) {
this.sunColor = dim.getSunColor();
this.moonColors = dim.getMoonColors();
}
if(dim.isCustom()) { if(dim.isCustom()) {
this.dimType = dim.getType();
this.dimName = UniverseRegistry.getName(dim); this.dimName = UniverseRegistry.getName(dim);
this.dimDisplay = dim.getCustomName(); this.dimDisplay = dim.getCustomName();
this.dimFull = dim.getFormattedName(true); this.dimFull = dim.getFormattedName(true);
if(this.dimType.celestials) {
this.sunColor = dim.getSunColor();
this.moonColors = dim.getMoonColors();
}
this.dimId = -1; this.dimId = -1;
} }
else { else {
@ -56,13 +56,9 @@ public class SPacketRespawn implements Packet<IClientPlayer> {
public void readPacketData(PacketBuffer buf) throws IOException { public void readPacketData(PacketBuffer buf) throws IOException {
this.dimId = buf.readVarInt(); this.dimId = buf.readVarInt();
if(this.dimId >= -1) if(this.dimId >= -1) {
this.dimData = buf.readTag();
if(this.dimId == -1) {
this.dimType = buf.readEnumValue(DimType.class); this.dimType = buf.readEnumValue(DimType.class);
this.dimName = buf.readString(1024); this.dimData = buf.readTag();
this.dimDisplay = buf.readString(1024);
this.dimFull = buf.readString(4096);
if(this.dimType.celestials) { if(this.dimType.celestials) {
this.sunColor = buf.readInt(); this.sunColor = buf.readInt();
this.moonColors = new int[buf.readVarInt()]; this.moonColors = new int[buf.readVarInt()];
@ -71,19 +67,20 @@ public class SPacketRespawn implements Packet<IClientPlayer> {
} }
} }
} }
if(this.dimId == -1) {
this.dimName = buf.readString(1024);
this.dimDisplay = buf.readString(1024);
this.dimFull = buf.readString(4096);
}
this.type = buf.readUnsignedShort(); this.type = buf.readUnsignedShort();
this.editor = buf.readBoolean(); this.editor = buf.readBoolean();
} }
public void writePacketData(PacketBuffer buf) throws IOException { public void writePacketData(PacketBuffer buf) throws IOException {
buf.writeVarInt(this.dimId); buf.writeVarInt(this.dimId);
if(this.dimId >= -1) if(this.dimId >= -1) {
buf.writeTag(this.dimData);
if(this.dimId == -1) {
buf.writeEnumValue(this.dimType); buf.writeEnumValue(this.dimType);
buf.writeString(this.dimName); buf.writeTag(this.dimData);
buf.writeString(this.dimDisplay);
buf.writeString(this.dimFull);
if(this.dimType.celestials) { if(this.dimType.celestials) {
buf.writeInt(this.sunColor); buf.writeInt(this.sunColor);
buf.writeVarInt(this.moonColors.length); buf.writeVarInt(this.moonColors.length);
@ -92,6 +89,11 @@ public class SPacketRespawn implements Packet<IClientPlayer> {
} }
} }
} }
if(this.dimId == -1) {
buf.writeString(this.dimName);
buf.writeString(this.dimDisplay);
buf.writeString(this.dimFull);
}
buf.writeShort(this.type & 65535); buf.writeShort(this.type & 65535);
buf.writeBoolean(this.editor); buf.writeBoolean(this.editor);
} }
@ -101,14 +103,14 @@ public class SPacketRespawn implements Packet<IClientPlayer> {
return null; return null;
Dimension dim = this.dimId >= 0 ? UniverseRegistry.getDimension(this.dimId) : Dimension.create(this.dimType); Dimension dim = this.dimId >= 0 ? UniverseRegistry.getDimension(this.dimId) : Dimension.create(this.dimType);
dim.readData(this.dimData); dim.readData(this.dimData);
if(!dim.isCustom())
return dim;
dim.setCustomName(this.dimDisplay);
dim.setDisplayName(this.dimFull);
if(this.dimType.celestials) { if(this.dimType.celestials) {
dim.setSunColor(this.sunColor); dim.setSunColor(this.sunColor);
dim.setMoonColors(this.moonColors); dim.setMoonColors(this.moonColors);
} }
if(!dim.isCustom())
return dim;
dim.setCustomName(this.dimDisplay);
dim.setDisplayName(this.dimFull);
return dim; return dim;
} }

View file

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

View file

@ -890,7 +890,7 @@ public abstract class World implements IWorldAccess {
} }
public int calculateSkylightSubtracted(boolean current) { public int calculateSkylightSubtracted(boolean current) {
float f = !this.dimension.getType().days ? 0.5f : this.calculateCelestialAngle(current ? this.daytime : float f = !this.dimension.getType().days || (current && this.dimension.isBaseDestroyed()) ? 0.5f : this.calculateCelestialAngle(current ? this.daytime :
(this.dimension.getRotationalPeriod() / 4L), 1.0f); (this.dimension.getRotationalPeriod() / 4L), 1.0f);
float f1 = 1.0F - (ExtMath.cos(f * (float)Math.PI * 2.0F) * 2.0F + 0.5F); float f1 = 1.0F - (ExtMath.cos(f * (float)Math.PI * 2.0F) * 2.0F + 0.5F);
f1 = ExtMath.clampf(f1, 0.0F, 1.0F); f1 = ExtMath.clampf(f1, 0.0F, 1.0F);
@ -915,8 +915,7 @@ public abstract class World implements IWorldAccess {
} }
public float getCelestialAngleRadians(float partialTicks) { public float getCelestialAngleRadians(float partialTicks) {
float f = this.getCelestialAngle(partialTicks); return (this.dimension.isBaseDestroyed() ? 0.5f : this.getCelestialAngle(partialTicks)) * (float)Math.PI * 2.0F;
return f * (float)Math.PI * 2.0F;
} }
public BlockPos getPrecipitationHeight(BlockPos pos) { public BlockPos getPrecipitationHeight(BlockPos pos) {