Made the world actually load!

This commit is contained in:
peytonplayz585 2023-07-27 00:21:52 -07:00
parent 6d89b9eb75
commit 479252d9de
6 changed files with 75 additions and 83 deletions

BIN
resources/char.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -52,13 +52,7 @@ public class MinecraftMain {
//minecraft.minecraftUri = "127.0.0.1:25565"; //minecraft.minecraftUri = "127.0.0.1:25565";
minecraft.session = new Session("PeytonPlayz595", "WebGL-Emulator"); minecraft.session = new Session("PeytonPlayz595", "WebGL-Emulator");
Thread thread = new Thread (minecraft, "Minecraft main Thread"); Thread thread = new Thread (minecraft, "Minecraft main Thread");
try { thread.run();
thread.run();
} catch(Exception e) {
minecraft.displayGuiScreen(new GuiErrorScreen("Client error", "The game broke! [" + e + "]"));
e.printStackTrace();
return;
}
} }
@JSBody(params = { }, script = "return window.classicConfig;") @JSBody(params = { }, script = "return window.classicConfig;")

View File

@ -596,6 +596,9 @@ public final class Minecraft implements Runnable {
} }
public final void setLevel(World var1) { public final void setLevel(World var1) {
this.theWorld = var1;
if(this.theWorld != null) { if(this.theWorld != null) {
this.theWorld.setLevel(); this.theWorld.setLevel();
} }

View File

@ -163,7 +163,7 @@ public class RenderEngine {
} }
public int getTextureForDownloadableImage(String s, String s1) { public int getTextureForDownloadableImage(String s, String s1) {
return getTexture("/mob/char.png"); return getTexture("/char.png");
} }
private int averageColor(int i, int j) { private int averageColor(int i, int j) {

View File

@ -95,7 +95,7 @@ public abstract class Render {
Render var27 = this; Render var27 = this;
GL11.glEnable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_BLEND);
RenderEngine var10 = this.renderManager.renderEngine; RenderEngine var10 = this.renderManager.renderEngine;
RenderEngine.bindTexture(var10.getTexture("%%/shadow.png")); RenderEngine.bindTexture(var10.getTexture("%clamp%/shadow.png"));
World var11 = this.renderManager.worldObj; World var11 = this.renderManager.worldObj;
GL11.glDepthMask(false); GL11.glDepthMask(false);
var12 = this.shadowSize; var12 = this.shadowSize;

View File

@ -22,93 +22,88 @@ public class RenderLiving extends Render {
public void a(EntityLiving var1, float var2, float var3, float var4, float var5, float var6) { public void a(EntityLiving var1, float var2, float var3, float var4, float var5, float var6) {
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glDisable(GL11.GL_CULL_FACE); GL11.glDisable(GL11.GL_CULL_FACE);
var5 = var1.prevRenderYawOffset + (var1.renderYawOffset - var1.prevRenderYawOffset) * var6;
try { float var7 = var1.prevRotationYaw + (var1.rotationYaw - var1.prevRotationYaw) * var6;
var5 = var1.prevRenderYawOffset + (var1.renderYawOffset - var1.prevRenderYawOffset) * var6; float var8 = var1.prevRotationPitch + (var1.rotationPitch - var1.prevRotationPitch) * var6;
float var7 = var1.prevRotationYaw + (var1.rotationYaw - var1.prevRotationYaw) * var6; GL11.glTranslatef(var2, var3, var4);
float var8 = var1.prevRotationPitch + (var1.rotationPitch - var1.prevRotationPitch) * var6; var2 = (float)var1.ticksExisted + var6;
GL11.glTranslatef(var2, var3, var4); GL11.glRotatef(180.0F - var5, 0.0F, 1.0F, 0.0F);
var2 = (float)var1.ticksExisted + var6; if(var1.deathTime > 0) {
GL11.glRotatef(180.0F - var5, 0.0F, 1.0F, 0.0F); var3 = ((float)var1.deathTime + var6 - 1.0F) / 20.0F * 1.6F;
if(var1.deathTime > 0) { var3 = MathHelper.sqrt_float(var3);
var3 = ((float)var1.deathTime + var6 - 1.0F) / 20.0F * 1.6F;
var3 = MathHelper.sqrt_float(var3);
if(var3 > 1.0F) {
var3 = 1.0F;
}
GL11.glRotatef(var3 * this.getDeathMaxRotation(var1), 0.0F, 0.0F, 1.0F);
}
GL11.glScalef(-(1.0F / 16.0F), -(1.0F / 16.0F), 1.0F / 16.0F);
this.preRenderCallback(var1, var6);
GL11.glTranslatef(0.0F, -24.0F, 0.0F);
GL11.glEnable(GL11.GL_NORMALIZE);
var3 = var1.prevLimbYaw + (var1.limbYaw - var1.prevLimbYaw) * var6;
var4 = var1.limbSwing - var1.limbYaw * (1.0F - var6);
if(var3 > 1.0F) { if(var3 > 1.0F) {
var3 = 1.0F; var3 = 1.0F;
} }
this.loadDownloadableImageTexture(var1.skinUrl, var1.getTexture()); GL11.glRotatef(var3 * this.getDeathMaxRotation(var1), 0.0F, 0.0F, 1.0F);
GL11.glEnable(GL11.GL_ALPHA_TEST); }
this.mainModel.render(var4, var3, var2, var7 - var5, var8, 1.0F);
for(int var9 = 0; var9 < 4; ++var9) { GL11.glScalef(-(1.0F / 16.0F), -(1.0F / 16.0F), 1.0F / 16.0F);
if(this.shouldRenderPass(var1, var9)) { this.preRenderCallback(var1, var6);
this.renderPassModel.render(var4, var3, var2, var7 - var5, var8, 1.0F); GL11.glTranslatef(0.0F, -24.0F, 0.0F);
GL11.glDisable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_NORMALIZE);
GL11.glEnable(GL11.GL_ALPHA_TEST); var3 = var1.prevLimbYaw + (var1.limbYaw - var1.prevLimbYaw) * var6;
} var4 = var1.limbSwing - var1.limbYaw * (1.0F - var6);
} if(var3 > 1.0F) {
var3 = 1.0F;
}
float var15 = var1.getEntityBrightness(var6); this.loadDownloadableImageTexture(var1.skinUrl, var1.getTexture());
int var14 = this.getColorMultiplier(var1, var15, var6); GL11.glEnable(GL11.GL_ALPHA_TEST);
if(var14 >>> 24 > 0 || var1.hurtTime > 0 || var1.deathTime > 0) { this.mainModel.render(var4, var3, var2, var7 - var5, var8, 1.0F);
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glDisable(GL11.GL_ALPHA_TEST);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glDepthFunc(GL11.GL_EQUAL);
if(var1.hurtTime > 0 || var1.deathTime > 0) {
GL11.glColor4f(var15, 0.0F, 0.0F, 0.4F);
this.mainModel.render(var4, var3, var2, var7 - var5, var8, 1.0F);
for(int var10 = 0; var10 < 4; ++var10) { for(int var9 = 0; var9 < 4; ++var9) {
if(this.shouldRenderPass(var1, var10)) { if(this.shouldRenderPass(var1, var9)) {
GL11.glColor4f(var15, 0.0F, 0.0F, 0.4F); this.renderPassModel.render(var4, var3, var2, var7 - var5, var8, 1.0F);
this.renderPassModel.render(var4, var3, var2, var7 - var5, var8, 1.0F);
}
}
}
if(var14 >>> 24 > 0) {
float var16 = (float)(var14 >> 16 & 255) / 255.0F;
var15 = (float)(var14 >> 8 & 255) / 255.0F;
float var11 = (float)(var14 & 255) / 255.0F;
var6 = (float)(var14 >>> 24) / 255.0F;
GL11.glColor4f(var16, var15, var11, var6);
this.mainModel.render(var4, var3, var2, var7 - var5, var8, 1.0F);
for(int var12 = 0; var12 < 4; ++var12) {
if(this.shouldRenderPass(var1, var12)) {
GL11.glColor4f(var16, var15, var11, var6);
this.renderPassModel.render(var4, var3, var2, var7 - var5, var8, 1.0F);
}
}
}
GL11.glDepthFunc(GL11.GL_LEQUAL);
GL11.glDisable(GL11.GL_BLEND); GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_ALPHA_TEST); GL11.glEnable(GL11.GL_ALPHA_TEST);
GL11.glEnable(GL11.GL_TEXTURE_2D); }
}
float var15 = var1.getEntityBrightness(var6);
int var14 = this.getColorMultiplier(var1, var15, var6);
if(var14 >>> 24 > 0 || var1.hurtTime > 0 || var1.deathTime > 0) {
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glDisable(GL11.GL_ALPHA_TEST);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glDepthFunc(GL11.GL_EQUAL);
if(var1.hurtTime > 0 || var1.deathTime > 0) {
GL11.glColor4f(var15, 0.0F, 0.0F, 0.4F);
this.mainModel.render(var4, var3, var2, var7 - var5, var8, 1.0F);
for(int var10 = 0; var10 < 4; ++var10) {
if(this.shouldRenderPass(var1, var10)) {
GL11.glColor4f(var15, 0.0F, 0.0F, 0.4F);
this.renderPassModel.render(var4, var3, var2, var7 - var5, var8, 1.0F);
}
}
} }
GL11.glDisable(GL11.GL_NORMALIZE); if(var14 >>> 24 > 0) {
} catch (Exception var13) { float var16 = (float)(var14 >> 16 & 255) / 255.0F;
var13.printStackTrace(); var15 = (float)(var14 >> 8 & 255) / 255.0F;
float var11 = (float)(var14 & 255) / 255.0F;
var6 = (float)(var14 >>> 24) / 255.0F;
GL11.glColor4f(var16, var15, var11, var6);
this.mainModel.render(var4, var3, var2, var7 - var5, var8, 1.0F);
for(int var12 = 0; var12 < 4; ++var12) {
if(this.shouldRenderPass(var1, var12)) {
GL11.glColor4f(var16, var15, var11, var6);
this.renderPassModel.render(var4, var3, var2, var7 - var5, var8, 1.0F);
}
}
}
GL11.glDepthFunc(GL11.GL_LEQUAL);
GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_ALPHA_TEST);
GL11.glEnable(GL11.GL_TEXTURE_2D);
} }
GL11.glDisable(GL11.GL_NORMALIZE);
GL11.glEnable(GL11.GL_CULL_FACE); GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glPopMatrix(); GL11.glPopMatrix();
} }