Made the world actually load

This commit is contained in:
PeytonPlayz595 2023-10-11 17:53:49 -04:00
parent 31d09f3c50
commit 5f2acc6c46
14 changed files with 275 additions and 253 deletions

View File

@ -62,7 +62,7 @@ public class Client {
} }
public static void run0() { public static void run0() {
instance = new Minecraft(Display.getDisplayMode().getWidth(), Display.getDisplayMode().getHeight(), false); instance = new Minecraft(Display.getWidth(), Display.getHeight(), false);
instance.session = new Session("Player", "fuckmojang123"); instance.session = new Session("Player", "fuckmojang123");
instance.session.mpPassParameter = "randpasslol"; instance.session.mpPassParameter = "randpasslol";
mcThread = new Thread(instance, "Minecraft main thread"); mcThread = new Thread(instance, "Minecraft main thread");

View File

@ -1,7 +1,6 @@
package net.PeytonPlayz585.io; package net.PeytonPlayz585.io;
import java.util.Collection; import java.util.Collection;
import java.util.List;
import net.PeytonPlayz585.opengl.LWJGLMain; import net.PeytonPlayz585.opengl.LWJGLMain;
@ -26,11 +25,11 @@ public class File {
} }
public boolean exists() { public boolean exists() {
if(LWJGLMain.directoryExists(path) || LWJGLMain.fileExists(path)) { byte[] data = LWJGLMain.readFile(path);
return true; if(data == null) {
} else {
return false; return false;
} }
return true;
} }
public boolean mkdirs() { public boolean mkdirs() {
@ -76,7 +75,9 @@ public class File {
} }
public void delete() { public void delete() {
LWJGLMain.writeFile(path, null); if(exists()) {
LWJGLMain.deleteFile(path);
}
} }
public File[] listFiles() { public File[] listFiles() {
@ -89,10 +90,6 @@ public class File {
return files; return files;
} }
public boolean isDirectory() {
return LWJGLMain.directoryExists(path);
}
public void renameTo(File var4) { public void renameTo(File var4) {
LWJGLMain.renameFile(path, var4.getPath()); LWJGLMain.renameFile(path, var4.getPath());
} }

View File

@ -725,4 +725,22 @@ public abstract class Entity {
var1.riddenByEntity = this; var1.riddenByEntity = this;
} }
} }
public void turn(float var1, float var2) {
float var3 = this.rotationPitch;
float var4 = this.rotationYaw;
this.rotationYaw = (float)((double)this.rotationYaw + (double)var1 * 0.15D);
this.rotationPitch = (float)((double)this.rotationPitch - (double)var2 * 0.15D);
if(this.rotationPitch < -90.0F) {
this.rotationPitch = -90.0F;
}
if(this.rotationPitch > 90.0F) {
this.rotationPitch = 90.0F;
}
this.prevRotationPitch += this.rotationPitch - var3;
this.prevRotationYaw += this.rotationYaw - var4;
}
} }

View File

