FEAT: Crafting on server
This commit is contained in:
54
src/network/packet/RemoveItemPacket.h
Normal file
54
src/network/packet/RemoveItemPacket.h
Normal file
@@ -0,0 +1,54 @@
|
||||
#ifndef NET_MINECRAFT_NETWORK_PACKET__RemoveItemPacket_H__
|
||||
#define NET_MINECRAFT_NETWORK_PACKET__RemoveItemPacket_H__
|
||||
|
||||
//package net.minecraft.network.packet;
|
||||
|
||||
#include "../Packet.h"
|
||||
|
||||
class RemoveItemPacket: public Packet
|
||||
{
|
||||
public:
|
||||
RemoveItemPacket() {
|
||||
}
|
||||
|
||||
RemoveItemPacket(int playerId, int count, int auxValue, int itemId)
|
||||
:
|
||||
playerId(playerId),
|
||||
count(count),
|
||||
auxValue(auxValue),
|
||||
itemId(itemId)
|
||||
{
|
||||
}
|
||||
|
||||
void write(RakNet::BitStream* bitStream)
|
||||
{
|
||||
bitStream->Write((RakNet::MessageID)(ID_USER_PACKET_ENUM + PACKET_REMOVEITEM));
|
||||
bitStream->Write(itemId);
|
||||
bitStream->Write(count);
|
||||
bitStream->Write(auxValue);
|
||||
|
||||
bitStream->Write(playerId);
|
||||
}
|
||||
|
||||
void read(RakNet::BitStream* bitStream)
|
||||
{
|
||||
bitStream->Read(itemId);
|
||||
bitStream->Read(count);
|
||||
bitStream->Read(auxValue);
|
||||
|
||||
bitStream->Read(playerId);
|
||||
}
|
||||
|
||||
void handle(const RakNet::RakNetGUID& source, NetEventCallback* callback)
|
||||
{
|
||||
callback->handle(source, (RemoveItemPacket*)this);
|
||||
}
|
||||
|
||||
int playerId;
|
||||
|
||||
int itemId;
|
||||
int count;
|
||||
int auxValue;
|
||||
};
|
||||
|
||||
#endif /*NET_MINECRAFT_NETWORK_PACKET__RemoveItemPacket_H__*/
|
||||
Reference in New Issue
Block a user