diff --git a/docs/src/progress/renderertodo.md b/docs/src/progress/renderertodo.md index 1c38ead8..ecb44252 100644 --- a/docs/src/progress/renderertodo.md +++ b/docs/src/progress/renderertodo.md @@ -1783,6 +1783,7 @@ Grid aligned entity work Grid alignment visualization work Move around entity debug tab classes Grid alignment data editing in debug menus +Grid alignment offsets work diff --git a/src/main/java/electrosphere/controls/cursor/CursorState.java b/src/main/java/electrosphere/controls/cursor/CursorState.java index 65f667f6..0aebf483 100644 --- a/src/main/java/electrosphere/controls/cursor/CursorState.java +++ b/src/main/java/electrosphere/controls/cursor/CursorState.java @@ -346,15 +346,12 @@ public class CursorState { * @param position The position * @param data The data */ - public static void nudgeGridAlignment(Vector3d position, GridAlignedData data){ + private static void nudgeGridAlignment(Vector3d position, GridAlignedData data){ if(data.getWidth() / 2 == 1){ - position.x = position.x + BlockChunkData.BLOCK_SIZE_MULTIPLIER / 2.0f; - } - if(data.getHeight() / 2 == 1){ - position.y = position.y + BlockChunkData.BLOCK_SIZE_MULTIPLIER / 2.0f; + position.x = position.x - BlockChunkData.BLOCK_SIZE_MULTIPLIER / 2.0f; } if(data.getLength() / 2 == 1){ - position.z = position.z + BlockChunkData.BLOCK_SIZE_MULTIPLIER / 2.0f; + position.z = position.z - BlockChunkData.BLOCK_SIZE_MULTIPLIER / 2.0f; } } diff --git a/src/main/java/electrosphere/entity/types/common/CommonEntityUtils.java b/src/main/java/electrosphere/entity/types/common/CommonEntityUtils.java index b91a8839..53c98789 100644 --- a/src/main/java/electrosphere/entity/types/common/CommonEntityUtils.java +++ b/src/main/java/electrosphere/entity/types/common/CommonEntityUtils.java @@ -12,7 +12,6 @@ import org.ode4j.ode.DBody; import electrosphere.client.interact.ClientInteractionEngine; import electrosphere.collision.PhysicsEntityUtils; import electrosphere.collision.collidable.Collidable; -import electrosphere.controls.cursor.CursorState; import electrosphere.data.collidable.CollidableTemplate; import electrosphere.data.common.CommonEntityType; import electrosphere.data.creature.CreatureData; @@ -745,9 +744,6 @@ public class CommonEntityUtils { //grid alignment if(rawType.getGridAlignedData() != null){ - Vector3d placementPos = realm.getServerWorldData().clampRealToBlock(position); - CursorState.nudgeGridAlignment(placementPos,rawType.getGridAlignedData()); - position.set(placementPos); Globals.clientScene.registerEntityToTag(entity, EntityTags.BLOCK_OCCUPANT); //TODO: must register with all nearby scenes as well because it could possibly occupy other chunks }