diff --git a/docs/src/progress/renderertodo.md b/docs/src/progress/renderertodo.md index b75a15f5..e1ce2d9f 100644 --- a/docs/src/progress/renderertodo.md +++ b/docs/src/progress/renderertodo.md @@ -1943,6 +1943,7 @@ Error checking on mesh rendering (making sure not trying to draw 0-element meshe Fix generating rendering geometry for blocks/terrain with 0 elements GriddedDataCellManager filtering optimization StandardUniformManager implementation +Small fixes diff --git a/src/main/java/electrosphere/client/ui/menu/script/ScriptLevelEditorUtils.java b/src/main/java/electrosphere/client/ui/menu/script/ScriptLevelEditorUtils.java index 96fc9eee..003f00e5 100644 --- a/src/main/java/electrosphere/client/ui/menu/script/ScriptLevelEditorUtils.java +++ b/src/main/java/electrosphere/client/ui/menu/script/ScriptLevelEditorUtils.java @@ -43,6 +43,7 @@ public class ScriptLevelEditorUtils { cursorPos = new Vector3d(centerPos).add(new Vector3d(eyePos).normalize().mul(-CollisionEngine.DEFAULT_INTERACT_DISTANCE)); } cursorPos = cursorPos.add(cursorVerticalOffset); + realm.getServerWorldData().clampWithinBounds(cursorPos); CreatureUtils.serverSpawnBasicCreature(realm, cursorPos, Globals.clientState.selectedSpawntype.getId(), null); } else if(Globals.clientState.selectedSpawntype instanceof Item){ LoggerInterface.loggerEngine.INFO("spawn " + Globals.clientState.selectedSpawntype.getId() + "!"); diff --git a/src/main/java/electrosphere/data/entity/graphics/NonproceduralModel.java b/src/main/java/electrosphere/data/entity/graphics/NonproceduralModel.java index eaa22fcb..dd29d208 100644 --- a/src/main/java/electrosphere/data/entity/graphics/NonproceduralModel.java +++ b/src/main/java/electrosphere/data/entity/graphics/NonproceduralModel.java @@ -14,22 +14,22 @@ public class NonproceduralModel { /** * The path to the model */ - String path; + private String path; /** * The idle data for the model */ - IdleData idleData; + private IdleData idleData; /** * Uniform values set ahead of time */ - Map> uniforms; + private Map> uniforms; /** * The map of mesh to color to apply to that mesh */ - Map meshColorMap; + private Map meshColorMap; /** * Gets the path of the model diff --git a/src/main/java/electrosphere/engine/profiler/Profiler.java b/src/main/java/electrosphere/engine/profiler/Profiler.java index fe0c1fda..0391d39e 100644 --- a/src/main/java/electrosphere/engine/profiler/Profiler.java +++ b/src/main/java/electrosphere/engine/profiler/Profiler.java @@ -18,7 +18,7 @@ public class Profiler { /** * Pointer to the global instance */ - long pointer = -1; + private long pointer = -1; /** * Creates the profiler diff --git a/src/main/java/electrosphere/server/datacell/ServerWorldData.java b/src/main/java/electrosphere/server/datacell/ServerWorldData.java index 74dd6ad3..d02ea60b 100644 --- a/src/main/java/electrosphere/server/datacell/ServerWorldData.java +++ b/src/main/java/electrosphere/server/datacell/ServerWorldData.java @@ -430,6 +430,22 @@ public class ServerWorldData { realPos.z - realPos.z % BlockChunkData.BLOCK_SIZE_MULTIPLIER ); } + + /** + * Clamps a real position within bounds of the world + * @param realPos The real position + */ + public void clampWithinBounds(Vector3d realPos){ + if(realPos.x < 0){ + realPos.x = 0; + } + if(realPos.y < 0){ + realPos.y = 0; + } + if(realPos.z < 0){ + realPos.z = 0; + } + } /** * Gets the terrain manager for this world