![JAR search and dependency download from the Maven repository](/logo.png)
cn.nukkit.network.protocol.UpdateTradePacket Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of powernukkit Show documentation
Show all versions of powernukkit Show documentation
A Minecraft Bedrock Edition server software implementation made in Java from scratch which supports all new features.
package cn.nukkit.network.protocol;
import lombok.ToString;
@ToString
public class UpdateTradePacket extends DataPacket {
public static final byte NETWORK_ID = ProtocolInfo.UPDATE_TRADE_PACKET;
public byte windowId;
public byte windowType = 15; //trading id
public int unknownVarInt1; // hardcoded to 0
public int tradeTier;
public long trader;
public long player;
public String displayName;
public boolean screen2;
public boolean isWilling;
public byte[] offers;
@Override
public byte pid() {
return NETWORK_ID;
}
@Override
public void decode() {
}
@Override
public void encode() {
this.reset();
this.putByte(windowId);
this.putByte(windowType);
this.putVarInt(unknownVarInt1);
this.putVarInt(tradeTier);
this.putEntityUniqueId(trader);
this.putEntityUniqueId(player);
this.putString(displayName);
this.putBoolean(screen2);
this.putBoolean(isWilling);
this.put(this.offers);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy