summaryrefslogtreecommitdiffstats
path: root/src/Entities/ItemFrame.cpp
diff options
context:
space:
mode:
authorTycho <work.tycho+git@gmail.com>2014-03-22 15:48:16 +0100
committerTycho <work.tycho+git@gmail.com>2014-03-22 15:48:16 +0100
commit2266c2150daad68c19d320683f6bf5abd7f2ebb2 (patch)
tree111fe0c36643afd27317b8d9a4c7912b6899ec4a /src/Entities/ItemFrame.cpp
parentPatched tolua to understand size_t (diff)
parentImplemented faster upscaling using templates. (diff)
downloadcuberite-2266c2150daad68c19d320683f6bf5abd7f2ebb2.tar
cuberite-2266c2150daad68c19d320683f6bf5abd7f2ebb2.tar.gz
cuberite-2266c2150daad68c19d320683f6bf5abd7f2ebb2.tar.bz2
cuberite-2266c2150daad68c19d320683f6bf5abd7f2ebb2.tar.lz
cuberite-2266c2150daad68c19d320683f6bf5abd7f2ebb2.tar.xz
cuberite-2266c2150daad68c19d320683f6bf5abd7f2ebb2.tar.zst
cuberite-2266c2150daad68c19d320683f6bf5abd7f2ebb2.zip
Diffstat (limited to 'src/Entities/ItemFrame.cpp')
-rw-r--r--src/Entities/ItemFrame.cpp39
1 files changed, 3 insertions, 36 deletions
diff --git a/src/Entities/ItemFrame.cpp b/src/Entities/ItemFrame.cpp
index 8cfa5e18d..9dd909880 100644
--- a/src/Entities/ItemFrame.cpp
+++ b/src/Entities/ItemFrame.cpp
@@ -10,43 +10,10 @@
cItemFrame::cItemFrame(eBlockFace a_BlockFace, double a_X, double a_Y, double a_Z)
- : cEntity(etItemFrame, a_X, a_Y, a_Z, 0.8, 0.8),
- m_BlockFace(a_BlockFace),
- m_Item(E_BLOCK_AIR),
- m_Rotation(0)
+ : cHangingEntity(etItemFrame, a_BlockFace, a_X, a_Y, a_Z)
+ , m_Item(E_BLOCK_AIR)
+ , m_Rotation(0)
{
- SetMaxHealth(1);
- SetHealth(1);
-}
-
-
-
-
-
-void cItemFrame::SpawnOn(cClientHandle & a_ClientHandle)
-{
- int Dir = 0;
-
- // The client uses different values for item frame directions and block faces. Our constants are for the block faces, so we convert them here to item frame faces
- switch (m_BlockFace)
- {
- case BLOCK_FACE_ZP: break; // Initialised to zero
- case BLOCK_FACE_ZM: Dir = 2; break;
- case BLOCK_FACE_XM: Dir = 1; break;
- case BLOCK_FACE_XP: Dir = 3; break;
- default: ASSERT(!"Unhandled block face when trying to spawn item frame!"); return;
- }
-
- if ((Dir == 0) || (Dir == 2)) // Probably a client bug, but two directions are flipped and contrary to the norm, so we do -180
- {
- SetYaw((Dir * 90) - 180);
- }
- else
- {
- SetYaw(Dir * 90);
- }
-
- a_ClientHandle.SendSpawnObject(*this, 71, Dir, (Byte)GetYaw(), (Byte)GetPitch());
}