From a895289eb201029fceaa520a1dfe603c829c4b99 Mon Sep 17 00:00:00 2001 From: austin Date: Sat, 28 Jan 2023 22:23:01 -0500 Subject: [PATCH] Refactoring parts of code --- .vscode/launch.json | 6 +++--- assets/Scenes/testscene1/testscene1.json | 11 ----------- pom.xml | 10 +++++----- src/main/java/electrosphere/audio/AudioUtils.java | 2 +- .../electrosphere/auth/AuthenticationManager.java | 6 +++--- .../electrosphere/controls/CameraHandler.java | 4 ++-- .../electrosphere/controls/ControlHandler.java | 4 ++-- .../electrosphere/{main => engine}/Globals.java | 15 +++++++-------- .../java/electrosphere/engine/LoadingThread.java | 9 ++++----- .../java/electrosphere/{main => engine}/Main.java | 3 +-- .../java/electrosphere/engine/cli/CLIParser.java | 2 +- src/main/java/electrosphere/entity/Entity.java | 3 ++- .../java/electrosphere/entity/EntityManager.java | 3 ++- .../java/electrosphere/entity/EntityUtils.java | 4 ++-- .../electrosphere/entity/scene/SceneLoader.java | 11 +++++++++-- .../java/electrosphere/entity/state/IdleTree.java | 2 +- .../electrosphere/entity/state/ParticleTree.java | 3 ++- .../entity/state/attack/AttackTree.java | 4 ++-- .../entity/state/collidable/CollidableTree.java | 2 +- .../entity/state/equip/EquipState.java | 4 ++-- .../entity/state/gravity/GravityTree.java | 2 +- .../entity/state/inventory/InventoryState.java | 2 +- .../entity/state/inventory/InventoryUtils.java | 4 ++-- .../entity/state/ironsight/IronSightTree.java | 2 +- .../entity/state/life/LifeState.java | 4 ++-- .../state/movement/AirplaneMovementTree.java | 4 ++-- .../entity/state/movement/GroundMovementTree.java | 4 ++-- .../entity/state/movement/ProjectileTree.java | 2 +- .../entity/state/rotator/RotatorTree.java | 2 +- .../entity/types/attach/AttachUtils.java | 2 +- .../entity/types/camera/CameraEntityUtils.java | 3 ++- .../entity/types/collision/CollisionObjUtils.java | 2 +- .../entity/types/creature/CreatureUtils.java | 6 +++--- .../entity/types/foliage/FoliageUtils.java | 2 +- .../entity/types/hitbox/HitboxUtils.java | 2 +- .../entity/types/item/ItemUtils.java | 2 +- .../entity/types/object/ObjectUtils.java | 2 +- .../entity/types/particle/ParticleUtils.java | 3 ++- .../entity/types/projectile/ProjectileUtils.java | 2 +- .../entity/types/structure/StructureUtils.java | 2 +- .../game/client/ClientFunctions.java | 2 +- .../electrosphere/game/client/cells/DrawCell.java | 2 +- .../game/client/cells/DrawCellManager.java | 2 +- .../client/targeting/crosshair/Crosshair.java | 3 ++- .../game/client/world/ClientWorldData.java | 3 ++- .../game/collision/PhysicsUtils.java | 3 ++- .../electrosphere/game/config/UserSettings.java | 2 +- .../game/server/character/diety/Diety.java | 3 ++- .../structure/virtual/StructureManager.java | 8 +++++--- .../structure/virtual/VirtualStructureUtils.java | 2 +- .../terrain/manager/ServerTerrainManager.java | 2 +- .../java/electrosphere/game/server/town/Town.java | 5 +++-- .../electrosphere/game/server/unit/UnitUtils.java | 2 +- .../game/server/world/MacroData.java | 4 +++- .../game/server/world/ServerWorldData.java | 3 ++- .../java/electrosphere/menu/MenuCallbacks.java | 6 +++--- .../java/electrosphere/menu/MenuGenerators.java | 6 +++--- .../electrosphere/menu/MenuGeneratorsArena.java | 2 +- .../electrosphere/menu/MenuGeneratorsDebug.java | 2 +- .../menu/MenuGeneratorsInventory.java | 2 +- .../menu/MenuGeneratorsMultiplayer.java | 2 +- src/main/java/electrosphere/menu/WindowUtils.java | 2 +- .../net/client/ClientNetworking.java | 4 ++-- .../net/client/protocol/AuthProtocol.java | 2 +- .../net/client/protocol/CharacterProtocol.java | 2 +- .../net/client/protocol/ClientProtocol.java | 4 ++-- .../net/client/protocol/EntityProtocol.java | 4 ++-- .../net/client/protocol/InventoryProtocol.java | 2 +- .../net/client/protocol/LoreProtocol.java | 2 +- .../net/client/protocol/PlayerProtocol.java | 4 ++-- .../net/client/protocol/ServerProtocol.java | 2 +- .../net/client/protocol/TerrainProtocol.java | 2 +- .../java/electrosphere/net/server/Server.java | 7 ++++--- .../net/server/ServerConnectionHandler.java | 4 ++-- .../electrosphere/net/server/player/Player.java | 2 +- .../net/server/protocol/AuthProtocol.java | 2 +- .../net/server/protocol/CharacterProtocol.java | 4 ++-- .../net/server/protocol/EntityProtocol.java | 4 ++-- .../net/server/protocol/InventoryProtocol.java | 2 +- .../net/server/protocol/LoreProtocol.java | 2 +- .../net/server/protocol/ServerProtocol.java | 4 ++-- .../net/server/protocol/TerrainProtocol.java | 2 +- .../java/electrosphere/renderer/Material.java | 2 +- src/main/java/electrosphere/renderer/Mesh.java | 4 ++-- src/main/java/electrosphere/renderer/Model.java | 3 ++- .../java/electrosphere/renderer/ModelUtils.java | 2 +- .../java/electrosphere/renderer/RenderUtils.java | 2 +- .../electrosphere/renderer/RenderingEngine.java | 8 ++++---- .../electrosphere/renderer/ShaderProgram.java | 2 +- .../java/electrosphere/renderer/actor/Actor.java | 2 +- .../renderer/actor/ActorMeshMask.java | 2 +- .../electrosphere/renderer/actor/ActorUtils.java | 2 +- .../renderer/debug/DebugRendering.java | 2 +- .../renderer/framebuffer/FramebufferUtils.java | 2 +- .../renderer/light/LightEntityUtils.java | 3 ++- .../renderer/light/LightManager.java | 2 +- .../renderer/loading/ModelLoader.java | 4 ++-- .../electrosphere/renderer/texture/Texture.java | 2 +- .../electrosphere/renderer/ui/WidgetUtils.java | 2 +- .../java/electrosphere/renderer/ui/Window.java | 2 +- .../renderer/ui/elements/ActorPanel.java | 2 +- .../renderer/ui/elements/Button.java | 2 +- .../electrosphere/renderer/ui/elements/Div.java | 2 +- .../renderer/ui/elements/ImagePanel.java | 2 +- .../electrosphere/renderer/ui/elements/Label.java | 2 +- .../renderer/ui/elements/ScrollableContainer.java | 2 +- .../renderer/ui/elements/Slider.java | 2 +- .../renderer/ui/elements/TextBox.java | 2 +- .../renderer/ui/elements/TextInput.java | 2 +- .../electrosphere/renderer/ui/font/FontUtils.java | 2 +- .../ui/font/bitmapchar/BitmapCharacter.java | 2 +- .../ui/layout/LayoutSchemeListScrollable.java | 2 +- .../electrosphere/{game => }/server/ai/AI.java | 2 +- .../{game => }/server/ai/AIManager.java | 2 +- .../{game => }/server/ai/creature/MillAbout.java | 7 ++++--- .../server/ai/creature/MindlessAttacker.java | 7 ++++--- .../server/ai/creature/OpportunisticAttacker.java | 6 +++--- .../server/datacell/DataCellManager.java | 14 ++++++++++++-- .../server/datacell/EnvironmentGenerator.java | 5 +++-- .../server/datacell/ServerDataCell.java | 8 ++++---- .../{game => }/server/db/DatabaseController.java | 2 +- .../{game => }/server/db/DatabaseResult.java | 2 +- .../server/db/DatabaseResultIterator.java | 2 +- .../{game => }/server/db/DatabaseResultRow.java | 2 +- .../{game => }/server/db/DatabaseUtils.java | 4 ++-- .../server/pathfinding/ChunkMeshList.java | 5 +++-- .../server/pathfinding/NavMeshManager.java | 13 +++++++------ .../server/pathfinding/NavMeshPathfinder.java | 11 ++++++----- .../server/pathfinding/NavMeshUtils.java | 13 +++++++------ .../server/pathfinding/blocker/NavBlocker.java | 4 ++-- .../blocker/NavTerrainBlockerCache.java | 2 +- .../server/pathfinding/navmesh/NavCube.java | 2 +- .../server/pathfinding/navmesh/NavMesh.java | 2 +- .../server/pathfinding/navmesh/NavShape.java | 2 +- .../server/pathfinding/path/Waypoint.java | 2 +- .../{game => }/server/saves/Save.java | 2 +- .../{game => }/server/saves/SaveUtils.java | 8 ++++---- .../simulation/MacroSimulation.java | 4 ++-- .../simulation/MicroSimulation.java | 6 +++--- src/main/java/electrosphere/util/FileUtils.java | 3 ++- src/main/java/electrosphere/util/Utilities.java | 5 +++-- .../util/worldviewer/TerrainViewer.java | 7 ++++--- src/test/java/testingutils/MainLoop.java | 2 +- 143 files changed, 275 insertions(+), 244 deletions(-) rename src/main/java/electrosphere/{main => engine}/Globals.java (97%) rename src/main/java/electrosphere/{main => engine}/Main.java (99%) rename src/main/java/electrosphere/{game => }/server/ai/AI.java (74%) rename src/main/java/electrosphere/{game => }/server/ai/AIManager.java (93%) rename src/main/java/electrosphere/{game => }/server/ai/creature/MillAbout.java (98%) rename src/main/java/electrosphere/{game => }/server/ai/creature/MindlessAttacker.java (96%) rename src/main/java/electrosphere/{game => }/server/ai/creature/OpportunisticAttacker.java (98%) rename src/main/java/electrosphere/{game => }/server/datacell/DataCellManager.java (96%) rename src/main/java/electrosphere/{game => }/server/datacell/EnvironmentGenerator.java (94%) rename src/main/java/electrosphere/{game => }/server/datacell/ServerDataCell.java (97%) rename src/main/java/electrosphere/{game => }/server/db/DatabaseController.java (99%) rename src/main/java/electrosphere/{game => }/server/db/DatabaseResult.java (98%) rename src/main/java/electrosphere/{game => }/server/db/DatabaseResultIterator.java (98%) rename src/main/java/electrosphere/{game => }/server/db/DatabaseResultRow.java (98%) rename src/main/java/electrosphere/{game => }/server/db/DatabaseUtils.java (97%) rename src/main/java/electrosphere/{game => }/server/pathfinding/ChunkMeshList.java (84%) rename src/main/java/electrosphere/{game => }/server/pathfinding/NavMeshManager.java (75%) rename src/main/java/electrosphere/{game => }/server/pathfinding/NavMeshPathfinder.java (98%) rename src/main/java/electrosphere/{game => }/server/pathfinding/NavMeshUtils.java (97%) rename src/main/java/electrosphere/{game => }/server/pathfinding/blocker/NavBlocker.java (88%) rename src/main/java/electrosphere/{game => }/server/pathfinding/blocker/NavTerrainBlockerCache.java (97%) rename src/main/java/electrosphere/{game => }/server/pathfinding/navmesh/NavCube.java (95%) rename src/main/java/electrosphere/{game => }/server/pathfinding/navmesh/NavMesh.java (94%) rename src/main/java/electrosphere/{game => }/server/pathfinding/navmesh/NavShape.java (84%) rename src/main/java/electrosphere/{game => }/server/pathfinding/path/Waypoint.java (76%) rename src/main/java/electrosphere/{game => }/server/saves/Save.java (85%) rename src/main/java/electrosphere/{game => }/server/saves/SaveUtils.java (95%) rename src/main/java/electrosphere/{game => server}/simulation/MacroSimulation.java (98%) rename src/main/java/electrosphere/{game => server}/simulation/MicroSimulation.java (98%) diff --git a/.vscode/launch.json b/.vscode/launch.json index 8b1dca84..084d7b2a 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -14,14 +14,14 @@ "type": "java", "name": "Launch Main", "request": "launch", - "mainClass": "electrosphere.main.Main", + "mainClass": "electrosphere.engine.Main", "projectName": "Renderer" }, { "type": "java", "name": "Launch Main (macos)", "request": "launch", - "mainClass": "electrosphere.main.Main", + "mainClass": "electrosphere.engine.Main", "projectName": "Renderer", "vmArgs": "-XstartOnFirstThread" }, @@ -29,7 +29,7 @@ "type": "java", "name": "Launch Main (Headless)", "request": "launch", - "mainClass": "electrosphere.main.Main", + "mainClass": "electrosphere.engine.Main", "projectName": "Renderer", "args" : "--headless" } diff --git a/assets/Scenes/testscene1/testscene1.json b/assets/Scenes/testscene1/testscene1.json index c7bbc97b..d6c7cd61 100644 --- a/assets/Scenes/testscene1/testscene1.json +++ b/assets/Scenes/testscene1/testscene1.json @@ -21,17 +21,6 @@ "rotY": 0, "rotZ": 0, "rotW": 0.7071068 - }, - { - "type": "creature", - "subtype": "fighter", - "posX": 2, - "posY": 1, - "posZ": 2, - "rotX": -0.7071068, - "rotY": 0, - "rotZ": 0, - "rotW": 0.7071068 } ], "scriptPaths": [ diff --git a/pom.xml b/pom.xml index 800f02c8..ff2eed68 100644 --- a/pom.xml +++ b/pom.xml @@ -241,7 +241,7 @@ - electrosphere.main.Main + electrosphere.engine.Main @@ -278,24 +278,24 @@ java false true - electrosphere.main.Main + electrosphere.engine.Main -cp target/classes;target/Renderer-0.1-jar-with-dependencies.jar - electrosphere.main.Main + electrosphere.engine.Main - + \ No newline at end of file diff --git a/src/main/java/electrosphere/audio/AudioUtils.java b/src/main/java/electrosphere/audio/AudioUtils.java index 904142ab..a4a928c9 100644 --- a/src/main/java/electrosphere/audio/AudioUtils.java +++ b/src/main/java/electrosphere/audio/AudioUtils.java @@ -1,7 +1,7 @@ package electrosphere.audio; +import electrosphere.engine.Globals; import electrosphere.logger.LoggerInterface; -import electrosphere.main.Globals; import electrosphere.util.FileUtils; import org.joml.Vector3f; diff --git a/src/main/java/electrosphere/auth/AuthenticationManager.java b/src/main/java/electrosphere/auth/AuthenticationManager.java index 503a6039..43df2ba8 100644 --- a/src/main/java/electrosphere/auth/AuthenticationManager.java +++ b/src/main/java/electrosphere/auth/AuthenticationManager.java @@ -9,10 +9,10 @@ import java.util.Base64; import javax.crypto.SecretKeyFactory; import javax.crypto.spec.PBEKeySpec; -import electrosphere.game.server.db.DatabaseResult; -import electrosphere.game.server.db.DatabaseResultRow; +import electrosphere.engine.Globals; import electrosphere.logger.LoggerInterface; -import electrosphere.main.Globals; +import electrosphere.server.db.DatabaseResult; +import electrosphere.server.db.DatabaseResultRow; public class AuthenticationManager { diff --git a/src/main/java/electrosphere/controls/CameraHandler.java b/src/main/java/electrosphere/controls/CameraHandler.java index 30cabf6f..41fe3057 100644 --- a/src/main/java/electrosphere/controls/CameraHandler.java +++ b/src/main/java/electrosphere/controls/CameraHandler.java @@ -4,11 +4,11 @@ import org.joml.Quaternionf; import org.joml.Vector3d; import org.joml.Vector3f; +import electrosphere.engine.Globals; +import electrosphere.engine.Main; import electrosphere.entity.EntityUtils; import electrosphere.entity.types.camera.CameraEntityUtils; import electrosphere.game.client.targeting.crosshair.Crosshair; -import electrosphere.main.Globals; -import electrosphere.main.Main; import electrosphere.renderer.ui.events.MouseEvent; public class CameraHandler { diff --git a/src/main/java/electrosphere/controls/ControlHandler.java b/src/main/java/electrosphere/controls/ControlHandler.java index 9d3fa8f4..0d539489 100644 --- a/src/main/java/electrosphere/controls/ControlHandler.java +++ b/src/main/java/electrosphere/controls/ControlHandler.java @@ -74,6 +74,8 @@ import org.lwjgl.glfw.GLFW; import electrosphere.audio.AudioUtils; import electrosphere.controls.Control.ControlMethod; import electrosphere.controls.Control.ControlType; +import electrosphere.engine.Globals; +import electrosphere.engine.Main; import electrosphere.entity.Entity; import electrosphere.entity.state.BehaviorTree; import electrosphere.entity.state.attack.AttackTree; @@ -91,8 +93,6 @@ import electrosphere.entity.types.camera.CameraEntityUtils; import electrosphere.entity.types.creature.CreatureUtils; import electrosphere.game.client.targeting.crosshair.Crosshair; import electrosphere.logger.LoggerInterface; -import electrosphere.main.Globals; -import electrosphere.main.Main; import electrosphere.menu.MenuGenerators; import electrosphere.menu.MenuGeneratorsDebug; import electrosphere.menu.MenuGeneratorsInventory; diff --git a/src/main/java/electrosphere/main/Globals.java b/src/main/java/electrosphere/engine/Globals.java similarity index 97% rename from src/main/java/electrosphere/main/Globals.java rename to src/main/java/electrosphere/engine/Globals.java index b011704a..b7ebf63a 100644 --- a/src/main/java/electrosphere/main/Globals.java +++ b/src/main/java/electrosphere/engine/Globals.java @@ -1,4 +1,4 @@ -package electrosphere.main; +package electrosphere.engine; import java.util.ArrayList; import java.util.LinkedList; @@ -16,7 +16,6 @@ import electrosphere.controls.CameraHandler; import electrosphere.controls.ControlCallback; import electrosphere.controls.ControlHandler; import electrosphere.controls.MouseCallback; -import electrosphere.engine.LoadingThread; import electrosphere.engine.assetmanager.AssetDataStrings; import electrosphere.engine.assetmanager.AssetManager; import electrosphere.entity.Entity; @@ -29,16 +28,10 @@ import electrosphere.game.client.world.ClientWorldData; import electrosphere.game.collision.CollisionEngine; import electrosphere.game.collision.CommonWorldData; import electrosphere.game.config.UserSettings; -import electrosphere.game.server.ai.AIManager; -import electrosphere.game.server.datacell.DataCellManager; -import electrosphere.game.server.db.DatabaseController; -import electrosphere.game.server.pathfinding.NavMeshManager; import electrosphere.game.server.structure.virtual.StructureManager; import electrosphere.game.server.terrain.manager.ServerTerrainManager; import electrosphere.game.server.world.MacroData; import electrosphere.game.server.world.ServerWorldData; -import electrosphere.game.simulation.MacroSimulation; -import electrosphere.game.simulation.MicroSimulation; import electrosphere.logger.LoggerInterface; import electrosphere.menu.WindowUtils; import electrosphere.net.client.ClientNetworking; @@ -59,6 +52,12 @@ import electrosphere.renderer.ui.elements.ImagePanel; import electrosphere.renderer.ui.font.FontUtils; import electrosphere.renderer.ui.font.RawFontMap; import electrosphere.script.ScriptEngine; +import electrosphere.server.ai.AIManager; +import electrosphere.server.datacell.DataCellManager; +import electrosphere.server.db.DatabaseController; +import electrosphere.server.pathfinding.NavMeshManager; +import electrosphere.server.simulation.MacroSimulation; +import electrosphere.server.simulation.MicroSimulation; import electrosphere.util.FileUtils; /** diff --git a/src/main/java/electrosphere/engine/LoadingThread.java b/src/main/java/electrosphere/engine/LoadingThread.java index b7cd334c..82cec775 100644 --- a/src/main/java/electrosphere/engine/LoadingThread.java +++ b/src/main/java/electrosphere/engine/LoadingThread.java @@ -29,16 +29,11 @@ import electrosphere.game.client.terrain.manager.ClientTerrainManager; import electrosphere.game.collision.CommonWorldData; import electrosphere.game.data.creature.type.CreatureType; import electrosphere.game.data.creature.type.visualattribute.VisualAttribute; -import electrosphere.game.server.datacell.DataCellManager; -import electrosphere.game.server.saves.SaveUtils; import electrosphere.game.server.terrain.manager.ServerTerrainManager; import electrosphere.game.server.town.Town; import electrosphere.game.server.world.MacroData; import electrosphere.game.server.world.ServerWorldData; -import electrosphere.game.simulation.MacroSimulation; -import electrosphere.game.simulation.MicroSimulation; import electrosphere.logger.LoggerInterface; -import electrosphere.main.Globals; import electrosphere.menu.MenuGenerators; import electrosphere.menu.MenuGeneratorsMultiplayer; import electrosphere.menu.WindowStrings; @@ -48,6 +43,10 @@ import electrosphere.net.client.ClientNetworking; import electrosphere.net.server.Server; import electrosphere.net.server.player.Player; import electrosphere.renderer.ui.Window; +import electrosphere.server.datacell.DataCellManager; +import electrosphere.server.saves.SaveUtils; +import electrosphere.server.simulation.MacroSimulation; +import electrosphere.server.simulation.MicroSimulation; import electrosphere.util.FileUtils; /** diff --git a/src/main/java/electrosphere/main/Main.java b/src/main/java/electrosphere/engine/Main.java similarity index 99% rename from src/main/java/electrosphere/main/Main.java rename to src/main/java/electrosphere/engine/Main.java index ad370ea7..a0adaefc 100644 --- a/src/main/java/electrosphere/main/Main.java +++ b/src/main/java/electrosphere/engine/Main.java @@ -1,4 +1,4 @@ -package electrosphere.main; +package electrosphere.engine; import static org.lwjgl.glfw.GLFW.glfwGetTime; import static org.lwjgl.glfw.GLFW.glfwTerminate; @@ -8,7 +8,6 @@ import java.util.concurrent.TimeUnit; import electrosphere.audio.AudioEngine; import electrosphere.controls.ControlHandler; -import electrosphere.engine.LoadingThread; import electrosphere.engine.cli.CLIParser; import electrosphere.game.client.ClientFunctions; import electrosphere.game.config.UserSettings; diff --git a/src/main/java/electrosphere/engine/cli/CLIParser.java b/src/main/java/electrosphere/engine/cli/CLIParser.java index 3994437a..9a309f38 100644 --- a/src/main/java/electrosphere/engine/cli/CLIParser.java +++ b/src/main/java/electrosphere/engine/cli/CLIParser.java @@ -3,7 +3,7 @@ package electrosphere.engine.cli; import java.util.Arrays; import java.util.List; -import electrosphere.main.Globals; +import electrosphere.engine.Globals; public class CLIParser { diff --git a/src/main/java/electrosphere/entity/Entity.java b/src/main/java/electrosphere/entity/Entity.java index f447bbff..537467c9 100644 --- a/src/main/java/electrosphere/entity/Entity.java +++ b/src/main/java/electrosphere/entity/Entity.java @@ -1,10 +1,11 @@ package electrosphere.entity; -import electrosphere.main.Globals; import java.util.HashMap; import java.util.LinkedList; import java.util.List; +import electrosphere.engine.Globals; + /** * * @author amaterasu diff --git a/src/main/java/electrosphere/entity/EntityManager.java b/src/main/java/electrosphere/entity/EntityManager.java index de4b60fa..da28c15a 100644 --- a/src/main/java/electrosphere/entity/EntityManager.java +++ b/src/main/java/electrosphere/entity/EntityManager.java @@ -1,9 +1,10 @@ package electrosphere.entity; +import electrosphere.engine.Globals; import electrosphere.entity.state.BehaviorTree; import electrosphere.entity.types.attach.AttachUtils; import electrosphere.logger.LoggerInterface; -import electrosphere.main.Globals; + import java.util.Iterator; import java.util.List; import java.util.Map; diff --git a/src/main/java/electrosphere/entity/EntityUtils.java b/src/main/java/electrosphere/entity/EntityUtils.java index ef63dffe..650061a3 100644 --- a/src/main/java/electrosphere/entity/EntityUtils.java +++ b/src/main/java/electrosphere/entity/EntityUtils.java @@ -5,16 +5,16 @@ */ package electrosphere.entity; +import electrosphere.engine.Globals; import electrosphere.entity.state.collidable.CollidableTree; import electrosphere.entity.state.movement.GroundMovementTree; import electrosphere.entity.types.collision.CollisionObjUtils; import electrosphere.entity.types.creature.CreatureUtils; import electrosphere.entity.types.item.ItemUtils; -import electrosphere.game.server.datacell.ServerDataCell; import electrosphere.renderer.Model; import electrosphere.renderer.actor.Actor; import electrosphere.renderer.actor.ActorUtils; -import electrosphere.main.Globals; +import electrosphere.server.datacell.ServerDataCell; import org.joml.Quaternionf; import org.joml.Vector3d; diff --git a/src/main/java/electrosphere/entity/scene/SceneLoader.java b/src/main/java/electrosphere/entity/scene/SceneLoader.java index b5e1c34a..1885f8f9 100644 --- a/src/main/java/electrosphere/entity/scene/SceneLoader.java +++ b/src/main/java/electrosphere/entity/scene/SceneLoader.java @@ -1,11 +1,12 @@ package electrosphere.entity.scene; +import electrosphere.engine.Globals; import electrosphere.entity.Entity; import electrosphere.entity.EntityUtils; import electrosphere.entity.types.creature.CreatureUtils; import electrosphere.entity.types.item.ItemUtils; import electrosphere.entity.types.object.ObjectUtils; -import electrosphere.main.Globals; +import electrosphere.server.datacell.ServerDataCell; import electrosphere.util.FileUtils; /** @@ -17,7 +18,8 @@ public class SceneLoader { * Loads a scene file on the server * @param path The path in the assets directory to a scene file */ - public void serverInstantiateSceneFile(String path){ + public ServerDataCell serverInstantiateSceneFile(String path){ + ServerDataCell rVal = Globals.dataCellManager.createNewCell(); SceneFile file = FileUtils.loadObjectFromAssetPath(path, SceneFile.class); //spawn initial entities for(EntityDescriptor descriptor : file.getEntities()){ @@ -28,18 +30,21 @@ public class SceneLoader { Entity newEntity = CreatureUtils.spawnBasicCreature(descriptor.subtype, null); EntityUtils.getPosition(newEntity).set(descriptor.posX,descriptor.posY,descriptor.posZ); EntityUtils.getRotation(newEntity).set((float)descriptor.rotX, (float)descriptor.rotY, (float)descriptor.rotZ, (float)descriptor.rotW); + rVal.initializeEntityForNewPlayers(newEntity, rVal); } break; case EntityDescriptor.TYPE_ITEM: { Entity newEntity = ItemUtils.spawnBasicItem(descriptor.subtype); EntityUtils.getPosition(newEntity).set(descriptor.posX,descriptor.posY,descriptor.posZ); EntityUtils.getRotation(newEntity).set((float)descriptor.rotX, (float)descriptor.rotY, (float)descriptor.rotZ, (float)descriptor.rotW); + rVal.initializeEntityForNewPlayers(newEntity, rVal); } break; case EntityDescriptor.TYPE_OBJECT: { Entity newEntity = ObjectUtils.spawnBasicObject(descriptor.subtype); EntityUtils.getPosition(newEntity).set(descriptor.posX,descriptor.posY,descriptor.posZ); EntityUtils.getRotation(newEntity).set((float)descriptor.rotX, (float)descriptor.rotY, (float)descriptor.rotZ, (float)descriptor.rotW); + rVal.initializeEntityForNewPlayers(newEntity, rVal); } break; default: throw new UnsupportedOperationException(); @@ -50,6 +55,8 @@ public class SceneLoader { Globals.scriptEngine.loadScript(scriptPath); } Globals.scriptEngine.runScript(file.getInitScriptPath()); + + return rVal; } } diff --git a/src/main/java/electrosphere/entity/state/IdleTree.java b/src/main/java/electrosphere/entity/state/IdleTree.java index b53072e6..abab765f 100644 --- a/src/main/java/electrosphere/entity/state/IdleTree.java +++ b/src/main/java/electrosphere/entity/state/IdleTree.java @@ -4,12 +4,12 @@ import electrosphere.entity.state.attack.AttackTree; import electrosphere.entity.state.attack.AttackTree.AttackTreeState; import electrosphere.entity.state.movement.AirplaneMovementTree; import electrosphere.entity.state.movement.GroundMovementTree; +import electrosphere.engine.Globals; import electrosphere.entity.Entity; import electrosphere.entity.EntityDataStrings; import electrosphere.entity.EntityUtils; import electrosphere.entity.state.movement.GroundMovementTree.MovementTreeState; import electrosphere.entity.types.creature.CreatureUtils; -import electrosphere.main.Globals; import electrosphere.net.parser.net.message.EntityMessage; import electrosphere.renderer.actor.Actor; import electrosphere.renderer.anim.Animation; diff --git a/src/main/java/electrosphere/entity/state/ParticleTree.java b/src/main/java/electrosphere/entity/state/ParticleTree.java index 0ab02fda..65d2f0bb 100644 --- a/src/main/java/electrosphere/entity/state/ParticleTree.java +++ b/src/main/java/electrosphere/entity/state/ParticleTree.java @@ -1,8 +1,9 @@ package electrosphere.entity.state; +import electrosphere.engine.Globals; import electrosphere.entity.Entity; import electrosphere.entity.EntityUtils; -import electrosphere.main.Globals; + import org.joml.Vector3d; import org.joml.Vector3f; diff --git a/src/main/java/electrosphere/entity/state/attack/AttackTree.java b/src/main/java/electrosphere/entity/state/attack/AttackTree.java index b5860f69..d71a77c6 100644 --- a/src/main/java/electrosphere/entity/state/attack/AttackTree.java +++ b/src/main/java/electrosphere/entity/state/attack/AttackTree.java @@ -1,5 +1,7 @@ package electrosphere.entity.state.attack; +import electrosphere.engine.Globals; +import electrosphere.engine.Main; import electrosphere.entity.Entity; import electrosphere.entity.EntityDataStrings; import electrosphere.entity.EntityUtils; @@ -17,8 +19,6 @@ import electrosphere.entity.types.projectile.ProjectileUtils; import electrosphere.game.collision.collidable.Collidable; import electrosphere.game.data.creature.type.attack.AttackMove; import electrosphere.game.data.creature.type.equip.EquipPoint; -import electrosphere.main.Globals; -import electrosphere.main.Main; import electrosphere.net.parser.net.message.EntityMessage; import electrosphere.renderer.actor.Actor; import electrosphere.renderer.anim.Animation; diff --git a/src/main/java/electrosphere/entity/state/collidable/CollidableTree.java b/src/main/java/electrosphere/entity/state/collidable/CollidableTree.java index b75b0db8..6ee2aff2 100644 --- a/src/main/java/electrosphere/entity/state/collidable/CollidableTree.java +++ b/src/main/java/electrosphere/entity/state/collidable/CollidableTree.java @@ -1,6 +1,7 @@ package electrosphere.entity.state.collidable; import electrosphere.collision.dispatch.CollisionObject; +import electrosphere.engine.Globals; import electrosphere.entity.Entity; import electrosphere.entity.EntityDataStrings; import electrosphere.entity.EntityUtils; @@ -12,7 +13,6 @@ import electrosphere.entity.types.item.ItemUtils; import electrosphere.game.collision.PhysicsUtils; import electrosphere.game.collision.collidable.Collidable; import electrosphere.game.data.creature.type.CollidableTemplate; -import electrosphere.main.Globals; import org.joml.Matrix4f; import org.joml.Quaterniond; diff --git a/src/main/java/electrosphere/entity/state/equip/EquipState.java b/src/main/java/electrosphere/entity/state/equip/EquipState.java index 53664493..295e2b73 100644 --- a/src/main/java/electrosphere/entity/state/equip/EquipState.java +++ b/src/main/java/electrosphere/entity/state/equip/EquipState.java @@ -9,6 +9,7 @@ import org.joml.Vector3d; import electrosphere.collision.dispatch.CollisionObject; import electrosphere.dynamics.RigidBody; +import electrosphere.engine.Globals; import electrosphere.entity.Entity; import electrosphere.entity.EntityDataStrings; import electrosphere.entity.EntityUtils; @@ -23,14 +24,13 @@ import electrosphere.game.client.targeting.crosshair.Crosshair; import electrosphere.game.collision.collidable.Collidable; import electrosphere.game.data.creature.type.equip.EquipPoint; import electrosphere.game.data.item.type.EquipWhitelist; -import electrosphere.game.server.datacell.ServerDataCell; -import electrosphere.main.Globals; import electrosphere.net.parser.net.message.InventoryMessage; import electrosphere.net.parser.net.message.NetworkMessage; import electrosphere.net.server.player.Player; import electrosphere.net.server.protocol.InventoryProtocol; import electrosphere.renderer.actor.Actor; import electrosphere.renderer.actor.ActorMeshMask; +import electrosphere.server.datacell.ServerDataCell; /** * diff --git a/src/main/java/electrosphere/entity/state/gravity/GravityTree.java b/src/main/java/electrosphere/entity/state/gravity/GravityTree.java index 425bfd22..b770f87e 100644 --- a/src/main/java/electrosphere/entity/state/gravity/GravityTree.java +++ b/src/main/java/electrosphere/entity/state/gravity/GravityTree.java @@ -8,6 +8,7 @@ import org.joml.Vector3d; import org.joml.Vector3f; import electrosphere.collision.dispatch.CollisionObject; +import electrosphere.engine.Globals; import electrosphere.entity.Entity; import electrosphere.entity.EntityUtils; import electrosphere.entity.state.collidable.CollidableTree; @@ -15,7 +16,6 @@ import electrosphere.entity.state.collidable.Impulse; import electrosphere.entity.state.movement.FallTree; import electrosphere.entity.state.movement.JumpTree; import electrosphere.game.collision.collidable.Collidable; -import electrosphere.main.Globals; import electrosphere.net.parser.net.message.EntityMessage; /** diff --git a/src/main/java/electrosphere/entity/state/inventory/InventoryState.java b/src/main/java/electrosphere/entity/state/inventory/InventoryState.java index fc647791..fec66909 100644 --- a/src/main/java/electrosphere/entity/state/inventory/InventoryState.java +++ b/src/main/java/electrosphere/entity/state/inventory/InventoryState.java @@ -2,12 +2,12 @@ package electrosphere.entity.state.inventory; import java.util.concurrent.CopyOnWriteArrayList; +import electrosphere.engine.Globals; import electrosphere.entity.Entity; import electrosphere.entity.state.BehaviorTree; import electrosphere.entity.state.equip.EquipState; import electrosphere.entity.types.item.ItemUtils; import electrosphere.game.data.creature.type.equip.EquipPoint; -import electrosphere.main.Globals; import electrosphere.menu.WindowStrings; import electrosphere.menu.WindowUtils; import electrosphere.net.parser.net.message.InventoryMessage; diff --git a/src/main/java/electrosphere/entity/state/inventory/InventoryUtils.java b/src/main/java/electrosphere/entity/state/inventory/InventoryUtils.java index 63c95961..10f3c05b 100644 --- a/src/main/java/electrosphere/entity/state/inventory/InventoryUtils.java +++ b/src/main/java/electrosphere/entity/state/inventory/InventoryUtils.java @@ -3,6 +3,7 @@ package electrosphere.entity.state.inventory; import org.joml.Vector3d; import org.joml.Vector3f; +import electrosphere.engine.Globals; import electrosphere.entity.Entity; import electrosphere.entity.EntityDataStrings; import electrosphere.entity.EntityUtils; @@ -10,12 +11,11 @@ import electrosphere.entity.state.equip.EquipState; import electrosphere.entity.state.gravity.GravityUtils; import electrosphere.entity.types.creature.CreatureUtils; import electrosphere.entity.types.item.ItemUtils; -import electrosphere.game.server.datacell.ServerDataCell; -import electrosphere.main.Globals; import electrosphere.net.parser.net.message.EntityMessage; import electrosphere.net.parser.net.message.InventoryMessage; import electrosphere.net.parser.net.message.NetworkMessage; import electrosphere.net.server.player.Player; +import electrosphere.server.datacell.ServerDataCell; import electrosphere.util.Utilities; public class InventoryUtils { diff --git a/src/main/java/electrosphere/entity/state/ironsight/IronSightTree.java b/src/main/java/electrosphere/entity/state/ironsight/IronSightTree.java index b73f94df..26d9bd26 100644 --- a/src/main/java/electrosphere/entity/state/ironsight/IronSightTree.java +++ b/src/main/java/electrosphere/entity/state/ironsight/IronSightTree.java @@ -2,11 +2,11 @@ package electrosphere.entity.state.ironsight; import org.joml.Vector3f; +import electrosphere.engine.Globals; import electrosphere.entity.Entity; import electrosphere.entity.EntityDataStrings; import electrosphere.entity.state.BehaviorTree; import electrosphere.entity.types.camera.CameraEntityUtils; -import electrosphere.main.Globals; public class IronSightTree implements BehaviorTree { diff --git a/src/main/java/electrosphere/entity/state/life/LifeState.java b/src/main/java/electrosphere/entity/state/life/LifeState.java index c815a80d..5e13d3d5 100644 --- a/src/main/java/electrosphere/entity/state/life/LifeState.java +++ b/src/main/java/electrosphere/entity/state/life/LifeState.java @@ -4,14 +4,14 @@ import java.util.concurrent.CopyOnWriteArrayList; import org.joml.Vector3d; +import electrosphere.engine.Globals; +import electrosphere.engine.Main; import electrosphere.entity.Entity; import electrosphere.entity.EntityUtils; import electrosphere.entity.state.BehaviorTree; import electrosphere.entity.types.creature.CreatureUtils; import electrosphere.game.data.creature.type.CreatureType; import electrosphere.game.data.creature.type.HealthSystem; -import electrosphere.main.Globals; -import electrosphere.main.Main; import electrosphere.net.parser.net.message.CharacterMessage; import electrosphere.net.parser.net.message.EntityMessage; import electrosphere.renderer.actor.Actor; diff --git a/src/main/java/electrosphere/entity/state/movement/AirplaneMovementTree.java b/src/main/java/electrosphere/entity/state/movement/AirplaneMovementTree.java index c46f3d6f..9e593d44 100644 --- a/src/main/java/electrosphere/entity/state/movement/AirplaneMovementTree.java +++ b/src/main/java/electrosphere/entity/state/movement/AirplaneMovementTree.java @@ -6,6 +6,8 @@ import org.joml.Quaternionf; import org.joml.Vector3d; import org.joml.Vector3f; +import electrosphere.engine.Globals; +import electrosphere.engine.Main; import electrosphere.entity.Entity; import electrosphere.entity.EntityUtils; import electrosphere.entity.state.BehaviorTree; @@ -13,8 +15,6 @@ import electrosphere.entity.state.collidable.Impulse; import electrosphere.entity.types.camera.CameraEntityUtils; import electrosphere.entity.types.creature.CreatureUtils; import electrosphere.game.collision.collidable.Collidable; -import electrosphere.main.Globals; -import electrosphere.main.Main; import electrosphere.net.parser.net.message.EntityMessage; import electrosphere.renderer.actor.Actor; import electrosphere.renderer.anim.Animation; diff --git a/src/main/java/electrosphere/entity/state/movement/GroundMovementTree.java b/src/main/java/electrosphere/entity/state/movement/GroundMovementTree.java index 98eff05f..bd540ad7 100644 --- a/src/main/java/electrosphere/entity/state/movement/GroundMovementTree.java +++ b/src/main/java/electrosphere/entity/state/movement/GroundMovementTree.java @@ -5,6 +5,8 @@ import electrosphere.entity.state.gravity.GravityTree; import electrosphere.entity.state.gravity.GravityUtils; import electrosphere.collision.dispatch.CollisionObject; import electrosphere.dynamics.RigidBody; +import electrosphere.engine.Globals; +import electrosphere.engine.Main; import electrosphere.entity.types.camera.CameraEntityUtils; import electrosphere.entity.types.creature.CreatureUtils; import electrosphere.entity.Entity; @@ -17,8 +19,6 @@ import electrosphere.entity.state.movement.SprintTree.SprintTreeState; import electrosphere.game.collision.CollisionEngine; import electrosphere.game.collision.PhysicsUtils; import electrosphere.game.collision.collidable.Collidable; -import electrosphere.main.Globals; -import electrosphere.main.Main; import electrosphere.net.NetUtils; import electrosphere.net.parser.net.message.EntityMessage; import electrosphere.renderer.anim.Animation; diff --git a/src/main/java/electrosphere/entity/state/movement/ProjectileTree.java b/src/main/java/electrosphere/entity/state/movement/ProjectileTree.java index 24a79eec..b9b5de88 100644 --- a/src/main/java/electrosphere/entity/state/movement/ProjectileTree.java +++ b/src/main/java/electrosphere/entity/state/movement/ProjectileTree.java @@ -3,11 +3,11 @@ package electrosphere.entity.state.movement; import org.joml.Vector3d; import org.joml.Vector3f; +import electrosphere.engine.Globals; import electrosphere.entity.Entity; import electrosphere.entity.EntityDataStrings; import electrosphere.entity.EntityUtils; import electrosphere.entity.state.BehaviorTree; -import electrosphere.main.Globals; public class ProjectileTree implements BehaviorTree { diff --git a/src/main/java/electrosphere/entity/state/rotator/RotatorTree.java b/src/main/java/electrosphere/entity/state/rotator/RotatorTree.java index 5615d02e..b6d76b02 100644 --- a/src/main/java/electrosphere/entity/state/rotator/RotatorTree.java +++ b/src/main/java/electrosphere/entity/state/rotator/RotatorTree.java @@ -7,13 +7,13 @@ import org.joml.Quaternionf; import org.joml.Vector3d; import org.joml.Vector3f; +import electrosphere.engine.Globals; import electrosphere.entity.Entity; import electrosphere.entity.EntityDataStrings; import electrosphere.entity.EntityUtils; import electrosphere.entity.state.BehaviorTree; import electrosphere.entity.state.view.ViewUtils; import electrosphere.entity.types.creature.CreatureUtils; -import electrosphere.main.Globals; import electrosphere.renderer.actor.Actor; import electrosphere.renderer.actor.ActorBoneRotator; diff --git a/src/main/java/electrosphere/entity/types/attach/AttachUtils.java b/src/main/java/electrosphere/entity/types/attach/AttachUtils.java index 4f524cd8..3c2d8134 100644 --- a/src/main/java/electrosphere/entity/types/attach/AttachUtils.java +++ b/src/main/java/electrosphere/entity/types/attach/AttachUtils.java @@ -1,10 +1,10 @@ package electrosphere.entity.types.attach; +import electrosphere.engine.Globals; import electrosphere.entity.Entity; import electrosphere.entity.EntityDataStrings; import electrosphere.entity.EntityUtils; import electrosphere.entity.types.creature.CreatureUtils; -import electrosphere.main.Globals; import electrosphere.renderer.Model; import electrosphere.renderer.actor.Actor; diff --git a/src/main/java/electrosphere/entity/types/camera/CameraEntityUtils.java b/src/main/java/electrosphere/entity/types/camera/CameraEntityUtils.java index 1ca6e8fa..6d847db2 100644 --- a/src/main/java/electrosphere/entity/types/camera/CameraEntityUtils.java +++ b/src/main/java/electrosphere/entity/types/camera/CameraEntityUtils.java @@ -1,10 +1,11 @@ package electrosphere.entity.types.camera; +import electrosphere.engine.Globals; import electrosphere.entity.Entity; import electrosphere.entity.EntityDataStrings; import electrosphere.entity.EntityUtils; import electrosphere.entity.state.BehaviorTree; -import electrosphere.main.Globals; + import org.joml.Matrix4f; import org.joml.Quaternionf; import org.joml.Vector3d; diff --git a/src/main/java/electrosphere/entity/types/collision/CollisionObjUtils.java b/src/main/java/electrosphere/entity/types/collision/CollisionObjUtils.java index ba35d57b..ab869950 100644 --- a/src/main/java/electrosphere/entity/types/collision/CollisionObjUtils.java +++ b/src/main/java/electrosphere/entity/types/collision/CollisionObjUtils.java @@ -2,13 +2,13 @@ package electrosphere.entity.types.collision; import electrosphere.collision.dispatch.CollisionObject; import electrosphere.collision.shapes.CylinderShape; +import electrosphere.engine.Globals; import electrosphere.entity.Entity; import electrosphere.entity.EntityDataStrings; import electrosphere.entity.EntityUtils; import electrosphere.entity.types.attach.AttachUtils; import electrosphere.game.collision.PhysicsUtils; import electrosphere.game.collision.collidable.Collidable; -import electrosphere.main.Globals; import org.joml.Matrix4f; import org.joml.Quaternionf; diff --git a/src/main/java/electrosphere/entity/types/creature/CreatureUtils.java b/src/main/java/electrosphere/entity/types/creature/CreatureUtils.java index befea8ec..2aa38fb9 100644 --- a/src/main/java/electrosphere/entity/types/creature/CreatureUtils.java +++ b/src/main/java/electrosphere/entity/types/creature/CreatureUtils.java @@ -2,6 +2,8 @@ package electrosphere.entity.types.creature; import electrosphere.collision.dispatch.CollisionObject; import electrosphere.dynamics.RigidBody; +import electrosphere.engine.Globals; +import electrosphere.engine.Main; import electrosphere.entity.Entity; import electrosphere.entity.EntityDataStrings; import electrosphere.entity.EntityUtils; @@ -44,10 +46,7 @@ import electrosphere.game.data.creature.type.rotator.RotatorItem; import electrosphere.game.data.creature.type.rotator.RotatorSystem; import electrosphere.game.data.creature.type.visualattribute.AttributeVariant; import electrosphere.game.data.creature.type.visualattribute.VisualAttribute; -import electrosphere.game.server.datacell.ServerDataCell; import electrosphere.logger.LoggerInterface; -import electrosphere.main.Globals; -import electrosphere.main.Main; import electrosphere.net.NetUtils; import electrosphere.net.parser.net.message.EntityMessage; import electrosphere.net.parser.net.message.NetworkMessage; @@ -59,6 +58,7 @@ import electrosphere.renderer.actor.ActorStaticMorph; import electrosphere.renderer.actor.ActorUtils; import electrosphere.renderer.light.PointLight; import electrosphere.renderer.loading.ModelLoader; +import electrosphere.server.datacell.ServerDataCell; import electrosphere.util.Utilities; import java.util.LinkedList; diff --git a/src/main/java/electrosphere/entity/types/foliage/FoliageUtils.java b/src/main/java/electrosphere/entity/types/foliage/FoliageUtils.java index 4e61d887..7fa3d6a3 100644 --- a/src/main/java/electrosphere/entity/types/foliage/FoliageUtils.java +++ b/src/main/java/electrosphere/entity/types/foliage/FoliageUtils.java @@ -1,6 +1,7 @@ package electrosphere.entity.types.foliage; import electrosphere.collision.dispatch.CollisionObject; +import electrosphere.engine.Globals; import electrosphere.entity.Entity; import electrosphere.entity.EntityDataStrings; import electrosphere.entity.EntityUtils; @@ -10,7 +11,6 @@ import electrosphere.game.collision.PhysicsUtils; import electrosphere.game.collision.collidable.Collidable; import electrosphere.game.data.foliage.type.FoliageType; import electrosphere.game.data.foliage.type.PhysicsObject; -import electrosphere.main.Globals; import electrosphere.renderer.actor.ActorUtils; import java.util.List; diff --git a/src/main/java/electrosphere/entity/types/hitbox/HitboxUtils.java b/src/main/java/electrosphere/entity/types/hitbox/HitboxUtils.java index a4ef13c1..e1866d16 100644 --- a/src/main/java/electrosphere/entity/types/hitbox/HitboxUtils.java +++ b/src/main/java/electrosphere/entity/types/hitbox/HitboxUtils.java @@ -1,5 +1,6 @@ package electrosphere.entity.types.hitbox; +import electrosphere.engine.Globals; import electrosphere.entity.Entity; import electrosphere.entity.EntityDataStrings; import electrosphere.entity.EntityUtils; @@ -11,7 +12,6 @@ import electrosphere.entity.state.life.LifeState; import electrosphere.entity.state.life.LifeUtils; import electrosphere.entity.state.movement.ProjectileTree; import electrosphere.game.server.effects.ParticleEffects; -import electrosphere.main.Globals; import java.util.List; diff --git a/src/main/java/electrosphere/entity/types/item/ItemUtils.java b/src/main/java/electrosphere/entity/types/item/ItemUtils.java index 054c8eaf..52c56582 100644 --- a/src/main/java/electrosphere/entity/types/item/ItemUtils.java +++ b/src/main/java/electrosphere/entity/types/item/ItemUtils.java @@ -1,6 +1,7 @@ package electrosphere.entity.types.item; import electrosphere.collision.dispatch.CollisionObject; +import electrosphere.engine.Globals; import electrosphere.entity.Entity; import electrosphere.entity.EntityDataStrings; import electrosphere.entity.EntityUtils; @@ -18,7 +19,6 @@ import electrosphere.game.data.creature.type.CreatureType; import electrosphere.game.data.item.type.EquipWhitelist; import electrosphere.game.data.item.type.Item; import electrosphere.game.data.item.type.WeaponData; -import electrosphere.main.Globals; import electrosphere.net.parser.net.message.EntityMessage; import electrosphere.net.parser.net.message.NetworkMessage; import electrosphere.net.server.player.Player; diff --git a/src/main/java/electrosphere/entity/types/object/ObjectUtils.java b/src/main/java/electrosphere/entity/types/object/ObjectUtils.java index f3eb567d..03ef9471 100644 --- a/src/main/java/electrosphere/entity/types/object/ObjectUtils.java +++ b/src/main/java/electrosphere/entity/types/object/ObjectUtils.java @@ -4,6 +4,7 @@ import org.joml.Matrix4f; import org.joml.Vector3f; import electrosphere.collision.dispatch.CollisionObject; +import electrosphere.engine.Globals; import electrosphere.entity.Entity; import electrosphere.entity.EntityDataStrings; import electrosphere.entity.EntityUtils; @@ -20,7 +21,6 @@ import electrosphere.game.collision.PhysicsUtils; import electrosphere.game.collision.collidable.Collidable; import electrosphere.game.data.creature.type.CollidableTemplate; import electrosphere.game.data.object.type.ObjectData; -import electrosphere.main.Globals; import electrosphere.renderer.actor.Actor; import electrosphere.renderer.actor.ActorUtils; diff --git a/src/main/java/electrosphere/entity/types/particle/ParticleUtils.java b/src/main/java/electrosphere/entity/types/particle/ParticleUtils.java index fb5e118e..22370028 100644 --- a/src/main/java/electrosphere/entity/types/particle/ParticleUtils.java +++ b/src/main/java/electrosphere/entity/types/particle/ParticleUtils.java @@ -1,11 +1,12 @@ package electrosphere.entity.types.particle; +import electrosphere.engine.Globals; import electrosphere.entity.Entity; import electrosphere.entity.EntityDataStrings; import electrosphere.entity.EntityUtils; import electrosphere.entity.state.ParticleTree; import electrosphere.entity.types.camera.CameraEntityUtils; -import electrosphere.main.Globals; + import org.joml.AxisAngle4f; import org.joml.Matrix4f; import org.joml.Quaternionf; diff --git a/src/main/java/electrosphere/entity/types/projectile/ProjectileUtils.java b/src/main/java/electrosphere/entity/types/projectile/ProjectileUtils.java index 6e38de12..48d21cbd 100644 --- a/src/main/java/electrosphere/entity/types/projectile/ProjectileUtils.java +++ b/src/main/java/electrosphere/entity/types/projectile/ProjectileUtils.java @@ -9,13 +9,13 @@ import org.joml.Quaternionfc; import org.joml.Vector3d; import org.joml.Vector3f; +import electrosphere.engine.Globals; import electrosphere.entity.Entity; import electrosphere.entity.EntityUtils; import electrosphere.entity.state.movement.ProjectileTree; import electrosphere.entity.types.hitbox.HitboxUtils; import electrosphere.entity.types.hitbox.HitboxUtils.HitboxPositionCallback; import electrosphere.game.data.projectile.ProjectileType; -import electrosphere.main.Globals; public class ProjectileUtils { diff --git a/src/main/java/electrosphere/entity/types/structure/StructureUtils.java b/src/main/java/electrosphere/entity/types/structure/StructureUtils.java index 885db177..d83eb496 100644 --- a/src/main/java/electrosphere/entity/types/structure/StructureUtils.java +++ b/src/main/java/electrosphere/entity/types/structure/StructureUtils.java @@ -1,5 +1,6 @@ package electrosphere.entity.types.structure; +import electrosphere.engine.Globals; import electrosphere.entity.Entity; import electrosphere.entity.EntityDataStrings; import electrosphere.entity.EntityUtils; @@ -7,7 +8,6 @@ import electrosphere.entity.types.collision.CollisionObjUtils; import electrosphere.game.collision.collidable.Collidable; import electrosphere.game.data.structure.type.model.CollisionObjectTemplate; import electrosphere.game.data.structure.type.model.StructureType; -import electrosphere.main.Globals; import electrosphere.net.parser.net.message.EntityMessage; import electrosphere.net.parser.net.message.NetworkMessage; import electrosphere.net.server.player.Player; diff --git a/src/main/java/electrosphere/game/client/ClientFunctions.java b/src/main/java/electrosphere/game/client/ClientFunctions.java index 681fbeec..7e61f1c1 100644 --- a/src/main/java/electrosphere/game/client/ClientFunctions.java +++ b/src/main/java/electrosphere/game/client/ClientFunctions.java @@ -1,8 +1,8 @@ package electrosphere.game.client; +import electrosphere.engine.Globals; import electrosphere.entity.EntityUtils; import electrosphere.entity.types.camera.CameraEntityUtils; -import electrosphere.main.Globals; import org.joml.Vector3d; import org.joml.Vector3f; diff --git a/src/main/java/electrosphere/game/client/cells/DrawCell.java b/src/main/java/electrosphere/game/client/cells/DrawCell.java index ead7f130..5b6c162c 100644 --- a/src/main/java/electrosphere/game/client/cells/DrawCell.java +++ b/src/main/java/electrosphere/game/client/cells/DrawCell.java @@ -2,6 +2,7 @@ package electrosphere.game.client.cells; import electrosphere.collision.dispatch.CollisionObject; import electrosphere.dynamics.RigidBody; +import electrosphere.engine.Globals; import electrosphere.entity.Entity; import electrosphere.entity.EntityDataStrings; import electrosphere.entity.EntityUtils; @@ -9,7 +10,6 @@ import electrosphere.game.collision.PhysicsUtils; import electrosphere.game.collision.collidable.Collidable; import electrosphere.game.terrain.processing.TerrainInterpolator; import electrosphere.logger.LoggerInterface; -import electrosphere.main.Globals; import electrosphere.renderer.Mesh; import electrosphere.renderer.Model; import electrosphere.renderer.ModelUtils; diff --git a/src/main/java/electrosphere/game/client/cells/DrawCellManager.java b/src/main/java/electrosphere/game/client/cells/DrawCellManager.java index f98510e6..cc62a06f 100644 --- a/src/main/java/electrosphere/game/client/cells/DrawCellManager.java +++ b/src/main/java/electrosphere/game/client/cells/DrawCellManager.java @@ -1,11 +1,11 @@ package electrosphere.game.client.cells; +import electrosphere.engine.Globals; import electrosphere.game.client.terrain.manager.ClientTerrainManager; import electrosphere.game.server.terrain.manager.ServerTerrainManager; import electrosphere.game.terrain.processing.TerrainInterpolator; import electrosphere.game.client.world.ClientWorldData; import electrosphere.game.collision.CommonWorldData; -import electrosphere.main.Globals; import electrosphere.net.parser.net.message.TerrainMessage; import electrosphere.renderer.ShaderProgram; import java.util.Arrays; diff --git a/src/main/java/electrosphere/game/client/targeting/crosshair/Crosshair.java b/src/main/java/electrosphere/game/client/targeting/crosshair/Crosshair.java index 8c9983d1..a31d01d6 100644 --- a/src/main/java/electrosphere/game/client/targeting/crosshair/Crosshair.java +++ b/src/main/java/electrosphere/game/client/targeting/crosshair/Crosshair.java @@ -1,9 +1,10 @@ package electrosphere.game.client.targeting.crosshair; +import electrosphere.engine.Globals; import electrosphere.entity.Entity; import electrosphere.entity.EntityUtils; import electrosphere.entity.types.camera.CameraEntityUtils; -import electrosphere.main.Globals; + import org.joml.Vector3d; /** diff --git a/src/main/java/electrosphere/game/client/world/ClientWorldData.java b/src/main/java/electrosphere/game/client/world/ClientWorldData.java index 0e926a15..2d8b2e69 100644 --- a/src/main/java/electrosphere/game/client/world/ClientWorldData.java +++ b/src/main/java/electrosphere/game/client/world/ClientWorldData.java @@ -1,8 +1,9 @@ package electrosphere.game.client.world; import electrosphere.game.server.world.*; +import electrosphere.server.datacell.ServerDataCell; import electrosphere.game.server.terrain.manager.ServerTerrainManager; -import electrosphere.game.server.datacell.ServerDataCell; + import java.util.List; import org.joml.Vector2f; import org.joml.Vector3f; diff --git a/src/main/java/electrosphere/game/collision/PhysicsUtils.java b/src/main/java/electrosphere/game/collision/PhysicsUtils.java index 494e2459..2c61271f 100644 --- a/src/main/java/electrosphere/game/collision/PhysicsUtils.java +++ b/src/main/java/electrosphere/game/collision/PhysicsUtils.java @@ -8,13 +8,14 @@ import electrosphere.collision.shapes.IndexedMesh; import electrosphere.collision.shapes.TriangleIndexVertexArray; import electrosphere.dynamics.RigidBody; import electrosphere.dynamics.RigidBodyConstructionInfo; +import electrosphere.engine.Globals; import electrosphere.linearmath.DefaultMotionState; import electrosphere.linearmath.Transform; import electrosphere.entity.Entity; import electrosphere.entity.EntityDataStrings; import electrosphere.entity.EntityUtils; import electrosphere.game.collision.collidable.Collidable; -import electrosphere.main.Globals; + import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.FloatBuffer; diff --git a/src/main/java/electrosphere/game/config/UserSettings.java b/src/main/java/electrosphere/game/config/UserSettings.java index 76fc0bcd..90e90d58 100644 --- a/src/main/java/electrosphere/game/config/UserSettings.java +++ b/src/main/java/electrosphere/game/config/UserSettings.java @@ -1,7 +1,7 @@ package electrosphere.game.config; +import electrosphere.engine.Globals; import electrosphere.logger.LoggerInterface; -import electrosphere.main.Globals; import electrosphere.util.FileUtils; /** diff --git a/src/main/java/electrosphere/game/server/character/diety/Diety.java b/src/main/java/electrosphere/game/server/character/diety/Diety.java index 8ea2cc21..601ae153 100644 --- a/src/main/java/electrosphere/game/server/character/diety/Diety.java +++ b/src/main/java/electrosphere/game/server/character/diety/Diety.java @@ -1,8 +1,9 @@ package electrosphere.game.server.character.diety; +import electrosphere.engine.Globals; import electrosphere.game.server.symbolism.model.Symbol; import electrosphere.game.server.symbolism.model.SymbolMap; -import electrosphere.main.Globals; + import java.util.LinkedList; import java.util.List; import java.util.Random; diff --git a/src/main/java/electrosphere/game/server/structure/virtual/StructureManager.java b/src/main/java/electrosphere/game/server/structure/virtual/StructureManager.java index 483c5a4d..485abade 100644 --- a/src/main/java/electrosphere/game/server/structure/virtual/StructureManager.java +++ b/src/main/java/electrosphere/game/server/structure/virtual/StructureManager.java @@ -1,10 +1,12 @@ package electrosphere.game.server.structure.virtual; import com.google.gson.Gson; -import electrosphere.game.server.db.DatabaseResult; -import electrosphere.game.server.db.DatabaseResultRow; + +import electrosphere.engine.Globals; import electrosphere.logger.LoggerInterface; -import electrosphere.main.Globals; +import electrosphere.server.db.DatabaseResult; +import electrosphere.server.db.DatabaseResultRow; + import java.sql.ResultSet; import java.sql.SQLException; import java.util.LinkedList; diff --git a/src/main/java/electrosphere/game/server/structure/virtual/VirtualStructureUtils.java b/src/main/java/electrosphere/game/server/structure/virtual/VirtualStructureUtils.java index 89131f40..3261ec37 100644 --- a/src/main/java/electrosphere/game/server/structure/virtual/VirtualStructureUtils.java +++ b/src/main/java/electrosphere/game/server/structure/virtual/VirtualStructureUtils.java @@ -1,8 +1,8 @@ package electrosphere.game.server.structure.virtual; +import electrosphere.engine.Globals; import electrosphere.entity.types.structure.StructureUtils; import electrosphere.game.data.structure.type.model.StructureType; -import electrosphere.main.Globals; import electrosphere.game.server.character.Character; import java.util.LinkedList; import java.util.List; diff --git a/src/main/java/electrosphere/game/server/terrain/manager/ServerTerrainManager.java b/src/main/java/electrosphere/game/server/terrain/manager/ServerTerrainManager.java index 3e34bef4..9d1d3e49 100644 --- a/src/main/java/electrosphere/game/server/terrain/manager/ServerTerrainManager.java +++ b/src/main/java/electrosphere/game/server/terrain/manager/ServerTerrainManager.java @@ -2,7 +2,7 @@ package electrosphere.game.server.terrain.manager; import com.google.gson.Gson; import electrosphere.game.terrain.processing.TerrainInterpolator; -import electrosphere.main.Globals; +import electrosphere.engine.Globals; import electrosphere.game.server.terrain.generation.TerrainGen; import electrosphere.game.server.terrain.models.ModificationList; import electrosphere.game.server.terrain.models.TerrainModel; diff --git a/src/main/java/electrosphere/game/server/town/Town.java b/src/main/java/electrosphere/game/server/town/Town.java index e01c9273..f1a22c07 100644 --- a/src/main/java/electrosphere/game/server/town/Town.java +++ b/src/main/java/electrosphere/game/server/town/Town.java @@ -1,12 +1,13 @@ package electrosphere.game.server.town; -import electrosphere.game.server.db.DatabaseResult; import electrosphere.game.server.structure.virtual.Structure; import electrosphere.game.server.structure.virtual.VirtualStructureUtils; import electrosphere.game.server.terrain.manager.ServerTerrainChunk; +import electrosphere.engine.Globals; import electrosphere.game.server.character.Character; import electrosphere.logger.LoggerInterface; -import electrosphere.main.Globals; +import electrosphere.server.db.DatabaseResult; + import java.sql.ResultSet; import java.sql.SQLException; import java.util.LinkedList; diff --git a/src/main/java/electrosphere/game/server/unit/UnitUtils.java b/src/main/java/electrosphere/game/server/unit/UnitUtils.java index e4dfce97..af014c57 100644 --- a/src/main/java/electrosphere/game/server/unit/UnitUtils.java +++ b/src/main/java/electrosphere/game/server/unit/UnitUtils.java @@ -6,7 +6,7 @@ import electrosphere.entity.types.attach.AttachUtils; import electrosphere.entity.types.collision.CollisionObjUtils; import electrosphere.entity.types.creature.CreatureUtils; import electrosphere.entity.types.item.ItemUtils; -import electrosphere.game.server.ai.creature.MillAbout; +import electrosphere.server.ai.creature.MillAbout; import org.joml.Quaterniond; import org.joml.Quaternionf; diff --git a/src/main/java/electrosphere/game/server/world/MacroData.java b/src/main/java/electrosphere/game/server/world/MacroData.java index b5faef1c..78191c82 100644 --- a/src/main/java/electrosphere/game/server/world/MacroData.java +++ b/src/main/java/electrosphere/game/server/world/MacroData.java @@ -2,6 +2,8 @@ package electrosphere.game.server.world; import java.util.LinkedList; import java.util.List; + +import electrosphere.engine.Globals; import electrosphere.game.server.character.Character; import electrosphere.game.server.character.CharacterDataStrings; import electrosphere.game.server.character.CharacterUtils; @@ -12,7 +14,7 @@ import electrosphere.game.server.race.model.RaceMap; import electrosphere.game.server.structure.virtual.Structure; import electrosphere.game.server.symbolism.model.Symbol; import electrosphere.game.server.town.Town; -import electrosphere.main.Globals; + import java.util.Random; import org.joml.Vector2i; diff --git a/src/main/java/electrosphere/game/server/world/ServerWorldData.java b/src/main/java/electrosphere/game/server/world/ServerWorldData.java index 47394ac9..7b01fa55 100644 --- a/src/main/java/electrosphere/game/server/world/ServerWorldData.java +++ b/src/main/java/electrosphere/game/server/world/ServerWorldData.java @@ -1,7 +1,8 @@ package electrosphere.game.server.world; import electrosphere.game.server.terrain.manager.ServerTerrainManager; -import electrosphere.game.server.datacell.ServerDataCell; +import electrosphere.server.datacell.ServerDataCell; + import java.util.List; import org.joml.Vector3f; diff --git a/src/main/java/electrosphere/menu/MenuCallbacks.java b/src/main/java/electrosphere/menu/MenuCallbacks.java index 1878cf27..b86320b3 100644 --- a/src/main/java/electrosphere/menu/MenuCallbacks.java +++ b/src/main/java/electrosphere/menu/MenuCallbacks.java @@ -4,14 +4,14 @@ import electrosphere.audio.AudioSource; import electrosphere.audio.AudioUtils; import electrosphere.controls.ControlHandler; import electrosphere.controls.ControlHandler.ControlsState; +import electrosphere.engine.Globals; import electrosphere.engine.LoadingThread; -import electrosphere.game.server.saves.SaveUtils; -import electrosphere.main.Globals; -import electrosphere.main.Main; +import electrosphere.engine.Main; import electrosphere.net.NetUtils; import electrosphere.net.client.ClientNetworking; import electrosphere.renderer.ui.DrawableElement; import electrosphere.renderer.ui.elements.Label; +import electrosphere.server.saves.SaveUtils; import org.joml.Vector3f; diff --git a/src/main/java/electrosphere/menu/MenuGenerators.java b/src/main/java/electrosphere/menu/MenuGenerators.java index 7dab49f8..602088ac 100644 --- a/src/main/java/electrosphere/menu/MenuGenerators.java +++ b/src/main/java/electrosphere/menu/MenuGenerators.java @@ -6,7 +6,9 @@ import org.joml.Vector3f; import electrosphere.auth.AuthenticationManager; import electrosphere.controls.ControlHandler.ControlsState; +import electrosphere.engine.Globals; import electrosphere.engine.LoadingThread; +import electrosphere.engine.Main; import electrosphere.entity.Entity; import electrosphere.entity.EntityDataStrings; import electrosphere.entity.EntityUtils; @@ -14,9 +16,6 @@ import electrosphere.entity.types.camera.CameraEntityUtils; import electrosphere.entity.types.creature.CreatureUtils; import electrosphere.game.data.creature.type.CreatureType; import electrosphere.game.data.creature.type.visualattribute.VisualAttribute; -import electrosphere.game.server.saves.SaveUtils; -import electrosphere.main.Globals; -import electrosphere.main.Main; import electrosphere.net.NetUtils; import electrosphere.renderer.Model; import electrosphere.renderer.RenderingEngine; @@ -40,6 +39,7 @@ import electrosphere.renderer.ui.events.ClickEvent; import electrosphere.renderer.ui.events.NavigationEvent; import electrosphere.renderer.ui.events.ValueChangeEvent; import electrosphere.renderer.ui.form.FormElement; +import electrosphere.server.saves.SaveUtils; /** * diff --git a/src/main/java/electrosphere/menu/MenuGeneratorsArena.java b/src/main/java/electrosphere/menu/MenuGeneratorsArena.java index 4cca6b59..3893d3e4 100644 --- a/src/main/java/electrosphere/menu/MenuGeneratorsArena.java +++ b/src/main/java/electrosphere/menu/MenuGeneratorsArena.java @@ -1,8 +1,8 @@ package electrosphere.menu; import electrosphere.auth.AuthenticationManager; +import electrosphere.engine.Globals; import electrosphere.engine.LoadingThread; -import electrosphere.main.Globals; import electrosphere.net.NetUtils; import electrosphere.renderer.ui.ClickableElement; import electrosphere.renderer.ui.Element; diff --git a/src/main/java/electrosphere/menu/MenuGeneratorsDebug.java b/src/main/java/electrosphere/menu/MenuGeneratorsDebug.java index 3d8be8c4..b785b104 100644 --- a/src/main/java/electrosphere/menu/MenuGeneratorsDebug.java +++ b/src/main/java/electrosphere/menu/MenuGeneratorsDebug.java @@ -3,7 +3,7 @@ package electrosphere.menu; import java.util.LinkedList; import java.util.List; -import electrosphere.main.Globals; +import electrosphere.engine.Globals; import electrosphere.renderer.debug.DebugRendering; import electrosphere.renderer.ui.ClickableElement; import electrosphere.renderer.ui.ContainerElement; diff --git a/src/main/java/electrosphere/menu/MenuGeneratorsInventory.java b/src/main/java/electrosphere/menu/MenuGeneratorsInventory.java index 5ac31370..29bd4597 100644 --- a/src/main/java/electrosphere/menu/MenuGeneratorsInventory.java +++ b/src/main/java/electrosphere/menu/MenuGeneratorsInventory.java @@ -4,6 +4,7 @@ import java.util.List; import electrosphere.audio.AudioUtils; import electrosphere.controls.ControlHandler.ControlsState; +import electrosphere.engine.Globals; import electrosphere.entity.Entity; import electrosphere.entity.EntityDataStrings; import electrosphere.entity.state.equip.EquipState; @@ -12,7 +13,6 @@ import electrosphere.entity.state.inventory.InventoryUtils; import electrosphere.entity.state.inventory.RelationalInventoryState; import electrosphere.entity.state.inventory.UnrelationalInventoryState; import electrosphere.entity.types.item.ItemUtils; -import electrosphere.main.Globals; import electrosphere.renderer.ui.DraggableElement.DragEventCallback; import electrosphere.renderer.ui.elements.Div; import electrosphere.renderer.ui.elements.ImagePanel; diff --git a/src/main/java/electrosphere/menu/MenuGeneratorsMultiplayer.java b/src/main/java/electrosphere/menu/MenuGeneratorsMultiplayer.java index 9dc2eab2..c29ece93 100644 --- a/src/main/java/electrosphere/menu/MenuGeneratorsMultiplayer.java +++ b/src/main/java/electrosphere/menu/MenuGeneratorsMultiplayer.java @@ -6,12 +6,12 @@ import java.util.List; import org.joml.Quaternionf; import org.joml.Vector3f; +import electrosphere.engine.Globals; import electrosphere.entity.types.camera.CameraEntityUtils; import electrosphere.entity.types.creature.CreatureTemplate; import electrosphere.game.data.creature.type.CreatureType; import electrosphere.game.data.creature.type.visualattribute.AttributeVariant; import electrosphere.game.data.creature.type.visualattribute.VisualAttribute; -import electrosphere.main.Globals; import electrosphere.net.parser.net.message.CharacterMessage; import electrosphere.renderer.Model; import electrosphere.renderer.RenderingEngine; diff --git a/src/main/java/electrosphere/menu/WindowUtils.java b/src/main/java/electrosphere/menu/WindowUtils.java index e158a243..d3522ede 100644 --- a/src/main/java/electrosphere/menu/WindowUtils.java +++ b/src/main/java/electrosphere/menu/WindowUtils.java @@ -1,9 +1,9 @@ package electrosphere.menu; +import electrosphere.engine.Globals; import electrosphere.entity.state.inventory.InventoryUtils; import electrosphere.entity.state.inventory.RelationalInventoryState; import electrosphere.entity.state.inventory.UnrelationalInventoryState; -import electrosphere.main.Globals; import electrosphere.renderer.ui.ContainerElement; import electrosphere.renderer.ui.DrawableElement; import electrosphere.renderer.ui.Element; diff --git a/src/main/java/electrosphere/net/client/ClientNetworking.java b/src/main/java/electrosphere/net/client/ClientNetworking.java index 60524ca5..ef38afe0 100644 --- a/src/main/java/electrosphere/net/client/ClientNetworking.java +++ b/src/main/java/electrosphere/net/client/ClientNetworking.java @@ -1,11 +1,11 @@ package electrosphere.net.client; import electrosphere.entity.types.creature.CreatureUtils; +import electrosphere.engine.Globals; +import electrosphere.engine.Main; import electrosphere.entity.Entity; import electrosphere.entity.EntityUtils; import electrosphere.logger.LoggerInterface; -import electrosphere.main.Globals; -import electrosphere.main.Main; import electrosphere.net.client.protocol.ClientProtocol; import electrosphere.net.parser.net.message.EntityMessage; import electrosphere.net.parser.net.message.NetworkMessage; diff --git a/src/main/java/electrosphere/net/client/protocol/AuthProtocol.java b/src/main/java/electrosphere/net/client/protocol/AuthProtocol.java index a799541b..ec1a685a 100644 --- a/src/main/java/electrosphere/net/client/protocol/AuthProtocol.java +++ b/src/main/java/electrosphere/net/client/protocol/AuthProtocol.java @@ -1,7 +1,7 @@ package electrosphere.net.client.protocol; +import electrosphere.engine.Globals; import electrosphere.logger.LoggerInterface; -import electrosphere.main.Globals; import electrosphere.net.parser.net.message.AuthMessage; import electrosphere.net.parser.net.message.CharacterMessage; import electrosphere.net.parser.net.message.LoreMessage; diff --git a/src/main/java/electrosphere/net/client/protocol/CharacterProtocol.java b/src/main/java/electrosphere/net/client/protocol/CharacterProtocol.java index 38072a18..64109ada 100644 --- a/src/main/java/electrosphere/net/client/protocol/CharacterProtocol.java +++ b/src/main/java/electrosphere/net/client/protocol/CharacterProtocol.java @@ -1,7 +1,7 @@ package electrosphere.net.client.protocol; +import electrosphere.engine.Globals; import electrosphere.engine.LoadingThread; -import electrosphere.main.Globals; import electrosphere.net.parser.net.message.CharacterMessage; import electrosphere.net.parser.net.message.TerrainMessage; diff --git a/src/main/java/electrosphere/net/client/protocol/ClientProtocol.java b/src/main/java/electrosphere/net/client/protocol/ClientProtocol.java index 4399468a..ebcb0af8 100644 --- a/src/main/java/electrosphere/net/client/protocol/ClientProtocol.java +++ b/src/main/java/electrosphere/net/client/protocol/ClientProtocol.java @@ -1,5 +1,7 @@ package electrosphere.net.client.protocol; +import electrosphere.engine.Globals; +import electrosphere.engine.Main; import electrosphere.entity.Entity; import electrosphere.entity.EntityUtils; import electrosphere.entity.types.creature.CreatureUtils; @@ -7,8 +9,6 @@ import electrosphere.game.client.world.ClientWorldData; import electrosphere.entity.types.attach.AttachUtils; import electrosphere.entity.types.item.ItemUtils; import electrosphere.logger.LoggerInterface; -import electrosphere.main.Globals; -import electrosphere.main.Main; import electrosphere.net.parser.net.message.AuthMessage; import electrosphere.net.parser.net.message.CharacterMessage; import electrosphere.net.parser.net.message.EntityMessage; diff --git a/src/main/java/electrosphere/net/client/protocol/EntityProtocol.java b/src/main/java/electrosphere/net/client/protocol/EntityProtocol.java index 03198c00..1e330d2b 100644 --- a/src/main/java/electrosphere/net/client/protocol/EntityProtocol.java +++ b/src/main/java/electrosphere/net/client/protocol/EntityProtocol.java @@ -4,6 +4,8 @@ import org.joml.Quaterniond; import org.joml.Quaternionf; import org.joml.Vector3d; +import electrosphere.engine.Globals; +import electrosphere.engine.Main; import electrosphere.entity.Entity; import electrosphere.entity.EntityUtils; import electrosphere.entity.types.attach.AttachUtils; @@ -11,8 +13,6 @@ import electrosphere.entity.types.creature.CreatureTemplate; import electrosphere.entity.types.creature.CreatureUtils; import electrosphere.entity.types.item.ItemUtils; import electrosphere.logger.LoggerInterface; -import electrosphere.main.Globals; -import electrosphere.main.Main; import electrosphere.net.parser.net.message.EntityMessage; import electrosphere.util.Utilities; diff --git a/src/main/java/electrosphere/net/client/protocol/InventoryProtocol.java b/src/main/java/electrosphere/net/client/protocol/InventoryProtocol.java index 1f5fe1c1..8f56b50e 100644 --- a/src/main/java/electrosphere/net/client/protocol/InventoryProtocol.java +++ b/src/main/java/electrosphere/net/client/protocol/InventoryProtocol.java @@ -1,5 +1,6 @@ package electrosphere.net.client.protocol; +import electrosphere.engine.Globals; import electrosphere.entity.Entity; import electrosphere.entity.state.equip.EquipState; import electrosphere.entity.state.inventory.InventoryState; @@ -7,7 +8,6 @@ import electrosphere.entity.state.inventory.InventoryUtils; import electrosphere.entity.types.item.ItemUtils; import electrosphere.game.data.creature.type.equip.EquipPoint; import electrosphere.logger.LoggerInterface; -import electrosphere.main.Globals; import electrosphere.net.parser.net.message.InventoryMessage; public class InventoryProtocol { diff --git a/src/main/java/electrosphere/net/client/protocol/LoreProtocol.java b/src/main/java/electrosphere/net/client/protocol/LoreProtocol.java index 8f8f2ad0..6639a51f 100644 --- a/src/main/java/electrosphere/net/client/protocol/LoreProtocol.java +++ b/src/main/java/electrosphere/net/client/protocol/LoreProtocol.java @@ -4,7 +4,7 @@ import java.util.List; import com.google.gson.Gson; -import electrosphere.main.Globals; +import electrosphere.engine.Globals; import electrosphere.net.parser.net.message.LoreMessage; public class LoreProtocol { diff --git a/src/main/java/electrosphere/net/client/protocol/PlayerProtocol.java b/src/main/java/electrosphere/net/client/protocol/PlayerProtocol.java index 81f1c7b1..2c52574c 100644 --- a/src/main/java/electrosphere/net/client/protocol/PlayerProtocol.java +++ b/src/main/java/electrosphere/net/client/protocol/PlayerProtocol.java @@ -1,8 +1,8 @@ package electrosphere.net.client.protocol; +import electrosphere.engine.Globals; +import electrosphere.engine.Main; import electrosphere.logger.LoggerInterface; -import electrosphere.main.Globals; -import electrosphere.main.Main; import electrosphere.net.parser.net.message.PlayerMessage; import electrosphere.net.server.player.Player; diff --git a/src/main/java/electrosphere/net/client/protocol/ServerProtocol.java b/src/main/java/electrosphere/net/client/protocol/ServerProtocol.java index ab629697..cb7d6436 100644 --- a/src/main/java/electrosphere/net/client/protocol/ServerProtocol.java +++ b/src/main/java/electrosphere/net/client/protocol/ServerProtocol.java @@ -1,6 +1,6 @@ package electrosphere.net.client.protocol; -import electrosphere.main.Globals; +import electrosphere.engine.Globals; import electrosphere.net.parser.net.message.ServerMessage; public class ServerProtocol { diff --git a/src/main/java/electrosphere/net/client/protocol/TerrainProtocol.java b/src/main/java/electrosphere/net/client/protocol/TerrainProtocol.java index c9b22726..0c33ec13 100644 --- a/src/main/java/electrosphere/net/client/protocol/TerrainProtocol.java +++ b/src/main/java/electrosphere/net/client/protocol/TerrainProtocol.java @@ -4,9 +4,9 @@ import javax.vecmath.Vector3d; import org.joml.Vector3f; +import electrosphere.engine.Globals; import electrosphere.game.client.world.ClientWorldData; import electrosphere.logger.LoggerInterface; -import electrosphere.main.Globals; import electrosphere.net.parser.net.message.TerrainMessage; public class TerrainProtocol { diff --git a/src/main/java/electrosphere/net/server/Server.java b/src/main/java/electrosphere/net/server/Server.java index a6b288db..9cc5cd0e 100644 --- a/src/main/java/electrosphere/net/server/Server.java +++ b/src/main/java/electrosphere/net/server/Server.java @@ -1,10 +1,11 @@ package electrosphere.net.server; -import electrosphere.game.server.saves.SaveUtils; -import electrosphere.main.Globals; -import electrosphere.main.Main; +import electrosphere.engine.Globals; +import electrosphere.engine.Main; import electrosphere.net.NetUtils; import electrosphere.net.parser.net.message.NetworkMessage; +import electrosphere.server.saves.SaveUtils; + import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; diff --git a/src/main/java/electrosphere/net/server/ServerConnectionHandler.java b/src/main/java/electrosphere/net/server/ServerConnectionHandler.java index 6d075729..0694e677 100644 --- a/src/main/java/electrosphere/net/server/ServerConnectionHandler.java +++ b/src/main/java/electrosphere/net/server/ServerConnectionHandler.java @@ -2,6 +2,8 @@ package electrosphere.net.server; import electrosphere.entity.types.creature.CreatureTemplate; import electrosphere.entity.types.creature.CreatureUtils; +import electrosphere.engine.Globals; +import electrosphere.engine.Main; import electrosphere.entity.Entity; import electrosphere.entity.EntityUtils; import electrosphere.entity.state.ironsight.IronSightTree; @@ -9,8 +11,6 @@ import electrosphere.entity.types.item.ItemUtils; import electrosphere.entity.types.attach.AttachUtils; import electrosphere.entity.types.collision.CollisionObjUtils; import electrosphere.logger.LoggerInterface; -import electrosphere.main.Globals; -import electrosphere.main.Main; import electrosphere.net.NetUtils; import electrosphere.net.parser.net.message.AuthMessage; import electrosphere.net.parser.net.message.EntityMessage; diff --git a/src/main/java/electrosphere/net/server/player/Player.java b/src/main/java/electrosphere/net/server/player/Player.java index 246cec64..0f0a5287 100644 --- a/src/main/java/electrosphere/net/server/player/Player.java +++ b/src/main/java/electrosphere/net/server/player/Player.java @@ -1,7 +1,7 @@ package electrosphere.net.server.player; +import electrosphere.engine.Globals; import electrosphere.entity.Entity; -import electrosphere.main.Globals; import electrosphere.net.parser.net.message.NetworkMessage; import electrosphere.net.server.ServerConnectionHandler; diff --git a/src/main/java/electrosphere/net/server/protocol/AuthProtocol.java b/src/main/java/electrosphere/net/server/protocol/AuthProtocol.java index b56be16a..3c4807d8 100644 --- a/src/main/java/electrosphere/net/server/protocol/AuthProtocol.java +++ b/src/main/java/electrosphere/net/server/protocol/AuthProtocol.java @@ -1,6 +1,6 @@ package electrosphere.net.server.protocol; -import electrosphere.main.Globals; +import electrosphere.engine.Globals; import electrosphere.net.parser.net.message.AuthMessage; import electrosphere.net.parser.net.message.PlayerMessage; import electrosphere.net.server.ServerConnectionHandler; diff --git a/src/main/java/electrosphere/net/server/protocol/CharacterProtocol.java b/src/main/java/electrosphere/net/server/protocol/CharacterProtocol.java index ad549ee6..fcd7ea32 100644 --- a/src/main/java/electrosphere/net/server/protocol/CharacterProtocol.java +++ b/src/main/java/electrosphere/net/server/protocol/CharacterProtocol.java @@ -3,14 +3,14 @@ package electrosphere.net.server.protocol; import org.joml.Vector3d; import org.joml.Vector3f; +import electrosphere.engine.Globals; +import electrosphere.engine.Main; import electrosphere.entity.Entity; import electrosphere.entity.EntityUtils; import electrosphere.entity.state.ironsight.IronSightTree; import electrosphere.entity.types.collision.CollisionObjUtils; import electrosphere.entity.types.creature.CreatureTemplate; import electrosphere.entity.types.creature.CreatureUtils; -import electrosphere.main.Globals; -import electrosphere.main.Main; import electrosphere.net.parser.net.message.CharacterMessage; import electrosphere.net.parser.net.message.PlayerMessage; import electrosphere.net.parser.net.message.TerrainMessage; diff --git a/src/main/java/electrosphere/net/server/protocol/EntityProtocol.java b/src/main/java/electrosphere/net/server/protocol/EntityProtocol.java index c1edbf2f..dbfa4943 100644 --- a/src/main/java/electrosphere/net/server/protocol/EntityProtocol.java +++ b/src/main/java/electrosphere/net/server/protocol/EntityProtocol.java @@ -1,13 +1,13 @@ package electrosphere.net.server.protocol; +import electrosphere.engine.Globals; +import electrosphere.engine.Main; import electrosphere.entity.Entity; import electrosphere.entity.EntityUtils; import electrosphere.entity.types.attach.AttachUtils; import electrosphere.entity.types.creature.CreatureUtils; import electrosphere.entity.types.item.ItemUtils; import electrosphere.logger.LoggerInterface; -import electrosphere.main.Globals; -import electrosphere.main.Main; import electrosphere.net.NetUtils; import electrosphere.net.parser.net.message.EntityMessage; import electrosphere.net.server.ServerConnectionHandler; diff --git a/src/main/java/electrosphere/net/server/protocol/InventoryProtocol.java b/src/main/java/electrosphere/net/server/protocol/InventoryProtocol.java index c97a4bc8..b7de2dc5 100644 --- a/src/main/java/electrosphere/net/server/protocol/InventoryProtocol.java +++ b/src/main/java/electrosphere/net/server/protocol/InventoryProtocol.java @@ -1,5 +1,6 @@ package electrosphere.net.server.protocol; +import electrosphere.engine.Globals; import electrosphere.entity.Entity; import electrosphere.entity.state.equip.EquipState; import electrosphere.entity.state.inventory.InventoryUtils; @@ -7,7 +8,6 @@ import electrosphere.entity.state.inventory.UnrelationalInventoryState; import electrosphere.entity.types.creature.CreatureUtils; import electrosphere.game.data.creature.type.equip.EquipPoint; import electrosphere.logger.LoggerInterface; -import electrosphere.main.Globals; import electrosphere.net.parser.net.message.InventoryMessage; import electrosphere.net.server.ServerConnectionHandler; diff --git a/src/main/java/electrosphere/net/server/protocol/LoreProtocol.java b/src/main/java/electrosphere/net/server/protocol/LoreProtocol.java index 241e7e3c..8c596abb 100644 --- a/src/main/java/electrosphere/net/server/protocol/LoreProtocol.java +++ b/src/main/java/electrosphere/net/server/protocol/LoreProtocol.java @@ -2,7 +2,7 @@ package electrosphere.net.server.protocol; import java.util.List; -import electrosphere.main.Globals; +import electrosphere.engine.Globals; import electrosphere.net.parser.net.message.LoreMessage; import electrosphere.net.server.ServerConnectionHandler; import electrosphere.util.Utilities; diff --git a/src/main/java/electrosphere/net/server/protocol/ServerProtocol.java b/src/main/java/electrosphere/net/server/protocol/ServerProtocol.java index cf17436d..70e51a77 100644 --- a/src/main/java/electrosphere/net/server/protocol/ServerProtocol.java +++ b/src/main/java/electrosphere/net/server/protocol/ServerProtocol.java @@ -2,6 +2,8 @@ package electrosphere.net.server.protocol; import org.joml.Vector3f; +import electrosphere.engine.Globals; +import electrosphere.engine.Main; import electrosphere.entity.Entity; import electrosphere.entity.EntityUtils; import electrosphere.entity.state.ironsight.IronSightTree; @@ -12,8 +14,6 @@ import electrosphere.entity.types.item.ItemUtils; import electrosphere.game.server.terrain.manager.ServerTerrainChunk; import electrosphere.game.server.terrain.models.TerrainModification; import electrosphere.logger.LoggerInterface; -import electrosphere.main.Globals; -import electrosphere.main.Main; import electrosphere.net.NetUtils; import electrosphere.net.parser.net.message.AuthMessage; import electrosphere.net.parser.net.message.CharacterMessage; diff --git a/src/main/java/electrosphere/net/server/protocol/TerrainProtocol.java b/src/main/java/electrosphere/net/server/protocol/TerrainProtocol.java index ac055a3b..04be59bc 100644 --- a/src/main/java/electrosphere/net/server/protocol/TerrainProtocol.java +++ b/src/main/java/electrosphere/net/server/protocol/TerrainProtocol.java @@ -1,8 +1,8 @@ package electrosphere.net.server.protocol; +import electrosphere.engine.Globals; import electrosphere.game.server.terrain.manager.ServerTerrainChunk; import electrosphere.game.server.terrain.models.TerrainModification; -import electrosphere.main.Globals; import electrosphere.net.parser.net.message.TerrainMessage; import electrosphere.net.server.Server; import electrosphere.net.server.ServerConnectionHandler; diff --git a/src/main/java/electrosphere/renderer/Material.java b/src/main/java/electrosphere/renderer/Material.java index 882da470..42790f13 100644 --- a/src/main/java/electrosphere/renderer/Material.java +++ b/src/main/java/electrosphere/renderer/Material.java @@ -5,7 +5,7 @@ */ package electrosphere.renderer; -import electrosphere.main.Globals; +import electrosphere.engine.Globals; import electrosphere.renderer.texture.Texture; import org.lwjgl.PointerBuffer; import org.lwjgl.assimp.AIMaterial; diff --git a/src/main/java/electrosphere/renderer/Mesh.java b/src/main/java/electrosphere/renderer/Mesh.java index ca4b0494..07c53c64 100644 --- a/src/main/java/electrosphere/renderer/Mesh.java +++ b/src/main/java/electrosphere/renderer/Mesh.java @@ -1,9 +1,9 @@ package electrosphere.renderer; +import electrosphere.engine.Globals; +import electrosphere.engine.Main; import electrosphere.entity.types.camera.CameraEntityUtils; import electrosphere.logger.LoggerInterface; -import electrosphere.main.Globals; -import electrosphere.main.Main; import electrosphere.renderer.actor.ActorTextureMask; import electrosphere.renderer.light.LightManager; import electrosphere.renderer.loading.ModelPretransforms; diff --git a/src/main/java/electrosphere/renderer/Model.java b/src/main/java/electrosphere/renderer/Model.java index f1f4d14b..ac3e77a8 100644 --- a/src/main/java/electrosphere/renderer/Model.java +++ b/src/main/java/electrosphere/renderer/Model.java @@ -11,8 +11,9 @@ import electrosphere.renderer.anim.Animation; import electrosphere.renderer.loading.ModelPretransforms; import electrosphere.renderer.loading.ModelPretransforms.MeshMetadata; import electrosphere.renderer.anim.AnimNode; +import electrosphere.engine.Globals; import electrosphere.logger.LoggerInterface; -import electrosphere.main.Globals; + import java.io.File; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/electrosphere/renderer/ModelUtils.java b/src/main/java/electrosphere/renderer/ModelUtils.java index eabcac0d..88e4a95f 100644 --- a/src/main/java/electrosphere/renderer/ModelUtils.java +++ b/src/main/java/electrosphere/renderer/ModelUtils.java @@ -1,6 +1,6 @@ package electrosphere.renderer; -import electrosphere.main.Globals; +import electrosphere.engine.Globals; import electrosphere.engine.assetmanager.AssetDataStrings; import electrosphere.renderer.texture.Texture; import java.nio.FloatBuffer; diff --git a/src/main/java/electrosphere/renderer/RenderUtils.java b/src/main/java/electrosphere/renderer/RenderUtils.java index 616bb4b3..f0c9ba35 100644 --- a/src/main/java/electrosphere/renderer/RenderUtils.java +++ b/src/main/java/electrosphere/renderer/RenderUtils.java @@ -1,5 +1,6 @@ package electrosphere.renderer; +import electrosphere.engine.Globals; import electrosphere.engine.assetmanager.AssetDataStrings; import electrosphere.entity.types.camera.CameraEntityUtils; @@ -10,7 +11,6 @@ import java.util.Iterator; import java.util.LinkedList; import java.util.List; -import electrosphere.main.Globals; import electrosphere.renderer.actor.ActorTextureMask; import electrosphere.renderer.texture.Texture; diff --git a/src/main/java/electrosphere/renderer/RenderingEngine.java b/src/main/java/electrosphere/renderer/RenderingEngine.java index 143105eb..2ff782bc 100644 --- a/src/main/java/electrosphere/renderer/RenderingEngine.java +++ b/src/main/java/electrosphere/renderer/RenderingEngine.java @@ -72,6 +72,7 @@ import org.lwjgl.opengl.GL20; import electrosphere.controls.ControlCallback; import electrosphere.controls.MouseCallback; +import electrosphere.engine.Globals; import electrosphere.entity.Entity; import electrosphere.entity.EntityDataStrings; import electrosphere.entity.EntityUtils; @@ -79,11 +80,7 @@ import electrosphere.entity.types.camera.CameraEntityUtils; import electrosphere.entity.types.hitbox.HitboxData; import electrosphere.entity.types.hitbox.HitboxUtils; import electrosphere.game.data.creature.type.CollidableTemplate; -import electrosphere.game.server.pathfinding.navmesh.NavCube; -import electrosphere.game.server.pathfinding.navmesh.NavMesh; -import electrosphere.game.server.pathfinding.navmesh.NavShape; import electrosphere.logger.LoggerInterface; -import electrosphere.main.Globals; import electrosphere.renderer.actor.Actor; import electrosphere.renderer.debug.DebugRendering; import electrosphere.renderer.framebuffer.Framebuffer; @@ -93,6 +90,9 @@ import electrosphere.renderer.light.LightManager; import electrosphere.renderer.texture.Texture; import electrosphere.renderer.ui.DrawableElement; import electrosphere.renderer.ui.Element; +import electrosphere.server.pathfinding.navmesh.NavCube; +import electrosphere.server.pathfinding.navmesh.NavMesh; +import electrosphere.server.pathfinding.navmesh.NavShape; public class RenderingEngine { diff --git a/src/main/java/electrosphere/renderer/ShaderProgram.java b/src/main/java/electrosphere/renderer/ShaderProgram.java index 6c57da00..6c4fbe0c 100644 --- a/src/main/java/electrosphere/renderer/ShaderProgram.java +++ b/src/main/java/electrosphere/renderer/ShaderProgram.java @@ -29,8 +29,8 @@ import javax.management.RuntimeErrorException; import org.lwjgl.opengl.GL20; +import electrosphere.engine.Globals; import electrosphere.logger.LoggerInterface; -import electrosphere.main.Globals; import electrosphere.util.FileUtils; /** diff --git a/src/main/java/electrosphere/renderer/actor/Actor.java b/src/main/java/electrosphere/renderer/actor/Actor.java index f3566819..c4f13041 100644 --- a/src/main/java/electrosphere/renderer/actor/Actor.java +++ b/src/main/java/electrosphere/renderer/actor/Actor.java @@ -1,6 +1,6 @@ package electrosphere.renderer.actor; -import electrosphere.main.Globals; +import electrosphere.engine.Globals; import electrosphere.renderer.Bone; import electrosphere.renderer.Model; import electrosphere.renderer.texture.Texture; diff --git a/src/main/java/electrosphere/renderer/actor/ActorMeshMask.java b/src/main/java/electrosphere/renderer/actor/ActorMeshMask.java index 2155080b..485e493e 100644 --- a/src/main/java/electrosphere/renderer/actor/ActorMeshMask.java +++ b/src/main/java/electrosphere/renderer/actor/ActorMeshMask.java @@ -6,7 +6,7 @@ import java.util.List; import java.util.Map; import java.util.concurrent.Semaphore; -import electrosphere.main.Globals; +import electrosphere.engine.Globals; import electrosphere.renderer.Mesh; import electrosphere.renderer.Model; diff --git a/src/main/java/electrosphere/renderer/actor/ActorUtils.java b/src/main/java/electrosphere/renderer/actor/ActorUtils.java index c4afe86b..171db457 100644 --- a/src/main/java/electrosphere/renderer/actor/ActorUtils.java +++ b/src/main/java/electrosphere/renderer/actor/ActorUtils.java @@ -1,8 +1,8 @@ package electrosphere.renderer.actor; +import electrosphere.engine.Globals; import electrosphere.entity.Entity; import electrosphere.entity.EntityUtils; -import electrosphere.main.Globals; /** * diff --git a/src/main/java/electrosphere/renderer/debug/DebugRendering.java b/src/main/java/electrosphere/renderer/debug/DebugRendering.java index 5d114b92..be49a37e 100644 --- a/src/main/java/electrosphere/renderer/debug/DebugRendering.java +++ b/src/main/java/electrosphere/renderer/debug/DebugRendering.java @@ -9,8 +9,8 @@ import static org.lwjgl.opengl.GL11.glPolygonMode; import org.joml.Vector3f; +import electrosphere.engine.Globals; import electrosphere.logger.LoggerInterface; -import electrosphere.main.Globals; import electrosphere.renderer.Model; import electrosphere.renderer.RenderingEngine; import electrosphere.renderer.ShaderProgram; diff --git a/src/main/java/electrosphere/renderer/framebuffer/FramebufferUtils.java b/src/main/java/electrosphere/renderer/framebuffer/FramebufferUtils.java index f6ade804..3cd3f55c 100644 --- a/src/main/java/electrosphere/renderer/framebuffer/FramebufferUtils.java +++ b/src/main/java/electrosphere/renderer/framebuffer/FramebufferUtils.java @@ -1,7 +1,7 @@ package electrosphere.renderer.framebuffer; +import electrosphere.engine.Globals; import electrosphere.logger.LoggerInterface; -import electrosphere.main.Globals; import electrosphere.renderer.texture.Texture; import java.nio.IntBuffer; diff --git a/src/main/java/electrosphere/renderer/light/LightEntityUtils.java b/src/main/java/electrosphere/renderer/light/LightEntityUtils.java index f9255f3d..194a81c2 100644 --- a/src/main/java/electrosphere/renderer/light/LightEntityUtils.java +++ b/src/main/java/electrosphere/renderer/light/LightEntityUtils.java @@ -1,8 +1,9 @@ package electrosphere.renderer.light; +import electrosphere.engine.Globals; import electrosphere.entity.Entity; import electrosphere.entity.EntityDataStrings; -import electrosphere.main.Globals; + import org.joml.Vector3d; import org.joml.Vector3f; diff --git a/src/main/java/electrosphere/renderer/light/LightManager.java b/src/main/java/electrosphere/renderer/light/LightManager.java index 25b492fc..2350940f 100644 --- a/src/main/java/electrosphere/renderer/light/LightManager.java +++ b/src/main/java/electrosphere/renderer/light/LightManager.java @@ -10,8 +10,8 @@ import org.lwjgl.BufferUtils; import org.lwjgl.opengl.GL30; import org.lwjgl.opengl.GL31; +import electrosphere.engine.Globals; import electrosphere.entity.types.camera.CameraEntityUtils; -import electrosphere.main.Globals; /** * diff --git a/src/main/java/electrosphere/renderer/loading/ModelLoader.java b/src/main/java/electrosphere/renderer/loading/ModelLoader.java index 66673ae9..64174d2c 100644 --- a/src/main/java/electrosphere/renderer/loading/ModelLoader.java +++ b/src/main/java/electrosphere/renderer/loading/ModelLoader.java @@ -1,8 +1,8 @@ package electrosphere.renderer.loading; +import electrosphere.engine.Globals; +import electrosphere.engine.Main; import electrosphere.logger.LoggerInterface; -import electrosphere.main.Globals; -import electrosphere.main.Main; import electrosphere.renderer.Material; import electrosphere.renderer.Mesh; import electrosphere.renderer.Model; diff --git a/src/main/java/electrosphere/renderer/texture/Texture.java b/src/main/java/electrosphere/renderer/texture/Texture.java index 7db44c14..84ab9924 100644 --- a/src/main/java/electrosphere/renderer/texture/Texture.java +++ b/src/main/java/electrosphere/renderer/texture/Texture.java @@ -5,7 +5,7 @@ */ package electrosphere.renderer.texture; -import electrosphere.main.Main; +import electrosphere.engine.Main; import electrosphere.util.FileUtils; import java.awt.Color; import java.awt.image.BufferedImage; diff --git a/src/main/java/electrosphere/renderer/ui/WidgetUtils.java b/src/main/java/electrosphere/renderer/ui/WidgetUtils.java index 97605524..d5489d37 100644 --- a/src/main/java/electrosphere/renderer/ui/WidgetUtils.java +++ b/src/main/java/electrosphere/renderer/ui/WidgetUtils.java @@ -1,7 +1,7 @@ package electrosphere.renderer.ui; import electrosphere.controls.ControlHandler; -import electrosphere.main.Globals; +import electrosphere.engine.Globals; import electrosphere.renderer.ui.elements.Button; import electrosphere.renderer.ui.elements.Label; diff --git a/src/main/java/electrosphere/renderer/ui/Window.java b/src/main/java/electrosphere/renderer/ui/Window.java index 15210757..b435a107 100644 --- a/src/main/java/electrosphere/renderer/ui/Window.java +++ b/src/main/java/electrosphere/renderer/ui/Window.java @@ -12,8 +12,8 @@ import java.util.List; import org.joml.Vector3f; +import electrosphere.engine.Globals; import electrosphere.logger.LoggerInterface; -import electrosphere.main.Globals; import electrosphere.renderer.Material; import electrosphere.renderer.Model; import electrosphere.renderer.debug.DebugRendering; diff --git a/src/main/java/electrosphere/renderer/ui/elements/ActorPanel.java b/src/main/java/electrosphere/renderer/ui/elements/ActorPanel.java index 3e99d526..16597095 100644 --- a/src/main/java/electrosphere/renderer/ui/elements/ActorPanel.java +++ b/src/main/java/electrosphere/renderer/ui/elements/ActorPanel.java @@ -18,8 +18,8 @@ import org.joml.Matrix4f; import org.joml.Quaternionf; import org.joml.Vector3f; +import electrosphere.engine.Globals; import electrosphere.logger.LoggerInterface; -import electrosphere.main.Globals; import electrosphere.renderer.Material; import electrosphere.renderer.Model; import electrosphere.renderer.RenderingEngine; diff --git a/src/main/java/electrosphere/renderer/ui/elements/Button.java b/src/main/java/electrosphere/renderer/ui/elements/Button.java index ffaaafe4..c91363e7 100644 --- a/src/main/java/electrosphere/renderer/ui/elements/Button.java +++ b/src/main/java/electrosphere/renderer/ui/elements/Button.java @@ -5,7 +5,7 @@ import java.util.List; import org.joml.Vector3f; -import electrosphere.main.Globals; +import electrosphere.engine.Globals; import electrosphere.renderer.debug.DebugRendering; import electrosphere.renderer.ui.ClickableElement; import electrosphere.renderer.ui.ContainerElement; diff --git a/src/main/java/electrosphere/renderer/ui/elements/Div.java b/src/main/java/electrosphere/renderer/ui/elements/Div.java index e6efb942..8c7335b7 100644 --- a/src/main/java/electrosphere/renderer/ui/elements/Div.java +++ b/src/main/java/electrosphere/renderer/ui/elements/Div.java @@ -5,7 +5,7 @@ import java.util.List; import org.joml.Vector3f; -import electrosphere.main.Globals; +import electrosphere.engine.Globals; import electrosphere.renderer.debug.DebugRendering; import electrosphere.renderer.ui.ClickableElement; import electrosphere.renderer.ui.ContainerElement; diff --git a/src/main/java/electrosphere/renderer/ui/elements/ImagePanel.java b/src/main/java/electrosphere/renderer/ui/elements/ImagePanel.java index 23540fc9..2bc05883 100644 --- a/src/main/java/electrosphere/renderer/ui/elements/ImagePanel.java +++ b/src/main/java/electrosphere/renderer/ui/elements/ImagePanel.java @@ -5,8 +5,8 @@ import static org.lwjgl.opengl.GL30.glBindFramebuffer; import org.joml.Vector3f; +import electrosphere.engine.Globals; import electrosphere.logger.LoggerInterface; -import electrosphere.main.Globals; import electrosphere.renderer.Material; import electrosphere.renderer.Model; import electrosphere.renderer.debug.DebugRendering; diff --git a/src/main/java/electrosphere/renderer/ui/elements/Label.java b/src/main/java/electrosphere/renderer/ui/elements/Label.java index 3ea71a2a..7ee4905b 100644 --- a/src/main/java/electrosphere/renderer/ui/elements/Label.java +++ b/src/main/java/electrosphere/renderer/ui/elements/Label.java @@ -5,7 +5,7 @@ import java.util.List; import org.joml.Vector3f; -import electrosphere.main.Globals; +import electrosphere.engine.Globals; import electrosphere.renderer.debug.DebugRendering; import electrosphere.renderer.ui.DrawableElement; import electrosphere.renderer.ui.Element; diff --git a/src/main/java/electrosphere/renderer/ui/elements/ScrollableContainer.java b/src/main/java/electrosphere/renderer/ui/elements/ScrollableContainer.java index 059fe69a..ab85f94a 100644 --- a/src/main/java/electrosphere/renderer/ui/elements/ScrollableContainer.java +++ b/src/main/java/electrosphere/renderer/ui/elements/ScrollableContainer.java @@ -6,8 +6,8 @@ import java.util.List; import org.joml.Vector2f; import org.joml.Vector3f; +import electrosphere.engine.Globals; import electrosphere.logger.LoggerInterface; -import electrosphere.main.Globals; import electrosphere.renderer.Material; import electrosphere.renderer.Model; import electrosphere.renderer.framebuffer.Framebuffer; diff --git a/src/main/java/electrosphere/renderer/ui/elements/Slider.java b/src/main/java/electrosphere/renderer/ui/elements/Slider.java index 412c86c8..6ccbfe9b 100644 --- a/src/main/java/electrosphere/renderer/ui/elements/Slider.java +++ b/src/main/java/electrosphere/renderer/ui/elements/Slider.java @@ -2,8 +2,8 @@ package electrosphere.renderer.ui.elements; import org.joml.Vector3f; +import electrosphere.engine.Globals; import electrosphere.logger.LoggerInterface; -import electrosphere.main.Globals; import electrosphere.renderer.Model; import electrosphere.renderer.debug.DebugRendering; import electrosphere.renderer.ui.ClickableElement; diff --git a/src/main/java/electrosphere/renderer/ui/elements/TextBox.java b/src/main/java/electrosphere/renderer/ui/elements/TextBox.java index 92c5d44e..2b10ea10 100644 --- a/src/main/java/electrosphere/renderer/ui/elements/TextBox.java +++ b/src/main/java/electrosphere/renderer/ui/elements/TextBox.java @@ -1,7 +1,7 @@ package electrosphere.renderer.ui.elements; -import electrosphere.main.Globals; import electrosphere.renderer.Model; +import electrosphere.engine.Globals; import electrosphere.engine.assetmanager.AssetDataStrings; import electrosphere.renderer.ui.DrawableElement; import electrosphere.renderer.ui.events.Event; diff --git a/src/main/java/electrosphere/renderer/ui/elements/TextInput.java b/src/main/java/electrosphere/renderer/ui/elements/TextInput.java index 6384ad6e..ad29e4d4 100644 --- a/src/main/java/electrosphere/renderer/ui/elements/TextInput.java +++ b/src/main/java/electrosphere/renderer/ui/elements/TextInput.java @@ -1,8 +1,8 @@ package electrosphere.renderer.ui.elements; -import electrosphere.main.Globals; import electrosphere.renderer.Material; import electrosphere.renderer.Model; +import electrosphere.engine.Globals; import electrosphere.engine.assetmanager.AssetDataStrings; import electrosphere.renderer.framebuffer.Framebuffer; import electrosphere.renderer.framebuffer.FramebufferUtils; diff --git a/src/main/java/electrosphere/renderer/ui/font/FontUtils.java b/src/main/java/electrosphere/renderer/ui/font/FontUtils.java index cd2049f3..8ffff1f4 100644 --- a/src/main/java/electrosphere/renderer/ui/font/FontUtils.java +++ b/src/main/java/electrosphere/renderer/ui/font/FontUtils.java @@ -1,9 +1,9 @@ package electrosphere.renderer.ui.font; +import electrosphere.engine.Globals; import electrosphere.entity.Entity; import electrosphere.entity.EntityDataStrings; import electrosphere.entity.EntityUtils; -import electrosphere.main.Globals; import electrosphere.renderer.Model; import electrosphere.renderer.ModelUtils; import electrosphere.renderer.actor.ActorUtils; diff --git a/src/main/java/electrosphere/renderer/ui/font/bitmapchar/BitmapCharacter.java b/src/main/java/electrosphere/renderer/ui/font/bitmapchar/BitmapCharacter.java index 3bccc499..dc3d7944 100644 --- a/src/main/java/electrosphere/renderer/ui/font/bitmapchar/BitmapCharacter.java +++ b/src/main/java/electrosphere/renderer/ui/font/bitmapchar/BitmapCharacter.java @@ -1,7 +1,7 @@ package electrosphere.renderer.ui.font.bitmapchar; +import electrosphere.engine.Globals; import electrosphere.engine.assetmanager.AssetDataStrings; -import electrosphere.main.Globals; import electrosphere.renderer.Model; import electrosphere.renderer.ui.DrawableElement; import electrosphere.renderer.ui.events.Event; diff --git a/src/main/java/electrosphere/renderer/ui/layout/LayoutSchemeListScrollable.java b/src/main/java/electrosphere/renderer/ui/layout/LayoutSchemeListScrollable.java index 8e0caf6e..bf9c1635 100644 --- a/src/main/java/electrosphere/renderer/ui/layout/LayoutSchemeListScrollable.java +++ b/src/main/java/electrosphere/renderer/ui/layout/LayoutSchemeListScrollable.java @@ -12,7 +12,7 @@ import java.util.List; import org.joml.Vector3f; -import electrosphere.main.Globals; +import electrosphere.engine.Globals; import electrosphere.renderer.Material; import electrosphere.renderer.Model; import electrosphere.renderer.debug.DebugRendering; diff --git a/src/main/java/electrosphere/game/server/ai/AI.java b/src/main/java/electrosphere/server/ai/AI.java similarity index 74% rename from src/main/java/electrosphere/game/server/ai/AI.java rename to src/main/java/electrosphere/server/ai/AI.java index 7c565824..2d989e44 100644 --- a/src/main/java/electrosphere/game/server/ai/AI.java +++ b/src/main/java/electrosphere/server/ai/AI.java @@ -1,4 +1,4 @@ -package electrosphere.game.server.ai; +package electrosphere.server.ai; /** * diff --git a/src/main/java/electrosphere/game/server/ai/AIManager.java b/src/main/java/electrosphere/server/ai/AIManager.java similarity index 93% rename from src/main/java/electrosphere/game/server/ai/AIManager.java rename to src/main/java/electrosphere/server/ai/AIManager.java index 1bdfcdf7..426c795c 100644 --- a/src/main/java/electrosphere/game/server/ai/AIManager.java +++ b/src/main/java/electrosphere/server/ai/AIManager.java @@ -1,4 +1,4 @@ -package electrosphere.game.server.ai; +package electrosphere.server.ai; import java.util.LinkedList; import java.util.List; diff --git a/src/main/java/electrosphere/game/server/ai/creature/MillAbout.java b/src/main/java/electrosphere/server/ai/creature/MillAbout.java similarity index 98% rename from src/main/java/electrosphere/game/server/ai/creature/MillAbout.java rename to src/main/java/electrosphere/server/ai/creature/MillAbout.java index cc1d6e5e..1a03efb5 100644 --- a/src/main/java/electrosphere/game/server/ai/creature/MillAbout.java +++ b/src/main/java/electrosphere/server/ai/creature/MillAbout.java @@ -1,12 +1,13 @@ -package electrosphere.game.server.ai.creature; +package electrosphere.server.ai.creature; +import electrosphere.engine.Globals; import electrosphere.entity.Entity; import electrosphere.entity.EntityUtils; import electrosphere.entity.state.movement.GroundMovementTree; import electrosphere.entity.state.movement.GroundMovementTree.MovementRelativeFacing; import electrosphere.entity.types.creature.CreatureUtils; -import electrosphere.game.server.ai.AI; -import electrosphere.main.Globals; +import electrosphere.server.ai.AI; + import java.util.Random; import org.joml.Vector3d; import org.joml.Vector3f; diff --git a/src/main/java/electrosphere/game/server/ai/creature/MindlessAttacker.java b/src/main/java/electrosphere/server/ai/creature/MindlessAttacker.java similarity index 96% rename from src/main/java/electrosphere/game/server/ai/creature/MindlessAttacker.java rename to src/main/java/electrosphere/server/ai/creature/MindlessAttacker.java index b199e48b..1c401c6a 100644 --- a/src/main/java/electrosphere/game/server/ai/creature/MindlessAttacker.java +++ b/src/main/java/electrosphere/server/ai/creature/MindlessAttacker.java @@ -1,5 +1,6 @@ -package electrosphere.game.server.ai.creature; +package electrosphere.server.ai.creature; +import electrosphere.engine.Globals; import electrosphere.entity.Entity; import electrosphere.entity.EntityDataStrings; import electrosphere.entity.EntityUtils; @@ -7,8 +8,8 @@ import electrosphere.entity.state.attack.AttackTree; import electrosphere.entity.state.movement.GroundMovementTree; import electrosphere.entity.state.movement.GroundMovementTree.MovementRelativeFacing; import electrosphere.entity.types.creature.CreatureUtils; -import electrosphere.game.server.ai.AI; -import electrosphere.main.Globals; +import electrosphere.server.ai.AI; + import org.joml.Vector3d; import org.joml.Vector3f; diff --git a/src/main/java/electrosphere/game/server/ai/creature/OpportunisticAttacker.java b/src/main/java/electrosphere/server/ai/creature/OpportunisticAttacker.java similarity index 98% rename from src/main/java/electrosphere/game/server/ai/creature/OpportunisticAttacker.java rename to src/main/java/electrosphere/server/ai/creature/OpportunisticAttacker.java index 7a3cf261..5ebd4c60 100644 --- a/src/main/java/electrosphere/game/server/ai/creature/OpportunisticAttacker.java +++ b/src/main/java/electrosphere/server/ai/creature/OpportunisticAttacker.java @@ -1,5 +1,6 @@ -package electrosphere.game.server.ai.creature; +package electrosphere.server.ai.creature; +import electrosphere.engine.Globals; import electrosphere.entity.Entity; import electrosphere.entity.EntityDataStrings; import electrosphere.entity.EntityUtils; @@ -9,8 +10,7 @@ import electrosphere.entity.state.movement.GroundMovementTree; import electrosphere.entity.state.movement.GroundMovementTree.MovementRelativeFacing; import electrosphere.entity.types.creature.CreatureUtils; import electrosphere.entity.types.item.ItemUtils; -import electrosphere.game.server.ai.AI; -import electrosphere.main.Globals; +import electrosphere.server.ai.AI; import org.joml.Vector3f; diff --git a/src/main/java/electrosphere/game/server/datacell/DataCellManager.java b/src/main/java/electrosphere/server/datacell/DataCellManager.java similarity index 96% rename from src/main/java/electrosphere/game/server/datacell/DataCellManager.java rename to src/main/java/electrosphere/server/datacell/DataCellManager.java index e398e875..49ac9803 100644 --- a/src/main/java/electrosphere/game/server/datacell/DataCellManager.java +++ b/src/main/java/electrosphere/server/datacell/DataCellManager.java @@ -1,11 +1,11 @@ -package electrosphere.game.server.datacell; +package electrosphere.server.datacell; +import electrosphere.engine.Globals; import electrosphere.entity.Entity; import electrosphere.entity.EntityUtils; import electrosphere.game.collision.CommonWorldData; import electrosphere.game.server.world.ServerWorldData; import electrosphere.logger.LoggerInterface; -import electrosphere.main.Globals; import electrosphere.net.parser.net.message.NetworkMessage; import electrosphere.net.server.player.Player; @@ -35,6 +35,16 @@ public class DataCellManager { public void init(){ loadingCell = new ServerDataCell(); } + + public ServerDataCell createNewCell(){ + ServerDataCell newCell = new ServerDataCell(); + loadedDataCells.add(newCell); + return newCell; + } + + public void deregisterCell(ServerDataCell cell){ + loadedDataCells.remove(cell); + } public void addPlayerToGroundCells(Player player){ diff --git a/src/main/java/electrosphere/game/server/datacell/EnvironmentGenerator.java b/src/main/java/electrosphere/server/datacell/EnvironmentGenerator.java similarity index 94% rename from src/main/java/electrosphere/game/server/datacell/EnvironmentGenerator.java rename to src/main/java/electrosphere/server/datacell/EnvironmentGenerator.java index ba62ec25..8f36eeb0 100644 --- a/src/main/java/electrosphere/game/server/datacell/EnvironmentGenerator.java +++ b/src/main/java/electrosphere/server/datacell/EnvironmentGenerator.java @@ -1,10 +1,11 @@ -package electrosphere.game.server.datacell; +package electrosphere.server.datacell; +import electrosphere.engine.Globals; import electrosphere.entity.Entity; import electrosphere.entity.EntityUtils; import electrosphere.entity.types.collision.CollisionObjUtils; import electrosphere.entity.types.foliage.FoliageUtils; -import electrosphere.main.Globals; + import java.util.List; import java.util.Random; import org.joml.Quaternionf; diff --git a/src/main/java/electrosphere/game/server/datacell/ServerDataCell.java b/src/main/java/electrosphere/server/datacell/ServerDataCell.java similarity index 97% rename from src/main/java/electrosphere/game/server/datacell/ServerDataCell.java rename to src/main/java/electrosphere/server/datacell/ServerDataCell.java index 6052fe1a..70e1d6a1 100644 --- a/src/main/java/electrosphere/game/server/datacell/ServerDataCell.java +++ b/src/main/java/electrosphere/server/datacell/ServerDataCell.java @@ -1,16 +1,16 @@ -package electrosphere.game.server.datacell; +package electrosphere.server.datacell; +import electrosphere.engine.Globals; import electrosphere.entity.Entity; import electrosphere.entity.types.creature.CreatureUtils; import electrosphere.entity.types.item.ItemUtils; import electrosphere.entity.types.structure.StructureUtils; import electrosphere.game.server.character.Character; -import electrosphere.game.server.pathfinding.NavMeshUtils; -import electrosphere.game.server.pathfinding.navmesh.NavMesh; -import electrosphere.main.Globals; import electrosphere.net.parser.net.message.EntityMessage; import electrosphere.net.parser.net.message.NetworkMessage; import electrosphere.net.server.player.Player; +import electrosphere.server.pathfinding.NavMeshUtils; +import electrosphere.server.pathfinding.navmesh.NavMesh; import java.util.LinkedList; import java.util.List; diff --git a/src/main/java/electrosphere/game/server/db/DatabaseController.java b/src/main/java/electrosphere/server/db/DatabaseController.java similarity index 99% rename from src/main/java/electrosphere/game/server/db/DatabaseController.java rename to src/main/java/electrosphere/server/db/DatabaseController.java index 04d2407c..17ac1283 100644 --- a/src/main/java/electrosphere/game/server/db/DatabaseController.java +++ b/src/main/java/electrosphere/server/db/DatabaseController.java @@ -1,4 +1,4 @@ -package electrosphere.game.server.db; +package electrosphere.server.db; import electrosphere.logger.LoggerInterface; import java.sql.Connection; diff --git a/src/main/java/electrosphere/game/server/db/DatabaseResult.java b/src/main/java/electrosphere/server/db/DatabaseResult.java similarity index 98% rename from src/main/java/electrosphere/game/server/db/DatabaseResult.java rename to src/main/java/electrosphere/server/db/DatabaseResult.java index e9a660e9..3b59b89b 100644 --- a/src/main/java/electrosphere/game/server/db/DatabaseResult.java +++ b/src/main/java/electrosphere/server/db/DatabaseResult.java @@ -1,4 +1,4 @@ -package electrosphere.game.server.db; +package electrosphere.server.db; import com.google.gson.Gson; import electrosphere.logger.LoggerInterface; diff --git a/src/main/java/electrosphere/game/server/db/DatabaseResultIterator.java b/src/main/java/electrosphere/server/db/DatabaseResultIterator.java similarity index 98% rename from src/main/java/electrosphere/game/server/db/DatabaseResultIterator.java rename to src/main/java/electrosphere/server/db/DatabaseResultIterator.java index 02f0baea..1efcc49d 100644 --- a/src/main/java/electrosphere/game/server/db/DatabaseResultIterator.java +++ b/src/main/java/electrosphere/server/db/DatabaseResultIterator.java @@ -1,4 +1,4 @@ -package electrosphere.game.server.db; +package electrosphere.server.db; import java.sql.ResultSet; import java.sql.ResultSetMetaData; diff --git a/src/main/java/electrosphere/game/server/db/DatabaseResultRow.java b/src/main/java/electrosphere/server/db/DatabaseResultRow.java similarity index 98% rename from src/main/java/electrosphere/game/server/db/DatabaseResultRow.java rename to src/main/java/electrosphere/server/db/DatabaseResultRow.java index 97534560..4b89c271 100644 --- a/src/main/java/electrosphere/game/server/db/DatabaseResultRow.java +++ b/src/main/java/electrosphere/server/db/DatabaseResultRow.java @@ -1,4 +1,4 @@ -package electrosphere.game.server.db; +package electrosphere.server.db; import java.util.HashMap; import java.util.Map; diff --git a/src/main/java/electrosphere/game/server/db/DatabaseUtils.java b/src/main/java/electrosphere/server/db/DatabaseUtils.java similarity index 97% rename from src/main/java/electrosphere/game/server/db/DatabaseUtils.java rename to src/main/java/electrosphere/server/db/DatabaseUtils.java index 858142cc..846700e1 100644 --- a/src/main/java/electrosphere/game/server/db/DatabaseUtils.java +++ b/src/main/java/electrosphere/server/db/DatabaseUtils.java @@ -1,7 +1,7 @@ -package electrosphere.game.server.db; +package electrosphere.server.db; +import electrosphere.engine.Globals; import electrosphere.logger.LoggerInterface; -import electrosphere.main.Globals; import electrosphere.util.FileUtils; import java.io.IOException; import java.util.logging.Level; diff --git a/src/main/java/electrosphere/game/server/pathfinding/ChunkMeshList.java b/src/main/java/electrosphere/server/pathfinding/ChunkMeshList.java similarity index 84% rename from src/main/java/electrosphere/game/server/pathfinding/ChunkMeshList.java rename to src/main/java/electrosphere/server/pathfinding/ChunkMeshList.java index 20d4cb7c..850e113d 100644 --- a/src/main/java/electrosphere/game/server/pathfinding/ChunkMeshList.java +++ b/src/main/java/electrosphere/server/pathfinding/ChunkMeshList.java @@ -1,7 +1,8 @@ -package electrosphere.game.server.pathfinding; +package electrosphere.server.pathfinding; -import electrosphere.game.server.pathfinding.navmesh.NavMesh; import electrosphere.game.server.terrain.manager.ServerTerrainChunk; +import electrosphere.server.pathfinding.navmesh.NavMesh; + import java.util.LinkedList; import java.util.List; diff --git a/src/main/java/electrosphere/game/server/pathfinding/NavMeshManager.java b/src/main/java/electrosphere/server/pathfinding/NavMeshManager.java similarity index 75% rename from src/main/java/electrosphere/game/server/pathfinding/NavMeshManager.java rename to src/main/java/electrosphere/server/pathfinding/NavMeshManager.java index a1315655..8ad6f55c 100644 --- a/src/main/java/electrosphere/game/server/pathfinding/NavMeshManager.java +++ b/src/main/java/electrosphere/server/pathfinding/NavMeshManager.java @@ -1,11 +1,12 @@ -package electrosphere.game.server.pathfinding; +package electrosphere.server.pathfinding; -import electrosphere.game.server.pathfinding.blocker.NavBlocker; -import electrosphere.game.server.pathfinding.blocker.NavTerrainBlockerCache; -import electrosphere.game.server.pathfinding.navmesh.NavMesh; -import electrosphere.game.server.pathfinding.navmesh.NavShape; -import electrosphere.game.server.pathfinding.path.Waypoint; import electrosphere.game.server.terrain.manager.ServerTerrainChunk; +import electrosphere.server.pathfinding.blocker.NavBlocker; +import electrosphere.server.pathfinding.blocker.NavTerrainBlockerCache; +import electrosphere.server.pathfinding.navmesh.NavMesh; +import electrosphere.server.pathfinding.navmesh.NavShape; +import electrosphere.server.pathfinding.path.Waypoint; + import java.util.HashMap; import java.util.LinkedList; import java.util.List; diff --git a/src/main/java/electrosphere/game/server/pathfinding/NavMeshPathfinder.java b/src/main/java/electrosphere/server/pathfinding/NavMeshPathfinder.java similarity index 98% rename from src/main/java/electrosphere/game/server/pathfinding/NavMeshPathfinder.java rename to src/main/java/electrosphere/server/pathfinding/NavMeshPathfinder.java index 27c11cfd..3274f63d 100644 --- a/src/main/java/electrosphere/game/server/pathfinding/NavMeshPathfinder.java +++ b/src/main/java/electrosphere/server/pathfinding/NavMeshPathfinder.java @@ -1,11 +1,12 @@ -package electrosphere.game.server.pathfinding; +package electrosphere.server.pathfinding; import electrosphere.entity.Entity; import electrosphere.entity.EntityUtils; -import electrosphere.game.server.pathfinding.navmesh.NavCube; -import electrosphere.game.server.pathfinding.navmesh.NavMesh; -import electrosphere.game.server.pathfinding.navmesh.NavShape; -import electrosphere.game.server.pathfinding.path.Waypoint; +import electrosphere.server.pathfinding.navmesh.NavCube; +import electrosphere.server.pathfinding.navmesh.NavMesh; +import electrosphere.server.pathfinding.navmesh.NavShape; +import electrosphere.server.pathfinding.path.Waypoint; + import java.awt.geom.Line2D; import java.util.HashMap; import java.util.LinkedList; diff --git a/src/main/java/electrosphere/game/server/pathfinding/NavMeshUtils.java b/src/main/java/electrosphere/server/pathfinding/NavMeshUtils.java similarity index 97% rename from src/main/java/electrosphere/game/server/pathfinding/NavMeshUtils.java rename to src/main/java/electrosphere/server/pathfinding/NavMeshUtils.java index c7d87095..20d76c96 100644 --- a/src/main/java/electrosphere/game/server/pathfinding/NavMeshUtils.java +++ b/src/main/java/electrosphere/server/pathfinding/NavMeshUtils.java @@ -1,12 +1,13 @@ -package electrosphere.game.server.pathfinding; +package electrosphere.server.pathfinding; -import electrosphere.game.server.pathfinding.blocker.NavBlocker; -import electrosphere.game.server.pathfinding.navmesh.NavCube; -import electrosphere.game.server.pathfinding.navmesh.NavMesh; -import electrosphere.game.server.pathfinding.navmesh.NavShape; +import electrosphere.engine.Globals; import electrosphere.game.server.terrain.manager.ServerTerrainChunk; import electrosphere.logger.LoggerInterface; -import electrosphere.main.Globals; +import electrosphere.server.pathfinding.blocker.NavBlocker; +import electrosphere.server.pathfinding.navmesh.NavCube; +import electrosphere.server.pathfinding.navmesh.NavMesh; +import electrosphere.server.pathfinding.navmesh.NavShape; + import java.util.LinkedList; import java.util.List; import org.joml.Vector2i; diff --git a/src/main/java/electrosphere/game/server/pathfinding/blocker/NavBlocker.java b/src/main/java/electrosphere/server/pathfinding/blocker/NavBlocker.java similarity index 88% rename from src/main/java/electrosphere/game/server/pathfinding/blocker/NavBlocker.java rename to src/main/java/electrosphere/server/pathfinding/blocker/NavBlocker.java index f04eeb58..b09a3a6a 100644 --- a/src/main/java/electrosphere/game/server/pathfinding/blocker/NavBlocker.java +++ b/src/main/java/electrosphere/server/pathfinding/blocker/NavBlocker.java @@ -1,6 +1,6 @@ -package electrosphere.game.server.pathfinding.blocker; +package electrosphere.server.pathfinding.blocker; -import electrosphere.main.Globals; +import electrosphere.engine.Globals; /** * diff --git a/src/main/java/electrosphere/game/server/pathfinding/blocker/NavTerrainBlockerCache.java b/src/main/java/electrosphere/server/pathfinding/blocker/NavTerrainBlockerCache.java similarity index 97% rename from src/main/java/electrosphere/game/server/pathfinding/blocker/NavTerrainBlockerCache.java rename to src/main/java/electrosphere/server/pathfinding/blocker/NavTerrainBlockerCache.java index 7a6f9b67..a770af36 100644 --- a/src/main/java/electrosphere/game/server/pathfinding/blocker/NavTerrainBlockerCache.java +++ b/src/main/java/electrosphere/server/pathfinding/blocker/NavTerrainBlockerCache.java @@ -1,4 +1,4 @@ -package electrosphere.game.server.pathfinding.blocker; +package electrosphere.server.pathfinding.blocker; import java.util.ArrayList; import java.util.HashMap; diff --git a/src/main/java/electrosphere/game/server/pathfinding/navmesh/NavCube.java b/src/main/java/electrosphere/server/pathfinding/navmesh/NavCube.java similarity index 95% rename from src/main/java/electrosphere/game/server/pathfinding/navmesh/NavCube.java rename to src/main/java/electrosphere/server/pathfinding/navmesh/NavCube.java index 4a32ab6c..723a4ac3 100644 --- a/src/main/java/electrosphere/game/server/pathfinding/navmesh/NavCube.java +++ b/src/main/java/electrosphere/server/pathfinding/navmesh/NavCube.java @@ -1,4 +1,4 @@ -package electrosphere.game.server.pathfinding.navmesh; +package electrosphere.server.pathfinding.navmesh; import java.util.LinkedList; import java.util.List; diff --git a/src/main/java/electrosphere/game/server/pathfinding/navmesh/NavMesh.java b/src/main/java/electrosphere/server/pathfinding/navmesh/NavMesh.java similarity index 94% rename from src/main/java/electrosphere/game/server/pathfinding/navmesh/NavMesh.java rename to src/main/java/electrosphere/server/pathfinding/navmesh/NavMesh.java index 5e8ba6be..605bf30c 100644 --- a/src/main/java/electrosphere/game/server/pathfinding/navmesh/NavMesh.java +++ b/src/main/java/electrosphere/server/pathfinding/navmesh/NavMesh.java @@ -1,4 +1,4 @@ -package electrosphere.game.server.pathfinding.navmesh; +package electrosphere.server.pathfinding.navmesh; import java.util.LinkedList; import java.util.List; diff --git a/src/main/java/electrosphere/game/server/pathfinding/navmesh/NavShape.java b/src/main/java/electrosphere/server/pathfinding/navmesh/NavShape.java similarity index 84% rename from src/main/java/electrosphere/game/server/pathfinding/navmesh/NavShape.java rename to src/main/java/electrosphere/server/pathfinding/navmesh/NavShape.java index 8ba4d8c7..12158897 100644 --- a/src/main/java/electrosphere/game/server/pathfinding/navmesh/NavShape.java +++ b/src/main/java/electrosphere/server/pathfinding/navmesh/NavShape.java @@ -1,4 +1,4 @@ -package electrosphere.game.server.pathfinding.navmesh; +package electrosphere.server.pathfinding.navmesh; import java.util.List; diff --git a/src/main/java/electrosphere/game/server/pathfinding/path/Waypoint.java b/src/main/java/electrosphere/server/pathfinding/path/Waypoint.java similarity index 76% rename from src/main/java/electrosphere/game/server/pathfinding/path/Waypoint.java rename to src/main/java/electrosphere/server/pathfinding/path/Waypoint.java index 26a8f0af..83bf63bd 100644 --- a/src/main/java/electrosphere/game/server/pathfinding/path/Waypoint.java +++ b/src/main/java/electrosphere/server/pathfinding/path/Waypoint.java @@ -1,4 +1,4 @@ -package electrosphere.game.server.pathfinding.path; +package electrosphere.server.pathfinding.path; import org.joml.Vector3d; diff --git a/src/main/java/electrosphere/game/server/saves/Save.java b/src/main/java/electrosphere/server/saves/Save.java similarity index 85% rename from src/main/java/electrosphere/game/server/saves/Save.java rename to src/main/java/electrosphere/server/saves/Save.java index a836233e..2ff293ea 100644 --- a/src/main/java/electrosphere/game/server/saves/Save.java +++ b/src/main/java/electrosphere/server/saves/Save.java @@ -1,4 +1,4 @@ -package electrosphere.game.server.saves; +package electrosphere.server.saves; /** * diff --git a/src/main/java/electrosphere/game/server/saves/SaveUtils.java b/src/main/java/electrosphere/server/saves/SaveUtils.java similarity index 95% rename from src/main/java/electrosphere/game/server/saves/SaveUtils.java rename to src/main/java/electrosphere/server/saves/SaveUtils.java index b4cd4fd2..dcd2effe 100644 --- a/src/main/java/electrosphere/game/server/saves/SaveUtils.java +++ b/src/main/java/electrosphere/server/saves/SaveUtils.java @@ -1,13 +1,13 @@ -package electrosphere.game.server.saves; +package electrosphere.server.saves; import java.util.List; -import electrosphere.game.server.datacell.DataCellManager; -import electrosphere.game.server.db.DatabaseUtils; +import electrosphere.engine.Globals; import electrosphere.game.server.terrain.manager.ServerTerrainManager; import electrosphere.game.server.world.ServerWorldData; import electrosphere.logger.LoggerInterface; -import electrosphere.main.Globals; +import electrosphere.server.datacell.DataCellManager; +import electrosphere.server.db.DatabaseUtils; import electrosphere.util.FileUtils; /** diff --git a/src/main/java/electrosphere/game/simulation/MacroSimulation.java b/src/main/java/electrosphere/server/simulation/MacroSimulation.java similarity index 98% rename from src/main/java/electrosphere/game/simulation/MacroSimulation.java rename to src/main/java/electrosphere/server/simulation/MacroSimulation.java index 7d0cb856..dfa2b936 100644 --- a/src/main/java/electrosphere/game/simulation/MacroSimulation.java +++ b/src/main/java/electrosphere/server/simulation/MacroSimulation.java @@ -1,14 +1,14 @@ -package electrosphere.game.simulation; +package electrosphere.server.simulation; import electrosphere.game.server.civilization.Civilization; import electrosphere.game.server.civilization.model.CivilizationMap; +import electrosphere.engine.Globals; import electrosphere.game.data.creature.type.CreatureType; import electrosphere.game.data.creature.type.model.CreatureTypeMap; import electrosphere.game.server.culture.Culture; import electrosphere.game.server.culture.religion.Religion; import electrosphere.game.server.structure.virtual.Structure; import electrosphere.game.server.town.Town; -import electrosphere.main.Globals; import electrosphere.game.server.character.Character; import electrosphere.game.server.character.CharacterDataStrings; import electrosphere.game.server.character.CharacterUtils; diff --git a/src/main/java/electrosphere/game/simulation/MicroSimulation.java b/src/main/java/electrosphere/server/simulation/MicroSimulation.java similarity index 98% rename from src/main/java/electrosphere/game/simulation/MicroSimulation.java rename to src/main/java/electrosphere/server/simulation/MicroSimulation.java index 9d048b63..4e435995 100644 --- a/src/main/java/electrosphere/game/simulation/MicroSimulation.java +++ b/src/main/java/electrosphere/server/simulation/MicroSimulation.java @@ -1,6 +1,8 @@ -package electrosphere.game.simulation; +package electrosphere.server.simulation; import electrosphere.entity.types.attach.AttachUtils; +import electrosphere.engine.Globals; +import electrosphere.engine.Main; import electrosphere.entity.Entity; import electrosphere.entity.EntityDataStrings; import electrosphere.entity.EntityUtils; @@ -19,8 +21,6 @@ import electrosphere.entity.state.life.LifeUtils; import electrosphere.entity.state.movement.SprintTree; import electrosphere.entity.types.particle.ParticleUtils; import electrosphere.game.client.targeting.crosshair.Crosshair; -import electrosphere.main.Globals; -import electrosphere.main.Main; import electrosphere.renderer.actor.Actor; diff --git a/src/main/java/electrosphere/util/FileUtils.java b/src/main/java/electrosphere/util/FileUtils.java index 5822bd8b..2f37c371 100644 --- a/src/main/java/electrosphere/util/FileUtils.java +++ b/src/main/java/electrosphere/util/FileUtils.java @@ -3,9 +3,10 @@ package electrosphere.util; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import electrosphere.engine.Main; import electrosphere.game.data.creature.type.movement.MovementSystem; import electrosphere.game.data.creature.type.movement.MovementSystemSerializer; -import electrosphere.main.Main; + import java.io.BufferedReader; import java.io.File; import java.io.IOException; diff --git a/src/main/java/electrosphere/util/Utilities.java b/src/main/java/electrosphere/util/Utilities.java index aafe43ed..94862ea6 100644 --- a/src/main/java/electrosphere/util/Utilities.java +++ b/src/main/java/electrosphere/util/Utilities.java @@ -1,5 +1,7 @@ package electrosphere.util; +import electrosphere.engine.Globals; +import electrosphere.engine.Main; import electrosphere.renderer.Material; import electrosphere.renderer.Mesh; import electrosphere.renderer.Model; @@ -7,8 +9,7 @@ import electrosphere.renderer.ShaderProgram; import electrosphere.renderer.texture.Texture; import electrosphere.renderer.texture.TextureMap; import com.google.gson.Gson; -import electrosphere.main.Globals; -import electrosphere.main.Main; + import java.io.BufferedReader; import java.io.File; import java.io.IOException; diff --git a/src/main/java/electrosphere/util/worldviewer/TerrainViewer.java b/src/main/java/electrosphere/util/worldviewer/TerrainViewer.java index 6e716e7b..1cf9a60d 100644 --- a/src/main/java/electrosphere/util/worldviewer/TerrainViewer.java +++ b/src/main/java/electrosphere/util/worldviewer/TerrainViewer.java @@ -1,11 +1,12 @@ package electrosphere.util.worldviewer; import com.google.gson.Gson; -import electrosphere.game.simulation.MacroSimulation; + +import electrosphere.engine.Globals; +import electrosphere.engine.Main; import electrosphere.game.server.terrain.manager.ServerTerrainManager; import electrosphere.game.server.terrain.models.TerrainModel; -import electrosphere.main.Globals; -import electrosphere.main.Main; +import electrosphere.server.simulation.MacroSimulation; import electrosphere.util.FileUtils; import electrosphere.util.Utilities; import java.awt.Color; diff --git a/src/test/java/testingutils/MainLoop.java b/src/test/java/testingutils/MainLoop.java index 883d670b..9f2a8558 100644 --- a/src/test/java/testingutils/MainLoop.java +++ b/src/test/java/testingutils/MainLoop.java @@ -6,12 +6,12 @@ import java.util.concurrent.TimeUnit; import electrosphere.audio.AudioEngine; import electrosphere.controls.ControlHandler; +import electrosphere.engine.Globals; import electrosphere.engine.LoadingThread; import electrosphere.engine.cli.CLIParser; import electrosphere.game.client.ClientFunctions; import electrosphere.game.config.UserSettings; import electrosphere.logger.LoggerInterface; -import electrosphere.main.Globals; import electrosphere.renderer.RenderingEngine; public class MainLoop {