universe cleanup
This commit is contained in:
parent
9b5eab4f57
commit
e289dc7d5b
41 changed files with 440 additions and 599 deletions
|
@ -486,6 +486,10 @@ public class Client implements IThreadListener {
|
|||
public int downfallRange = 4;
|
||||
@Variable(name = "draw_rain_particle_range", category = CVarCategory.RENDER, min = 0, max = 25, display = "Regen-Partikel-Radius")
|
||||
public int rainParticleRange = 10;
|
||||
@Variable(name = "draw_void_particles", category = CVarCategory.RENDER, display = "Partikel in der Tiefe")
|
||||
public boolean voidParticles = true;
|
||||
@Variable(name = "draw_void_fog", category = CVarCategory.RENDER, display = "Nebel in der Tiefe")
|
||||
public boolean voidFog = true;
|
||||
@Variable(name = "crosshair_size", category = CVarCategory.GUI, min = 0, max = 32, display = "Größe des Fadenkreuzes")
|
||||
private int crosshairSize = 6;
|
||||
@Variable(name = "crosshair_color_notarget", type = IntType.COLOR, category = CVarCategory.GUI, display = "Fadenkreuz-Farbe (ohne Ziel)")
|
||||
|
@ -1733,7 +1737,7 @@ public class Client implements IThreadListener {
|
|||
lline = "Licht: " + chunk.getLightSub(blockpos, 0) + " (" + chunk.getLight(LightType.SKY, blockpos) + " Himmel, "
|
||||
+ chunk.getLight(LightType.BLOCK, blockpos) + " Blöcke, " + String.format(
|
||||
"%.1f", this.world.getSunBrightness(1.0f) * 15.0f) + " Welt), A: "
|
||||
+ String.format("%.3f", this.world.getCelestialAngle(1.0f));
|
||||
+ String.format("%.3f °", this.world.getCelestialAngle(1.0f));
|
||||
}
|
||||
else {
|
||||
bline = "Biom: <?>, D: " +
|
||||
|
@ -1741,7 +1745,7 @@ public class Client implements IThreadListener {
|
|||
" (" + (this.dimensionName == null ? UniverseRegistry.getName(this.world.dimension) : this.dimensionName) + ")";
|
||||
lline = "Licht: " + String.format(
|
||||
"%.1f", this.world.getSunBrightness(1.0f) * 15.0f) + " Welt, A: "
|
||||
+ String.format("%.3f", this.world.getCelestialAngle(1.0f));
|
||||
+ String.format("%.3f °", this.world.getCelestialAngle(1.0f));
|
||||
}
|
||||
|
||||
float temp = Math.max(this.world.getTempOffset() + (biome != null ? biome.getTemperature(blockpos) : 0.0f), 0.0f);
|
||||
|
@ -1778,7 +1782,7 @@ public class Client implements IThreadListener {
|
|||
this.world.dimension.getOrbitalPeriod()
|
||||
) + "\n" +
|
||||
String.format("Laub: %s%s, T: %.2f K / %.2f °C, %s (R %.1f, %.1f)",
|
||||
!this.world.dimension.getType().days ? "*" : "",
|
||||
!this.world.dimension.hasSeasons() ? "*" : "",
|
||||
this.world.getLeavesGen(blockpos).getDisplayName(),
|
||||
temp, World.ABSOLUTE_ZERO + temp,
|
||||
this.world.getWeather().getDisplay(), this.world.getRainStrength(),
|
||||
|
|
|
@ -31,6 +31,7 @@ import common.block.tech.BlockChest;
|
|||
import common.block.tech.BlockDispenser;
|
||||
import common.block.tech.BlockFurnace;
|
||||
import common.block.tech.BlockWorkbench;
|
||||
import common.dimension.DimType;
|
||||
import common.dimension.Dimension;
|
||||
import common.dimension.Space;
|
||||
import common.effect.StatusEffect;
|
||||
|
@ -761,7 +762,7 @@ public class ClientPlayer implements IClientPlayer
|
|||
chunk.setData(packetIn.getExtractedDataBytes(), packetIn.getExtractedExtend(), packetIn.hasBiomes());
|
||||
this.world.markBlockRangeForRenderUpdate(packetIn.getChunkX() << 4, -World.MAX_SIZE_Y, packetIn.getChunkZ() << 4, (packetIn.getChunkX() << 4) + 15, World.MAX_SIZE_Y, (packetIn.getChunkZ() << 4) + 15);
|
||||
|
||||
if (!packetIn.hasBiomes() || this.world.dimension.hasNoLight()) // TODO: check
|
||||
if (!packetIn.hasBiomes() || !this.world.dimension.hasSkyLight()) // TODO: check
|
||||
{
|
||||
chunk.resetRelight();
|
||||
}
|
||||
|
@ -1401,7 +1402,7 @@ public class ClientPlayer implements IClientPlayer
|
|||
chunk.setData(packetIn.getChunkBytes(i), packetIn.getChunkExtend(i), true);
|
||||
this.world.markBlockRangeForRenderUpdate(j << 4, -World.MAX_SIZE_Y, k << 4, (j << 4) + 15, World.MAX_SIZE_Y, (k << 4) + 15);
|
||||
|
||||
if (this.world.dimension.hasNoLight()) // TODO: check
|
||||
if (!this.world.dimension.hasSkyLight()) // TODO: check
|
||||
{
|
||||
chunk.resetRelight();
|
||||
}
|
||||
|
@ -1900,7 +1901,7 @@ public class ClientPlayer implements IClientPlayer
|
|||
public void handleCelestials(SPacketCelestials packet) {
|
||||
NetHandler.checkThread(packet, this, this.gm, this.world);
|
||||
this.world.setExterminated(packet.getExterminated());
|
||||
if(this.world.dimension.getType().celestials) {
|
||||
if(this.world.dimension.getType() == DimType.PLANET || this.world.dimension.getType() == DimType.MOON) {
|
||||
this.world.dimension.setSunColor(packet.getSunColor());
|
||||
this.world.dimension.setMoonColors(packet.getMoonColors());
|
||||
}
|
||||
|
|
|
@ -764,7 +764,7 @@ public class EntityRenderer {
|
|||
if (world.dimension.getLightColor() != 0xffffffff)
|
||||
{
|
||||
Vec3 lightColor = new Vec3(world.dimension.getLightColor());
|
||||
float light = world.dimension.hasNoLight() ? 1.0f : sky;
|
||||
float light = world.dimension.hasSkyLight() ? sky : 1.0f;
|
||||
sred = (float)lightColor.xCoord * light;
|
||||
sgreen = (float)lightColor.yCoord * light;
|
||||
sblue = (float)lightColor.zCoord * light;
|
||||
|
@ -780,7 +780,7 @@ public class EntityRenderer {
|
|||
float intens = (float)world.getLastLightning() - partialTicks;
|
||||
if(intens > 1.0F)
|
||||
intens = 1.0F;
|
||||
float light = world.dimension.hasNoLight() ? 1.0f : rsky;
|
||||
float light = world.dimension.hasSkyLight() ? rsky : 1.0f;
|
||||
sred = sred * (1.0F - intens) + (float)lightColor.xCoord * light * intens;
|
||||
sgreen = sgreen * (1.0F - intens) + (float)lightColor.yCoord * light * intens;
|
||||
sblue = sblue * (1.0F - intens) + (float)lightColor.zCoord * light * intens;
|
||||
|
@ -1089,7 +1089,7 @@ public class EntityRenderer {
|
|||
this.setupFog(0, partialTicks);
|
||||
// renderGlobalIn.renderClouds(partialTicks);
|
||||
float alpha = 0.8F * (1.0f - this.gm.world.getSpaceFactor());
|
||||
if(this.gm.world.dimension.getType().clouds && alpha > 0.5f)
|
||||
if(this.gm.world.dimension.hasWeather() && alpha > 0.5f)
|
||||
renderGlobalIn.renderClouds(alpha, partialTicks);
|
||||
GlState.disableFog();
|
||||
GL11.glPopMatrix();
|
||||
|
@ -1334,32 +1334,40 @@ public class EntityRenderer {
|
|||
{
|
||||
WorldClient world = this.gm.world;
|
||||
Entity entity = this.gm.getRenderViewEntity();
|
||||
float dist = 0.25F + 0.75F * (float)this.gm.renderDistance / 32.0F;
|
||||
dist = 1.0F - (float)Math.pow((double)dist, 0.25D);
|
||||
Vec3 sky = world.getSkyColor(this.gm.getRenderViewEntity(), partial);
|
||||
float sr = (float)sky.xCoord;
|
||||
float sg = (float)sky.yCoord;
|
||||
float sb = (float)sky.zCoord;
|
||||
Vec3 fog = world.getFogColor(this.gm.getRenderViewEntity(), partial);
|
||||
|
||||
Vec3 fog = new Vec3(world.dimension.getFogColor());
|
||||
this.fogColorRed = (float)fog.xCoord;
|
||||
this.fogColorGreen = (float)fog.yCoord;
|
||||
this.fogColorBlue = (float)fog.zCoord;
|
||||
|
||||
if(world.dimension.isExterminated()) {
|
||||
this.fogColorRed = 0.188f;
|
||||
this.fogColorGreen = 0.188f;
|
||||
this.fogColorBlue = 0.188f;
|
||||
}
|
||||
|
||||
if(world.dimension.hasDaylight()) {
|
||||
float sun = ExtMath.clampf(ExtMath.cos(world.getDayPhase(partial)) * 2.0F + 0.5F, 0.0F, 1.0F);
|
||||
this.fogColorRed = this.fogColorRed * (sun * 0.94F + 0.06F);
|
||||
this.fogColorGreen = this.fogColorGreen * (sun * 0.94F + 0.06F);
|
||||
this.fogColorBlue = this.fogColorBlue * (sun * 0.91F + 0.09F);
|
||||
}
|
||||
|
||||
if (this.gm.renderDistance >= 4)
|
||||
float space = world.getSpaceFactor();
|
||||
if(space > 0.0f) {
|
||||
this.fogColorRed = this.fogColorRed * (1.0F - space);
|
||||
this.fogColorGreen = this.fogColorGreen * (1.0F - space);
|
||||
this.fogColorBlue = this.fogColorBlue * (1.0F - space);
|
||||
}
|
||||
|
||||
if (this.gm.renderDistance >= 4 && world.dimension.hasDaylight() && !world.dimension.isBaseDestroyed())
|
||||
{
|
||||
double neg = -1.0D;
|
||||
Vec3 pos = ExtMath.sin(world.getCelestialAngleRadians(partial)) > 0.0F ? new Vec3(neg, 0.0D, 0.0D) : new Vec3(1.0D, 0.0D, 0.0D);
|
||||
Vec3 pos = ExtMath.sin(world.getDayPhase(partial)) > 0.0F ? new Vec3(neg, 0.0D, 0.0D) : new Vec3(1.0D, 0.0D, 0.0D);
|
||||
float shift = (float)entity.getLook(partial).dotProduct(pos);
|
||||
|
||||
if (shift < 0.0F)
|
||||
{
|
||||
shift = 0.0F;
|
||||
}
|
||||
|
||||
if (shift > 0.0F)
|
||||
{
|
||||
float[] sun = world.dimension.getType().days && !world.dimension.isBaseDestroyed() ?
|
||||
RenderGlobal.calcSunriseSunsetColors(world.getCelestialAngleRadians(partial), partial) : null;
|
||||
float[] sun = RenderGlobal.calcSunriseSunsetColors(world.getDayPhase(partial), partial);
|
||||
if (sun != null)
|
||||
{
|
||||
shift = shift * sun[3];
|
||||
|
@ -1370,11 +1378,14 @@ public class EntityRenderer {
|
|||
}
|
||||
}
|
||||
|
||||
this.fogColorRed += (sr - this.fogColorRed) * dist;
|
||||
this.fogColorGreen += (sg - this.fogColorGreen) * dist;
|
||||
this.fogColorBlue += (sb - this.fogColorBlue) * dist;
|
||||
float dist = 0.25F + 0.75F * (float)this.gm.renderDistance / 32.0F;
|
||||
dist = 1.0F - (float)Math.pow((double)dist, 0.25D);
|
||||
Vec3 sky = world.getSkyColor(this.gm.getRenderViewEntity(), partial);
|
||||
this.fogColorRed += ((float)sky.xCoord - this.fogColorRed) * dist;
|
||||
this.fogColorGreen += ((float)sky.yCoord - this.fogColorGreen) * dist;
|
||||
this.fogColorBlue += ((float)sky.zCoord - this.fogColorBlue) * dist;
|
||||
|
||||
float rain = world.getRainStrength();
|
||||
|
||||
if (rain > 0.0F)
|
||||
{
|
||||
float rg = 1.0F - rain * 0.5F;
|
||||
|
@ -1385,7 +1396,6 @@ public class EntityRenderer {
|
|||
}
|
||||
|
||||
float dark = world.getDarkness();
|
||||
|
||||
if (dark > 0.0F)
|
||||
{
|
||||
float mul = 1.0F - dark * 0.5F;
|
||||
|
@ -1395,27 +1405,11 @@ public class EntityRenderer {
|
|||
}
|
||||
|
||||
Block block = MatrixState.getLookedBlock(this.gm.world, entity, partial);
|
||||
|
||||
// if (this.cloudFog)
|
||||
// {
|
||||
// Vec3 cloud = world.getCloudColour(this.gm.getRenderViewEntity(), partial);
|
||||
// this.fogColorRed = (float)cloud.xCoord;
|
||||
// this.fogColorGreen = (float)cloud.yCoord;
|
||||
// this.fogColorBlue = (float)cloud.zCoord;
|
||||
// }
|
||||
// else
|
||||
if (block.getMaterial().isColdLiquid())
|
||||
{
|
||||
float cn = 0.4f; // (float)EnchantmentHelper.getRespiration(entity) * 0.2F;
|
||||
|
||||
// if (entity instanceof EntityLivingBase && ((EntityLivingBase)entity).hasEffect(Potion.waterBreathing))
|
||||
// {
|
||||
// f12 = f12 * 0.3F + 0.6F;
|
||||
// }
|
||||
|
||||
this.fogColorRed = 0.02F + cn;
|
||||
this.fogColorGreen = 0.02F + cn;
|
||||
this.fogColorBlue = 0.2F + cn;
|
||||
this.fogColorRed = 0.42F;
|
||||
this.fogColorGreen = 0.42F;
|
||||
this.fogColorBlue = 0.6F;
|
||||
}
|
||||
else if (block.getMaterial().isHotLiquid())
|
||||
{
|
||||
|
@ -1428,73 +1422,45 @@ public class EntityRenderer {
|
|||
this.fogColorRed *= mult;
|
||||
this.fogColorGreen *= mult;
|
||||
this.fogColorBlue *= mult;
|
||||
double vfog = (entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * (double)partial); // * world.dimension.getVoidFogYFactor();
|
||||
|
||||
if (entity instanceof EntityLiving && ((EntityLiving)entity).hasEffect(Effect.BLINDNESS))
|
||||
|
||||
double vision = 1.0;
|
||||
if(world.dimension.hasVoidFog() && this.gm.voidFog) {
|
||||
double y = (entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * (double)partial);
|
||||
if(y < 0.0)
|
||||
vision += y / 64.0;
|
||||
}
|
||||
if (entity instanceof EntityLiving living && living.hasEffect(Effect.BLINDNESS))
|
||||
{
|
||||
int blind = ((EntityLiving)entity).getEffect(Effect.BLINDNESS).getRemaining();
|
||||
int blind = living.getEffect(Effect.BLINDNESS).getRemaining();
|
||||
|
||||
if (blind < 20)
|
||||
{
|
||||
vfog *= (double)(1.0F - (float)blind / 20.0F);
|
||||
}
|
||||
vision *= (double)(1.0F - (float)blind / 20.0F);
|
||||
else
|
||||
{
|
||||
vfog = 0.0D;
|
||||
}
|
||||
vision = 0.0D;
|
||||
}
|
||||
if (vision < 1.0D)
|
||||
{
|
||||
if (vision < 0.0D)
|
||||
vision = 0.0D;
|
||||
vision = vision * vision;
|
||||
this.fogColorRed = (float)((double)this.fogColorRed * vision);
|
||||
this.fogColorGreen = (float)((double)this.fogColorGreen * vision);
|
||||
this.fogColorBlue = (float)((double)this.fogColorBlue * vision);
|
||||
}
|
||||
|
||||
if (vfog < 1.0D)
|
||||
if (entity instanceof EntityLiving living && living.hasEffect(Effect.NIGHT_VISION))
|
||||
{
|
||||
if (vfog < 0.0D)
|
||||
{
|
||||
vfog = 0.0D;
|
||||
}
|
||||
|
||||
vfog = vfog * vfog;
|
||||
this.fogColorRed = (float)((double)this.fogColorRed * vfog);
|
||||
this.fogColorGreen = (float)((double)this.fogColorGreen * vfog);
|
||||
this.fogColorBlue = (float)((double)this.fogColorBlue * vfog);
|
||||
}
|
||||
|
||||
// if (this.bossColorModifier > 0.0F)
|
||||
// {
|
||||
// float shift = this.bossColorModifierPrev + (this.bossColorModifier - this.bossColorModifierPrev) * partial;
|
||||
// this.fogColorRed = this.fogColorRed * (1.0F - shift) + this.fogColorRed * 0.7F * shift;
|
||||
// this.fogColorGreen = this.fogColorGreen * (1.0F - shift) + this.fogColorGreen * 0.6F * shift;
|
||||
// this.fogColorBlue = this.fogColorBlue * (1.0F - shift) + this.fogColorBlue * 0.6F * shift;
|
||||
// }
|
||||
|
||||
if (entity instanceof EntityLiving && ((EntityLiving)entity).hasEffect(Effect.NIGHT_VISION))
|
||||
{
|
||||
float vis = this.getNightVisionBrightness((EntityLiving)entity, partial);
|
||||
float vis = this.getNightVisionBrightness(living, partial);
|
||||
float mul = 1.0F / this.fogColorRed;
|
||||
|
||||
if (mul > 1.0F / this.fogColorGreen)
|
||||
{
|
||||
mul = 1.0F / this.fogColorGreen;
|
||||
}
|
||||
|
||||
if (mul > 1.0F / this.fogColorBlue)
|
||||
{
|
||||
mul = 1.0F / this.fogColorBlue;
|
||||
}
|
||||
|
||||
this.fogColorRed = this.fogColorRed * (1.0F - vis) + this.fogColorRed * mul * vis;
|
||||
this.fogColorGreen = this.fogColorGreen * (1.0F - vis) + this.fogColorGreen * mul * vis;
|
||||
this.fogColorBlue = this.fogColorBlue * (1.0F - vis) + this.fogColorBlue * mul * vis;
|
||||
}
|
||||
|
||||
// if (this.gm.anaglyph)
|
||||
// {
|
||||
// float f16 = (this.fogColorRed * 30.0F + this.fogColorGreen * 59.0F + this.fogColorBlue * 11.0F) / 100.0F;
|
||||
// float f17 = (this.fogColorRed * 30.0F + this.fogColorGreen * 70.0F) / 100.0F;
|
||||
// float f7 = (this.fogColorRed * 30.0F + this.fogColorBlue * 70.0F) / 100.0F;
|
||||
// this.fogColorRed = f16;
|
||||
// this.fogColorGreen = f17;
|
||||
// this.fogColorBlue = f7;
|
||||
// }
|
||||
|
||||
GlState.clearColor(this.fogColorRed, this.fogColorGreen, this.fogColorBlue, 0.0F);
|
||||
}
|
||||
|
||||
|
|
|
@ -146,7 +146,7 @@ public class RegionRenderCache implements IWorldAccess
|
|||
|
||||
private int getLightForExt(LightType p_175629_1_, BlockPos pos)
|
||||
{
|
||||
if (p_175629_1_ == LightType.SKY && this.world.dimension.hasNoLight())
|
||||
if (p_175629_1_ == LightType.SKY && !this.world.dimension.hasSkyLight())
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -1137,7 +1137,7 @@ public class RenderGlobal
|
|||
{
|
||||
this.renderSkyBox(this.gm.world.dimension.getSkyBoxTexture());
|
||||
}
|
||||
else if (this.gm.world.dimension.getType().sky)
|
||||
else if (this.gm.world.dimension.hasSky())
|
||||
{
|
||||
GlState.disableTexture2D();
|
||||
Vec3 vec3 = this.theWorld.getSkyColor(this.gm.getRenderViewEntity(), partialTicks);
|
||||
|
@ -1183,15 +1183,15 @@ public class RenderGlobal
|
|||
GlState.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO);
|
||||
ItemRenderer.disableStandardItemLighting();
|
||||
|
||||
float[] afloat = this.theWorld.dimension.getType().days && !this.theWorld.dimension.isBaseDestroyed() ?
|
||||
RenderGlobal.calcSunriseSunsetColors(this.theWorld.getCelestialAngleRadians(partialTicks), partialTicks) : null;
|
||||
float[] afloat = this.theWorld.dimension.hasDaylight() && !this.theWorld.dimension.isBaseDestroyed() ?
|
||||
RenderGlobal.calcSunriseSunsetColors(this.theWorld.getDayPhase(partialTicks), partialTicks) : null;
|
||||
if (afloat != null)
|
||||
{
|
||||
GlState.disableTexture2D();
|
||||
GlState.shadeModel(GL11.GL_SMOOTH);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glRotatef(ExtMath.sin(this.theWorld.getCelestialAngleRadians(partialTicks)) < 0.0F ? 180.0F : 0.0F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glRotatef(ExtMath.sin(this.theWorld.getDayPhase(partialTicks)) < 0.0F ? 180.0F : 0.0F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glRotatef(90.0F, 0.0F, 0.0F, 1.0F);
|
||||
float f6 = afloat[0];
|
||||
float f7 = afloat[1];
|
||||
|
@ -1229,8 +1229,8 @@ public class RenderGlobal
|
|||
GL11.glPushMatrix();
|
||||
float f16 = 1.0F - Math.max(this.theWorld.getRainStrength(), this.theWorld.getFogStrength());
|
||||
GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(this.theWorld.getCelestialAngle(partialTicks) * 360.0F, 1.0F, 0.0F, 0.0F);
|
||||
if(this.gm.world.dimension.getType().celestials) {
|
||||
GL11.glRotatef(this.theWorld.getCelestialAngle(partialTicks), 1.0F, 0.0F, 0.0F);
|
||||
if(this.gm.world.dimension.getType() == DimType.PLANET || this.gm.world.dimension.getType() == DimType.MOON) {
|
||||
float size = 30.0F;
|
||||
int color = this.gm.world.dimension.getSunColor();
|
||||
if(color != 0xffffffff) {
|
||||
|
|
|
@ -64,7 +64,7 @@ public class ChunkClient extends Chunk {
|
|||
|
||||
public void setData(byte[] data, int[] extend, boolean biomes) {
|
||||
int pos = 0;
|
||||
boolean sky = !this.world.dimension.hasNoLight();
|
||||
boolean sky = this.world.dimension.hasSkyLight();
|
||||
|
||||
if(biomes) {
|
||||
this.clearArrays();
|
||||
|
|
|
@ -314,14 +314,15 @@ public class WorldClient extends AWorldClient
|
|||
State state = this.getState(pos);
|
||||
state.getBlock().randomDisplayTick(this, pos, state, rand);
|
||||
}
|
||||
// if(this.canShowVoidParticles()) {
|
||||
for(int n = 0; n < 1000; n++) {
|
||||
float x = ((float)posX) + (rand.floatv() - rand.floatv() - 0.5f) * 32.0f;
|
||||
float y = -64.0f + rand.floatv() * 65.0f; // * 68.0f;
|
||||
float z = ((float)posZ) + (rand.floatv() - rand.floatv() - 0.5f) * 32.0f;
|
||||
this.spawnParticle(ParticleType.DEPTH, (double)x, (double)y, (double)z);
|
||||
if(this.dimension.hasVoidFog() && this.gm.voidParticles && posY < 32) {
|
||||
for(int n = 0; n < 1000; n++) {
|
||||
float x = ((float)posX) + (rand.floatv() - rand.floatv() - 0.5f) * 32.0f;
|
||||
float y = (posY < -32 ? (float)posY - 32.0f : -64.0f) + rand.floatv() * 65.0f;
|
||||
float z = ((float)posZ) + (rand.floatv() - rand.floatv() - 0.5f) * 32.0f;
|
||||
if(y < -64.0f || rand.floatv() >= (64.0f + y) / 64.0f)
|
||||
this.spawnParticle(ParticleType.DEPTH, (double)x, (double)y, (double)z);
|
||||
}
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
public void removeAllEntities()
|
||||
|
@ -695,7 +696,7 @@ public class WorldClient extends AWorldClient
|
|||
}
|
||||
|
||||
public float getSunBrightness(float p_72971_1_) {
|
||||
float f = this.getCelestialAngleRadians(p_72971_1_);
|
||||
float f = this.getDayPhase(p_72971_1_);
|
||||
float f1 = 1.0F - (ExtMath.cos(f) * 2.0F + 0.2F);
|
||||
f1 = ExtMath.clampf(f1, 0.0F, 1.0F);
|
||||
f1 = 1.0F - f1;
|
||||
|
@ -772,8 +773,8 @@ public class WorldClient extends AWorldClient
|
|||
vec = new Vec3(0x101010);
|
||||
else
|
||||
vec = new Vec3(this.dimension.getSkyColor());
|
||||
if(this.dimension.getType().days) {
|
||||
float mult = ExtMath.clampf(ExtMath.cos(this.getCelestialAngleRadians(partial)) * 2.0F + 0.5F,
|
||||
if(this.dimension.hasDaylight()) {
|
||||
float mult = ExtMath.clampf(ExtMath.cos(this.getDayPhase(partial)) * 2.0F + 0.5F,
|
||||
0.0F, 1.0F);
|
||||
if(this.dimension.getSkyColor() == 0xffffffff) {
|
||||
float temp = ExtMath.clampf(((biome.getTemperature(pos) + 14.0f) / 40.0f + 0.15f) / 3.0F,
|
||||
|
@ -829,8 +830,6 @@ public class WorldClient extends AWorldClient
|
|||
|
||||
public Vec3 getCloudColour(Entity entity, float partialTicks) {
|
||||
Vec3 color = new Vec3(this.dimension.getCloudColor());
|
||||
Biome biome = this.getBiomeGenForCoords(new BlockPos(ExtMath.floord(entity.posX), ExtMath.floord(entity.posY),
|
||||
ExtMath.floord(entity.posZ)));
|
||||
if(this.dimension.isExterminated())
|
||||
color = new Vec3(0x000000);
|
||||
float r = (float)color.xCoord;
|
||||
|
@ -846,8 +845,8 @@ public class WorldClient extends AWorldClient
|
|||
b = b * shift + mul * (1.0F - shift);
|
||||
}
|
||||
|
||||
if(this.dimension.getType().days) {
|
||||
float sun = ExtMath.clampf(ExtMath.cos(this.getCelestialAngleRadians(partialTicks)) * 2.0F + 0.5F,
|
||||
if(this.dimension.hasDaylight()) {
|
||||
float sun = ExtMath.clampf(ExtMath.cos(this.getDayPhase(partialTicks)) * 2.0F + 0.5F,
|
||||
0.0F, 1.0F);
|
||||
r = r * (sun * 0.9F + 0.1F);
|
||||
g = g * (sun * 0.9F + 0.1F);
|
||||
|
@ -873,42 +872,15 @@ public class WorldClient extends AWorldClient
|
|||
return new Vec3((double)r, (double)g, (double)b);
|
||||
}
|
||||
|
||||
public Vec3 getFogColor(Entity entity, float partialTicks) {
|
||||
Vec3 color = new Vec3(this.dimension.getFogColor());
|
||||
Biome biome = this.getBiomeGenForCoords(new BlockPos(ExtMath.floord(entity.posX), ExtMath.floord(entity.posY),
|
||||
ExtMath.floord(entity.posZ)));
|
||||
if(this.dimension.isExterminated())
|
||||
color = new Vec3(0x303030);
|
||||
if(!this.dimension.getType().days)
|
||||
return color;
|
||||
float sun = ExtMath.clampf(ExtMath.cos(this.getCelestialAngleRadians(partialTicks)) * 2.0F + 0.5F,
|
||||
0.0F, 1.0F);
|
||||
float r = (float)color.xCoord;
|
||||
float g = (float)color.yCoord;
|
||||
float b = (float)color.zCoord;
|
||||
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);
|
||||
}
|
||||
|
||||
public float getStarBrightness(float partialTicks) {
|
||||
float f = this.getCelestialAngleRadians(partialTicks);
|
||||
float f = this.getDayPhase(partialTicks);
|
||||
float f1 = 1.0F - (ExtMath.cos(f) * 2.0F + 0.25F);
|
||||
f1 = ExtMath.clampf(f1, 0.0F, 1.0F);
|
||||
return Math.max(f1 * f1 * this.dimension.getStarBrightness(), this.getSpaceFactor());
|
||||
}
|
||||
|
||||
public float getDeepStarBrightness(float partialTicks) {
|
||||
float f = this.getCelestialAngleRadians(partialTicks);
|
||||
float f = this.getDayPhase(partialTicks);
|
||||
float f1 = 1.0F - (ExtMath.cos(f) * 2.0F + 0.25F);
|
||||
f1 = ExtMath.clampf(f1, 0.0F, 1.0F);
|
||||
return Math.max(f1 * f1 * this.dimension.getDeepStarBrightness(), this.getSpaceFactor());
|
||||
|
|
BIN
client/src/main/resources/textures/blocks/plasma_flow.png
Executable file
BIN
client/src/main/resources/textures/blocks/plasma_flow.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 58 KiB |
BIN
client/src/main/resources/textures/blocks/plasma_still.png
Executable file
BIN
client/src/main/resources/textures/blocks/plasma_still.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 21 KiB |
Loading…
Add table
Add a link
Reference in a new issue