Almost all packets in 1.13

This commit is contained in:
Bixilon 2020-07-08 20:23:00 +02:00
parent e45ff660fd
commit 35728f95d8
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4
89 changed files with 124 additions and 14 deletions

View File

@ -31,6 +31,7 @@ public class PackerResourcePackSend implements ClientboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
url = buffer.readString();
hash = buffer.readString();
return true;

View File

@ -41,6 +41,7 @@ public class PacketAdvancements implements ClientboundPacket {
public boolean read(InPacketBuffer buffer) {
switch (buffer.getVersion()) {
case VERSION_1_12_2:
case VERSION_1_13_2:
reset = buffer.readBoolean();
int length = buffer.readVarInt();
for (int i = 0; i < length; i++) {

View File

@ -37,6 +37,7 @@ public class PacketAttachEntity implements ClientboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
this.entityId = buffer.readInt();
this.vehicleId = buffer.readInt();
this.leash = true;

View File

@ -37,6 +37,7 @@ public class PacketBlockAction implements ClientboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
// that's the only difference here
if (buffer.getVersion().getVersionNumber() >= ProtocolVersion.VERSION_1_8.getVersionNumber()) {
position = buffer.readPosition();

View File

@ -38,7 +38,7 @@ public class PacketBlockBreakAnimation implements ClientboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
entityId = buffer.readVarInt();
position = buffer.readPosition();
stage = buffer.readByte();

View File

@ -42,6 +42,7 @@ public class PacketBlockEntityMetadata implements ClientboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
position = buffer.readPosition();
action = Actions.byId(buffer.readByte(), buffer.getVersion());
nbt = buffer.readNBT();
@ -76,7 +77,8 @@ public class PacketBlockEntityMetadata implements ClientboundPacket {
COMMAND_BLOCK_TEXT(new MapSet[]{new MapSet<>(ProtocolVersion.VERSION_1_7_10, 2)}),
BEACON(new MapSet[]{new MapSet<>(ProtocolVersion.VERSION_1_8, 3)}),
SKULL(new MapSet[]{new MapSet<>(ProtocolVersion.VERSION_1_7_10, 3), new MapSet<>(ProtocolVersion.VERSION_1_8, 4)}),
FLOWER_POT(new MapSet[]{new MapSet<>(ProtocolVersion.VERSION_1_7_10, 4), new MapSet<>(ProtocolVersion.VERSION_1_8, 5)}),
FLOWER_POT(new MapSet[]{new MapSet<>(ProtocolVersion.VERSION_1_7_10, 4), new MapSet<>(ProtocolVersion.VERSION_1_8, 5), new MapSet<>(ProtocolVersion.VERSION_1_13_2, 1000)}),
DECLARE_CONDUIT(new MapSet[]{new MapSet<>(ProtocolVersion.VERSION_1_13_2, 5)}),
BANNER(new MapSet[]{new MapSet<>(ProtocolVersion.VERSION_1_8, 6)}),
DATA_STRUCTURE_TILE_ENTITY(new MapSet[]{new MapSet<>(ProtocolVersion.VERSION_1_9_4, 7)}),
END_GATEWAY_DESTINATION(new MapSet[]{new MapSet<>(ProtocolVersion.VERSION_1_9_4, 8)}),

View File

@ -41,6 +41,7 @@ public class PacketBossBar implements ClientboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
uuid = buffer.readUUID();
action = BossBarAction.byId(buffer.readVarInt());
switch (action) {
@ -139,6 +140,10 @@ public class PacketBossBar implements ClientboundPacket {
return BitByte.isBitMask(flags, 0x02);
}
public boolean createFog() {
return BitByte.isBitMask(flags, 0x04);
}
public enum BossBarAction {
ADD(0),
REMOVE(1),

View File

@ -32,6 +32,7 @@ public class PacketChangeGameState implements ClientboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
reason = Reason.byId(buffer.readByte());
value = buffer.readFloat();
return true;
@ -81,6 +82,7 @@ public class PacketChangeGameState implements ClientboundPacket {
ARROW_HITTING_PLAYER(6),
FADE_VALUE(7),
FADE_TIME(8),
PLAY_PUFFERFISH_STING_SOUND(9),
PLAY_ELDER_GUARDIAN_MOB_APPEARANCE(10);
final byte id;

View File

@ -37,6 +37,7 @@ public class PacketChatMessageReceiving implements ClientboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
c = buffer.readTextComponent();
position = TextPosition.byId(buffer.readByte());
return true;

View File

@ -69,7 +69,8 @@ public class PacketChunkData implements ClientboundPacket {
case VERSION_1_9_4:
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2: {
case VERSION_1_12_2:
case VERSION_1_13_2: {
this.location = new ChunkLocation(buffer.readInt(), buffer.readInt());
boolean groundUpContinuous = buffer.readBoolean();
short sectionBitMask = (short) buffer.readVarInt();

View File

@ -31,6 +31,7 @@ public class PacketCloseWindowReceiving implements ClientboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
this.windowId = buffer.readByte();
return true;
}

View File

@ -39,6 +39,7 @@ public class PacketCollectItem implements ClientboundPacket {
return true;
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
itemId = buffer.readVarInt();
collectorId = buffer.readVarInt();
count = buffer.readVarInt();

View File

@ -36,6 +36,7 @@ public class PacketCombatEvent implements ClientboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
action = CombatEvent.byId(buffer.readVarInt());
switch (action) {
case END_COMBAT:

View File

@ -33,6 +33,7 @@ public class PacketConfirmTransactionReceiving implements ClientboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
this.windowId = buffer.readByte();
this.actionNumber = buffer.readShort();
this.accepted = buffer.readBoolean();

View File

@ -38,6 +38,7 @@ public class PacketDestroyEntity implements ClientboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
this.entityIds = new int[buffer.readVarInt()];
for (int i = 0; i < entityIds.length; i++) {
entityIds[i] = buffer.readVarInt();

View File

@ -32,6 +32,7 @@ public class PacketDisconnect implements ClientboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
reason = buffer.readTextComponent();
return true;
}

View File

@ -42,6 +42,7 @@ public class PacketEffect implements ClientboundPacket {
case VERSION_1_9_4:
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_13_2:
this.effect = EffectEffects.byId(buffer.readInt(), buffer.getVersion());
position = buffer.readPosition();
data = buffer.readInt();

View File

@ -32,6 +32,7 @@ public class PacketEntity implements ClientboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
entityId = buffer.readVarInt();
return true;
}

View File

@ -34,6 +34,7 @@ public class PacketEntityAnimation implements ClientboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
entityId = buffer.readVarInt();
animation = EntityAnimations.byId(buffer.readByte(), buffer.getVersion());
return true;

View File

@ -44,6 +44,7 @@ public class PacketEntityEffect implements ClientboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
entityId = buffer.readVarInt();
effect = new StatusEffect(StatusEffects.byId(buffer.readByte()), buffer.readByte(), buffer.readVarInt());
byte flags = buffer.readByte();

View File

@ -43,6 +43,7 @@ public class PacketEntityEquipment implements ClientboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
entityId = buffer.readVarInt();
this.slot = InventorySlots.EntityInventory.byId(buffer.readVarInt(), buffer.getVersion());
this.data = buffer.readSlot();

View File

@ -35,6 +35,7 @@ public class PacketEntityHeadRotation implements ClientboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
this.entityId = buffer.readVarInt();
this.headYaw = buffer.readAngle();
return true;

View File

@ -41,6 +41,7 @@ public class PacketEntityMovement implements ClientboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
this.entityId = buffer.readVarInt();
this.location = new RelativeLocation(buffer.readShort() / 4096F, buffer.readShort() / 4096F, buffer.readShort() / 4096F); // / 128 / 32
this.onGround = buffer.readBoolean();

View File

@ -47,6 +47,7 @@ public class PacketEntityMovementAndRotation implements ClientboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
this.entityId = buffer.readVarInt();
this.location = new RelativeLocation(buffer.readShort() / 4096F, buffer.readShort() / 4096F, buffer.readShort() / 4096F); // / 128 / 32
this.yaw = buffer.readAngle();

View File

@ -53,7 +53,8 @@ public class PacketEntityProperties implements ClientboundPacket {
case VERSION_1_9_4:
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2: {
case VERSION_1_12_2:
case VERSION_1_13_2: {
entityId = buffer.readVarInt();
int count = buffer.readInt();
for (int i = 0; i < count; i++) {

View File

@ -38,6 +38,7 @@ public class PacketEntityRotation implements ClientboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
this.entityId = buffer.readVarInt();
this.yaw = buffer.readAngle();
this.pitch = buffer.readAngle();

View File

@ -31,6 +31,7 @@ public class PacketEntityStatus implements ClientboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
entityId = buffer.readInt();
status = Status.byId(buffer.readByte());
return true;

View File

@ -47,6 +47,7 @@ public class PacketEntityTeleport implements ClientboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
this.entityId = buffer.readVarInt();
this.location = new Location(buffer.readDouble(), buffer.readDouble(), buffer.readDouble());
this.yaw = buffer.readAngle();

View File

@ -36,6 +36,7 @@ public class PacketEntityVelocity implements ClientboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
this.entityId = buffer.readVarInt();
this.velocity = new Velocity(buffer.readShort(), buffer.readShort(), buffer.readShort());
return true;

View File

@ -36,6 +36,7 @@ public class PacketExplosion implements ClientboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
location = new Location(buffer.readFloat(), buffer.readFloat(), buffer.readFloat());
radius = buffer.readFloat();
if (radius > 100.0F) {

View File

@ -30,6 +30,7 @@ public class PacketHeldItemChangeReceiving implements ClientboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
slot = buffer.readByte();
return true;
}

View File

@ -35,6 +35,7 @@ public class PacketKeepAlive implements ClientboundPacket {
id = buffer.readVarInt();
return true;
case VERSION_1_12_2:
case VERSION_1_13_2:
id = buffer.readLong();
return true;
}

View File

@ -204,10 +204,27 @@ public class PacketMapData implements ClientboundPacket {
WHITE_CROSS(4),
RED_POINTER(5),
WHITE_CIRCLE(6),
BLUE_SQUARE(7), // - 15
BLUE_SQUARE(7),
SMALL_WHITE_CIRCLE(8),
MANSION(8),
TEMPLE(9);
TEMPLE(9),
WHITE_BANNER(10),
ORANGE_BANNER(11),
MAGENTA_BANNER(12),
LIGHT_BLUE_BANNER(13),
YELLOW_BANNER(14),
LIME_BANNER(15),
PINK_BANNER(16),
GRAY_BANNER(17),
LIGHT_GRAY_BANNER(18),
CYAN_BANNER(19),
PURPLE_BANNER(20),
BLUE_BANNER(21),
BROWN_BANNER(22),
GREEN_BANNER(23),
RED_BANNER(24),
BLACK_BANNER(25),
TREASURE_MARKER(26);
final int id;

View File

@ -52,7 +52,8 @@ public class PacketMultiBlockChange implements ClientboundPacket {
case VERSION_1_9_4:
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2: {
case VERSION_1_12_2:
case VERSION_1_13_2: {
location = new ChunkLocation(buffer.readInt(), buffer.readInt());
int count = buffer.readVarInt();
for (int i = 0; i < count; i++) {

View File

@ -48,6 +48,7 @@ public class PacketNamedSoundEffect implements ClientboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
sound = buffer.readString();
category = buffer.readVarInt(); //ToDo: category
location = new Location(buffer.readFixedPointNumberInteger() * 4, buffer.readFixedPointNumberInteger() * 4, buffer.readFixedPointNumberInteger() * 4);

View File

@ -34,6 +34,7 @@ public class PacketOpenSignEditor implements ClientboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
position = buffer.readPosition();
return true;
}

View File

@ -48,6 +48,7 @@ public class PacketOpenWindow implements ClientboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
this.windowId = buffer.readByte();
this.type = InventoryType.byName(buffer.readString());
this.title = buffer.readTextComponent();

View File

@ -45,7 +45,8 @@ public class PacketPlayerAbilitiesReceiving implements ClientboundPacket {
case VERSION_1_9_4:
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2: {
case VERSION_1_12_2:
case VERSION_1_13_2: {
byte flags = buffer.readByte();
godMode = BitByte.isBitSet(flags, 0);
flying = BitByte.isBitSet(flags, 1);

View File

@ -43,6 +43,7 @@ public class PacketPlayerInfo implements ClientboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
PlayerInfoAction action = PlayerInfoAction.byId(buffer.readVarInt());
int count = buffer.readVarInt();
for (int i = 0; i < count; i++) {

View File

@ -48,6 +48,7 @@ public class PacketPlayerPositionAndRotation implements ClientboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
location = buffer.readLocation();
yaw = buffer.readFloat();
pitch = buffer.readFloat();

View File

@ -35,6 +35,7 @@ public class PacketPluginMessageReceiving implements ClientboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
channel = buffer.readString();
data = buffer.readBytesLeft();
return true;

View File

@ -36,6 +36,7 @@ public class PacketRemoveEntityEffect implements ClientboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
entityId = buffer.readVarInt();
effect = StatusEffects.byId(buffer.readByte());
return true;

View File

@ -38,6 +38,7 @@ public class PacketRespawn implements ClientboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
dimension = Dimension.byId(buffer.readInt());
difficulty = Difficulty.byId(buffer.readByte());
gameMode = GameMode.byId(buffer.readByte());

View File

@ -33,6 +33,7 @@ public class PacketScoreboardDisplayScoreboard implements ClientboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
action = ScoreboardAnimation.byId(buffer.readByte());
scoreName = buffer.readString();
return true;

View File

@ -43,6 +43,7 @@ public class PacketScoreboardUpdateScore implements ClientboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
itemName = buffer.readString();
action = ScoreboardUpdateScoreAction.byId(buffer.readByte());
scoreName = buffer.readString();

View File

@ -28,6 +28,7 @@ public class PacketSelectAdvancementTab implements ClientboundPacket {
public boolean read(InPacketBuffer buffer) {
switch (buffer.getVersion()) {
case VERSION_1_12_2:
case VERSION_1_13_2:
if (buffer.readBoolean()) {
tab = AdvancementTabs.byName(buffer.readString(), buffer.getVersion());
}

View File

@ -31,6 +31,7 @@ public class PacketServerDifficulty implements ClientboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
difficulty = Difficulty.byId(buffer.readByte());
return true;
}

View File

@ -32,6 +32,7 @@ public class PacketSetCooldown implements ClientboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
item = Items.byLegacy(buffer.readVarInt());
cooldownTicks = buffer.readVarInt();
return true;

View File

@ -38,6 +38,7 @@ public class PacketSetExperience implements ClientboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
bar = buffer.readFloat();
level = buffer.readVarInt();
total = buffer.readVarInt();

View File

@ -30,6 +30,7 @@ public class PacketSetPassenger implements ClientboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
this.vehicleId = buffer.readVarInt();
entityIds = new int[buffer.readVarInt()];
for (int i = 0; i < entityIds.length; i++) {

View File

@ -34,6 +34,7 @@ public class PacketSetSlot implements ClientboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
this.windowId = buffer.readByte();
this.slotId = buffer.readShort();
this.slot = buffer.readSlot();

View File

@ -41,6 +41,7 @@ public class PacketSoundEffect implements ClientboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
sound = buffer.readVarInt();
category = buffer.readVarInt(); //ToDo: category
location = new Location(buffer.readFixedPointNumberInteger() * 4, buffer.readFixedPointNumberInteger() * 4, buffer.readFixedPointNumberInteger() * 4);

View File

@ -34,6 +34,7 @@ public class PacketSpawnLocation implements ClientboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
location = buffer.readPosition();
return true;
}

View File

@ -66,7 +66,8 @@ public class PacketSpawnPlayer implements ClientboundPacket {
case VERSION_1_9_4:
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2: {
case VERSION_1_12_2:
case VERSION_1_13_2: {
this.entityId = buffer.readVarInt();
UUID uuid = buffer.readUUID();
Location location = new Location(buffer.readDouble(), buffer.readDouble(), buffer.readDouble());

View File

@ -32,6 +32,7 @@ public class PacketTabHeaderAndFooter implements ClientboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
header = buffer.readTextComponent();
footer = buffer.readTextComponent();
return true;

View File

@ -32,6 +32,7 @@ public class PacketTimeUpdate implements ClientboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
worldAge = buffer.readLong();
timeOfDay = buffer.readLong();
return true;

View File

@ -41,6 +41,7 @@ public class PacketTitle implements ClientboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
action = TitleAction.byId(buffer.readVarInt(), buffer.getVersion());
switch (action) {
case SET_TITLE:

View File

@ -30,6 +30,7 @@ public class PacketUnloadChunk implements ClientboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
location = new ChunkLocation(buffer.readInt(), buffer.readInt());
return true;
}

View File

@ -37,6 +37,7 @@ public class PacketUpdateHealth implements ClientboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
health = buffer.readFloat();
food = buffer.readVarInt();
saturation = buffer.readFloat();

View File

@ -36,6 +36,7 @@ public class PacketUseBed implements ClientboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
entityId = buffer.readVarInt();
position = buffer.readPosition();
return true;

View File

@ -33,6 +33,7 @@ public class PacketWindowItems implements ClientboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
windowId = buffer.readByte();
data = new Slot[buffer.readShort()];
for (int i = 0; i < data.length; i++) {

View File

@ -44,6 +44,7 @@ public class PacketWorldBorder implements ClientboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
action = WorldBorderAction.byId(buffer.readVarInt());
switch (action) {
case SET_SIZE:

View File

@ -40,6 +40,7 @@ public class PacketAdvancementTab implements ServerboundPacket {
OutPacketBuffer buffer = new OutPacketBuffer(version, version.getPacketCommand(Packets.Serverbound.PLAY_ADVANCEMENT_TAB));
switch (version) {
case VERSION_1_12_2:
case VERSION_1_13_2:
buffer.writeVarInt(action.getId());
if (action == AdvancementTabStatus.OPEN_TAB) {
buffer.writeString(tabToOpen);

View File

@ -39,6 +39,7 @@ public class PacketAnimation implements ServerboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
buffer.writeVarInt(hand.getId());
break;
}

View File

@ -67,6 +67,7 @@ public class PacketClientSettings implements ServerboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
buffer.writeString(locale.getName()); // locale
buffer.writeByte(renderDistance); // render Distance
buffer.writeVarInt(0x00); // chat settings (nobody uses them)

View File

@ -41,6 +41,7 @@ public class PacketClientStatus implements ServerboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
buffer.writeVarInt(status.getId());
break;
}

View File

@ -39,6 +39,7 @@ public class PacketCloseWindowSending implements ServerboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
buffer.writeByte(windowId);
break;
}

View File

@ -37,6 +37,7 @@ public class PacketConfirmTeleport implements ServerboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
buffer.writeVarInt(teleportId);
break;
}

View File

@ -43,6 +43,7 @@ public class PacketConfirmTransactionSending implements ServerboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
buffer.writeByte(windowId);
buffer.writeShort(actionNumber);
buffer.writeBoolean(accepted);

View File

@ -42,6 +42,7 @@ public class PacketCreativeInventoryAction implements ServerboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
buffer.writeShort(slot);
buffer.writeSlot(clickedItem);
break;

View File

@ -56,6 +56,7 @@ public class PacketEntityAction implements ServerboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
buffer.writeVarInt(entityId);
buffer.writeVarInt(action.getId(version));
buffer.writeVarInt(parameter);

View File

@ -44,6 +44,7 @@ public class PacketHeldItemChangeSending implements ServerboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
buffer.writeShort(slot);
break;
}

View File

@ -22,14 +22,14 @@ import de.bixilon.minosoft.protocol.protocol.OutPacketBuffer;
import de.bixilon.minosoft.protocol.protocol.Packets;
import de.bixilon.minosoft.protocol.protocol.ProtocolVersion;
public class PacketUseEntity implements ServerboundPacket {
public class PacketInteractEntity implements ServerboundPacket {
final int entityId;
final Click click;
final Location location;
final Hand hand;
public PacketUseEntity(Entity entity, Click click) {
public PacketInteractEntity(Entity entity, Click click) {
this.entityId = entity.getEntityId();
this.click = click;
location = null;
@ -37,7 +37,7 @@ public class PacketUseEntity implements ServerboundPacket {
log();
}
public PacketUseEntity(int entityId, Click click) {
public PacketInteractEntity(int entityId, Click click) {
this.entityId = entityId;
this.click = click;
location = null;
@ -45,7 +45,7 @@ public class PacketUseEntity implements ServerboundPacket {
log();
}
public PacketUseEntity(int entityId, Click click, Location location) {
public PacketInteractEntity(int entityId, Click click, Location location) {
this.entityId = entityId;
this.click = click;
this.location = location;
@ -53,7 +53,7 @@ public class PacketUseEntity implements ServerboundPacket {
log();
}
public PacketUseEntity(int entityId, Click click, Location location, Hand hand) {
public PacketInteractEntity(int entityId, Click click, Location location, Hand hand) {
this.entityId = entityId;
this.click = click;
this.location = location;
@ -84,6 +84,7 @@ public class PacketUseEntity implements ServerboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
buffer.writeInt(entityId);
buffer.writeByte((byte) click.getId());
if (click == Click.INTERACT_AT) {

View File

@ -48,6 +48,7 @@ public class PacketKeepAliveResponse implements ServerboundPacket {
buffer.writeVarInt((int) id);
break;
case VERSION_1_12_2:
case VERSION_1_13_2:
buffer.writeLong(id);
break;
}

View File

@ -40,6 +40,7 @@ public class PacketPlayerAbilitiesSending implements ServerboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
// only fly matters, everything else ignored
byte flags = 0;
if (flying) {

View File

@ -90,6 +90,7 @@ public class PacketPlayerBlockPlacement implements ServerboundPacket {
break;
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
buffer.writePosition(position);
buffer.writeVarInt(direction);
buffer.writeVarInt(hand.getId());

View File

@ -62,6 +62,7 @@ public class PacketPlayerDigging implements ServerboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
buffer.writeVarInt(status.getId());
if (position == null) {
buffer.writeLong(0L);

View File

@ -69,6 +69,7 @@ public class PacketPlayerPositionAndRotationSending implements ServerboundPacket
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
buffer.writeDouble(x);
buffer.writeDouble(feetY);
buffer.writeDouble(z);

View File

@ -61,6 +61,7 @@ public class PacketPlayerPositionSending implements ServerboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
buffer.writeDouble(x);
buffer.writeDouble(feetY);
buffer.writeDouble(z);

View File

@ -42,6 +42,7 @@ public class PacketPlayerRotationSending implements ServerboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
buffer.writeFloat(yaw);
buffer.writeFloat(pitch);
buffer.writeBoolean(onGround);

View File

@ -45,6 +45,7 @@ public class PacketPluginMessageSending implements ServerboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
buffer.writeString(channel); // name
buffer.writeBytes(data); // data
break;

View File

@ -42,6 +42,7 @@ public class PacketResourcePackStatus implements ServerboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
buffer.writeVarInt(status.getId());
break;
}

View File

@ -39,6 +39,7 @@ public class PacketSpectate implements ServerboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
buffer.writeUUID(entityUUID);
break;
}

View File

@ -40,6 +40,7 @@ public class PacketSteerBoat implements ServerboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
buffer.writeBoolean(leftPaddle);
buffer.writeBoolean(rightPaddle);
break;

View File

@ -50,6 +50,7 @@ public class PacketSteerVehicle implements ServerboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
buffer.writeFloat(sideways);
buffer.writeFloat(forward);
byte flags = 0;

View File

@ -52,6 +52,7 @@ public class PacketUpdateSignSending implements ServerboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
buffer.writePosition(position);
for (int i = 0; i < 4; i++) {
buffer.writeString(lines[i].getRawMessage());

View File

@ -37,6 +37,7 @@ public class PacketUseItem implements ServerboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
buffer.writeVarInt(hand.getId());
break;
}

View File

@ -45,6 +45,7 @@ public class PacketVehicleMove implements ServerboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
buffer.writeDouble(x);
buffer.writeDouble(y);
buffer.writeDouble(z);

View File

@ -41,6 +41,7 @@ public class PacketWindowClickButton implements ServerboundPacket {
case VERSION_1_10:
case VERSION_1_11_2:
case VERSION_1_12_2:
case VERSION_1_13_2:
buffer.writeByte(windowId);
buffer.writeByte(buttonId);
break;