mirror of
https://gitea.sffnetwork.ru/Kolyah35/minecraft-pe-0.6.1.git
synced 2026-11-23 10:59:45 +00:00
the whole game
This commit is contained in:
parent
816e9060b4
commit
f0617a5d22
2069 changed files with 581500 additions and 0 deletions
41
src/network/packet/SetHealthPacket.h
Executable file
41
src/network/packet/SetHealthPacket.h
Executable file
|
|
@ -0,0 +1,41 @@
|
|||
#ifndef NET_MINECRAFT_NETWORK_PACKET__SetHealthPacket_H__
|
||||
#define NET_MINECRAFT_NETWORK_PACKET__SetHealthPacket_H__
|
||||
|
||||
#include "../Packet.h"
|
||||
|
||||
//package net.minecraft.network.packet;
|
||||
|
||||
class SetHealthPacket: public Packet {
|
||||
public:
|
||||
static const int HEALTH_MODIFY_OFFSET = -64;
|
||||
|
||||
SetHealthPacket() {
|
||||
}
|
||||
|
||||
SetHealthPacket(int health)
|
||||
: health(health)
|
||||
{
|
||||
}
|
||||
|
||||
void write(RakNet::BitStream* bitStream)
|
||||
{
|
||||
bitStream->Write((RakNet::MessageID)(ID_USER_PACKET_ENUM + PACKET_SETHEALTH));
|
||||
bitStream->Write((signed char)health);
|
||||
}
|
||||
|
||||
void read(RakNet::BitStream* bitStream)
|
||||
{
|
||||
signed char tmpHealth;
|
||||
bitStream->Read(tmpHealth);
|
||||
health = tmpHealth;
|
||||
}
|
||||
|
||||
void handle(const RakNet::RakNetGUID& source, NetEventCallback* callback)
|
||||
{
|
||||
callback->handle(source, (SetHealthPacket*)this);
|
||||
}
|
||||
|
||||
int health;
|
||||
};
|
||||
|
||||
#endif /*NET_MINECRAFT_NETWORK_PACKET__SetHealthPacket_H__*/
|
||||
Loading…
Add table
Add a link
Reference in a new issue