diff --git a/TrueCraft.Core/MathHelper.cs b/TrueCraft.Core/MathHelper.cs index 4591901..b301b67 100644 --- a/TrueCraft.Core/MathHelper.cs +++ b/TrueCraft.Core/MathHelper.cs @@ -184,16 +184,6 @@ namespace TrueCraft.Core return (int)Math.Floor((double)BlockCoord / Chunk.Depth); } - public static int BlockToChunkBlockX(int BlockX) - { - return BlockX % Chunk.Width; - } - - public static int BlockToChunkBlockZ(int BlockZ) - { - return BlockZ % Chunk.Depth; - } - /// /// Returns a value indicating the most extreme value of the /// provided Vector. diff --git a/TrueCraft.Core/World/World.cs b/TrueCraft.Core/World/World.cs index 4d47642..111a81b 100644 --- a/TrueCraft.Core/World/World.cs +++ b/TrueCraft.Core/World/World.cs @@ -304,9 +304,9 @@ namespace TrueCraft.Core.World chunk = GetChunk(new Coordinates2D(chunkX, chunkZ)); return new Coordinates3D( - MathHelper.BlockToChunkBlockX(coordinates.X), + (coordinates.X - chunkX * Chunk.Width) % Chunk.Width, coordinates.Y, - MathHelper.BlockToChunkBlockZ(coordinates.Z)); + (coordinates.Z - chunkZ * Chunk.Depth) % Chunk.Depth); } public bool IsValidPosition(Coordinates3D position)