add world size, space around worlds

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

View file

@ -1775,10 +1775,10 @@ public class Client implements IThreadListener {
this.world.getDarkness()
) + "\n" +
String.format("Zeitfaktor: %dx, Schwerkraft: %.2f m/s²",
Vars.timeFlow, this.world.gravity * 10.0
Vars.timeFlow, this.world.getGravity(this.viewEntity) * 10.0
) + "\n" +
String.format("Letzte Zeitsynch.: + %d.%d s",
ticked / 1000L, (ticked / 100L) % 10L
String.format("Letzte Zeitsynch.: + %d.%d s, Größe: %d .. %d",
ticked / 1000L, (ticked / 100L) % 10L, -this.world.dimension.getSize(), this.world.dimension.getSize()
) + "\n" +
"Startwert: " + this.world.dimension.getSeed() +
(this.serverInfo != null ? "\n" + this.serverInfo : "")

View file

@ -749,6 +749,7 @@ public class EntityRenderer {
{
float sun = world.getSunBrightness(1.0F);
float msun = sun * 0.95F + 0.05F;
float space = world.getSpaceFactor();
for (int n = 0; n < 256; ++n)
{
@ -768,6 +769,11 @@ public class EntityRenderer {
sgreen = (float)lightColor.yCoord * light;
sblue = (float)lightColor.zCoord * light;
}
if(space > 0.0f) {
sred = sred * (1.0F - space) + space;
sgreen = sgreen * (1.0F - space) + space;
sblue = sblue * (1.0F - space) + space;
}
if (world.getLastLightning() > 0)
{
Vec3 lightColor = world.getLightColor();
@ -1082,8 +1088,9 @@ public class EntityRenderer {
GL11.glPushMatrix();
this.setupFog(0, partialTicks);
// renderGlobalIn.renderClouds(partialTicks);
if(this.gm.world.dimension.getType().clouds)
renderGlobalIn.renderClouds(partialTicks);
float alpha = 0.8F * (1.0f - this.gm.world.getSpaceFactor());
if(this.gm.world.dimension.getType().clouds && alpha > 0.5f)
renderGlobalIn.renderClouds(alpha, partialTicks);
GlState.disableFog();
GL11.glPopMatrix();
GL11.glMatrixMode(GL11.GL_PROJECTION);

View file

@ -1357,7 +1357,7 @@ public class RenderGlobal
}
}
public void renderClouds(float partialTicks)
public void renderClouds(float alpha, float partialTicks)
{
GlState.disableCull();
float f = (float)(this.gm.getRenderViewEntity().lastTickPosY + (this.gm.getRenderViewEntity().posY - this.gm.getRenderViewEntity().lastTickPosY) * (double)partialTicks);
@ -1445,28 +1445,28 @@ public class RenderGlobal
if (f3 > -5.0F)
{
worldrenderer.pos((double)(f24 + 0.0F), (double)(f3 + 0.0F), (double)(f25 + 8.0F)).tex((double)((f22 + 0.0F) * 0.00390625F + f17), (double)((f23 + 8.0F) * 0.00390625F + f18)).color(f10, f11, f12, 0.8F).normal(0.0F, -1.0F, 0.0F).endVertex();
worldrenderer.pos((double)(f24 + 8.0F), (double)(f3 + 0.0F), (double)(f25 + 8.0F)).tex((double)((f22 + 8.0F) * 0.00390625F + f17), (double)((f23 + 8.0F) * 0.00390625F + f18)).color(f10, f11, f12, 0.8F).normal(0.0F, -1.0F, 0.0F).endVertex();
worldrenderer.pos((double)(f24 + 8.0F), (double)(f3 + 0.0F), (double)(f25 + 0.0F)).tex((double)((f22 + 8.0F) * 0.00390625F + f17), (double)((f23 + 0.0F) * 0.00390625F + f18)).color(f10, f11, f12, 0.8F).normal(0.0F, -1.0F, 0.0F).endVertex();
worldrenderer.pos((double)(f24 + 0.0F), (double)(f3 + 0.0F), (double)(f25 + 0.0F)).tex((double)((f22 + 0.0F) * 0.00390625F + f17), (double)((f23 + 0.0F) * 0.00390625F + f18)).color(f10, f11, f12, 0.8F).normal(0.0F, -1.0F, 0.0F).endVertex();
worldrenderer.pos((double)(f24 + 0.0F), (double)(f3 + 0.0F), (double)(f25 + 8.0F)).tex((double)((f22 + 0.0F) * 0.00390625F + f17), (double)((f23 + 8.0F) * 0.00390625F + f18)).color(f10, f11, f12, alpha).normal(0.0F, -1.0F, 0.0F).endVertex();
worldrenderer.pos((double)(f24 + 8.0F), (double)(f3 + 0.0F), (double)(f25 + 8.0F)).tex((double)((f22 + 8.0F) * 0.00390625F + f17), (double)((f23 + 8.0F) * 0.00390625F + f18)).color(f10, f11, f12, alpha).normal(0.0F, -1.0F, 0.0F).endVertex();
worldrenderer.pos((double)(f24 + 8.0F), (double)(f3 + 0.0F), (double)(f25 + 0.0F)).tex((double)((f22 + 8.0F) * 0.00390625F + f17), (double)((f23 + 0.0F) * 0.00390625F + f18)).color(f10, f11, f12, alpha).normal(0.0F, -1.0F, 0.0F).endVertex();
worldrenderer.pos((double)(f24 + 0.0F), (double)(f3 + 0.0F), (double)(f25 + 0.0F)).tex((double)((f22 + 0.0F) * 0.00390625F + f17), (double)((f23 + 0.0F) * 0.00390625F + f18)).color(f10, f11, f12, alpha).normal(0.0F, -1.0F, 0.0F).endVertex();
}
if (f3 <= 5.0F)
{
worldrenderer.pos((double)(f24 + 0.0F), (double)(f3 + 4.0F - 9.765625E-4F), (double)(f25 + 8.0F)).tex((double)((f22 + 0.0F) * 0.00390625F + f17), (double)((f23 + 8.0F) * 0.00390625F + f18)).color(f4, f5, f6, 0.8F).normal(0.0F, 1.0F, 0.0F).endVertex();
worldrenderer.pos((double)(f24 + 8.0F), (double)(f3 + 4.0F - 9.765625E-4F), (double)(f25 + 8.0F)).tex((double)((f22 + 8.0F) * 0.00390625F + f17), (double)((f23 + 8.0F) * 0.00390625F + f18)).color(f4, f5, f6, 0.8F).normal(0.0F, 1.0F, 0.0F).endVertex();
worldrenderer.pos((double)(f24 + 8.0F), (double)(f3 + 4.0F - 9.765625E-4F), (double)(f25 + 0.0F)).tex((double)((f22 + 8.0F) * 0.00390625F + f17), (double)((f23 + 0.0F) * 0.00390625F + f18)).color(f4, f5, f6, 0.8F).normal(0.0F, 1.0F, 0.0F).endVertex();
worldrenderer.pos((double)(f24 + 0.0F), (double)(f3 + 4.0F - 9.765625E-4F), (double)(f25 + 0.0F)).tex((double)((f22 + 0.0F) * 0.00390625F + f17), (double)((f23 + 0.0F) * 0.00390625F + f18)).color(f4, f5, f6, 0.8F).normal(0.0F, 1.0F, 0.0F).endVertex();
worldrenderer.pos((double)(f24 + 0.0F), (double)(f3 + 4.0F - 9.765625E-4F), (double)(f25 + 8.0F)).tex((double)((f22 + 0.0F) * 0.00390625F + f17), (double)((f23 + 8.0F) * 0.00390625F + f18)).color(f4, f5, f6, alpha).normal(0.0F, 1.0F, 0.0F).endVertex();
worldrenderer.pos((double)(f24 + 8.0F), (double)(f3 + 4.0F - 9.765625E-4F), (double)(f25 + 8.0F)).tex((double)((f22 + 8.0F) * 0.00390625F + f17), (double)((f23 + 8.0F) * 0.00390625F + f18)).color(f4, f5, f6, alpha).normal(0.0F, 1.0F, 0.0F).endVertex();
worldrenderer.pos((double)(f24 + 8.0F), (double)(f3 + 4.0F - 9.765625E-4F), (double)(f25 + 0.0F)).tex((double)((f22 + 8.0F) * 0.00390625F + f17), (double)((f23 + 0.0F) * 0.00390625F + f18)).color(f4, f5, f6, alpha).normal(0.0F, 1.0F, 0.0F).endVertex();
worldrenderer.pos((double)(f24 + 0.0F), (double)(f3 + 4.0F - 9.765625E-4F), (double)(f25 + 0.0F)).tex((double)((f22 + 0.0F) * 0.00390625F + f17), (double)((f23 + 0.0F) * 0.00390625F + f18)).color(f4, f5, f6, alpha).normal(0.0F, 1.0F, 0.0F).endVertex();
}
if (j1 > -1)
{
for (int l1 = 0; l1 < 8; ++l1)
{
worldrenderer.pos((double)(f24 + (float)l1 + 0.0F), (double)(f3 + 0.0F), (double)(f25 + 8.0F)).tex((double)((f22 + (float)l1 + 0.5F) * 0.00390625F + f17), (double)((f23 + 8.0F) * 0.00390625F + f18)).color(f26, f27, f28, 0.8F).normal(-1.0F, 0.0F, 0.0F).endVertex();
worldrenderer.pos((double)(f24 + (float)l1 + 0.0F), (double)(f3 + 4.0F), (double)(f25 + 8.0F)).tex((double)((f22 + (float)l1 + 0.5F) * 0.00390625F + f17), (double)((f23 + 8.0F) * 0.00390625F + f18)).color(f26, f27, f28, 0.8F).normal(-1.0F, 0.0F, 0.0F).endVertex();
worldrenderer.pos((double)(f24 + (float)l1 + 0.0F), (double)(f3 + 4.0F), (double)(f25 + 0.0F)).tex((double)((f22 + (float)l1 + 0.5F) * 0.00390625F + f17), (double)((f23 + 0.0F) * 0.00390625F + f18)).color(f26, f27, f28, 0.8F).normal(-1.0F, 0.0F, 0.0F).endVertex();
worldrenderer.pos((double)(f24 + (float)l1 + 0.0F), (double)(f3 + 0.0F), (double)(f25 + 0.0F)).tex((double)((f22 + (float)l1 + 0.5F) * 0.00390625F + f17), (double)((f23 + 0.0F) * 0.00390625F + f18)).color(f26, f27, f28, 0.8F).normal(-1.0F, 0.0F, 0.0F).endVertex();
worldrenderer.pos((double)(f24 + (float)l1 + 0.0F), (double)(f3 + 0.0F), (double)(f25 + 8.0F)).tex((double)((f22 + (float)l1 + 0.5F) * 0.00390625F + f17), (double)((f23 + 8.0F) * 0.00390625F + f18)).color(f26, f27, f28, alpha).normal(-1.0F, 0.0F, 0.0F).endVertex();
worldrenderer.pos((double)(f24 + (float)l1 + 0.0F), (double)(f3 + 4.0F), (double)(f25 + 8.0F)).tex((double)((f22 + (float)l1 + 0.5F) * 0.00390625F + f17), (double)((f23 + 8.0F) * 0.00390625F + f18)).color(f26, f27, f28, alpha).normal(-1.0F, 0.0F, 0.0F).endVertex();
worldrenderer.pos((double)(f24 + (float)l1 + 0.0F), (double)(f3 + 4.0F), (double)(f25 + 0.0F)).tex((double)((f22 + (float)l1 + 0.5F) * 0.00390625F + f17), (double)((f23 + 0.0F) * 0.00390625F + f18)).color(f26, f27, f28, alpha).normal(-1.0F, 0.0F, 0.0F).endVertex();
worldrenderer.pos((double)(f24 + (float)l1 + 0.0F), (double)(f3 + 0.0F), (double)(f25 + 0.0F)).tex((double)((f22 + (float)l1 + 0.5F) * 0.00390625F + f17), (double)((f23 + 0.0F) * 0.00390625F + f18)).color(f26, f27, f28, alpha).normal(-1.0F, 0.0F, 0.0F).endVertex();
}
}
@ -1474,10 +1474,10 @@ public class RenderGlobal
{
for (int i2 = 0; i2 < 8; ++i2)
{
worldrenderer.pos((double)(f24 + (float)i2 + 1.0F - 9.765625E-4F), (double)(f3 + 0.0F), (double)(f25 + 8.0F)).tex((double)((f22 + (float)i2 + 0.5F) * 0.00390625F + f17), (double)((f23 + 8.0F) * 0.00390625F + f18)).color(f26, f27, f28, 0.8F).normal(1.0F, 0.0F, 0.0F).endVertex();
worldrenderer.pos((double)(f24 + (float)i2 + 1.0F - 9.765625E-4F), (double)(f3 + 4.0F), (double)(f25 + 8.0F)).tex((double)((f22 + (float)i2 + 0.5F) * 0.00390625F + f17), (double)((f23 + 8.0F) * 0.00390625F + f18)).color(f26, f27, f28, 0.8F).normal(1.0F, 0.0F, 0.0F).endVertex();
worldrenderer.pos((double)(f24 + (float)i2 + 1.0F - 9.765625E-4F), (double)(f3 + 4.0F), (double)(f25 + 0.0F)).tex((double)((f22 + (float)i2 + 0.5F) * 0.00390625F + f17), (double)((f23 + 0.0F) * 0.00390625F + f18)).color(f26, f27, f28, 0.8F).normal(1.0F, 0.0F, 0.0F).endVertex();
worldrenderer.pos((double)(f24 + (float)i2 + 1.0F - 9.765625E-4F), (double)(f3 + 0.0F), (double)(f25 + 0.0F)).tex((double)((f22 + (float)i2 + 0.5F) * 0.00390625F + f17), (double)((f23 + 0.0F) * 0.00390625F + f18)).color(f26, f27, f28, 0.8F).normal(1.0F, 0.0F, 0.0F).endVertex();
worldrenderer.pos((double)(f24 + (float)i2 + 1.0F - 9.765625E-4F), (double)(f3 + 0.0F), (double)(f25 + 8.0F)).tex((double)((f22 + (float)i2 + 0.5F) * 0.00390625F + f17), (double)((f23 + 8.0F) * 0.00390625F + f18)).color(f26, f27, f28, alpha).normal(1.0F, 0.0F, 0.0F).endVertex();
worldrenderer.pos((double)(f24 + (float)i2 + 1.0F - 9.765625E-4F), (double)(f3 + 4.0F), (double)(f25 + 8.0F)).tex((double)((f22 + (float)i2 + 0.5F) * 0.00390625F + f17), (double)((f23 + 8.0F) * 0.00390625F + f18)).color(f26, f27, f28, alpha).normal(1.0F, 0.0F, 0.0F).endVertex();
worldrenderer.pos((double)(f24 + (float)i2 + 1.0F - 9.765625E-4F), (double)(f3 + 4.0F), (double)(f25 + 0.0F)).tex((double)((f22 + (float)i2 + 0.5F) * 0.00390625F + f17), (double)((f23 + 0.0F) * 0.00390625F + f18)).color(f26, f27, f28, alpha).normal(1.0F, 0.0F, 0.0F).endVertex();
worldrenderer.pos((double)(f24 + (float)i2 + 1.0F - 9.765625E-4F), (double)(f3 + 0.0F), (double)(f25 + 0.0F)).tex((double)((f22 + (float)i2 + 0.5F) * 0.00390625F + f17), (double)((f23 + 0.0F) * 0.00390625F + f18)).color(f26, f27, f28, alpha).normal(1.0F, 0.0F, 0.0F).endVertex();
}
}
@ -1485,10 +1485,10 @@ public class RenderGlobal
{
for (int j2 = 0; j2 < 8; ++j2)
{
worldrenderer.pos((double)(f24 + 0.0F), (double)(f3 + 4.0F), (double)(f25 + (float)j2 + 0.0F)).tex((double)((f22 + 0.0F) * 0.00390625F + f17), (double)((f23 + (float)j2 + 0.5F) * 0.00390625F + f18)).color(f13, f14, f15, 0.8F).normal(0.0F, 0.0F, -1.0F).endVertex();
worldrenderer.pos((double)(f24 + 8.0F), (double)(f3 + 4.0F), (double)(f25 + (float)j2 + 0.0F)).tex((double)((f22 + 8.0F) * 0.00390625F + f17), (double)((f23 + (float)j2 + 0.5F) * 0.00390625F + f18)).color(f13, f14, f15, 0.8F).normal(0.0F, 0.0F, -1.0F).endVertex();
worldrenderer.pos((double)(f24 + 8.0F), (double)(f3 + 0.0F), (double)(f25 + (float)j2 + 0.0F)).tex((double)((f22 + 8.0F) * 0.00390625F + f17), (double)((f23 + (float)j2 + 0.5F) * 0.00390625F + f18)).color(f13, f14, f15, 0.8F).normal(0.0F, 0.0F, -1.0F).endVertex();
worldrenderer.pos((double)(f24 + 0.0F), (double)(f3 + 0.0F), (double)(f25 + (float)j2 + 0.0F)).tex((double)((f22 + 0.0F) * 0.00390625F + f17), (double)((f23 + (float)j2 + 0.5F) * 0.00390625F + f18)).color(f13, f14, f15, 0.8F).normal(0.0F, 0.0F, -1.0F).endVertex();
worldrenderer.pos((double)(f24 + 0.0F), (double)(f3 + 4.0F), (double)(f25 + (float)j2 + 0.0F)).tex((double)((f22 + 0.0F) * 0.00390625F + f17), (double)((f23 + (float)j2 + 0.5F) * 0.00390625F + f18)).color(f13, f14, f15, alpha).normal(0.0F, 0.0F, -1.0F).endVertex();
worldrenderer.pos((double)(f24 + 8.0F), (double)(f3 + 4.0F), (double)(f25 + (float)j2 + 0.0F)).tex((double)((f22 + 8.0F) * 0.00390625F + f17), (double)((f23 + (float)j2 + 0.5F) * 0.00390625F + f18)).color(f13, f14, f15, alpha).normal(0.0F, 0.0F, -1.0F).endVertex();
worldrenderer.pos((double)(f24 + 8.0F), (double)(f3 + 0.0F), (double)(f25 + (float)j2 + 0.0F)).tex((double)((f22 + 8.0F) * 0.00390625F + f17), (double)((f23 + (float)j2 + 0.5F) * 0.00390625F + f18)).color(f13, f14, f15, alpha).normal(0.0F, 0.0F, -1.0F).endVertex();
worldrenderer.pos((double)(f24 + 0.0F), (double)(f3 + 0.0F), (double)(f25 + (float)j2 + 0.0F)).tex((double)((f22 + 0.0F) * 0.00390625F + f17), (double)((f23 + (float)j2 + 0.5F) * 0.00390625F + f18)).color(f13, f14, f15, alpha).normal(0.0F, 0.0F, -1.0F).endVertex();
}
}
@ -1496,10 +1496,10 @@ public class RenderGlobal
{
for (int k2 = 0; k2 < 8; ++k2)
{
worldrenderer.pos((double)(f24 + 0.0F), (double)(f3 + 4.0F), (double)(f25 + (float)k2 + 1.0F - 9.765625E-4F)).tex((double)((f22 + 0.0F) * 0.00390625F + f17), (double)((f23 + (float)k2 + 0.5F) * 0.00390625F + f18)).color(f13, f14, f15, 0.8F).normal(0.0F, 0.0F, 1.0F).endVertex();
worldrenderer.pos((double)(f24 + 8.0F), (double)(f3 + 4.0F), (double)(f25 + (float)k2 + 1.0F - 9.765625E-4F)).tex((double)((f22 + 8.0F) * 0.00390625F + f17), (double)((f23 + (float)k2 + 0.5F) * 0.00390625F + f18)).color(f13, f14, f15, 0.8F).normal(0.0F, 0.0F, 1.0F).endVertex();
worldrenderer.pos((double)(f24 + 8.0F), (double)(f3 + 0.0F), (double)(f25 + (float)k2 + 1.0F - 9.765625E-4F)).tex((double)((f22 + 8.0F) * 0.00390625F + f17), (double)((f23 + (float)k2 + 0.5F) * 0.00390625F + f18)).color(f13, f14, f15, 0.8F).normal(0.0F, 0.0F, 1.0F).endVertex();
worldrenderer.pos((double)(f24 + 0.0F), (double)(f3 + 0.0F), (double)(f25 + (float)k2 + 1.0F - 9.765625E-4F)).tex((double)((f22 + 0.0F) * 0.00390625F + f17), (double)((f23 + (float)k2 + 0.5F) * 0.00390625F + f18)).color(f13, f14, f15, 0.8F).normal(0.0F, 0.0F, 1.0F).endVertex();
worldrenderer.pos((double)(f24 + 0.0F), (double)(f3 + 4.0F), (double)(f25 + (float)k2 + 1.0F - 9.765625E-4F)).tex((double)((f22 + 0.0F) * 0.00390625F + f17), (double)((f23 + (float)k2 + 0.5F) * 0.00390625F + f18)).color(f13, f14, f15, alpha).normal(0.0F, 0.0F, 1.0F).endVertex();
worldrenderer.pos((double)(f24 + 8.0F), (double)(f3 + 4.0F), (double)(f25 + (float)k2 + 1.0F - 9.765625E-4F)).tex((double)((f22 + 8.0F) * 0.00390625F + f17), (double)((f23 + (float)k2 + 0.5F) * 0.00390625F + f18)).color(f13, f14, f15, alpha).normal(0.0F, 0.0F, 1.0F).endVertex();
worldrenderer.pos((double)(f24 + 8.0F), (double)(f3 + 0.0F), (double)(f25 + (float)k2 + 1.0F - 9.765625E-4F)).tex((double)((f22 + 8.0F) * 0.00390625F + f17), (double)((f23 + (float)k2 + 0.5F) * 0.00390625F + f18)).color(f13, f14, f15, alpha).normal(0.0F, 0.0F, 1.0F).endVertex();
worldrenderer.pos((double)(f24 + 0.0F), (double)(f3 + 0.0F), (double)(f25 + (float)k2 + 1.0F - 9.765625E-4F)).tex((double)((f22 + 0.0F) * 0.00390625F + f17), (double)((f23 + (float)k2 + 0.5F) * 0.00390625F + f18)).color(f13, f14, f15, alpha).normal(0.0F, 0.0F, 1.0F).endVertex();
}
}

View file

@ -55,11 +55,11 @@ public class ChunkEmpty extends ChunkClient {
return state;
}
public ChunkEmpty(WorldClient world, boolean debug) {
super(world, 0, 0);
public ChunkEmpty(WorldClient world, boolean out, boolean debug) {
super(world, out ? Integer.MAX_VALUE : 0, 0);
this.debug = debug;
this.liquidY = world.dimension.getSeaLevel() - 1;
this.liquid = world.dimension.isExterminated() ? Blocks.air.getState() : world.dimension.getLiquid();
this.liquid = out || world.dimension.isExterminated() ? Blocks.air.getState() : world.dimension.getLiquid();
this.liquidBlock = this.liquid.getBlock();
this.dummyBlock = this.fillerBlock == Blocks.air ? Blocks.air : Blocks.bedrock;
this.dummy = this.dummyBlock.getState();

View file

@ -46,8 +46,9 @@ public class WorldClient extends AWorldClient
private final List<ChunkClient> chunkListing = Lists.<ChunkClient>newArrayList();
private final Set<Long> emptyChunkListing = Sets.<Long>newHashSet();
private final Set<Long> nextEmptyChunkListing = Sets.<Long>newHashSet();
private ChunkClient emptyChunk;
private ChunkClient outsideChunk;
protected int lastLightning;
protected Vec3 lightColor = new Vec3(0xffffff);
@ -55,13 +56,19 @@ public class WorldClient extends AWorldClient
{
super(dim);
this.gm = gm;
this.emptyChunk = new ChunkEmpty(this, this.gm.debugWorld);
this.emptyChunk = new ChunkEmpty(this, false, this.gm.debugWorld);
this.outsideChunk = new ChunkEmpty(this, true, this.gm.debugWorld);
this.calculateInitialSkylight();
this.calculateInitialWeather();
this.updatePhysics();
// this.setDifficulty(this.gm.difficulty);
}
private ChunkClient getEmptyChunk(int x, int z) {
int size = this.dimension.getSize() / 16;
return x < -size || z < -size || x >= size || z >= size ? this.outsideChunk : this.emptyChunk;
}
private void markReload(int cx, int cz, int range) {
this.nextEmptyChunkListing.clear();
for(int x = cx - range; x <= cx + range; x++) {
@ -74,7 +81,7 @@ public class WorldClient extends AWorldClient
}
continue;
}
this.chunkMapping.add(id, this.emptyChunk);
this.chunkMapping.add(id, this.getEmptyChunk(x, z));
this.emptyChunkListing.remove(id);
this.nextEmptyChunkListing.add(id);
this.markBlockRangeForRenderUpdate(x << 4, -World.MAX_SIZE_Y, z << 4, (x << 4) + 15, World.MAX_SIZE_Y, (z << 4) + 15);
@ -97,12 +104,13 @@ public class WorldClient extends AWorldClient
public void setExterminated(boolean exterminated) {
this.dimension.setExterminated(exterminated);
this.emptyChunk = new ChunkEmpty(this, this.gm.debugWorld);
this.emptyChunk = new ChunkEmpty(this, false, this.gm.debugWorld);
this.outsideChunk = new ChunkEmpty(this, true, 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.chunkMapping.add(id, this.getEmptyChunk(x, z));
this.markBlockRangeForRenderUpdate(x << 4, -World.MAX_SIZE_Y, z << 4, (x << 4) + 15, World.MAX_SIZE_Y, (z << 4) + 15);
}
}
@ -394,7 +402,7 @@ public class WorldClient extends AWorldClient
public ChunkClient getChunk(int x, int z)
{
ChunkClient chunk = this.chunkMapping.getValueByKey(LongHashMap.packInt(x, z));
return chunk == null ? this.emptyChunk : chunk;
return chunk == null ? this.getEmptyChunk(x, z) : chunk;
}
public ChunkClient getChunk(BlockPos pos) {
@ -686,7 +694,7 @@ public class WorldClient extends AWorldClient
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.getDarkness() * 5.0F) / 16.0D));
return f1 * 0.8F + 0.2F;
return Math.max(f1 * 0.8F + 0.2F, this.getSpaceFactor());
}
private static int hsvToRGB(float hue, float saturation, float value)
@ -801,6 +809,13 @@ public class WorldClient extends AWorldClient
g = g * (1.0F - light) + (float)this.lightColor.yCoord * light;
b = b * (1.0F - light) + (float)this.lightColor.zCoord * light;
}
float space = this.getSpaceFactor();
if(space > 0.0f) {
r = r * (1.0F - space);
g = g * (1.0F - space);
b = b * (1.0F - space);
}
return new Vec3((double)r, (double)g, (double)b);
}
@ -840,6 +855,13 @@ public class WorldClient extends AWorldClient
g = g * shift + mul * (1.0F - shift);
b = b * shift + mul * (1.0F - shift);
}
float space = this.getSpaceFactor();
if(space > 0.0f) {
r = r * (1.0F - space);
g = g * (1.0F - space);
b = b * (1.0F - space);
}
return new Vec3((double)r, (double)g, (double)b);
}
@ -860,6 +882,14 @@ public class WorldClient extends AWorldClient
r = r * (sun * 0.94F + 0.06F);
g = g * (sun * 0.94F + 0.06F);
b = b * (sun * 0.91F + 0.09F);
float space = this.getSpaceFactor();
if(space > 0.0f) {
r = r * (1.0F - space);
g = g * (1.0F - space);
b = b * (1.0F - space);
}
return new Vec3((double)r, (double)g, (double)b);
}
@ -867,14 +897,19 @@ public class WorldClient extends AWorldClient
float f = this.getCelestialAngleRadians(partialTicks);
float f1 = 1.0F - (ExtMath.cos(f) * 2.0F + 0.25F);
f1 = ExtMath.clampf(f1, 0.0F, 1.0F);
return f1 * f1 * this.dimension.getStarBrightness();
return Math.max(f1 * f1 * this.dimension.getStarBrightness(), this.getSpaceFactor());
}
public float getDeepStarBrightness(float partialTicks) {
float f = this.getCelestialAngleRadians(partialTicks);
float f1 = 1.0F - (ExtMath.cos(f) * 2.0F + 0.25F);
f1 = ExtMath.clampf(f1, 0.0F, 1.0F);
return f1 * f1 * this.dimension.getDeepStarBrightness();
return Math.max(f1 * f1 * this.dimension.getDeepStarBrightness(), this.getSpaceFactor());
}
public float getSpaceFactor() {
Entity entity = this.gm.getRenderViewEntity();
return entity == null ? 0.0f : (float)this.getSpaceFactor(entity.posX, entity.posY, entity.posZ);
}
public int getLastLightning() {