Just an update, banners can now be placed but I only see them when reconnecting. I'm assuming I need to send an update to let the client know about the new banner. Looking at the other item handlers it must be something like this, but it doesn't work. Any pointers?
virtual bool OnPlayerPlace( cWorld & a_World, cPlayer & a_Player, const cItem & a_EquippedItem, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ ) override { // If the regular placement doesn't work, do no further processing: if (!super::OnPlayerPlace(a_World, a_Player, a_EquippedItem, a_BlockX, a_BlockY, a_BlockZ, a_BlockFace, a_CursorX, a_CursorY, a_CursorZ)) { return false; } AddFaceDirection(a_BlockX, a_BlockY, a_BlockZ, a_BlockFace); // Use a callback to set the properties of the banner entity class cCallback : public cBlockEntityCallback { cPlayer & m_Player; NIBBLETYPE m_BlockMeta; virtual bool Item(cBlockEntity * a_BlockEntity) { if (!(a_BlockEntity->GetBlockType() == E_BLOCK_STANDING_BANNER || a_BlockEntity->GetBlockType() == E_BLOCK_WALL_BANNER)) { return false; } auto BannerEntity = static_cast<cBannerEntity *>(a_BlockEntity); //TODO base color and patterns BannerEntity->GetWorld()->BroadcastBlockEntity(BannerEntity->GetPosX(), BannerEntity->GetPosY(), BannerEntity->GetPosZ()); //m_Player.GetClientHandle()->SendUpdateBlockEntity(*a_BlockEntity); return false; } public: cCallback(cPlayer & a_CBPlayer, NIBBLETYPE a_BlockMeta) : m_Player(a_CBPlayer), m_BlockMeta(a_BlockMeta) {} }; cCallback Callback(a_Player, static_cast<NIBBLETYPE>(a_BlockFace)); a_World.DoWithBlockEntityAt(a_BlockX, a_BlockY, a_BlockZ, Callback); return true; }