Add ClientUpdateCommandBlockMinecartPacket

This commit is contained in:
Jonas Herzig 2018-07-19 14:11:06 +02:00
parent 8e58a9155d
commit f00f25ad69
2 changed files with 51 additions and 1 deletions

View file

@ -44,6 +44,7 @@ import com.github.steveice10.mc.protocol.packet.ingame.client.world.ClientSpecta
import com.github.steveice10.mc.protocol.packet.ingame.client.world.ClientSteerBoatPacket;
import com.github.steveice10.mc.protocol.packet.ingame.client.world.ClientSteerVehiclePacket;
import com.github.steveice10.mc.protocol.packet.ingame.client.world.ClientTeleportConfirmPacket;
import com.github.steveice10.mc.protocol.packet.ingame.client.window.ClientUpdateCommandBlockMinecartPacket;
import com.github.steveice10.mc.protocol.packet.ingame.client.world.ClientUpdateSignPacket;
import com.github.steveice10.mc.protocol.packet.ingame.client.world.ClientVehicleMovePacket;
import com.github.steveice10.mc.protocol.packet.ingame.server.ServerAdvancementTabPacket;
@ -476,7 +477,7 @@ public class MinecraftProtocol extends PacketProtocol {
this.registerOutgoing(0x20, ClientSetBeaconEffectPacket.class);
this.registerOutgoing(0x21, ClientPlayerChangeHeldItemPacket.class);
this.registerOutgoing(0x22, ClientUpdateCommandBlockPacket.class);
// FIXME: 23
this.registerOutgoing(0x23, ClientUpdateCommandBlockMinecartPacket.class);
this.registerOutgoing(0x24, ClientCreativeInventoryActionPacket.class);
// FIXME: 25
this.registerOutgoing(0x26, ClientUpdateSignPacket.class);

View file

@ -0,0 +1,49 @@
package com.github.steveice10.mc.protocol.packet.ingame.client.window;
import com.github.steveice10.mc.protocol.packet.MinecraftPacket;
import com.github.steveice10.packetlib.io.NetInput;
import com.github.steveice10.packetlib.io.NetOutput;
import java.io.IOException;
public class ClientUpdateCommandBlockMinecartPacket extends MinecraftPacket {
private int entityId;
private String command;
private boolean doesTrackOutput;
@SuppressWarnings("unused")
private ClientUpdateCommandBlockMinecartPacket() {
}
public ClientUpdateCommandBlockMinecartPacket(int entityId, String command, boolean doesTrackOutput) {
this.entityId = entityId;
this.command = command;
this.doesTrackOutput = doesTrackOutput;
}
public int getEntityId() {
return this.entityId;
}
public String getCommand() {
return this.command;
}
public boolean isDoesTrackOutput() {
return this.doesTrackOutput;
}
@Override
public void read(NetInput in) throws IOException {
this.entityId = in.readVarInt();
this.command = in.readString();
this.doesTrackOutput = in.readBoolean();
}
@Override
public void write(NetOutput out) throws IOException {
out.writeVarInt(this.entityId);
out.writeString(this.command);
out.writeBoolean(this.doesTrackOutput);
}
}