Skip to content
This repository has been archived by the owner on Nov 1, 2024. It is now read-only.

Commit

Permalink
refactor: rollback sendTextPacket & sendRawFormPacket because not wor…
Browse files Browse the repository at this point in the history
…king
  • Loading branch information
ShrBox committed Mar 20, 2023
1 parent 07e0ad9 commit fba5c4d
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions LiteLoader/src/llapi/mc/PlayerAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -631,9 +631,8 @@ bool Player::sendTextPacket(string text, TextType Type) const {
wp.writeString("");
wp.writeString("");

auto pkt = MinecraftPackets::createPacket(MinecraftPacketIds::Text);
pkt->read(wp);
sendNetworkPacket(*pkt);
NetworkPacket<(int)MinecraftPacketIds::Text> pkt(wp.getAndReleaseData());
sendNetworkPacket(pkt);
return true;
}

Expand Down Expand Up @@ -885,9 +884,8 @@ bool Player::sendRawFormPacket(unsigned formId, const string& data) const {
wp.writeUnsignedVarInt(formId);
wp.writeString(data);

auto pkt = MinecraftPackets::createPacket(MinecraftPacketIds::ModalFormRequest);
pkt->read(wp);
sendNetworkPacket(*pkt);
NetworkPacket<(int)MinecraftPacketIds::ModalFormRequest> pkt(wp.getAndReleaseData());
sendNetworkPacket(pkt);
return true;
}

Expand Down

0 comments on commit fba5c4d

Please sign in to comment.