fixing rotation - rel. #4625
This commit is contained in:
parent
0d72270186
commit
0712fd2d90
|
@ -97,7 +97,7 @@
|
|||
|
||||
|
||||
|
||||
using cBlockGlazedTerracottaHandler = cClearMetaOnDrop<cYawRotator<cBlockHandler, 0x03, 0x01, 0x03, 0x00, 0x02>>;
|
||||
using cBlockGlazedTerracottaHandler = cClearMetaOnDrop<cYawRotator<cBlockHandler, 0x03, 0x00, 0x01, 0x02, 0x03>>;
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -217,28 +217,22 @@ 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))
|
||||
{
|
||||
return West;
|
||||
}
|
||||
else if ((a_Rotation >= 90) && (a_Rotation < 180))
|
||||
{
|
||||
return North;
|
||||
}
|
||||
else if ((a_Rotation >= 180) && (a_Rotation < 270))
|
||||
if ((a_Rotation >= -135) && (a_Rotation < -45))
|
||||
{
|
||||
return East;
|
||||
}
|
||||
else // (a_Rotation >= 270) && (a_Rotation < 360)
|
||||
else if ((a_Rotation >= -45) && (a_Rotation < 45))
|
||||
{
|
||||
return South;
|
||||
}
|
||||
else if ((a_Rotation >= 45) && (a_Rotation < 135))
|
||||
{
|
||||
return West;
|
||||
}
|
||||
else // degrees jumping from 180 to -180
|
||||
{
|
||||
return North;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue