summaryrefslogtreecommitdiffstats
path: root/source/cBlockEntity.h
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-08-24 09:58:26 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-08-24 09:58:26 +0200
commite92b9e7ecbdf2918aab59d4eeb7bb5966430b264 (patch)
tree1a998d44e5faab91c54ea8517dd9fa02b3732ef7 /source/cBlockEntity.h
parentAdded plugin name to deprecation messages (diff)
downloadcuberite-e92b9e7ecbdf2918aab59d4eeb7bb5966430b264.tar
cuberite-e92b9e7ecbdf2918aab59d4eeb7bb5966430b264.tar.gz
cuberite-e92b9e7ecbdf2918aab59d4eeb7bb5966430b264.tar.bz2
cuberite-e92b9e7ecbdf2918aab59d4eeb7bb5966430b264.tar.lz
cuberite-e92b9e7ecbdf2918aab59d4eeb7bb5966430b264.tar.xz
cuberite-e92b9e7ecbdf2918aab59d4eeb7bb5966430b264.tar.zst
cuberite-e92b9e7ecbdf2918aab59d4eeb7bb5966430b264.zip
Diffstat (limited to 'source/cBlockEntity.h')
-rw-r--r--source/cBlockEntity.h23
1 files changed, 4 insertions, 19 deletions
diff --git a/source/cBlockEntity.h b/source/cBlockEntity.h
index 0a6494ec6..f5730d67e 100644
--- a/source/cBlockEntity.h
+++ b/source/cBlockEntity.h
@@ -58,25 +58,10 @@ public:
virtual void UsedBy( cPlayer * a_Player ) = 0;
- void SendTo( cClientHandle* a_Client )
- {
- std::auto_ptr<cPacket> Packet(GetPacket());
- if (Packet.get() == NULL)
- {
- return;
- }
- if ( a_Client != NULL )
- {
- a_Client->Send(*(Packet.get()));
- }
- else // broadcast to all chunk clients
- {
- m_World->BroadcastToChunkOfBlock(m_PosX, m_PosY, m_PosZ, Packet.get());
- }
- }
-
- /// Returns the packet to send to clients to represent this entity; NULL if no packet needed; caller is supposed to delete the packet
- virtual cPacket * GetPacket(void) {return NULL; }
+ /** Sends the packet defining the block entity to the client specified.
+ To send to all eligible clients, use cWorld::BroadcastBlockEntity()
+ */
+ virtual void SendTo(cClientHandle & a_Client) = 0;
protected:
int m_PosX; // Position in absolute block coordinates