Update And Rename ClickWindowButtonPacket

This commit is contained in:
Paul Heidenreich 2019-04-28 12:35:09 +02:00
parent 84625ecf27
commit 12c370d522
2 changed files with 12 additions and 11 deletions

View file

@ -32,7 +32,7 @@ import com.github.steveice10.mc.protocol.packet.ingame.client.window.ClientConfi
import com.github.steveice10.mc.protocol.packet.ingame.client.window.ClientCraftingBookDataPacket;
import com.github.steveice10.mc.protocol.packet.ingame.client.window.ClientCreativeInventoryActionPacket;
import com.github.steveice10.mc.protocol.packet.ingame.client.window.ClientEditBookPacket;
import com.github.steveice10.mc.protocol.packet.ingame.client.window.ClientEnchantItemPacket;
import com.github.steveice10.mc.protocol.packet.ingame.client.window.ClientClickWindowButtonPacket;
import com.github.steveice10.mc.protocol.packet.ingame.client.window.ClientMoveItemToHotbarPacket;
import com.github.steveice10.mc.protocol.packet.ingame.client.window.ClientPrepareCraftingGridPacket;
import com.github.steveice10.mc.protocol.packet.ingame.client.window.ClientRenameItemPacket;
@ -466,7 +466,7 @@ public class MinecraftProtocol extends PacketProtocol {
this.registerOutgoing(0x05, ClientSettingsPacket.class);
this.registerOutgoing(0x06, ClientTabCompletePacket.class);
this.registerOutgoing(0x07, ClientConfirmTransactionPacket.class);
this.registerOutgoing(0x08, ClientEnchantItemPacket.class); // Rename to Confirm Transaction
this.registerOutgoing(0x08, ClientClickWindowButtonPacket.class);
this.registerOutgoing(0x09, ClientWindowActionPacket.class);
this.registerOutgoing(0x0A, ClientCloseWindowPacket.class);
this.registerOutgoing(0x0B, ClientPluginMessagePacket.class);
@ -515,7 +515,7 @@ public class MinecraftProtocol extends PacketProtocol {
this.registerIncoming(0x05, ClientSettingsPacket.class);
this.registerIncoming(0x06, ClientTabCompletePacket.class);
this.registerIncoming(0x07, ClientConfirmTransactionPacket.class);
this.registerIncoming(0x08, ClientEnchantItemPacket.class); // Rename to Confirm Transaction
this.registerIncoming(0x08, ClientClickWindowButtonPacket.class);
this.registerIncoming(0x09, ClientWindowActionPacket.class);
this.registerIncoming(0x0A, ClientCloseWindowPacket.class);
this.registerIncoming(0x0B, ClientPluginMessagePacket.class);

View file

@ -6,17 +6,18 @@ import com.github.steveice10.packetlib.io.NetOutput;
import java.io.IOException;
public class ClientEnchantItemPacket extends MinecraftPacket {
public class ClientClickWindowButtonPacket extends MinecraftPacket {
private int windowId;
private int enchantment;
private int buttonId;
@SuppressWarnings("unused")
private ClientEnchantItemPacket() {
private ClientClickWindowButtonPacket() {
}
public ClientEnchantItemPacket(int windowId, int enchantment) {
public ClientClickWindowButtonPacket(int windowId, int enchantment) {
this.windowId = windowId;
this.enchantment = enchantment;
this.buttonId = enchantment;
}
public int getWindowId() {
@ -24,18 +25,18 @@ public class ClientEnchantItemPacket extends MinecraftPacket {
}
public int getEnchantment() {
return this.enchantment;
return this.buttonId;
}
@Override
public void read(NetInput in) throws IOException {
this.windowId = in.readByte();
this.enchantment = in.readByte();
this.buttonId = in.readByte();
}
@Override
public void write(NetOutput out) throws IOException {
out.writeByte(this.windowId);
out.writeByte(this.enchantment);
out.writeByte(this.buttonId);
}
}