mirror of
https://github.com/GeyserMC/MCProtocolLib.git
synced 2024-11-14 19:34:58 -05:00
Merge branch 'feature/1.20.5' into dev
This commit is contained in:
commit
80250660f9
2 changed files with 3 additions and 9 deletions
|
@ -369,7 +369,7 @@ public class MinecraftCodecHelper extends BasePacketCodecHelper {
|
|||
this.writeVarInt(buf, item.getAmount());
|
||||
|
||||
DataComponents dataComponents = item.getDataComponents();
|
||||
if (item.getDataComponents() == null) {
|
||||
if (dataComponents == null) {
|
||||
this.writeVarInt(buf, 0);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -29,10 +29,7 @@ public class ClientboundMerchantOffersPacket implements MinecraftPacket {
|
|||
for (int i = 0; i < trades.length; i++) {
|
||||
ItemStack firstInput = helper.readTradeItemStack(in);
|
||||
ItemStack output = helper.readOptionalItemStack(in);
|
||||
ItemStack secondInput = null;
|
||||
if (in.readBoolean()) {
|
||||
secondInput = helper.readTradeItemStack(in);
|
||||
}
|
||||
ItemStack secondInput = helper.readNullable(in, helper::readTradeItemStack);
|
||||
|
||||
boolean tradeDisabled = in.readBoolean();
|
||||
int numUses = in.readInt();
|
||||
|
@ -59,10 +56,7 @@ public class ClientboundMerchantOffersPacket implements MinecraftPacket {
|
|||
for (VillagerTrade trade : this.trades) {
|
||||
helper.writeTradeItemStack(out, trade.getFirstInput());
|
||||
helper.writeOptionalItemStack(out, trade.getOutput());
|
||||
out.writeBoolean(trade.getSecondInput() != null);
|
||||
if (trade.getSecondInput() != null) {
|
||||
helper.writeTradeItemStack(out, trade.getSecondInput());
|
||||
}
|
||||
helper.writeNullable(out, trade.getSecondInput(), helper::writeTradeItemStack);
|
||||
|
||||
out.writeBoolean(trade.isTradeDisabled());
|
||||
out.writeInt(trade.getNumUses());
|
||||
|
|
Loading…
Reference in a new issue