diff --git a/assets/Data/fab/fant_wall_section_1.block b/assets/Data/fab/fant_wall_section_1.block new file mode 100644 index 00000000..cf0aa1b2 Binary files /dev/null and b/assets/Data/fab/fant_wall_section_1.block differ diff --git a/assets/Data/fab/wood_refined_floor.block b/assets/Data/fab/wood_refined_floor.block new file mode 100644 index 00000000..73b78758 Binary files /dev/null and b/assets/Data/fab/wood_refined_floor.block differ diff --git a/docs/src/progress/currenttarget.md b/docs/src/progress/currenttarget.md index bf163f38..1c2d6df6 100644 --- a/docs/src/progress/currenttarget.md +++ b/docs/src/progress/currenttarget.md @@ -18,5 +18,6 @@ + bug fixes - Terrain edits do not save - Window does not play nice with its minWidth/minHeight being set differently + - Interaction block cursor is overwriting fab cursor + unreproducible bugs diff --git a/docs/src/progress/renderertodo.md b/docs/src/progress/renderertodo.md index 2147e593..76a430bf 100644 --- a/docs/src/progress/renderertodo.md +++ b/docs/src/progress/renderertodo.md @@ -1564,6 +1564,7 @@ Disable failing ui tests Pine trees drop wood blocks More block types Transparent blocks +Fix block meshgen diff --git a/src/main/java/electrosphere/client/interact/ClientInteractionEngine.java b/src/main/java/electrosphere/client/interact/ClientInteractionEngine.java index 578e87ba..e616fdfb 100644 --- a/src/main/java/electrosphere/client/interact/ClientInteractionEngine.java +++ b/src/main/java/electrosphere/client/interact/ClientInteractionEngine.java @@ -18,9 +18,7 @@ import electrosphere.collision.CollisionBodyCreation; import electrosphere.collision.CollisionEngine; import electrosphere.collision.PhysicsUtils; import electrosphere.collision.collidable.Collidable; -import electrosphere.controls.cursor.CursorState; import electrosphere.engine.Globals; -import electrosphere.engine.assetmanager.AssetDataStrings; import electrosphere.entity.Entity; import electrosphere.entity.EntityDataStrings; import electrosphere.entity.EntityUtils; @@ -279,7 +277,7 @@ public class ClientInteractionEngine { short type = blockChunkData.getType(blockPos.x, blockPos.y, blockPos.z); String text = Globals.gameConfigCurrent.getBlockData().getTypeFromId(type).getName(); InteractionTargetMenu.setInteractionTargetString(text); - CursorState.makeBlockVisible(AssetDataStrings.TEXTURE_RED_TRANSPARENT); + Globals.cursorState.hintShowBlockCursor(); Globals.cursorState.hintClampToExistingBlock(); set = true; } diff --git a/src/main/java/electrosphere/controls/cursor/CursorState.java b/src/main/java/electrosphere/controls/cursor/CursorState.java index 8df6bcc6..fff7be7b 100644 --- a/src/main/java/electrosphere/controls/cursor/CursorState.java +++ b/src/main/java/electrosphere/controls/cursor/CursorState.java @@ -416,6 +416,15 @@ public class CursorState { } } + /** + * Hints to show the block cursor + */ + public void hintShowBlockCursor(){ + if(!Globals.clientSceneWrapper.getScene().getEntitiesWithTag(EntityTags.DRAWABLE).contains(CursorState.playerFabCursor)){ + CursorState.makeBlockVisible(AssetDataStrings.TEXTURE_RED_TRANSPARENT); + } + } + /** * Gets the fab cursor * @return The fab cursor diff --git a/src/main/java/electrosphere/renderer/light/LightManager.java b/src/main/java/electrosphere/renderer/light/LightManager.java index 88100ef3..66a9e380 100644 --- a/src/main/java/electrosphere/renderer/light/LightManager.java +++ b/src/main/java/electrosphere/renderer/light/LightManager.java @@ -43,10 +43,12 @@ public class LightManager { * The width of the light cluster grid's x dimension */ public static final int LIGHT_CLUSTER_WIDTH_X = 12; + /** * The width of the light cluster grid's y dimension */ public static final int LIGHT_CLUSTER_WIDTH_Y = 12; + /** * The width of the light cluster grid's z dimension */ diff --git a/src/main/java/electrosphere/renderer/meshgen/BlockMeshgen.java b/src/main/java/electrosphere/renderer/meshgen/BlockMeshgen.java index 49fd0a8f..9dca0213 100644 --- a/src/main/java/electrosphere/renderer/meshgen/BlockMeshgen.java +++ b/src/main/java/electrosphere/renderer/meshgen/BlockMeshgen.java @@ -104,13 +104,44 @@ public class BlockMeshgen { currentQuad.w = 1; currentQuad.h = 1; currentQuad.type = data.getType(x, y, z); - } else { + } else if(currentQuad.type == data.getType(x, y, z)) { continue; + } else { + currentQuad.h = y - currentQuad.y; + //check if should merge with previous quad + for(QuadMesh prevMesh : quadMeshes){ + if(prevMesh.x + prevMesh.w == currentQuad.x && prevMesh.y == currentQuad.y && prevMesh.h == currentQuad.h && prevMesh.z == currentQuad.z){ + prevMesh.w = prevMesh.w + 1; + currentQuad = null; + break; + } + } + if(currentQuad != null){ + quadMeshes.add(currentQuad); + } + currentQuad = new QuadMesh(); + currentQuad.x = x; + currentQuad.y = y; + currentQuad.z = z; + currentQuad.w = 1; + currentQuad.h = 1; + currentQuad.type = data.getType(x, y, z); } } } if(currentQuad != null){ - quadMeshes.add(currentQuad); + currentQuad.h = dimensions.y - currentQuad.y; + //check if should merge with previous quad + for(QuadMesh prevMesh : quadMeshes){ + if(prevMesh.x + prevMesh.w == currentQuad.x && prevMesh.y == currentQuad.y && prevMesh.h == currentQuad.h && prevMesh.z == currentQuad.z){ + prevMesh.w = prevMesh.w + 1; + currentQuad = null; + break; + } + } + if(currentQuad != null){ + quadMeshes.add(currentQuad); + } } } }