summaryrefslogtreecommitdiffstats
path: root/src/Blocks/BlockAnvil.h
diff options
context:
space:
mode:
authorMasy98 <masy@antheruscraft.de>2014-08-30 21:31:51 +0200
committerMasy98 <masy@antheruscraft.de>2014-08-30 21:31:51 +0200
commit2d5a38bd61aa9436f2944f26344b14f92e30f025 (patch)
treed1caaf6446574ffdf676c272e39404ed8184a33b /src/Blocks/BlockAnvil.h
parentFixed slab name (diff)
parentcChunk: Fixed the Coords param. (diff)
downloadcuberite-2d5a38bd61aa9436f2944f26344b14f92e30f025.tar
cuberite-2d5a38bd61aa9436f2944f26344b14f92e30f025.tar.gz
cuberite-2d5a38bd61aa9436f2944f26344b14f92e30f025.tar.bz2
cuberite-2d5a38bd61aa9436f2944f26344b14f92e30f025.tar.lz
cuberite-2d5a38bd61aa9436f2944f26344b14f92e30f025.tar.xz
cuberite-2d5a38bd61aa9436f2944f26344b14f92e30f025.tar.zst
cuberite-2d5a38bd61aa9436f2944f26344b14f92e30f025.zip
Diffstat (limited to 'src/Blocks/BlockAnvil.h')
-rw-r--r--src/Blocks/BlockAnvil.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/Blocks/BlockAnvil.h b/src/Blocks/BlockAnvil.h
index 5c4661c11..20514580e 100644
--- a/src/Blocks/BlockAnvil.h
+++ b/src/Blocks/BlockAnvil.h
@@ -40,14 +40,15 @@ public:
) override
{
a_BlockType = m_BlockType;
- NIBBLETYPE HighBits = a_BlockMeta & 0x0c; // Only highest two bits are preserved
+ NIBBLETYPE Meta = (NIBBLETYPE)a_Player->GetEquippedItem().m_ItemDamage;
int Direction = (int)floor(a_Player->GetYaw() * 4.0 / 360.0 + 1.5) & 0x3;
+
switch (Direction)
{
- case 0: a_BlockMeta = 0x2 | HighBits; break;
- case 1: a_BlockMeta = 0x3 | HighBits; break;
- case 2: a_BlockMeta = 0x0 | HighBits; break;
- case 3: a_BlockMeta = 0x1 | HighBits; break;
+ case 0: a_BlockMeta = 0x2 | Meta << 2; break;
+ case 1: a_BlockMeta = 0x3 | Meta << 2; break;
+ case 2: a_BlockMeta = 0x0 | Meta << 2; break;
+ case 3: a_BlockMeta = 0x1 | Meta << 2; break;
default:
{
return false;