summaryrefslogtreecommitdiffstats
path: root/src/Blocks/Mixins.h
diff options
context:
space:
mode:
authorGefaketHD <Jobad@live.de>2020-04-10 18:52:59 +0200
committerAlexander Harkness <me@bearbin.net>2020-04-11 21:00:05 +0200
commit0712fd2d90203d171a76e0fef0d517022f173070 (patch)
tree7a979af7c13826b75007c4606a4d94c473f8b0e2 /src/Blocks/Mixins.h
parentReplace all single-digit hex constants with two-digit version (diff)
downloadcuberite-0712fd2d90203d171a76e0fef0d517022f173070.tar
cuberite-0712fd2d90203d171a76e0fef0d517022f173070.tar.gz
cuberite-0712fd2d90203d171a76e0fef0d517022f173070.tar.bz2
cuberite-0712fd2d90203d171a76e0fef0d517022f173070.tar.lz
cuberite-0712fd2d90203d171a76e0fef0d517022f173070.tar.xz
cuberite-0712fd2d90203d171a76e0fef0d517022f173070.tar.zst
cuberite-0712fd2d90203d171a76e0fef0d517022f173070.zip
Diffstat (limited to 'src/Blocks/Mixins.h')
-rw-r--r--src/Blocks/Mixins.h22
1 files changed, 8 insertions, 14 deletions
diff --git a/src/Blocks/Mixins.h b/src/Blocks/Mixins.h
index 24fad22be..62eaeae5c 100644
--- a/src/Blocks/Mixins.h
+++ b/src/Blocks/Mixins.h
@@ -217,27 +217,21 @@ public:
value for a block placed by a player facing that way */
static NIBBLETYPE YawToMetaData(double a_Rotation)
{
- a_Rotation += 90 + 45; // So its not aligned with axis
-
- if (a_Rotation >= 360)
- {
- a_Rotation -= 360;
- }
- if ((a_Rotation >= 0) && (a_Rotation < 90))
+ if ((a_Rotation >= -135) && (a_Rotation < -45))
{
- return West;
+ return East;
}
- else if ((a_Rotation >= 90) && (a_Rotation < 180))
+ else if ((a_Rotation >= -45) && (a_Rotation < 45))
{
- return North;
+ return South;
}
- else if ((a_Rotation >= 180) && (a_Rotation < 270))
+ else if ((a_Rotation >= 45) && (a_Rotation < 135))
{
- return East;
+ return West;
}
- else // (a_Rotation >= 270) && (a_Rotation < 360)
+ else // degrees jumping from 180 to -180
{
- return South;
+ return North;
}
}
};