chore: format Minecraft.World

This commit is contained in:
Tropical
2026-03-13 17:06:56 -05:00
parent bd6284025d
commit 33d0737d1d
1511 changed files with 108661 additions and 115521 deletions

View File

@@ -5,65 +5,60 @@
#include "PacketListener.h"
#include "SetEquippedItemPacket.h"
SetEquippedItemPacket::SetEquippedItemPacket()
{
entity = 0;
slot = 0;
item = nullptr;
SetEquippedItemPacket::SetEquippedItemPacket() {
entity = 0;
slot = 0;
item = nullptr;
}
SetEquippedItemPacket::SetEquippedItemPacket(int entity, int slot, std::shared_ptr<ItemInstance> item)
{
this->entity = entity;
this->slot = slot;
SetEquippedItemPacket::SetEquippedItemPacket(
int entity, int slot, std::shared_ptr<ItemInstance> item) {
this->entity = entity;
this->slot = slot;
// 4J Stu - Brought forward change from 1.3 to fix #64688 - Customer Encountered: TU7: Content: Art: Aura of enchanted item is not displayed for other players in online game
this->item = item == NULL ? nullptr : item->copy();
// 4J Stu - Brought forward change from 1.3 to fix #64688 - Customer
// Encountered: TU7: Content: Art: Aura of enchanted item is not displayed
// for other players in online game
this->item = item == NULL ? nullptr : item->copy();
}
void SetEquippedItemPacket::read(DataInputStream *dis) //throws IOException
void SetEquippedItemPacket::read(DataInputStream* dis) // throws IOException
{
entity = dis->readInt();
slot = dis->readShort();
entity = dis->readInt();
slot = dis->readShort();
// 4J Stu - Brought forward change from 1.3 to fix #64688 - Customer Encountered: TU7: Content: Art: Aura of enchanted item is not displayed for other players in online game
item = readItem(dis);
// 4J Stu - Brought forward change from 1.3 to fix #64688 - Customer
// Encountered: TU7: Content: Art: Aura of enchanted item is not displayed
// for other players in online game
item = readItem(dis);
}
void SetEquippedItemPacket::write(DataOutputStream *dos) //throws IOException
void SetEquippedItemPacket::write(DataOutputStream* dos) // throws IOException
{
dos->writeInt(entity);
dos->writeShort(slot);
dos->writeInt(entity);
dos->writeShort(slot);
// 4J Stu - Brought forward change from 1.3 to fix #64688 - Customer Encountered: TU7: Content: Art: Aura of enchanted item is not displayed for other players in online game
writeItem(item, dos);
// 4J Stu - Brought forward change from 1.3 to fix #64688 - Customer
// Encountered: TU7: Content: Art: Aura of enchanted item is not displayed
// for other players in online game
writeItem(item, dos);
}
void SetEquippedItemPacket::handle(PacketListener *listener)
{
listener->handleSetEquippedItem(shared_from_this());
void SetEquippedItemPacket::handle(PacketListener* listener) {
listener->handleSetEquippedItem(shared_from_this());
}
int SetEquippedItemPacket::getEstimatedSize()
{
return 4 + 2 * 2;
}
int SetEquippedItemPacket::getEstimatedSize() { return 4 + 2 * 2; }
// 4J Stu - Brought forward from 1.3 to fix #64688 - Customer Encountered: TU7: Content: Art: Aura of enchanted item is not displayed for other players in online game
std::shared_ptr<ItemInstance> SetEquippedItemPacket::getItem()
{
return item;
}
// 4J Stu - Brought forward from 1.3 to fix #64688 - Customer Encountered: TU7:
// Content: Art: Aura of enchanted item is not displayed for other players in
// online game
std::shared_ptr<ItemInstance> SetEquippedItemPacket::getItem() { return item; }
bool SetEquippedItemPacket::canBeInvalidated()
{
return true;
}
bool SetEquippedItemPacket::canBeInvalidated() { return true; }
bool SetEquippedItemPacket::isInvalidatedBy(std::shared_ptr<Packet> packet)
{
std::shared_ptr<SetEquippedItemPacket> target = std::dynamic_pointer_cast<SetEquippedItemPacket>(packet);
return target->entity == entity && target->slot == slot;
bool SetEquippedItemPacket::isInvalidatedBy(std::shared_ptr<Packet> packet) {
std::shared_ptr<SetEquippedItemPacket> target =
std::dynamic_pointer_cast<SetEquippedItemPacket>(packet);
return target->entity == entity && target->slot == slot;
}