Add UpdateJigsawBlock

This commit is contained in:
Paul Heidenreich 2019-04-28 12:54:05 +02:00
parent 0e28d84a26
commit 31e5df1c5f
2 changed files with 62 additions and 2 deletions

View file

@ -29,6 +29,7 @@ import com.github.steveice10.mc.protocol.packet.ingame.client.player.ClientPlaye
import com.github.steveice10.mc.protocol.packet.ingame.client.window.ClientAdvancementTabPacket;
import com.github.steveice10.mc.protocol.packet.ingame.client.window.ClientCloseWindowPacket;
import com.github.steveice10.mc.protocol.packet.ingame.client.window.ClientUpdateCommandBlockPacket;
import com.github.steveice10.mc.protocol.packet.ingame.client.window.ClientUpdateJigsawBlockPacket;
import com.github.steveice10.mc.protocol.packet.ingame.client.window.ClientConfirmTransactionPacket;
import com.github.steveice10.mc.protocol.packet.ingame.client.window.ClientCraftingBookDataPacket;
import com.github.steveice10.mc.protocol.packet.ingame.client.window.ClientCreativeInventoryActionPacket;
@ -498,7 +499,7 @@ public class MinecraftProtocol extends PacketProtocol {
this.registerOutgoing(0x24, ClientUpdateCommandBlockPacket.class);
this.registerOutgoing(0x25, ClientUpdateCommandBlockMinecartPacket.class);
this.registerOutgoing(0x26, ClientCreativeInventoryActionPacket.class);
// 0x27 Update Jigsaw Block
this.registerOutgoing(0x27, ClientUpdateJigsawBlockPacket.class);
this.registerOutgoing(0x28, ClientUpdateStructureBlockPacket.class);
this.registerOutgoing(0x29, ClientUpdateSignPacket.class);
this.registerOutgoing(0x2A, ClientPlayerSwingArmPacket.class);
@ -547,7 +548,7 @@ public class MinecraftProtocol extends PacketProtocol {
this.registerIncoming(0x24, ClientUpdateCommandBlockPacket.class);
this.registerIncoming(0x25, ClientUpdateCommandBlockMinecartPacket.class);
this.registerIncoming(0x26, ClientCreativeInventoryActionPacket.class);
// 0x27 Update Jigsaw Block
this.registerIncoming(0x27, ClientUpdateJigsawBlockPacket.class);
this.registerIncoming(0x28, ClientUpdateStructureBlockPacket.class);
this.registerIncoming(0x29, ClientUpdateSignPacket.class);
this.registerIncoming(0x2A, ClientPlayerSwingArmPacket.class);

View file

@ -0,0 +1,59 @@
package com.github.steveice10.mc.protocol.packet.ingame.client.window;
import java.io.IOException;
import com.github.steveice10.mc.protocol.data.game.entity.metadata.Position;
import com.github.steveice10.mc.protocol.packet.MinecraftPacket;
import com.github.steveice10.mc.protocol.util.NetUtil;
import com.github.steveice10.packetlib.io.NetInput;
import com.github.steveice10.packetlib.io.NetOutput;
public class ClientUpdateJigsawBlockPacket extends MinecraftPacket {
private Position position;
private String attachmentType;
private String targetPool;
private String finalState;
public ClientUpdateJigsawBlockPacket() {
}
public ClientUpdateJigsawBlockPacket(Position position, String attachmentType, String targetPool, String finalState) {
this.position = position;
this.attachmentType = attachmentType;
this.targetPool = targetPool;
this.finalState = finalState;
}
public Position getPosition() {
return position;
}
public String getAttachmentType() {
return attachmentType;
}
public String getTargetPool() {
return targetPool;
}
public String getFinalState() {
return finalState;
}
@Override
public void read(NetInput in) throws IOException {
this.position = NetUtil.readPosition(in);
this.attachmentType = in.readString();
this.targetPool = in.readString();
this.finalState = in.readString();
}
@Override
public void write(NetOutput out) throws IOException {
NetUtil.writePosition(out, this.position);
out.writeString(this.attachmentType);
out.writeString(this.targetPool);
out.writeString(this.finalState);
}
}