summaryrefslogtreecommitdiffstats
path: root/src/Blocks/BlockAnvil.h
diff options
context:
space:
mode:
authorHownaer <franzi.moos@googlemail.com>2014-08-28 18:57:56 +0200
committerHownaer <franzi.moos@googlemail.com>2014-08-28 18:57:56 +0200
commiteaf33e22cf65178d94aafab3df5d8a9f67581529 (patch)
treea3e95e7d6d40af8b04c8af8de1a5b45b31078148 /src/Blocks/BlockAnvil.h
parentFixed ItemCategory code example. (diff)
downloadcuberite-eaf33e22cf65178d94aafab3df5d8a9f67581529.tar
cuberite-eaf33e22cf65178d94aafab3df5d8a9f67581529.tar.gz
cuberite-eaf33e22cf65178d94aafab3df5d8a9f67581529.tar.bz2
cuberite-eaf33e22cf65178d94aafab3df5d8a9f67581529.tar.lz
cuberite-eaf33e22cf65178d94aafab3df5d8a9f67581529.tar.xz
cuberite-eaf33e22cf65178d94aafab3df5d8a9f67581529.tar.zst
cuberite-eaf33e22cf65178d94aafab3df5d8a9f67581529.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..376bf86a3 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 = 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;