@ -255,40 +255,52 @@ public class EntityRenderer {
int var3; int var3;
int var9; int var9;
int var10; int var10;
// if(this.mc.inGameHasFocus) {
// int var2 = Mouse.getDX() * 0;
// var3 = Mouse.getDY() * 0;
// this.mc.mouseHelper.mouseXYChange();
// byte var4 = 1;
// if(this.mc.gameSettings.invertMouse) {
// var4 = -1;
// }
//
// boolean var5 = false;
// boolean var6 = false;
// var9 = var2 + this.mc.mouseHelper.deltaX;
// var10 = var3 - this.mc.mouseHelper.deltaY;
// if(var2 != 0 || this.mouseDX != 0) {
// System.out.println("xxo: " + var2 + ", " + this.mouseDX + ": " + this.mouseDX + ", xo: " + var9);
// }
//
// if(this.mouseDX != 0) {
// this.mouseDX = 0;
// }
//
// if(this.mouseDY != 0) {
// this.mouseDY = 0;
// }
//
// if(var2 != 0) {
// this.mouseDX = var2;
// }
//
// if(var3 != 0) {
// this.mouseDY = var3;
// }
//
// this.mc.thePlayer.setAngles((float)var9, (float)(var10 * var4));
// }
int var5 = Mouse.getDX();
int var6 = Mouse.getDY();
byte var91 = 1;
if(this.mc.gameSettings.invertMouse) {
var91 = -1;
}
if(this.mc.inGameHasFocus) { if(this.mc.inGameHasFocus) {
int var2 = Mouse.getDX() * 0; this.mc.thePlayer.turn((float)var5, (float)(var6 & var91));
var3 = Mouse.getDY() * 0;
this.mc.mouseHelper.mouseXYChange();
byte var4 = 1;
if(this.mc.gameSettings.invertMouse) {
var4 = -1;
}
boolean var5 = false;
boolean var6 = false;
var9 = var2 + this.mc.mouseHelper.deltaX;
var10 = var3 - this.mc.mouseHelper.deltaY;
if(var2 != 0 || this.mouseDX != 0) {
System.out.println("xxo: " + var2 + ", " + this.mouseDX + ": " + this.mouseDX + ", xo: " + var9);
}
if(this.mouseDX != 0) {
this.mouseDX = 0;
}
if(this.mouseDY != 0) {
this.mouseDY = 0;
}
if(var2 != 0) {
this.mouseDX = var2;
}
if(var3 != 0) {
this.mouseDY = var3;
}
this.mc.thePlayer.setAngles((float)var9, (float)(var10 * var4));
} }
if(!this.mc.skipRenderWorld) { if(!this.mc.skipRenderWorld) {

View File

@ -29,9 +29,9 @@ public class GuiIngame extends Gui {
FontRenderer var8 = this.mc.fontRenderer; FontRenderer var8 = this.mc.fontRenderer;
this.mc.entityRenderer.setupOverlayRendering(); this.mc.entityRenderer.setupOverlayRendering();
GL11.glEnable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_BLEND);
if(this.mc.gameSettings.fancyGraphics) { // if(this.mc.gameSettings.fancyGraphics) {
this.renderVignette(this.mc.thePlayer.getEntityBrightness(var1), var6, var7); // this.renderVignette(this.mc.thePlayer.getEntityBrightness(var1), var6, var7);
} // }
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/gui/gui.png")); GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/gui/gui.png"));

View File

@ -232,87 +232,81 @@ public class Minecraft implements Runnable {
return; return;
} }
try { long var1 = System.currentTimeMillis();
long var1 = System.currentTimeMillis(); int var3 = 0;
int var3 = 0;
while(this.running) { while(this.running) {
AxisAlignedBB.clearBoundingBoxPool(); AxisAlignedBB.clearBoundingBoxPool();
Vec3D.initialize(); Vec3D.initialize();
if(this.isGamePaused) { if(this.isGamePaused) {
float var4 = this.timer.renderPartialTicks; float var4 = this.timer.renderPartialTicks;
this.timer.updateTimer(); this.timer.updateTimer();
this.timer.renderPartialTicks = var4; this.timer.renderPartialTicks = var4;
} else { } else {
this.timer.updateTimer(); this.timer.updateTimer();
} }
for(int var14 = 0; var14 < this.timer.elapsedTicks; ++var14) { for(int var14 = 0; var14 < this.timer.elapsedTicks; ++var14) {
++this.ticksRan; ++this.ticksRan;
this.runTick(); this.runTick();
} }
this.checkGLError("Pre render"); this.checkGLError("Pre render");
if(this.isGamePaused) { if(this.isGamePaused) {
this.timer.renderPartialTicks = 1.0F; this.timer.renderPartialTicks = 1.0F;
} }
//this.sndManager.setListener(this.thePlayer, this.timer.renderPartialTicks); GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glEnable(GL11.GL_TEXTURE_2D); if(this.theWorld != null) {
if(this.theWorld != null) { while(this.theWorld.updatingLighting()) {
while(this.theWorld.updatingLighting()) {
}
}
if(!this.skipRenderWorld) {
this.playerController.setPartialTime(this.timer.renderPartialTicks);
this.entityRenderer.updateCameraAndRender(this.timer.renderPartialTicks);
}
if(Keyboard.isKeyDown(33) && Keyboard.isKeyDown(7)) {
this.displayDebugInfo();
} else {
this.prevFrameTime = System.nanoTime();
}
Thread.yield();
Display.update();
if(LWJGLMain.canvas.getWidth() != this.displayWidth || LWJGLMain.canvas.getHeight() != this.displayHeight) {
this.displayWidth = LWJGLMain.canvas.getWidth();
this.displayHeight = LWJGLMain.canvas.getHeight();
if(this.displayWidth <= 0) {
this.displayWidth = 1;
}
if(this.displayHeight <= 0) {
this.displayHeight = 1;
}
this.resize(this.displayWidth, this.displayHeight);
}
if(this.gameSettings.limitFramerate) {
Thread.sleep(5L);
}
this.checkGLError("Post render");
++var3;
for(this.isGamePaused = !this.isMultiplayerWorld() && this.currentScreen != null && this.currentScreen.doesGuiPauseGame(); System.currentTimeMillis() >= var1 + 1000L; var3 = 0) {
this.debug = var3 + " fps, " + WorldRenderer.chunksUpdated + " chunk updates";
WorldRenderer.chunksUpdated = 0;
var1 += 1000L;
} }
} }
} catch (MinecraftError var11) {
} catch (Exception var12) {
var12.printStackTrace();
new UnexpectedThrowable("Unexpected error", var12);
} finally {
this.shutdownMinecraftApplet();
}
if(!this.skipRenderWorld) {
this.playerController.setPartialTime(this.timer.renderPartialTicks);
this.entityRenderer.updateCameraAndRender(this.timer.renderPartialTicks);
}
if(Keyboard.isKeyDown(33) && Keyboard.isKeyDown(7)) {
this.displayDebugInfo();
} else {
this.prevFrameTime = System.nanoTime();
}
Thread.yield();
Display.update();
if(Display.getWidth() != this.displayWidth || Display.getHeight() != this.displayHeight) {
this.displayWidth = LWJGLMain.canvas.getWidth();
this.displayHeight = LWJGLMain.canvas.getHeight();
if(this.displayWidth <= 0) {
this.displayWidth = 1;
}
if(this.displayHeight <= 0) {
this.displayHeight = 1;
}
this.resize(this.displayWidth, this.displayHeight);
}
if(this.gameSettings.limitFramerate) {
try {
Thread.sleep(5L);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
this.checkGLError("Post render");
++var3;
for(this.isGamePaused = !this.isMultiplayerWorld() && this.currentScreen != null && this.currentScreen.doesGuiPauseGame(); System.currentTimeMillis() >= var1 + 1000L; var3 = 0) {
this.debug = var3 + " fps, " + WorldRenderer.chunksUpdated + " chunk updates";
WorldRenderer.chunksUpdated = 0;
var1 += 1000L;
}
}
} }
private void displayDebugInfo() { private void displayDebugInfo() {

View File

@ -8,8 +8,8 @@ public class PlayerControllerSP extends PlayerController {
private float prevBlockDamage = 0.0F; private float prevBlockDamage = 0.0F;
private float blockDestroySoundCounter = 0.0F; private float blockDestroySoundCounter = 0.0F;
private int blockHitWait = 0; private int blockHitWait = 0;
private SpawnerAnimals monsterSpawner = new SpawnerMonsters(this, 100, EntityMonster.class, new Class[]{EntityZombie.class, EntitySkeleton.class, EntityCreeper.class, EntitySpider.class}); //private SpawnerAnimals monsterSpawner = new SpawnerMonsters(this, 100, EntityMonster.class, new Class[]{EntityZombie.class, EntitySkeleton.class, EntityCreeper.class, EntitySpider.class});
private SpawnerAnimals animalSpawner = new SpawnerAnimals(20, EntityAnimal.class, new Class[]{EntitySheep.class, EntityPig.class}); //private SpawnerAnimals animalSpawner = new SpawnerAnimals(20, EntityAnimal.class, new Class[]{EntitySheep.class, EntityPig.class});
public PlayerControllerSP(Minecraft var1) { public PlayerControllerSP(Minecraft var1) {
super(var1); super(var1);
@ -118,7 +118,7 @@ public class PlayerControllerSP extends PlayerController {
public void onUpdate() { public void onUpdate() {
this.prevBlockDamage = this.curBlockDamage; this.prevBlockDamage = this.curBlockDamage;
this.monsterSpawner.onUpdate(this.mc.theWorld); //this.monsterSpawner.onUpdate(this.mc.theWorld);
this.animalSpawner.onUpdate(this.mc.theWorld); //this.animalSpawner.onUpdate(this.mc.theWorld);
} }
} }

View File

@ -161,7 +161,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");
} }
public void registerTextureFX(TextureFX texturefx) { public void registerTextureFX(TextureFX texturefx) {
@ -190,7 +190,7 @@ public class RenderEngine {
} }
public static boolean useMipmaps = false; public static boolean useMipmaps = false;
private HashMap<String, Integer> textureMap; private static HashMap<String, Integer> textureMap;
private HashMap<Integer, MinecraftImageData> textureNameToImageMap; private HashMap<Integer, MinecraftImageData> textureNameToImageMap;
private IntBuffer singleIntBuffer; private IntBuffer singleIntBuffer;
private ByteBuffer imageDataB1; private ByteBuffer imageDataB1;

View File

@ -509,6 +509,7 @@ public class RenderGlobal implements IWorldAccess {
double var20 = var19.lastTickPosX + (var19.posX - var19.lastTickPosX) * var4; double var20 = var19.lastTickPosX + (var19.posX - var19.lastTickPosX) * var4;
double var10 = var19.lastTickPosY + (var19.posY - var19.lastTickPosY) * var4; double var10 = var19.lastTickPosY + (var19.posY - var19.lastTickPosY) * var4;
double var12 = var19.lastTickPosZ + (var19.posZ - var19.lastTickPosZ) * var4; double var12 = var19.lastTickPosZ + (var19.posZ - var19.lastTickPosZ) * var4;
int var14 = 0; int var14 = 0;
int var15; int var15;

View File

@ -1,97 +1,96 @@
package net.minecraft.src; //package net.minecraft.src;
//
public class SpawnerAnimals { //public class SpawnerAnimals {
private int maxSpawns; // private int maxSpawns;
private Class entityType; // private Class entityType;
private Class[] entities; // private Class[] entities;
//
public SpawnerAnimals(int var1, Class var2, Class[] var3) { // public SpawnerAnimals(int var1, Class var2, Class[] var3) {
this.maxSpawns = var1; // this.maxSpawns = var1;
this.entityType = var2; // this.entityType = var2;
this.entities = var3; // this.entities = var3;
} // }
//
public void onUpdate(World var1) { // public void onUpdate(World var1) {
int var2 = var1.countEntities(this.entityType); // int var2 = var1.countEntities(this.entityType);
if(var2 < this.maxSpawns) { // if(var2 < this.maxSpawns) {
for(int var3 = 0; var3 < 10; ++var3) { // for(int var3 = 0; var3 < 10; ++var3) {
this.performSpawning(var1, 1, var1.playerEntity, (IProgressUpdate)null); // this.performSpawning(var1, 1, var1.playerEntity, (IProgressUpdate)null);
} // }
} // }
//
} // }
//
protected ChunkPosition getRandomSpawningPointInChunk(World var1, int var2, int var3) { // protected ChunkPosition getRandomSpawningPointInChunk(World var1, int var2, int var3) {
int var4 = var2 + var1.rand.nextInt(256) - 128; // int var4 = var2 + var1.rand.nextInt(256) - 128;
int var5 = var1.rand.nextInt(128); // int var5 = var1.rand.nextInt(128);
int var6 = var3 + var1.rand.nextInt(256) - 128; // int var6 = var3 + var1.rand.nextInt(256) - 128;
return new ChunkPosition(var4, var5, var6); // return new ChunkPosition(var4, var5, var6);
} // }
//
private int performSpawning(World var1, int var2, Entity var3, IProgressUpdate var4) { // private int performSpawning(World var1, int var2, Entity var3, IProgressUpdate var4) {
int var5 = 0; // int var5 = 0;
int var6 = MathHelper.floor_double(var3.posX); // int var6 = MathHelper.floor_double(var3.posX);
int var7 = MathHelper.floor_double(var3.posZ); // int var7 = MathHelper.floor_double(var3.posZ);
int var8 = var1.rand.nextInt(this.entities.length); // int var8 = var1.rand.nextInt(this.entities.length);
ChunkPosition var9 = this.getRandomSpawningPointInChunk(var1, var6, var7); // ChunkPosition var9 = this.getRandomSpawningPointInChunk(var1, var6, var7);
int var10 = var9.x; // int var10 = var9.x;
int var11 = var9.y; // int var11 = var9.y;
int var12 = var9.z; // int var12 = var9.z;
if(var1.isBlockNormalCube(var10, var11, var12)) { // if(var1.isBlockNormalCube(var10, var11, var12)) {
return 0; // return 0;
} else if(var1.getBlockMaterial(var10, var11, var12) != Material.air) { // } else if(var1.getBlockMaterial(var10, var11, var12) != Material.air) {
return 0; // return 0;
} else { // } else {
for(int var13 = 0; var13 < 3; ++var13) { // for(int var13 = 0; var13 < 3; ++var13) {
int var14 = var10; // int var14 = var10;
int var15 = var11; // int var15 = var11;
int var16 = var12; // int var16 = var12;
byte var17 = 6; // byte var17 = 6;
//
for(int var18 = 0; var18 < 3; ++var18) { // for(int var18 = 0; var18 < 3; ++var18) {
var14 += var1.rand.nextInt(var17) - var1.rand.nextInt(var17); // var14 += var1.rand.nextInt(var17) - var1.rand.nextInt(var17);
var15 += var1.rand.nextInt(1) - var1.rand.nextInt(1); // var15 += var1.rand.nextInt(1) - var1.rand.nextInt(1);
var16 += var1.rand.nextInt(var17) - var1.rand.nextInt(var17); // var16 += var1.rand.nextInt(var17) - var1.rand.nextInt(var17);
if(var1.isBlockNormalCube(var14, var15 - 1, var16) && !var1.isBlockNormalCube(var14, var15, var16) && !var1.getBlockMaterial(var14, var15, var16).getIsLiquid() && !var1.isBlockNormalCube(var14, var15 + 1, var16)) { // if(var1.isBlockNormalCube(var14, var15 - 1, var16) && !var1.isBlockNormalCube(var14, var15, var16) && !var1.getBlockMaterial(var14, var15, var16).getIsLiquid() && !var1.isBlockNormalCube(var14, var15 + 1, var16)) {
float var19 = (float)var14 + 0.5F; // float var19 = (float)var14 + 0.5F;
float var20 = (float)var15 + 1.0F; // float var20 = (float)var15 + 1.0F;
float var21 = (float)var16 + 0.5F; // float var21 = (float)var16 + 0.5F;
if(var3 != null) { // if(var3 != null) {
double var22 = (double)var19 - var3.posX; // double var22 = (double)var19 - var3.posX;
double var24 = (double)var20 - var3.posY; // double var24 = (double)var20 - var3.posY;
double var26 = (double)var21 - var3.posZ; // double var26 = (double)var21 - var3.posZ;
double var28 = var22 * var22 + var24 * var24 + var26 * var26; // double var28 = var22 * var22 + var24 * var24 + var26 * var26;
if(var28 < 1024.0D) { // if(var28 < 1024.0D) {
continue; // continue;
} // }
} else { // } else {
float var31 = var19 - (float)var1.spawnX; // float var31 = var19 - (float)var1.spawnX;
float var23 = var20 - (float)var1.spawnY; // float var23 = var20 - (float)var1.spawnY;
float var33 = var21 - (float)var1.spawnZ; // float var33 = var21 - (float)var1.spawnZ;
float var25 = var31 * var31 + var23 * var23 + var33 * var33; // float var25 = var31 * var31 + var23 * var23 + var33 * var33;
if(var25 < 1024.0F) { // if(var25 < 1024.0F) {
continue; // continue;
} // }
} // }
//
EntityLiving var32; // EntityLiving var32;
try { // try {
var32 = (EntityLiving)this.entities[var8].getConstructor(new Class[]{World.class}).newInstance(new Object[]{var1}); // var32 = (EntityLiving)this.entities[var8].getConstructor(new Class[]{World.class}).newInstance(new Object[]{var1});
} catch (Exception var30) { // } catch (Exception var30) {
var30.printStackTrace(); // return var5;
return var5; // }
} //
// var32.setPositionAndRotation((double)var19, (double)var20, (double)var21, var1.rand.nextFloat() * 360.0F, 0.0F);
var32.setPositionAndRotation((double)var19, (double)var20, (double)var21, var1.rand.nextFloat() * 360.0F, 0.0F); // if(var32.getCanSpawnHere((double)var19, (double)var20, (double)var21)) {
if(var32.getCanSpawnHere((double)var19, (double)var20, (double)var21)) { // ++var5;
++var5; // var1.spawnEntityInWorld(var32);
var1.spawnEntityInWorld(var32); // }
} // }
} // }
} // }
} //
// return var5;
return var5; // }
} // }
} //}
}

View File

@ -1,17 +1,17 @@
package net.minecraft.src; //package net.minecraft.src;
//
class SpawnerMonsters extends SpawnerAnimals { //class SpawnerMonsters extends SpawnerAnimals {
final PlayerControllerSP playerController; // final PlayerControllerSP playerController;
//
SpawnerMonsters(PlayerControllerSP var1, int var2, Class var3, Class[] var4) { // SpawnerMonsters(PlayerControllerSP var1, int var2, Class var3, Class[] var4) {
super(var2, var3, var4); // super(var2, var3, var4);
this.playerController = var1; // this.playerController = var1;
} // }
//
protected ChunkPosition getRandomSpawningPointInChunk(World var1, int var2, int var3) { // protected ChunkPosition getRandomSpawningPointInChunk(World var1, int var2, int var3) {
int var4 = var2 + var1.rand.nextInt(256) - 128; // int var4 = var2 + var1.rand.nextInt(256) - 128;
int var5 = var1.rand.nextInt(var1.rand.nextInt(var1.rand.nextInt(112) + 8) + 8); // int var5 = var1.rand.nextInt(var1.rand.nextInt(var1.rand.nextInt(112) + 8) + 8);
int var6 = var3 + var1.rand.nextInt(256) - 128; // int var6 = var3 + var1.rand.nextInt(256) - 128;
return new ChunkPosition(var4, var5, var6); // return new ChunkPosition(var4, var5, var6);
} // }
} //}

View File

@ -79,7 +79,7 @@ public class World implements IBlockAccess {
private static void deleteWorldFiles(File[] var0) { private static void deleteWorldFiles(File[] var0) {
for(int var1 = 0; var1 < var0.length; ++var1) { for(int var1 = 0; var1 < var0.length; ++var1) {
if(var0[var1].isDirectory()) { if(var0[var1].exists()) {
deleteWorldFiles(var0[var1].listFiles()); deleteWorldFiles(var0[var1].listFiles());
} }

View File

@ -74,9 +74,13 @@ public class WorldRenderer {
} }
} }
private void setupGLTranslation() { // private void setupGLTranslation() {
GL11.glTranslatef((float)this.posXClip, (float)this.posYClip, (float)this.posZClip); // float var19 = 1.000001F;
} // GL11.glTranslatef((float)posXClip * var19, (float)posYClip * var19, (float)posZClip * var19);
// for(int var2000 = 0; var2000 < 4; var2000++) {
// tessellator.addVertex(posX * var19, posY * var19, posZ * var19);
// }
// }
public void updateRenderer() { public void updateRenderer() {
if(this.needsUpdate) { if(this.needsUpdate) {
@ -113,14 +117,8 @@ public class WorldRenderer {
if(!var14) { if(!var14) {
var14 = true; var14 = true;
GL11.glNewList(this.glRenderList + var11, GL11.GL_COMPILE); GL11.glNewList(this.glRenderList + var11, GL11.GL_COMPILE);
GL11.glPushMatrix();
this.setupGLTranslation();
float var19 = 1.000001F;
GL11.glTranslatef((float)(-this.sizeDepth) / 2.0F, (float)(-this.sizeHeight) / 2.0F, (float)(-this.sizeDepth) / 2.0F);
GL11.glScalef(var19, var19, var19);
GL11.glTranslatef((float)this.sizeDepth / 2.0F, (float)this.sizeHeight / 2.0F, (float)this.sizeDepth / 2.0F);
tessellator.startDrawingQuads(); tessellator.startDrawingQuads();
tessellator.setTranslationD((double)(-this.posX), (double)(-this.posY), (double)(-this.posZ)); tessellator.setTranslationD((double) (this.posXClip-this.posX), (double) (this.posYClip-this.posY), (double) (this.posZClip-this.posZ));
} }
if(var11 == 0 && Block.blocksList[var18] instanceof BlockContainer) { if(var11 == 0 && Block.blocksList[var18] instanceof BlockContainer) {
@ -144,7 +142,6 @@ public class WorldRenderer {
if(var14) { if(var14) {
tessellator.draw(); tessellator.draw();
GL11.glPopMatrix();
GL11.glEndList(); GL11.glEndList();
tessellator.setTranslationD(0.0D, 0.0D, 0.0D); tessellator.setTranslationD(0.0D, 0.0D, 0.0D);
} else { } else {

View File

@ -13,7 +13,11 @@ public class Display {
LWJGLMain.updateDisplay(); LWJGLMain.updateDisplay();
} }
public static HTMLCanvasElement getDisplayMode() { public static int getWidth() {
return LWJGLMain.canvas; return LWJGLMain.getCanvasWidth();
}
public static int getHeight() {
return LWJGLMain.getCanvasHeight();
} }
} }