summaryrefslogtreecommitdiffstats
path: root/src/Entities
diff options
context:
space:
mode:
authorKingCol13 <48412633+KingCol13@users.noreply.github.com>2021-07-09 19:45:53 +0200
committerGitHub <noreply@github.com>2021-07-09 19:45:53 +0200
commit68776c4d5919638b3cecccd083155cd58ccac573 (patch)
tree8b1d508953c3f3f260ad1b33c40e7ef9674ff0d0 /src/Entities
parentProtoProxy: encrypt in-place (diff)
downloadcuberite-68776c4d5919638b3cecccd083155cd58ccac573.tar
cuberite-68776c4d5919638b3cecccd083155cd58ccac573.tar.gz
cuberite-68776c4d5919638b3cecccd083155cd58ccac573.tar.bz2
cuberite-68776c4d5919638b3cecccd083155cd58ccac573.tar.lz
cuberite-68776c4d5919638b3cecccd083155cd58ccac573.tar.xz
cuberite-68776c4d5919638b3cecccd083155cd58ccac573.tar.zst
cuberite-68776c4d5919638b3cecccd083155cd58ccac573.zip
Diffstat (limited to 'src/Entities')
-rw-r--r--src/Entities/ItemFrame.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/Entities/ItemFrame.cpp b/src/Entities/ItemFrame.cpp
index ef2939e06..eeab06737 100644
--- a/src/Entities/ItemFrame.cpp
+++ b/src/Entities/ItemFrame.cpp
@@ -4,6 +4,7 @@
#include "ItemFrame.h"
#include "Player.h"
#include "../ClientHandle.h"
+#include "Chunk.h"
@@ -26,7 +27,7 @@ void cItemFrame::OnRightClicked(cPlayer & a_Player)
if (!m_Item.IsEmpty())
{
- // Item not empty, rotate, clipping values to zero to three inclusive
+ // Item not empty, rotate, clipping values to zero to seven inclusive
m_ItemRotation++;
if (m_ItemRotation >= 8)
{
@@ -46,6 +47,7 @@ void cItemFrame::OnRightClicked(cPlayer & a_Player)
}
GetWorld()->BroadcastEntityMetadata(*this); // Update clients
+ GetParentChunk()->MarkDirty(); // Mark chunk dirty to save rotation or item
}
@@ -97,4 +99,13 @@ void cItemFrame::SpawnOn(cClientHandle & a_ClientHandle)
Super::SpawnOn(a_ClientHandle);
a_ClientHandle.SendSpawnEntity(*this);
a_ClientHandle.SendEntityMetadata(*this);
+
+ if (m_Item.m_ItemType == E_ITEM_MAP)
+ {
+ cMap * Map = GetWorld()->GetMapManager().GetMapData(static_cast<unsigned>(m_Item.m_ItemDamage));
+ if (Map != nullptr)
+ {
+ a_ClientHandle.SendMapData(*Map, 0, 0);
+ }
+ }
}