From e92b9e7ecbdf2918aab59d4eeb7bb5966430b264 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Fri, 24 Aug 2012 07:58:26 +0000 Subject: Monster classes don't use cPackets. Chat messages are sent / broadcast without cPackets. BlockEntities don't use cPackets. git-svn-id: http://mc-server.googlecode.com/svn/trunk@783 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cBlockEntity.h | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) (limited to 'source/cBlockEntity.h') 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 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 -- cgit v1.2.3