Fixed random client crashes

This commit is contained in:
catfoolyou 2025-02-26 18:23:40 -05:00
parent a2d44c8db3
commit c591161ba5
24 changed files with 64 additions and 18 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel target="17" />
<bytecodeTargetLevel target="18" />
</component>
</project>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="corretto-18" project-jdk-type="JavaSDK" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_18" default="true" project-jdk-name="corretto-18" project-jdk-type="JavaSDK" />
</project>

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 242 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1017 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 386 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 511 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 562 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 391 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 669 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 287 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

@ -665,6 +665,7 @@ public class EaglerAdapterGL30 extends EaglerAdapterImpl2 {
if (matModelPointer > 0) {
--matModelPointer;
} else {
System.out.println(new Exception().getStackTrace()[1].getClassName());
System.err.println("modelview matrix stack underflow");
}
break;

View File

@ -1,6 +1,5 @@
package net.minecraft.src;
import java.awt.Color;
import java.util.ArrayList;
import java.util.List;
import net.lax1dude.eaglercraft.EaglercraftRandom;
@ -253,7 +252,53 @@ public abstract class BiomeGenBase
par1 = 1.0F;
}
return Color.getHSBColor(0.62222224F - par1 * 0.05F, 0.5F + par1 * 0.1F, 1.0F).getRGB();
return HSBtoRGB(0.62222224F - par1 * 0.05F, 0.5F + par1 * 0.1F, 1.0F);
}
public static int HSBtoRGB(float hue, float saturation, float brightness) {
int r = 0, g = 0, b = 0;
if (saturation == 0) {
r = g = b = (int) (brightness * 255.0f + 0.5f);
} else {
float h = (hue - (float) Math.floor(hue)) * 6.0f;
float f = h - (float) Math.floor(h);
float p = brightness * (1.0f - saturation);
float q = brightness * (1.0f - saturation * f);
float t = brightness * (1.0f - (saturation * (1.0f - f)));
switch ((int) h) {
case 0:
r = (int) (brightness * 255.0f + 0.5f);
g = (int) (t * 255.0f + 0.5f);
b = (int) (p * 255.0f + 0.5f);
break;
case 1:
r = (int) (q * 255.0f + 0.5f);
g = (int) (brightness * 255.0f + 0.5f);
b = (int) (p * 255.0f + 0.5f);
break;
case 2:
r = (int) (p * 255.0f + 0.5f);
g = (int) (brightness * 255.0f + 0.5f);
b = (int) (t * 255.0f + 0.5f);
break;
case 3:
r = (int) (p * 255.0f + 0.5f);
g = (int) (q * 255.0f + 0.5f);
b = (int) (brightness * 255.0f + 0.5f);
break;
case 4:
r = (int) (t * 255.0f + 0.5f);
g = (int) (p * 255.0f + 0.5f);
b = (int) (brightness * 255.0f + 0.5f);
break;
case 5:
r = (int) (brightness * 255.0f + 0.5f);
g = (int) (p * 255.0f + 0.5f);
b = (int) (q * 255.0f + 0.5f);
break;
}
}
return 0xff000000 | (r << 16) | (g << 8) | (b << 0);
}
/**
@ -336,8 +381,8 @@ public abstract class BiomeGenBase
/**
* Provides the basic grass color based on the biome temperature and rainfall
*/
public int getBiomeGrassColor()
{
public int getBiomeGrassColor() {
if(biomeID == 6) return 6975545;
double var1 = (double) MathHelper.clamp_float(this.getFloatTemperature(), 0.0F, 1.0F);
double var3 = (double) MathHelper.clamp_float(this.getFloatRainfall(), 0.0F, 1.0F);
return ColorizerGrass.getGrassColor(var1, var3);
@ -346,8 +391,8 @@ public abstract class BiomeGenBase
/**
* Provides the basic foliage color based on the biome temperature and rainfall
*/
public int getBiomeFoliageColor()
{
public int getBiomeFoliageColor() {
if(biomeID == 6) return 6975545;
double var1 = (double) MathHelper.clamp_float(this.getFloatTemperature(), 0.0F, 1.0F);
double var3 = (double) MathHelper.clamp_float(this.getFloatRainfall(), 0.0F, 1.0F);
return ColorizerFoliage.getFoliageColor(var1, var3);

View File

@ -110,9 +110,9 @@ public class WorldRenderer
this.posZMinus = par3 - this.posZClip;
float var4 = 6.0F;
this.rendererBoundingBox = AxisAlignedBB.getBoundingBox((double)((float)par1 - var4), (double)((float)par2 - var4), (double)((float)par3 - var4), (double)((float)(par1 + 16) + var4), (double)((float)(par2 + 16) + var4), (double)((float)(par3 + 16) + var4));
EaglerAdapter.glNewList(this.glRenderList + 2, EaglerAdapter.GL_COMPILE);
RenderItem.renderAABB(AxisAlignedBB.getAABBPool().getAABB((double)((float)this.posXClip - var4), (double)((float)this.posYClip - var4), (double)((float)this.posZClip - var4), (double)((float)(this.posXClip + 16) + var4), (double)((float)(this.posYClip + 16) + var4), (double)((float)(this.posZClip + 16) + var4)));
EaglerAdapter.glEndList();
//EaglerAdapter.glNewList(this.glRenderList + 2, EaglerAdapter.GL_COMPILE);
//RenderItem.renderAABB(AxisAlignedBB.getAABBPool().getAABB((double)((float)this.posXClip - var4), (double)((float)this.posYClip - var4), (double)((float)this.posZClip - var4), (double)((float)(this.posXClip + 16) + var4), (double)((float)(this.posYClip + 16) + var4), (double)((float)(this.posZClip + 16) + var4)));
//EaglerAdapter.glEndList();
this.markDirty();
}
}
@ -175,12 +175,12 @@ public class WorldRenderer
{
var14 = true;
EaglerAdapter.glNewList(this.glRenderList + var11, EaglerAdapter.GL_COMPILE);
EaglerAdapter.glPushMatrix();
/*EaglerAdapter.glPushMatrix();
this.setupGLTranslation();
float var19 = 1.000001F;
EaglerAdapter.glTranslatef(-8.0F, -8.0F, -8.0F);
EaglerAdapter.glScalef(var19, var19, var19);
EaglerAdapter.glTranslatef(8.0F, 8.0F, 8.0F);
EaglerAdapter.glTranslatef(8.0F, 8.0F, 8.0F);*/
tessellator.startDrawingQuads();
tessellator.setTranslation((double)(-this.posX), (double)(-this.posY), (double)(-this.posZ));
}
@ -218,7 +218,7 @@ public class WorldRenderer
if (var14)
{
this.bytesDrawn += tessellator.draw();
EaglerAdapter.glPopMatrix();
//EaglerAdapter.glPopMatrix();
EaglerAdapter.glEndList();
tessellator.setTranslation(0.0D, 0.0D, 0.0D);
}