diff --git a/src/js/net/minecraft/client/render/Tessellator.js b/src/js/net/minecraft/client/render/Tessellator.js index c35e1e0..6bb0cde 100644 --- a/src/js/net/minecraft/client/render/Tessellator.js +++ b/src/js/net/minecraft/client/render/Tessellator.js @@ -7,6 +7,7 @@ window.Tessellator = class { transparent: true }); + this.index = new THREE.BufferAttribute(new Uint32Array([0, 2, 1, 0, 3, 2]), 1); } bindTexture(texture) { @@ -49,9 +50,10 @@ window.Tessellator = class { geometry.setAttribute('position', new THREE.BufferAttribute(new Float32Array(this.vertices), 3)); geometry.setAttribute('color', new THREE.BufferAttribute(new Float32Array(this.colors), 3)); geometry.setAttribute('uv', new THREE.BufferAttribute(new Float32Array(this.uv), 2)); - geometry.setIndex(new THREE.BufferAttribute(new Uint32Array([0, 2, 1, 0, 3, 2]), 1)); + geometry.setIndex(this.index); let mesh = new THREE.Mesh(geometry, this.material); + group.matrixAutoUpdate = false; group.add(mesh); } diff --git a/src/js/net/minecraft/client/render/WorldRenderer.js b/src/js/net/minecraft/client/render/WorldRenderer.js index 3527858..c66ac13 100644 --- a/src/js/net/minecraft/client/render/WorldRenderer.js +++ b/src/js/net/minecraft/client/render/WorldRenderer.js @@ -16,6 +16,7 @@ window.WorldRenderer = class { // Create scene this.scene = new THREE.Scene(); + this.scene.matrixAutoUpdate = false; // Create web renderer this.canvasElement = document.createElement('canvas') diff --git a/src/js/net/minecraft/client/world/Chunk.js b/src/js/net/minecraft/client/world/Chunk.js index bdd88f8..ec6b414 100644 --- a/src/js/net/minecraft/client/world/Chunk.js +++ b/src/js/net/minecraft/client/world/Chunk.js @@ -6,6 +6,7 @@ window.Chunk = class { this.z = z; this.group = new THREE.Object3D(); + this.group.matrixAutoUpdate = false; // Initialize sections this.sections = []; diff --git a/src/js/net/minecraft/client/world/ChunkSection.js b/src/js/net/minecraft/client/world/ChunkSection.js index 2abb6af..532f0c3 100644 --- a/src/js/net/minecraft/client/world/ChunkSection.js +++ b/src/js/net/minecraft/client/world/ChunkSection.js @@ -1,8 +1,6 @@ window.ChunkSection = class { - static get SIZE() { - return 16; - } + static SIZE = 16; constructor(world, x, y, z) { this.world = world; @@ -11,6 +9,7 @@ window.ChunkSection = class { this.z = z; this.group = new THREE.Object3D(); + this.group.matrixAutoUpdate = false; this.dirty = true; this.blocks = []; diff --git a/src/js/net/minecraft/client/world/World.js b/src/js/net/minecraft/client/world/World.js index 19b7617..e72613e 100644 --- a/src/js/net/minecraft/client/world/World.js +++ b/src/js/net/minecraft/client/world/World.js @@ -4,6 +4,7 @@ window.World = class { constructor() { this.group = new THREE.Object3D(); + this.group.matrixAutoUpdate = false; this.chunks = []; // Debug world