TU19: merge Minecraft.World/Network

This commit is contained in:
Tropical
2026-03-21 18:09:02 -05:00
parent 0f280b5ed3
commit 11a0440998
66 changed files with 1355 additions and 462 deletions

View File

@@ -13,18 +13,18 @@ ContainerClickPacket::ContainerClickPacket() {
buttonNum = 0;
uid = 0;
item = nullptr;
quickKey = false;
clickType = 0;
}
ContainerClickPacket::ContainerClickPacket(int containerId, int slotNum,
int buttonNum, bool quickKey,
int buttonNum, int clickType,
std::shared_ptr<ItemInstance> item,
short uid) {
this->containerId = containerId;
this->slotNum = slotNum;
this->buttonNum = buttonNum;
this->uid = uid;
this->quickKey = quickKey;
this->clickType = clickType;
// 4J - make a copy of the relevant bits of this item, as we want our
// packets to have full ownership of any data they reference
this->item = item ? item->copy() : nullptr;
@@ -36,11 +36,11 @@ void ContainerClickPacket::handle(PacketListener* listener) {
void ContainerClickPacket::read(DataInputStream* dis) // throws IOException
{
containerId = (int)dis->readByte();
containerId = dis->readByte();
slotNum = dis->readShort();
buttonNum = (int)dis->readByte();
buttonNum = dis->readByte();
uid = dis->readShort();
quickKey = dis->readBoolean();
clickType = dis->readByte();
item = readItem(dis);
}