From 88be49d84a1499f89f625a3df19b38eba7031310 Mon Sep 17 00:00:00 2001 From: austin Date: Fri, 16 May 2025 16:40:04 -0400 Subject: [PATCH] refactor fabs --- src/main/java/electrosphere/client/ClientState.java | 2 +- .../electrosphere/client/block/ClientBlockSelection.java | 2 +- .../electrosphere/client/scene/ClientLevelEditorData.java | 2 +- .../client/ui/menu/editor/ImGuiStructureTab.java | 6 +++--- .../java/electrosphere/client/ui/menu/ingame/FabMenus.java | 2 +- .../java/electrosphere/controls/cursor/CursorState.java | 2 +- .../java/electrosphere/data/block/{ => fab}/BlockFab.java | 2 +- .../data/block/{ => fab}/BlockFabMetadata.java | 2 +- .../{client/block => data/block/fab}/StructureData.java | 4 +++- .../entity/state/equip/ClientToolbarState.java | 2 +- .../server/ai/nodes/checks/spatial/BeginStructureNode.java | 2 +- .../server/ai/nodes/solvers/SolveBuildMaterialNode.java | 2 +- .../java/electrosphere/server/macro/MacroDataLoader.java | 2 +- .../electrosphere/server/macro/structure/Structure.java | 2 +- .../server/macro/utils/StructureRepairUtils.java | 2 +- .../server/physics/block/editing/ServerBlockEditing.java | 2 +- .../server/simulation/chara/CharaSimulation.java | 2 +- 17 files changed, 21 insertions(+), 19 deletions(-) rename src/main/java/electrosphere/data/block/{ => fab}/BlockFab.java (99%) rename src/main/java/electrosphere/data/block/{ => fab}/BlockFabMetadata.java (95%) rename src/main/java/electrosphere/{client/block => data/block/fab}/StructureData.java (96%) diff --git a/src/main/java/electrosphere/client/ClientState.java b/src/main/java/electrosphere/client/ClientState.java index 3d19c6c7..20300bbb 100644 --- a/src/main/java/electrosphere/client/ClientState.java +++ b/src/main/java/electrosphere/client/ClientState.java @@ -5,7 +5,6 @@ import java.util.ArrayList; import org.joml.Vector3f; import electrosphere.client.block.ClientBlockManager; -import electrosphere.client.block.StructureData; import electrosphere.client.block.cells.ClientBlockCellManager; import electrosphere.client.chemistry.ClientChemistryCollisionCallback; import electrosphere.client.entity.character.ClientCharacterManager; @@ -20,6 +19,7 @@ import electrosphere.client.terrain.cells.ClientDrawCellManager; import electrosphere.client.terrain.foliage.FoliageCellManager; import electrosphere.client.terrain.manager.ClientTerrainManager; import electrosphere.collision.CollisionEngine; +import electrosphere.data.block.fab.StructureData; import electrosphere.data.common.CommonEntityType; import electrosphere.data.voxel.VoxelType; import electrosphere.entity.Entity; diff --git a/src/main/java/electrosphere/client/block/ClientBlockSelection.java b/src/main/java/electrosphere/client/block/ClientBlockSelection.java index b8e75af7..2272aa2d 100644 --- a/src/main/java/electrosphere/client/block/ClientBlockSelection.java +++ b/src/main/java/electrosphere/client/block/ClientBlockSelection.java @@ -11,7 +11,7 @@ import org.joml.Vector3i; import electrosphere.client.interact.select.AreaSelection; import electrosphere.client.interact.select.AreaSelection.AreaSelectionType; import electrosphere.client.scene.ClientWorldData; -import electrosphere.data.block.BlockFab; +import electrosphere.data.block.fab.BlockFab; import electrosphere.engine.Globals; import electrosphere.util.math.HashUtils; diff --git a/src/main/java/electrosphere/client/scene/ClientLevelEditorData.java b/src/main/java/electrosphere/client/scene/ClientLevelEditorData.java index a6a4d129..c7594d16 100644 --- a/src/main/java/electrosphere/client/scene/ClientLevelEditorData.java +++ b/src/main/java/electrosphere/client/scene/ClientLevelEditorData.java @@ -2,7 +2,7 @@ package electrosphere.client.scene; import org.joml.Vector3d; -import electrosphere.data.block.BlockFab; +import electrosphere.data.block.fab.BlockFab; /** * Stores the data for the client's level edits diff --git a/src/main/java/electrosphere/client/ui/menu/editor/ImGuiStructureTab.java b/src/main/java/electrosphere/client/ui/menu/editor/ImGuiStructureTab.java index fa5a25d1..233ce210 100644 --- a/src/main/java/electrosphere/client/ui/menu/editor/ImGuiStructureTab.java +++ b/src/main/java/electrosphere/client/ui/menu/editor/ImGuiStructureTab.java @@ -5,10 +5,10 @@ import java.io.File; import org.joml.Vector3d; import electrosphere.client.block.ClientBlockSelection; -import electrosphere.client.block.StructureData; import electrosphere.client.interact.select.AreaSelection; -import electrosphere.data.block.BlockFab; -import electrosphere.data.block.BlockFabMetadata; +import electrosphere.data.block.fab.BlockFab; +import electrosphere.data.block.fab.BlockFabMetadata; +import electrosphere.data.block.fab.StructureData; import electrosphere.engine.Globals; import imgui.ImGui; diff --git a/src/main/java/electrosphere/client/ui/menu/ingame/FabMenus.java b/src/main/java/electrosphere/client/ui/menu/ingame/FabMenus.java index 7e73f9b0..39d3739d 100644 --- a/src/main/java/electrosphere/client/ui/menu/ingame/FabMenus.java +++ b/src/main/java/electrosphere/client/ui/menu/ingame/FabMenus.java @@ -6,7 +6,7 @@ import electrosphere.client.ui.components.FabSelectionPanel; import electrosphere.client.ui.menu.WindowStrings; import electrosphere.client.ui.menu.WindowUtils; import electrosphere.controls.ControlHandler.ControlsState; -import electrosphere.data.block.BlockFab; +import electrosphere.data.block.fab.BlockFab; import electrosphere.engine.Globals; import electrosphere.engine.signal.Signal.SignalType; import electrosphere.renderer.ui.elements.Window; diff --git a/src/main/java/electrosphere/controls/cursor/CursorState.java b/src/main/java/electrosphere/controls/cursor/CursorState.java index 87b8b383..79b8a2f8 100644 --- a/src/main/java/electrosphere/controls/cursor/CursorState.java +++ b/src/main/java/electrosphere/controls/cursor/CursorState.java @@ -9,7 +9,7 @@ import electrosphere.client.block.BlockChunkData; import electrosphere.client.entity.camera.CameraEntityUtils; import electrosphere.client.interact.select.AreaSelection; import electrosphere.collision.CollisionEngine; -import electrosphere.data.block.BlockFab; +import electrosphere.data.block.fab.BlockFab; import electrosphere.data.grident.GridAlignedData; import electrosphere.data.item.Item; import electrosphere.engine.Globals; diff --git a/src/main/java/electrosphere/data/block/BlockFab.java b/src/main/java/electrosphere/data/block/fab/BlockFab.java similarity index 99% rename from src/main/java/electrosphere/data/block/BlockFab.java rename to src/main/java/electrosphere/data/block/fab/BlockFab.java index 93106415..a511c47d 100644 --- a/src/main/java/electrosphere/data/block/BlockFab.java +++ b/src/main/java/electrosphere/data/block/fab/BlockFab.java @@ -1,4 +1,4 @@ -package electrosphere.data.block; +package electrosphere.data.block.fab; import java.io.File; import java.io.IOException; diff --git a/src/main/java/electrosphere/data/block/BlockFabMetadata.java b/src/main/java/electrosphere/data/block/fab/BlockFabMetadata.java similarity index 95% rename from src/main/java/electrosphere/data/block/BlockFabMetadata.java rename to src/main/java/electrosphere/data/block/fab/BlockFabMetadata.java index 78335d61..d7774dc4 100644 --- a/src/main/java/electrosphere/data/block/BlockFabMetadata.java +++ b/src/main/java/electrosphere/data/block/fab/BlockFabMetadata.java @@ -1,4 +1,4 @@ -package electrosphere.data.block; +package electrosphere.data.block.fab; import java.util.LinkedList; import java.util.List; diff --git a/src/main/java/electrosphere/client/block/StructureData.java b/src/main/java/electrosphere/data/block/fab/StructureData.java similarity index 96% rename from src/main/java/electrosphere/client/block/StructureData.java rename to src/main/java/electrosphere/data/block/fab/StructureData.java index 79d29723..cf139493 100644 --- a/src/main/java/electrosphere/client/block/StructureData.java +++ b/src/main/java/electrosphere/data/block/fab/StructureData.java @@ -1,4 +1,4 @@ -package electrosphere.client.block; +package electrosphere.data.block.fab; import java.util.LinkedList; import java.util.List; @@ -6,6 +6,8 @@ import java.util.List; import org.joml.Vector3d; import org.joml.Vector3i; +import electrosphere.client.block.BlockChunkData; +import electrosphere.client.block.ClientBlockSelection; import electrosphere.client.interact.select.AreaSelection; import electrosphere.client.interact.select.AreaSelection.AreaSelectionType; import electrosphere.client.scene.ClientWorldData; diff --git a/src/main/java/electrosphere/entity/state/equip/ClientToolbarState.java b/src/main/java/electrosphere/entity/state/equip/ClientToolbarState.java index 34883036..56611d4a 100644 --- a/src/main/java/electrosphere/entity/state/equip/ClientToolbarState.java +++ b/src/main/java/electrosphere/entity/state/equip/ClientToolbarState.java @@ -15,7 +15,7 @@ import java.util.List; import electrosphere.client.ui.menu.ingame.ToolbarPreviewWindow; import electrosphere.collision.PhysicsEntityUtils; import electrosphere.controls.cursor.CursorState; -import electrosphere.data.block.BlockFab; +import electrosphere.data.block.fab.BlockFab; import electrosphere.data.common.treedata.TreeDataAnimation; import electrosphere.data.creature.equip.EquipPoint; import electrosphere.data.creature.equip.ToolbarData; diff --git a/src/main/java/electrosphere/server/ai/nodes/checks/spatial/BeginStructureNode.java b/src/main/java/electrosphere/server/ai/nodes/checks/spatial/BeginStructureNode.java index 7b0ab466..70aa0eff 100644 --- a/src/main/java/electrosphere/server/ai/nodes/checks/spatial/BeginStructureNode.java +++ b/src/main/java/electrosphere/server/ai/nodes/checks/spatial/BeginStructureNode.java @@ -2,7 +2,7 @@ package electrosphere.server.ai.nodes.checks.spatial; import org.joml.Vector3d; -import electrosphere.data.block.BlockFab; +import electrosphere.data.block.fab.BlockFab; import electrosphere.data.struct.StructureData; import electrosphere.engine.Globals; import electrosphere.entity.Entity; diff --git a/src/main/java/electrosphere/server/ai/nodes/solvers/SolveBuildMaterialNode.java b/src/main/java/electrosphere/server/ai/nodes/solvers/SolveBuildMaterialNode.java index fdda698b..b6e7784f 100644 --- a/src/main/java/electrosphere/server/ai/nodes/solvers/SolveBuildMaterialNode.java +++ b/src/main/java/electrosphere/server/ai/nodes/solvers/SolveBuildMaterialNode.java @@ -4,8 +4,8 @@ import org.joml.Vector3d; import org.joml.Vector3i; import electrosphere.client.block.BlockChunkData; -import electrosphere.data.block.BlockFab; import electrosphere.data.block.BlockType; +import electrosphere.data.block.fab.BlockFab; import electrosphere.data.item.Item; import electrosphere.engine.Globals; import electrosphere.entity.Entity; diff --git a/src/main/java/electrosphere/server/macro/MacroDataLoader.java b/src/main/java/electrosphere/server/macro/MacroDataLoader.java index cf418366..f916a429 100644 --- a/src/main/java/electrosphere/server/macro/MacroDataLoader.java +++ b/src/main/java/electrosphere/server/macro/MacroDataLoader.java @@ -2,7 +2,7 @@ package electrosphere.server.macro; import java.io.File; -import electrosphere.data.block.BlockFab; +import electrosphere.data.block.fab.BlockFab; import electrosphere.server.macro.structure.Structure; import electrosphere.util.FileUtils; diff --git a/src/main/java/electrosphere/server/macro/structure/Structure.java b/src/main/java/electrosphere/server/macro/structure/Structure.java index 011729ca..3d464968 100644 --- a/src/main/java/electrosphere/server/macro/structure/Structure.java +++ b/src/main/java/electrosphere/server/macro/structure/Structure.java @@ -3,7 +3,7 @@ package electrosphere.server.macro.structure; import org.joml.AABBd; import org.joml.Vector3d; -import electrosphere.data.block.BlockFab; +import electrosphere.data.block.fab.BlockFab; import electrosphere.data.struct.StructureData; import electrosphere.server.macro.MacroData; import electrosphere.server.macro.spatial.MacroAreaObject; diff --git a/src/main/java/electrosphere/server/macro/utils/StructureRepairUtils.java b/src/main/java/electrosphere/server/macro/utils/StructureRepairUtils.java index c54db55b..b042a1b2 100644 --- a/src/main/java/electrosphere/server/macro/utils/StructureRepairUtils.java +++ b/src/main/java/electrosphere/server/macro/utils/StructureRepairUtils.java @@ -4,8 +4,8 @@ import org.joml.Vector3d; import org.joml.Vector3i; import electrosphere.client.block.BlockChunkData; -import electrosphere.data.block.BlockFab; import electrosphere.data.block.BlockType; +import electrosphere.data.block.fab.BlockFab; import electrosphere.data.item.Item; import electrosphere.engine.Globals; import electrosphere.server.datacell.Realm; diff --git a/src/main/java/electrosphere/server/physics/block/editing/ServerBlockEditing.java b/src/main/java/electrosphere/server/physics/block/editing/ServerBlockEditing.java index 2826d964..6a20ba64 100644 --- a/src/main/java/electrosphere/server/physics/block/editing/ServerBlockEditing.java +++ b/src/main/java/electrosphere/server/physics/block/editing/ServerBlockEditing.java @@ -10,7 +10,7 @@ import org.joml.Vector4f; import electrosphere.client.block.BlockChunkData; import electrosphere.controls.cursor.CursorState; -import electrosphere.data.block.BlockFab; +import electrosphere.data.block.fab.BlockFab; import electrosphere.server.datacell.Realm; import electrosphere.server.datacell.interfaces.VoxelCellManager; diff --git a/src/main/java/electrosphere/server/simulation/chara/CharaSimulation.java b/src/main/java/electrosphere/server/simulation/chara/CharaSimulation.java index 27696c4c..f5424fbb 100644 --- a/src/main/java/electrosphere/server/simulation/chara/CharaSimulation.java +++ b/src/main/java/electrosphere/server/simulation/chara/CharaSimulation.java @@ -2,7 +2,7 @@ package electrosphere.server.simulation.chara; import org.joml.Vector3d; -import electrosphere.data.block.BlockFab; +import electrosphere.data.block.fab.BlockFab; import electrosphere.data.struct.StructureData; import electrosphere.engine.Globals; import electrosphere.server.datacell.Realm;