aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/TilePos.cpp
diff options
context:
space:
mode:
authordaoge_cmd <3523206925@qq.com>2026-03-01 12:16:08 +0800
committerdaoge_cmd <3523206925@qq.com>2026-03-01 12:16:08 +0800
commitb691c43c44ff180d10e7d4a9afc83b98551ff586 (patch)
tree3e9849222cbc6ba49f2f1fc6e5fe7179632c7390 /Minecraft.World/TilePos.cpp
parentdef8cb415354ac390b7e89052a50605285f1aca9 (diff)
Initial commit
Diffstat (limited to 'Minecraft.World/TilePos.cpp')
-rw-r--r--Minecraft.World/TilePos.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/Minecraft.World/TilePos.cpp b/Minecraft.World/TilePos.cpp
new file mode 100644
index 00000000..a254d336
--- /dev/null
+++ b/Minecraft.World/TilePos.cpp
@@ -0,0 +1,29 @@
+#include "stdafx.h"
+
+#include "TilePos.h"
+#include "Vec3.h"
+
+TilePos::TilePos(int x, int y, int z)
+{
+ this->x = x;
+ this->y = y;
+ this->z = z;
+}
+
+// 4J - brought forward from 1.2.3
+TilePos::TilePos(Vec3 *p)
+{
+ this->x = Mth::floor(p->x);
+ this->y = Mth::floor(p->y);
+ this->z = Mth::floor(p->z);
+}
+
+int TilePos::hash_fnct(const TilePos &k)
+{
+ return k.x * 8976890 + k.y * 981131 + k.z;
+}
+
+bool TilePos::eq_test(const TilePos &x, const TilePos &y)
+{
+ return x.x == y.x && x.y == y.y && x.z == y.z;
+} \ No newline at end of file