bugfixes
This commit is contained in:
@@ -56,7 +56,11 @@ window.Minecraft = class {
|
|||||||
|
|
||||||
init() {
|
init() {
|
||||||
// Load spawn chunk
|
// Load spawn chunk
|
||||||
this.world.getChunkAt(0, 0);
|
for (let x = -WorldRenderer.RENDER_DISTANCE; x <= WorldRenderer.RENDER_DISTANCE; x++) {
|
||||||
|
for (let z = -WorldRenderer.RENDER_DISTANCE; z <= WorldRenderer.RENDER_DISTANCE; z++) {
|
||||||
|
this.world.getChunkAt(x, z);
|
||||||
|
}
|
||||||
|
}
|
||||||
this.player.respawn();
|
this.player.respawn();
|
||||||
|
|
||||||
// Start render loop
|
// Start render loop
|
||||||
@@ -109,7 +113,7 @@ window.Minecraft = class {
|
|||||||
|
|
||||||
onRender(partialTicks) {
|
onRender(partialTicks) {
|
||||||
// Player rotation
|
// Player rotation
|
||||||
if (this.hasInGameFocus()) {
|
if (!this.isPaused()) {
|
||||||
this.player.turn(this.window.mouseMotionX, this.window.mouseMotionY);
|
this.player.turn(this.window.mouseMotionX, this.window.mouseMotionY);
|
||||||
|
|
||||||
this.window.mouseMotionX = 0;
|
this.window.mouseMotionX = 0;
|
||||||
@@ -122,7 +126,9 @@ window.Minecraft = class {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Render the game
|
// Render the game
|
||||||
this.worldRenderer.render(partialTicks);
|
if (this.hasInGameFocus()) {
|
||||||
|
this.worldRenderer.render(partialTicks);
|
||||||
|
}
|
||||||
this.screenRenderer.render(partialTicks);
|
this.screenRenderer.render(partialTicks);
|
||||||
this.itemRenderer.render(partialTicks);
|
this.itemRenderer.render(partialTicks);
|
||||||
}
|
}
|
||||||
@@ -149,11 +155,13 @@ window.Minecraft = class {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onTick() {
|
onTick() {
|
||||||
// Tick world
|
if (!this.isPaused()) {
|
||||||
this.world.onTick();
|
// Tick world
|
||||||
|
this.world.onTick();
|
||||||
|
|
||||||
// Tick the player
|
// Tick the player
|
||||||
this.player.onTick();
|
this.player.onTick();
|
||||||
|
}
|
||||||
|
|
||||||
// Update loading progress
|
// Update loading progress
|
||||||
if (!(this.loadingScreen === null)) {
|
if (!(this.loadingScreen === null)) {
|
||||||
@@ -222,4 +230,8 @@ window.Minecraft = class {
|
|||||||
this.inventory.shiftSelectedSlot(delta);
|
this.inventory.shiftSelectedSlot(delta);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isPaused() {
|
||||||
|
return false;
|
||||||
|
//return !this.hasInGameFocus() && this.loadingScreen === null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -21,7 +21,7 @@ window.IngameOverlay = class extends Gui {
|
|||||||
" " + this.minecraft.world.lightUpdateQueue.length + " light updates," +
|
" " + this.minecraft.world.lightUpdateQueue.length + " light updates," +
|
||||||
" " + this.minecraft.worldRenderer.chunkSectionUpdateQueue.length + " chunk updates", 1, 1);
|
" " + this.minecraft.worldRenderer.chunkSectionUpdateQueue.length + " chunk updates", 1, 1);
|
||||||
this.drawString(stack, Math.floor(this.minecraft.player.x) + ", " + Math.floor(this.minecraft.player.y) + ", " + Math.floor(this.minecraft.player.z)
|
this.drawString(stack, Math.floor(this.minecraft.player.x) + ", " + Math.floor(this.minecraft.player.y) + ", " + Math.floor(this.minecraft.player.z)
|
||||||
+ " (" + Math.floor(this.minecraft.player.x >> 4) + ", " + Math.floor(this.minecraft.player.y >> 4) + ", " + Math.floor(this.minecraft.player.z >> 4) + ")", 1, 1 + 9);
|
+ " (" + Math.floor(Math.floor(this.minecraft.player.x) >> 4) + ", " + Math.floor(Math.floor(this.minecraft.player.y) >> 4) + ", " + Math.floor(Math.floor(this.minecraft.player.z) >> 4) + ")", 1, 1 + 9);
|
||||||
}
|
}
|
||||||
|
|
||||||
renderCrosshair(stack, x, y) {
|
renderCrosshair(stack, x, y) {
|
||||||
|
|||||||
@@ -211,7 +211,7 @@ window.World = class {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getTotalLightAt(x, y, z) {
|
getTotalLightAt(x, y, z) {
|
||||||
if (y < 0) {
|
if (!this.blockExists(x, y, z)) {
|
||||||
return 15;
|
return 15;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user