diff --git a/engine.lua b/engine.lua index 5d368c466..9ba6ba17f 100644 --- a/engine.lua +++ b/engine.lua @@ -3,7 +3,7 @@ cpml = require("libs/cpml") -local engine = {} +engine = {} engine.objFormat = { { "VertexPosition", "float", 4 }, { "VertexTexCoord", "float", 2 }, @@ -116,7 +116,7 @@ end -- create a new Scene object with given canvas output size function engine.newScene(renderWidth, renderHeight) love.graphics.setDepthMode("lequal", true) - local scene = {} + scene = {} -- define the shaders used in rendering the scene scene.threeShader = love.graphics.newShader([[ @@ -249,7 +249,7 @@ function engine.newScene(renderWidth, renderHeight) ) end end - + -- renders the given func to the twoCanvas -- this is useful for drawing 2d HUDS and information on the screen in front of the 3d scene -- will draw threeCanvas if drawArg is not given or is true (use if you want to scale the game canvas to window) diff --git a/main.lua b/main.lua index e8f3b421f..e277a82af 100644 --- a/main.lua +++ b/main.lua @@ -57,6 +57,10 @@ gamestateWorldCreationMenu = "WorldCreationMenu" gamestate = gamestateMainMenu enableF3 = false +enableF8 = false +enableTESTBLOCK = false +modelalreadycreated = 0 +ChunkBorderAlreadyCreated = 0 --modloader require("src/modloader/structuremodloader") diff --git a/resources/assets/textures/debug/chunkborders.png b/resources/assets/textures/debug/chunkborders.png new file mode 100644 index 000000000..a5bae9e35 Binary files /dev/null and b/resources/assets/textures/debug/chunkborders.png differ diff --git a/src/client/!draw.lua b/src/client/!draw.lua index e4f52ad9a..58bcdf6ed 100644 --- a/src/client/!draw.lua +++ b/src/client/!draw.lua @@ -22,6 +22,8 @@ function DrawGame() DrawF3() end + DrawChunkBorders3D() + DrawTestBlock() DrawCrossHair() love.graphics.setShader() diff --git a/src/client/drawhud.lua b/src/client/drawhud.lua index dd122c1f8..16722eb65 100644 --- a/src/client/drawhud.lua +++ b/src/client/drawhud.lua @@ -1,5 +1,5 @@ function DrawCanevas() - local scale = love.graphics.getWidth() / InterfaceWidth + local scale = love.graphics.getWidth() / InterfaceWidth love.graphics.draw( Scene.twoCanvas, love.graphics.getWidth() / 2, @@ -13,27 +13,301 @@ function DrawCanevas() end function DrawF3() - love.graphics.setColor(0, 0, 0) - love.graphics.print( - "x: " - .. math.floor(ThePlayer.x + 0.5) - .. "\ny: " - .. math.floor(ThePlayer.y + 0.5) - .. "\nz: " - .. math.floor(ThePlayer.z + 0.5) - ) - local chunk, cx, cy, cz, hashx, hashy = GetChunk(ThePlayer.x, ThePlayer.y, ThePlayer.z) - if chunk ~= nil then - love.graphics.print("kB: " .. math.floor(collectgarbage("count")), 0, 50) - end - love.graphics.print("FPS: " .. love.timer.getFPS(), 0, 70) - love.graphics.print("#LightingQueue: " .. #LightingQueue, 0, 90) - love.graphics.print("#LightingRQueue: " .. #LightingRemovalQueue, 0, 110) - --love.graphics.print("Press 'V' to toggle VSync", 0, 90) - --love.graphics.print("#ThingList: " .. #ThingList, 0, 130) - --for i = 1, #ThingList do - -- love.graphics.print(ThingList[i].name, 10, 100 + i * 130) - --end + love.graphics.setColor(0, 0, 0) + love.graphics.print( + "x: " + .. math.floor(ThePlayer.x + 0.5) + .. "\ny: " + .. math.floor(ThePlayer.y + 0.5) + .. "\nz: " + .. math.floor(ThePlayer.z + 0.5) + ) + + local chunk, cx, cy, cz, hashx, hashy = GetChunk(ThePlayer.x, ThePlayer.y, ThePlayer.z) + if chunk ~= nil then + love.graphics.print("kB: " .. math.floor(collectgarbage("count")), 0, 50) + end + + love.graphics.print("FPS: " .. love.timer.getFPS(), 0, 70) + love.graphics.print("#LightingQueue: " .. #LightingQueue, 0, 90) + love.graphics.print("#LightingRQueue: " .. #LightingRemovalQueue, 0, 110) + + local playerDirection = GetPlayerDirection(ThePlayer.rotation, ThePlayer.pitch) + if playerDirection then + love.graphics.print("Direction: " .. playerDirection, 0, 130) + else + love.graphics.print("Direction: Unknown", 0, 130) + end +end + +-- Fonction pour obtenir la direction du joueur +function GetPlayerDirection(rotation, pitch) + if pitch then + local seuilVersLeHaut = math.pi / 4 + local seuilVersLeBas = -math.pi / 4 + + if pitch > seuilVersLeHaut then + return "Bas" + elseif pitch < seuilVersLeBas then + return "Haut" + end + end + + if rotation then + local directions = { "N", "NE", "E", "SE", "S", "SW", "W", "NW", "N" } + local index = math.floor(((rotation + math.pi / 8) % (2 * math.pi)) / (math.pi / 4)) + 1 + return directions[index] + end + + return nil +end + +local exampleModelReference = nil +function DrawTestBlock() + if enableTESTBLOCK == false and modelalreadycreated == 1 then + LuaCraftPrintLoggingNormal("[NORMAL LOGGING] Condition met. Disabling test block and removing model...") + if exampleModelReference then + -- Trouver l'indice du modèle dans la liste + local modelIndex = nil + for i, model in ipairs(scene.modelList) do + if model == exampleModelReference then + modelIndex = i + break + end + end + + -- Retirer le modèle de la liste + if modelIndex then + table.remove(scene.modelList, modelIndex) + LuaCraftPrintLoggingNormal("Model removed.") + end + + exampleModelReference = nil + modelalreadycreated = 0 + LuaCraftPrintLoggingNormal("modelalreadycreated reset to 0") + end + LuaCraftPrintLoggingNormal("modelalreadycreated") + elseif enableTESTBLOCK and modelalreadycreated == 0 then + if modelalreadycreated == 1 then + return + end + -- Example usage of engine.newModel + local verts = { + -- Face avant + { 0, 0, 0 }, + { 1, 0, 0 }, + { 1, 1, 0 }, + { 1, 1, 0 }, + { 0, 1, 0 }, + { 0, 0, 0 }, + + -- Face arrière + { 0, 0, 1 }, + { 1, 0, 1 }, + { 1, 1, 1 }, + { 1, 1, 1 }, + { 0, 1, 1 }, + { 0, 0, 1 }, + + -- Face gauche + { 0, 0, 0 }, + { 0, 1, 0 }, + { 0, 1, 1 }, + { 0, 1, 1 }, + { 0, 0, 1 }, + { 0, 0, 0 }, + + -- Face droite + { 1, 0, 0 }, + { 1, 1, 0 }, + { 1, 1, 1 }, + { 1, 1, 1 }, + { 1, 0, 1 }, + { 1, 0, 0 }, + + -- Face supérieure + { 0, 1, 0 }, + { 1, 1, 0 }, + { 1, 1, 1 }, + { 1, 1, 1 }, + { 0, 1, 1 }, + { 0, 1, 0 }, + + -- Face inférieure + { 0, 0, 0 }, + { 1, 0, 0 }, + { 1, 0, 1 }, + { 1, 0, 1 }, + { 0, 0, 1 }, + { 0, 0, 0 }, + } + local x = 0 + local y = 120 + local z = 0 + local coords = { x, y, z } + local color = { 1, 1, 1 } + local format = { + { "VertexPosition", "float", 3 }, + { "VertexTexCoord", "float", 2 }, + } + + local t = NewThing(x, y, z) + t.name = "BlockTest" + + myModel = engine.newModel(verts, BlockTest, coords, color, format) + myModel.culling = false + + t:assignModel(myModel) + + exampleModelReference = myModel + modelalreadycreated = 1 + LuaCraftPrintLoggingNormal("DrawTestBlock completed.") + end +end +local function CreateChunkBordersVertices() + ChunkVerts = { + -- Bottom face + { 0, 0, 0 }, + { ChunkSize, 0, 0 }, + { ChunkSize, 0, ChunkSize }, + { ChunkSize, 0, ChunkSize }, + { 0, 0, ChunkSize }, + { 0, 0, 0 }, + + -- Top face + { 0, WorldHeight, 0 }, + { ChunkSize, WorldHeight, 0 }, + { ChunkSize, WorldHeight, ChunkSize }, + { ChunkSize, WorldHeight, ChunkSize }, + { 0, WorldHeight, ChunkSize }, + { 0, WorldHeight, 0 }, + + -- Front face + { 0, 0, 0 }, + { ChunkSize, 0, 0 }, + { ChunkSize, WorldHeight, 0 }, + { ChunkSize, WorldHeight, 0 }, + { 0, WorldHeight, 0 }, + { 0, 0, 0 }, + + -- Back face + { 0, 0, ChunkSize }, + { ChunkSize, 0, ChunkSize }, + { ChunkSize, WorldHeight, ChunkSize }, + { ChunkSize, WorldHeight, ChunkSize }, + { 0, WorldHeight, ChunkSize }, + { 0, 0, ChunkSize }, + + -- Left face + { 0, 0, 0 }, + { 0, 0, ChunkSize }, + { 0, WorldHeight, ChunkSize }, + { 0, WorldHeight, ChunkSize }, + { 0, WorldHeight, 0 }, + { 0, 0, 0 }, + + -- Right face + { ChunkSize, 0, 0 }, + { ChunkSize, 0, ChunkSize }, + { ChunkSize, WorldHeight, ChunkSize }, + { ChunkSize, WorldHeight, ChunkSize }, + { ChunkSize, WorldHeight, 0 }, + { ChunkSize, 0, 0 }, + } +end +local chunkBordersModels = {} +function DrawChunkBorders3D() + if enableF8 == false and ChunkBorderAlreadyCreated == 1 then + LuaCraftPrintLoggingNormal("[NORMAL LOGGING] Condition met. Disabling test block and removing models...") + + -- Supprimer tous les modèles de la liste + for _, model in ipairs(chunkBordersModels) do + local modelIndex = nil + for i, sceneModel in ipairs(scene.modelList) do + if sceneModel == model then + modelIndex = i + break + end + end + + if modelIndex then + table.remove(scene.modelList, modelIndex) + LuaCraftPrintLoggingNormal("Model removed.") + end + end + + chunkBordersModels = {} -- Réinitialiser la table des modèles + + ChunkBorderAlreadyCreated = 0 + LuaCraftPrintLoggingNormal("ChunkBorderAlreadyCreated reset to 0") + LuaCraftPrintLoggingNormal("Models removed.") + elseif enableF8 and ChunkBorderAlreadyCreated == 0 then + for chunk, _ in pairs(ChunkSet) do + LuaCraftPrintLoggingNormal("test1") + if type(chunk) == "table" and chunk.x and chunk.y and chunk.z then + LuaCraftPrintLoggingNormal("test2") + + CreateChunkBordersVertices() + -- No rotation applied, so rotatedVerts is the same as verts + local rotatedVerts = ChunkVerts + + -- Debugging output + for i, v in ipairs(rotatedVerts) do + LuaCraftPrintLoggingNormal( + "After Rotation - Vertex " + .. i + .. ": x = " + .. rotatedVerts[i][1] + .. ", y = " + .. rotatedVerts[i][2] + .. ", z = " + .. rotatedVerts[i][3] + ) + end + + -- Update verts with rotatedVerts + ChunkVerts = rotatedVerts + + local x = (chunk.x - 1) * ChunkSize + local y = chunk.y + local z = (chunk.z - 1) * ChunkSize + local coords = { x, y, z } + local color = { 1, 1, 1 } + local format = { + { "VertexPosition", "float", 3 }, + { "VertexTexCoord", "float", 2 }, + } + + -- Print debugging information + LuaCraftPrintLoggingNormal("Chunk Borders Debugging:") + LuaCraftPrintLoggingNormal("World Height: " .. WorldHeight) + + -- Print chunk coordinates + LuaCraftPrintLoggingNormal("Chunk Coordinates: x = " .. x .. ", y = " .. y .. ", z = " .. z) + + -- Print vertices + for i, v in ipairs(ChunkVerts) do + LuaCraftPrintLoggingNormal( + "Vertex " .. i .. ": x = " .. v[1] .. ", y = " .. v[2] .. ", z = " .. v[3] + ) + end + + local t = NewThing(x, y, z) + t.name = "ChunkBorders" + + local chunkBordersModel = engine.newModel(ChunkVerts, ChunkBorders, coords, color, format) + chunkBordersModel.culling = false + + t:assignModel(chunkBordersModel) + + -- Ajouter le modèle à la table + table.insert(chunkBordersModels, chunkBordersModel) + end + end + + ChunkBorderAlreadyCreated = 1 + LuaCraftPrintLoggingNormal("DrawChunkBorders3D completed.") + end end function DrawHudTile(tile, x, y) @@ -88,32 +362,32 @@ function DrawHudTile(tile, x, y) end function DrawCrossHair() - -- draw crosshair - love.graphics.setColor(1, 1, 1) - CrosshairShader:send("source", Scene.threeCanvas) - CrosshairShader:send("xProportion", 32 / GraphicsWidth) - CrosshairShader:send("yProportion", 32 / GraphicsHeight) - love.graphics.setShader(CrosshairShader) - - -- draw crosshair - love.graphics.setColor(1, 1, 1) - CrosshairShader:send("source", Scene.threeCanvas) - CrosshairShader:send("xProportion", 32 / GraphicsWidth) - CrosshairShader:send("yProportion", 32 / GraphicsHeight) - love.graphics.draw(GuiSprites, GuiCrosshair, InterfaceWidth / 2 - 16, InterfaceHeight / 2 - 16, 0, 2, 2) + -- draw crosshair + love.graphics.setColor(1, 1, 1) + CrosshairShader:send("source", Scene.threeCanvas) + CrosshairShader:send("xProportion", 32 / GraphicsWidth) + CrosshairShader:send("yProportion", 32 / GraphicsHeight) + love.graphics.setShader(CrosshairShader) + + -- draw crosshair + love.graphics.setColor(1, 1, 1) + CrosshairShader:send("source", Scene.threeCanvas) + CrosshairShader:send("xProportion", 32 / GraphicsWidth) + CrosshairShader:send("yProportion", 32 / GraphicsHeight) + love.graphics.draw(GuiSprites, GuiCrosshair, InterfaceWidth / 2 - 16, InterfaceHeight / 2 - 16, 0, 2, 2) end function DrawHotBar() -- draw hotbar - love.graphics.setColor(1, 1, 1) - love.graphics.draw(GuiSprites, GuiHotbarQuad, InterfaceWidth / 2 - 182, InterfaceHeight - 22 * 2, 0, 2, 2) - love.graphics.draw( - GuiSprites, - GuiHotbarSelectQuad, - InterfaceWidth / 2 - 182 + 40 * (PlayerInventory.hotbarSelect - 1) - 2, - InterfaceHeight - 24 - 22, - 0, - 2, - 2 - ) -end \ No newline at end of file + love.graphics.setColor(1, 1, 1) + love.graphics.draw(GuiSprites, GuiHotbarQuad, InterfaceWidth / 2 - 182, InterfaceHeight - 22 * 2, 0, 2, 2) + love.graphics.draw( + GuiSprites, + GuiHotbarSelectQuad, + InterfaceWidth / 2 - 182 + 40 * (PlayerInventory.hotbarSelect - 1) - 2, + InterfaceHeight - 24 - 22, + 0, + 2, + 2 + ) +end diff --git a/src/entities/player.lua b/src/entities/player.lua index 8b0835a2c..c050d9878 100644 --- a/src/entities/player.lua +++ b/src/entities/player.lua @@ -13,45 +13,54 @@ function NewPlayer(x, y, z) t.height = 1.85 t.eyeLevel = 1.62 t.width = 0.25 + t.rotation = 0 + t.pitch = 0 t.update = function(self, dt) - if PhysicsStep then - self:physics() - end + if PhysicsStep then + self:physics() + end - -- view bobbing - local speed = math.dist(0, 0, self.xSpeed, self.zSpeed) - self.viewBob = self.viewBob + speed * 2.75 * (dt * 60) - self.viewBobMult = math.min(speed, 1) - - -- update camera position to new player position - Scene.camera.pos.x = self.x - Scene.camera.pos.y = self.y + math.sin(self.viewBob) * self.viewBobMult * 1 + self.eyeLevel - Scene.camera.pos.z = self.z - - -- update voxel cursor position to whatever block currently pointing at - local rx, ry, rz = Scene.camera.pos.x, Scene.camera.pos.y, Scene.camera.pos.z - local step = 0.1 - self.voxelCursor.model.visible = false - self.cursorHit = false - for i = 1, playerReach, step do - local chunk, cx, cy, cz, hashx, hashy = GetChunk(rx, ry, rz) - if chunk ~= nil and chunk:getVoxel(cx, cy, cz) ~= 0 then - self.cursorpos = { x = cx, y = cy, z = cz, chunk = chunk } - self.cursorHit = true - self.voxelCursor.model.visible = true - self.voxelCursor.model:setTransform({ math.floor(rx), math.floor(ry), math.floor(rz) }) - break - end - self.cursorposPrev = { x = cx, y = cy, z = cz, chunk = chunk } + -- view bobbing + local speed = math.dist(0, 0, self.xSpeed, self.zSpeed) + self.viewBob = self.viewBob + speed * 2.75 * (dt * 60) + self.viewBobMult = math.min(speed, 1) - rx = rx + math.cos(Scene.camera.angle.x - math.pi / 2) * step * math.cos(Scene.camera.angle.y) - rz = rz + math.sin(Scene.camera.angle.x - math.pi / 2) * step * math.cos(Scene.camera.angle.y) - ry = ry - math.sin(Scene.camera.angle.y) * step - end + -- update camera position to new player position + Scene.camera.pos.x = self.x + Scene.camera.pos.y = self.y + math.sin(self.viewBob) * self.viewBobMult * 1 + self.eyeLevel + Scene.camera.pos.z = self.z + + -- update voxel cursor position to whatever block currently pointing at + local rx, ry, rz = Scene.camera.pos.x, Scene.camera.pos.y, Scene.camera.pos.z + local step = 0.1 + self.voxelCursor.model.visible = false + self.cursorHit = false + for i = 1, playerReach, step do + local chunk, cx, cy, cz, hashx, hashy = GetChunk(rx, ry, rz) + if chunk ~= nil and chunk:getVoxel(cx, cy, cz) ~= 0 then + self.cursorpos = { x = cx, y = cy, z = cz, chunk = chunk } + self.cursorHit = true + self.voxelCursor.model.visible = true + self.voxelCursor.model:setTransform({ math.floor(rx), math.floor(ry), math.floor(rz) }) + break + end + self.cursorposPrev = { x = cx, y = cy, z = cz, chunk = chunk } + + rx = rx + math.cos(Scene.camera.angle.x - math.pi / 2) * step * math.cos(Scene.camera.angle.y) + rz = rz + math.sin(Scene.camera.angle.x - math.pi / 2) * step * math.cos(Scene.camera.angle.y) + ry = ry - math.sin(Scene.camera.angle.y) * step + end + + -- Mise à jour de la rotation + self.rotation = Scene.camera.angle.x + + -- Mise à jour de la hauteur de vue (pitch) + self.pitch = Scene.camera.angle.y + + return true + end - return true - end t.physics = function(self) local Camera = Scene.camera diff --git a/src/init/assetsinit.lua b/src/init/assetsinit.lua index 291ea0713..9398b2c37 100644 --- a/src/init/assetsinit.lua +++ b/src/init/assetsinit.lua @@ -16,4 +16,7 @@ function InitializeAssets() gameplayingpausemenu = lovegraphics.newImage("resources/assets/backgrounds/gameplayingpausemenu.png") playinggamesettings = lovegraphics.newImage("resources/assets/backgrounds/playinggamesettings.png") worldCreationBackground = lovegraphics.newImage("resources/assets/backgrounds/WorldCreationBackground.png") + + BlockTest = love.graphics.newImage("resources/assets/textures/blocks/Stone.png") + ChunkBorders = love.graphics.newImage("resources/assets/textures/debug/chunkborders.png") end diff --git a/src/init/worldinit.lua b/src/init/worldinit.lua index 2db99089a..2fc5434c9 100644 --- a/src/init/worldinit.lua +++ b/src/init/worldinit.lua @@ -60,37 +60,34 @@ function initPlayerInventory() end function generateWorldChunks() - ChunkHashTable = {} - ChunkSet = {} - ChunkRequests = {} - LightingQueue = {} - LightingRemovalQueue = {} - CaveList = {} - local worldSize = 4 - - StartTime = love.timer.getTime() - MeasureTime = StartTime - local timeDiff = function() - local timeget = love.timer.getTime() - local ret = timeget - MeasureTime - MeasureTime = timeget - - return ret - end - - for i = worldSize / -2 + 1, worldSize / 2 do - ChunkHashTable[ChunkHash(i)] = {} - for j = worldSize / -2 + 1, worldSize / 2 do - local chunk = NewChunk(i, j) - ChunkSet[chunk] = true - ChunkHashTable[ChunkHash(i)][ChunkHash(j)] = chunk - end - end - if enablePROFIProfiler then - ProFi:checkMemory(6, "6eme profil") - end + ChunkHashTable = {} + ChunkSet = {} + ChunkRequests = {} + LightingQueue = {} + LightingRemovalQueue = {} + CaveList = {} + local worldSize = 4 + + StartTime = love.timer.getTime() + MeasureTime = StartTime + + for i = worldSize / -2 + 1, worldSize / 2 do + ChunkHashTable[ChunkHash(i)] = {} + for j = worldSize / -2 + 1, worldSize / 2 do + local chunk = NewChunk(i, j) + ChunkSet[chunk] = true + ChunkHashTable[ChunkHash(i)][ChunkHash(j)] = chunk + + -- Ajoutez des prints pour déboguer + LuaCraftPrintLoggingNormal("Generated chunk with coordinates:", i, j) + end + end + if enablePROFIProfiler then + ProFi:checkMemory(6, "6eme profil") + end end + function updateWorld() UpdateCaves() updateLighting() @@ -118,7 +115,7 @@ function updateLighting() end function printGenerationTime() - print("total generation time: " .. (love.timer.getTime() - StartTime)) + LuaCraftPrintLoggingNormal("total generation time: " .. (love.timer.getTime() - StartTime)) end function GenerateWorld() diff --git a/src/utils/mouselogic.lua b/src/utils/mouselogic.lua index 937e9dae3..6643ebcf2 100644 --- a/src/utils/mouselogic.lua +++ b/src/utils/mouselogic.lua @@ -28,12 +28,12 @@ function MouseLogicOnPlay(x, y, b) LightingUpdate() UpdateChangedChunks() -- chunk:updateModel(cx, cy, cz) - -- print("---") - -- print(cx, cy, cz) - -- print(cx % ChunkSize, cy % SliceHeight, cz % ChunkSize) + -- LuaCraftPrintLoggingNormal("---") + -- LuaCraftPrintLoggingNormal(cx, cy, cz) + -- LuaCraftPrintLoggingNormal(cx % ChunkSize, cy % SliceHeight, cz % ChunkSize) elseif pos.x and pos.z and pos.y >= WorldHeight and ThePlayer.cursorpos and ThePlayer.cursorHit == true then - hudMessage = "you cannot place blocks at Y = " .. WorldHeight .. " or more" - hudTimeLeft = 3 + hudMessage = "you cannot place blocks at Y = " .. WorldHeight .. " or more" + hudTimeLeft = 3 end end @@ -66,6 +66,10 @@ function KeyPressed(k) GenerateWorld() elseif k == "f3" then enableF3 = not enableF3 + elseif k == "f8" then + enableF8 = not enableF8 + elseif k == "f1" then + enableTESTBLOCK = not enableTESTBLOCK end end if gamestate == gamestateGamePausing then diff --git a/src/world/chunk.lua b/src/world/chunk.lua index dff150f9e..9cec83abd 100644 --- a/src/world/chunk.lua +++ b/src/world/chunk.lua @@ -315,26 +315,26 @@ function NewChunk(x, z) sliceUpdates[math.max(index - 1, 1)][1] = true end - --print(self.changes[i][1], self.changes[i][2], self.changes[i][3]) + --LuaCraftPrintLoggingNormal(self.changes[i][1], self.changes[i][2], self.changes[i][3]) -- neg x if self.changes[i][1] == 1 then sliceUpdates[index][2] = true - --print("neg x") + --LuaCraftPrintLoggingNormal("neg x") end -- pos x if self.changes[i][1] == ChunkSize then sliceUpdates[index][3] = true - --print("pos x") + --LuaCraftPrintLoggingNormal("pos x") end -- neg z if self.changes[i][3] == 1 then sliceUpdates[index][4] = true - --print("neg z") + --LuaCraftPrintLoggingNormal("neg z") end -- pos z if self.changes[i][3] == ChunkSize then sliceUpdates[index][5] = true - --print("pos z") + --LuaCraftPrintLoggingNormal("pos z") end end end @@ -390,7 +390,7 @@ function NewChunkSlice(x, y, z, parent) t.parent = parent t.name = "chunkslice" local compmodel = Engine.newModel(nil, LightingTexture, { 0, 0, 0 }) - compmodel.culling = true + compmodel.culling = false t:assignModel(compmodel) t.updateModel = function(self)