From 3e124b2a0f289dac76b78fbd2cf51897cf02f07c Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Mon, 4 May 2015 13:17:16 -0600 Subject: [PATCH] Revert "Add: Helper methods for obtaining block's X and Z chunk coordinates given block's world coordinates." This reverts commit 592a98831a0cb1eb98824bf19b3cead11d2d2d0c. --- TrueCraft.Core/MathHelper.cs | 10 ---------- TrueCraft.Core/World/World.cs | 4 ++-- 2 files changed, 2 insertions(+), 12 deletions(-) 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)