Redstone wire and trapdoor fixes

* Fixes #1887
* Fixes #1763
* Fixes #1083
This commit is contained in:
Tiger Wang
2015-06-06 12:21:19 +01:00
parent bd48475085
commit 84534dfeb2
4 changed files with 345 additions and 333 deletions
+13
View File
@@ -96,6 +96,19 @@ public:
a_Z = a_Z - a_ChunkZ * Width;
}
inline static Vector3i AbsoluteToRelative(Vector3i a_BlockPosition)
{
int ChunkX, ChunkZ;
BlockToChunk(a_BlockPosition.x, a_BlockPosition.z, ChunkX, ChunkZ);
return {a_BlockPosition.x - ChunkX * Width, a_BlockPosition.y, a_BlockPosition.z - ChunkZ * Width};
}
inline static Vector3i AbsoluteToRelative(Vector3i a_BlockPosition, int a_ChunkX, int a_ChunkZ)
{
return {a_BlockPosition.x - a_ChunkX * Width, a_BlockPosition.y, a_BlockPosition.z - a_ChunkZ * Width};
}
/** Converts relative block coordinates into absolute coordinates with a known chunk location */
inline static Vector3i RelativeToAbsolute(const Vector3i & a_RelBlockPosition, int a_ChunkX, int a_ChunkZ)
{