mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/4jcraft.git
synced 2026-05-26 01:37:08 +00:00
chore: format Minecraft.World
This commit is contained in:
@@ -3,40 +3,31 @@
|
||||
#include "PacketListener.h"
|
||||
#include "SetCreativeModeSlotPacket.h"
|
||||
|
||||
|
||||
|
||||
SetCreativeModeSlotPacket::SetCreativeModeSlotPacket()
|
||||
{
|
||||
this->slotNum = 0;
|
||||
this->item = nullptr;
|
||||
SetCreativeModeSlotPacket::SetCreativeModeSlotPacket() {
|
||||
this->slotNum = 0;
|
||||
this->item = nullptr;
|
||||
}
|
||||
|
||||
SetCreativeModeSlotPacket::SetCreativeModeSlotPacket(int slotNum, std::shared_ptr<ItemInstance> item)
|
||||
{
|
||||
this->slotNum = slotNum;
|
||||
// 4J - take copy of item as we want our packets to have full ownership of any referenced data
|
||||
this->item = item ? item->copy() : std::shared_ptr<ItemInstance>();
|
||||
SetCreativeModeSlotPacket::SetCreativeModeSlotPacket(
|
||||
int slotNum, std::shared_ptr<ItemInstance> item) {
|
||||
this->slotNum = slotNum;
|
||||
// 4J - take copy of item as we want our packets to have full ownership of
|
||||
// any referenced data
|
||||
this->item = item ? item->copy() : std::shared_ptr<ItemInstance>();
|
||||
}
|
||||
|
||||
void SetCreativeModeSlotPacket::handle(PacketListener *listener)
|
||||
{
|
||||
listener->handleSetCreativeModeSlot(shared_from_this());
|
||||
void SetCreativeModeSlotPacket::handle(PacketListener* listener) {
|
||||
listener->handleSetCreativeModeSlot(shared_from_this());
|
||||
}
|
||||
|
||||
void SetCreativeModeSlotPacket::read(DataInputStream *dis)
|
||||
{
|
||||
slotNum = dis->readShort();
|
||||
item = readItem(dis);
|
||||
void SetCreativeModeSlotPacket::read(DataInputStream* dis) {
|
||||
slotNum = dis->readShort();
|
||||
item = readItem(dis);
|
||||
}
|
||||
|
||||
void SetCreativeModeSlotPacket::write(DataOutputStream *dos)
|
||||
{
|
||||
dos->writeShort(slotNum);
|
||||
writeItem(item, dos);
|
||||
|
||||
void SetCreativeModeSlotPacket::write(DataOutputStream* dos) {
|
||||
dos->writeShort(slotNum);
|
||||
writeItem(item, dos);
|
||||
}
|
||||
|
||||
int SetCreativeModeSlotPacket::getEstimatedSize()
|
||||
{
|
||||
return 8;
|
||||
}
|
||||
int SetCreativeModeSlotPacket::getEstimatedSize() { return 8; }
|
||||
Reference in New Issue
Block a user