mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-12-23 00:47:39 +01:00
21w08a (aka the great splittening)
This commit is contained in:
parent
37004d8c4f
commit
0a41d36220
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>viaversion-parent</artifactId>
|
<artifactId>viaversion-parent</artifactId>
|
||||||
<groupId>us.myles</groupId>
|
<groupId>us.myles</groupId>
|
||||||
<version>3.3.0-21w07a</version>
|
<version>3.3.0-21w08a</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>viaversion-parent</artifactId>
|
<artifactId>viaversion-parent</artifactId>
|
||||||
<groupId>us.myles</groupId>
|
<groupId>us.myles</groupId>
|
||||||
<version>3.3.0-21w07a</version>
|
<version>3.3.0-21w08a</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>viaversion-parent</artifactId>
|
<artifactId>viaversion-parent</artifactId>
|
||||||
<groupId>us.myles</groupId>
|
<groupId>us.myles</groupId>
|
||||||
<version>3.3.0-21w07a</version>
|
<version>3.3.0-21w08a</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>viaversion-parent</artifactId>
|
<artifactId>viaversion-parent</artifactId>
|
||||||
<groupId>us.myles</groupId>
|
<groupId>us.myles</groupId>
|
||||||
<version>3.3.0-21w07a</version>
|
<version>3.3.0-21w08a</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
@ -54,7 +54,7 @@ public class ProtocolVersion {
|
|||||||
public static final ProtocolVersion v1_16_2 = register(751, "1.16.2");
|
public static final ProtocolVersion v1_16_2 = register(751, "1.16.2");
|
||||||
public static final ProtocolVersion v1_16_3 = register(753, "1.16.3");
|
public static final ProtocolVersion v1_16_3 = register(753, "1.16.3");
|
||||||
public static final ProtocolVersion v1_16_4 = register(754, "1.16.4/5", new VersionRange("1.16", 4, 5));
|
public static final ProtocolVersion v1_16_4 = register(754, "1.16.4/5", new VersionRange("1.16", 4, 5));
|
||||||
public static final ProtocolVersion v1_17 = register(755, 15, "1.17");
|
public static final ProtocolVersion v1_17 = register(755, 16, "1.17");
|
||||||
public static final ProtocolVersion unknown = register(-1, "UNKNOWN");
|
public static final ProtocolVersion unknown = register(-1, "UNKNOWN");
|
||||||
|
|
||||||
public static ProtocolVersion register(int version, String name) {
|
public static ProtocolVersion register(int version, String name) {
|
||||||
|
@ -20,81 +20,91 @@ public enum ClientboundPackets1_17 implements ClientboundPacketType {
|
|||||||
BOSSBAR, // 0x0D
|
BOSSBAR, // 0x0D
|
||||||
SERVER_DIFFICULTY, // 0x0E
|
SERVER_DIFFICULTY, // 0x0E
|
||||||
CHAT_MESSAGE, // 0x0F
|
CHAT_MESSAGE, // 0x0F
|
||||||
TAB_COMPLETE, // 0x10
|
CLEAR_TITLES, // 0x10
|
||||||
DECLARE_COMMANDS, // 0x11
|
TAB_COMPLETE, // 0x11
|
||||||
WINDOW_CONFIRMATION, // 0x12
|
DECLARE_COMMANDS, // 0x12
|
||||||
CLOSE_WINDOW, // 0x13
|
WINDOW_CONFIRMATION, // 0x13
|
||||||
WINDOW_ITEMS, // 0x14
|
CLOSE_WINDOW, // 0x14
|
||||||
WINDOW_PROPERTY, // 0x15
|
WINDOW_ITEMS, // 0x15
|
||||||
SET_SLOT, // 0x16
|
WINDOW_PROPERTY, // 0x16
|
||||||
COOLDOWN, // 0x17
|
SET_SLOT, // 0x17
|
||||||
PLUGIN_MESSAGE, // 0x18
|
COOLDOWN, // 0x18
|
||||||
NAMED_SOUND, // 0x19
|
PLUGIN_MESSAGE, // 0x19
|
||||||
DISCONNECT, // 0x1A
|
NAMED_SOUND, // 0x1A
|
||||||
ENTITY_STATUS, // 0x1B
|
DISCONNECT, // 0x1B
|
||||||
EXPLOSION, // 0x1C
|
ENTITY_STATUS, // 0x1C
|
||||||
UNLOAD_CHUNK, // 0x1D
|
EXPLOSION, // 0x1D
|
||||||
GAME_EVENT, // 0x1E
|
UNLOAD_CHUNK, // 0x1E
|
||||||
OPEN_HORSE_WINDOW, // 0x1F
|
GAME_EVENT, // 0x1F
|
||||||
KEEP_ALIVE, // 0x20
|
OPEN_HORSE_WINDOW, // 0x20
|
||||||
CHUNK_DATA, // 0x21
|
WORLD_BORDER_INIT, // 0x21
|
||||||
EFFECT, // 0x22
|
KEEP_ALIVE, // 0x22
|
||||||
SPAWN_PARTICLE, // 0x23
|
CHUNK_DATA, // 0x23
|
||||||
UPDATE_LIGHT, // 0x24
|
EFFECT, // 0x24
|
||||||
JOIN_GAME, // 0x25
|
SPAWN_PARTICLE, // 0x25
|
||||||
MAP_DATA, // 0x26
|
UPDATE_LIGHT, // 0x26
|
||||||
TRADE_LIST, // 0x27
|
JOIN_GAME, // 0x27
|
||||||
ENTITY_POSITION, // 0x28
|
MAP_DATA, // 0x28
|
||||||
ENTITY_POSITION_AND_ROTATION, // 0x29
|
TRADE_LIST, // 0x29
|
||||||
ENTITY_ROTATION, // 0x2A
|
ENTITY_POSITION, // 0x2A
|
||||||
ENTITY_MOVEMENT, // 0x2B
|
ENTITY_POSITION_AND_ROTATION, // 0x2B
|
||||||
VEHICLE_MOVE, // 0x2C
|
ENTITY_ROTATION, // 0x2C
|
||||||
OPEN_BOOK, // 0x2D
|
VEHICLE_MOVE, // 0x2D
|
||||||
OPEN_WINDOW, // 0x2E
|
OPEN_BOOK, // 0x2E
|
||||||
OPEN_SIGN_EDITOR, // 0x2F
|
OPEN_WINDOW, // 0x2F
|
||||||
CRAFT_RECIPE_RESPONSE, // 0x30
|
OPEN_SIGN_EDITOR, // 0x30
|
||||||
PLAYER_ABILITIES, // 0x31
|
CRAFT_RECIPE_RESPONSE, // 0x31
|
||||||
COMBAT_EVENT, // 0x32
|
PLAYER_ABILITIES, // 0x32
|
||||||
PLAYER_INFO, // 0x33
|
COMBAT_END, // 0x33
|
||||||
FACE_PLAYER, // 0x34
|
COMBAT_ENTER, // 0x34
|
||||||
PLAYER_POSITION, // 0x35
|
COMBAT_KILL, // 0x35
|
||||||
UNLOCK_RECIPES, // 0x36
|
PLAYER_INFO, // 0x36
|
||||||
DESTROY_ENTITIES, // 0x37
|
FACE_PLAYER, // 0x37
|
||||||
REMOVE_ENTITY_EFFECT, // 0x38
|
PLAYER_POSITION, // 0x38
|
||||||
RESOURCE_PACK, // 0x39
|
UNLOCK_RECIPES, // 0x39
|
||||||
RESPAWN, // 0x3A
|
DESTROY_ENTITIES, // 0x3A
|
||||||
ENTITY_HEAD_LOOK, // 0x3B
|
REMOVE_ENTITY_EFFECT, // 0x3B
|
||||||
MULTI_BLOCK_CHANGE, // 0x3C
|
RESOURCE_PACK, // 0x3C
|
||||||
SELECT_ADVANCEMENTS_TAB, // 0x3D
|
RESPAWN, // 0x3D
|
||||||
WORLD_BORDER, // 0x3E
|
ENTITY_HEAD_LOOK, // 0x3E
|
||||||
CAMERA, // 0x3F
|
MULTI_BLOCK_CHANGE, // 0x3F
|
||||||
HELD_ITEM_CHANGE, // 0x40
|
SELECT_ADVANCEMENTS_TAB, // 0x40
|
||||||
UPDATE_VIEW_POSITION, // 0x41
|
ACTIONBAR, // 0x41
|
||||||
UPDATE_VIEW_DISTANCE, // 0x42
|
WORLD_BORDER_CENTER, // 0x42
|
||||||
SPAWN_POSITION, // 0x43
|
WORLD_BORDER_LERP_SIZE, // 0x43
|
||||||
DISPLAY_SCOREBOARD, // 0x44
|
WORLD_BORDER_SIZE, // 0x44
|
||||||
ENTITY_METADATA, // 0x45
|
WORLD_BORDER_WARNING_DELAY, // 0x45
|
||||||
ATTACH_ENTITY, // 0x46
|
WORLD_BORDER_WARNING_DISTANCE, // 0x46
|
||||||
ENTITY_VELOCITY, // 0x47
|
CAMERA, // 0x47
|
||||||
ENTITY_EQUIPMENT, // 0x48
|
HELD_ITEM_CHANGE, // 0x48
|
||||||
SET_EXPERIENCE, // 0x49
|
UPDATE_VIEW_POSITION, // 0x49
|
||||||
UPDATE_HEALTH, // 0x4A
|
UPDATE_VIEW_DISTANCE, // 0x4A
|
||||||
SCOREBOARD_OBJECTIVE, // 0x4B
|
SPAWN_POSITION, // 0x4B
|
||||||
SET_PASSENGERS, // 0x4C
|
DISPLAY_SCOREBOARD, // 0x4C
|
||||||
TEAMS, // 0x4D
|
ENTITY_METADATA, // 0x4D
|
||||||
UPDATE_SCORE, // 0x4E
|
ATTACH_ENTITY, // 0x4E
|
||||||
TIME_UPDATE, // 0x4F
|
ENTITY_VELOCITY, // 0x4F
|
||||||
TITLE, // 0x50
|
ENTITY_EQUIPMENT, // 0x50
|
||||||
ENTITY_SOUND, // 0x51
|
SET_EXPERIENCE, // 0x51
|
||||||
SOUND, // 0x52
|
UPDATE_HEALTH, // 0x52
|
||||||
STOP_SOUND, // 0x53
|
SCOREBOARD_OBJECTIVE, // 0x53
|
||||||
TAB_LIST, // 0x54
|
SET_PASSENGERS, // 0x54
|
||||||
NBT_QUERY, // 0x55
|
TEAMS, // 0x55
|
||||||
COLLECT_ITEM, // 0x56
|
UPDATE_SCORE, // 0x56
|
||||||
ENTITY_TELEPORT, // 0x57
|
TITLE_SUBTITLE, // 0x57
|
||||||
ADVANCEMENTS, // 0x58
|
TIME_UPDATE, // 0x58
|
||||||
ENTITY_PROPERTIES, // 0x59
|
TITLE_TIMES, // 0x59
|
||||||
ENTITY_EFFECT, // 0x5A
|
TITLE_TEXT, // 0x5A
|
||||||
DECLARE_RECIPES, // 0x5B
|
ENTITY_SOUND, // 0x5B
|
||||||
TAGS, // 0x5C
|
SOUND, // 0x5C
|
||||||
|
STOP_SOUND, // 0x5D
|
||||||
|
TAB_LIST, // 0x5E
|
||||||
|
NBT_QUERY, // 0x5F
|
||||||
|
COLLECT_ITEM, // 0x60
|
||||||
|
ENTITY_TELEPORT, // 0x61
|
||||||
|
ADVANCEMENTS, // 0x62
|
||||||
|
ENTITY_PROPERTIES, // 0x63
|
||||||
|
ENTITY_EFFECT, // 0x64
|
||||||
|
DECLARE_RECIPES, // 0x65
|
||||||
|
TAGS, // 0x66
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@ package us.myles.ViaVersion.protocols.protocol1_17to1_16_4;
|
|||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
import us.myles.ViaVersion.api.data.MappingData;
|
import us.myles.ViaVersion.api.data.MappingData;
|
||||||
import us.myles.ViaVersion.api.data.UserConnection;
|
import us.myles.ViaVersion.api.data.UserConnection;
|
||||||
|
import us.myles.ViaVersion.api.protocol.ClientboundPacketType;
|
||||||
import us.myles.ViaVersion.api.protocol.Protocol;
|
import us.myles.ViaVersion.api.protocol.Protocol;
|
||||||
import us.myles.ViaVersion.api.remapper.PacketRemapper;
|
import us.myles.ViaVersion.api.remapper.PacketRemapper;
|
||||||
import us.myles.ViaVersion.api.rewriters.RegistryType;
|
import us.myles.ViaVersion.api.rewriters.RegistryType;
|
||||||
@ -106,6 +107,67 @@ public class Protocol1_17To1_16_4 extends Protocol<ClientboundPackets1_16_2, Cli
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
registerOutgoing(ClientboundPackets1_16_2.TITLE, null, new PacketRemapper() {
|
||||||
|
@Override
|
||||||
|
public void registerMap() {
|
||||||
|
handler(wrapper -> {
|
||||||
|
// Title packet actions have been split into individual packets (the content hasn't changed)
|
||||||
|
int type = wrapper.read(Type.VAR_INT);
|
||||||
|
ClientboundPacketType packetType;
|
||||||
|
switch (type) {
|
||||||
|
case 0:
|
||||||
|
packetType = ClientboundPackets1_17.TITLE_TEXT;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
packetType = ClientboundPackets1_17.TITLE_SUBTITLE;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
packetType = ClientboundPackets1_17.ACTIONBAR;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
packetType = ClientboundPackets1_17.TITLE_TIMES;
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
packetType = ClientboundPackets1_17.CLEAR_TITLES;
|
||||||
|
wrapper.write(Type.BOOLEAN, false); // Reset times
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
packetType = ClientboundPackets1_17.CLEAR_TITLES;
|
||||||
|
wrapper.write(Type.BOOLEAN, true); // Reset times
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new IllegalArgumentException("Invalid title type received: " + type);
|
||||||
|
}
|
||||||
|
|
||||||
|
wrapper.setId(packetType.ordinal());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
registerOutgoing(ClientboundPackets1_16_2.EXPLOSION, new PacketRemapper() {
|
||||||
|
@Override
|
||||||
|
public void registerMap() {
|
||||||
|
map(Type.FLOAT); // X
|
||||||
|
map(Type.FLOAT); // Y
|
||||||
|
map(Type.FLOAT); // Z
|
||||||
|
handler(wrapper -> {
|
||||||
|
// Collection length is now a var int
|
||||||
|
wrapper.write(Type.VAR_INT, wrapper.read(Type.INT));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
registerOutgoing(ClientboundPackets1_16_2.SPAWN_POSITION, new PacketRemapper() {
|
||||||
|
@Override
|
||||||
|
public void registerMap() {
|
||||||
|
map(Type.POSITION1_14);
|
||||||
|
handler(wrapper -> {
|
||||||
|
// Angle (which Mojang just forgot to write to the buffer, lol)
|
||||||
|
wrapper.write(Type.FLOAT, 0f);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
registerIncoming(ServerboundPackets1_16_2.CLIENT_SETTINGS, new PacketRemapper() {
|
registerIncoming(ServerboundPackets1_16_2.CLIENT_SETTINGS, new PacketRemapper() {
|
||||||
@Override
|
@Override
|
||||||
public void registerMap() {
|
public void registerMap() {
|
||||||
@ -125,10 +187,12 @@ public class Protocol1_17To1_16_4 extends Protocol<ClientboundPackets1_16_2, Cli
|
|||||||
@Override
|
@Override
|
||||||
protected void onMappingDataLoaded() {
|
protected void onMappingDataLoaded() {
|
||||||
tagRewriter.addEmptyTags(RegistryType.ITEM, "minecraft:candles", "minecraft:ignored_by_piglin_babies", "minecraft:piglin_food", "minecraft:freeze_immune_wearables",
|
tagRewriter.addEmptyTags(RegistryType.ITEM, "minecraft:candles", "minecraft:ignored_by_piglin_babies", "minecraft:piglin_food", "minecraft:freeze_immune_wearables",
|
||||||
"minecraft:axolotl_tempt_items", "minecraft:occludes_vibration_signals");
|
"minecraft:axolotl_tempt_items", "minecraft:occludes_vibration_signals",
|
||||||
|
"minecraft:diamond_ores", "minecraft:iron_ores", "minecraft:lapis_ores", "minecraft:redstone_ores");
|
||||||
tagRewriter.addEmptyTags(RegistryType.BLOCK, "minecraft:crystal_sound_blocks", "minecraft:candle_cakes", "minecraft:candles",
|
tagRewriter.addEmptyTags(RegistryType.BLOCK, "minecraft:crystal_sound_blocks", "minecraft:candle_cakes", "minecraft:candles",
|
||||||
"minecraft:snow_step_sound_blocks", "minecraft:inside_step_sound_blocks", "minecraft:occludes_vibration_signals", "minecraft:dripstone_replaceable_blocks",
|
"minecraft:snow_step_sound_blocks", "minecraft:inside_step_sound_blocks", "minecraft:occludes_vibration_signals", "minecraft:dripstone_replaceable_blocks",
|
||||||
"azalea_log_replaceable", "cave_vines", "lush_plants_replaceable");
|
"minecraft:azalea_log_replaceable", "minecraft:cave_vines", "minecraft:lush_plants_replaceable", "minecraft:deepslate_ore_replaceables",
|
||||||
|
"minecraft:diamond_ores", "minecraft:iron_ores", "minecraft:lapis_ores", "minecraft:redstone_ores", "minecraft:stone_ore_replaceables");
|
||||||
tagRewriter.addEmptyTags(RegistryType.ENTITY, "minecraft:powder_snow_walkable_mobs", "minecraft:axolotl_always_hostiles", "minecraft:axolotl_tempted_hostiles");
|
tagRewriter.addEmptyTags(RegistryType.ENTITY, "minecraft:powder_snow_walkable_mobs", "minecraft:axolotl_always_hostiles", "minecraft:axolotl_tempted_hostiles");
|
||||||
|
|
||||||
tagRewriter.addTag(RegistryType.BLOCK, "minecraft:cauldrons", 261);
|
tagRewriter.addTag(RegistryType.BLOCK, "minecraft:cauldrons", 261);
|
||||||
|
@ -1,11 +1,13 @@
|
|||||||
package us.myles.ViaVersion.protocols.protocol1_17to1_16_4.packets;
|
package us.myles.ViaVersion.protocols.protocol1_17to1_16_4.packets;
|
||||||
|
|
||||||
import us.myles.ViaVersion.api.entities.Entity1_17Types;
|
import us.myles.ViaVersion.api.entities.Entity1_17Types;
|
||||||
|
import us.myles.ViaVersion.api.protocol.ClientboundPacketType;
|
||||||
import us.myles.ViaVersion.api.remapper.PacketRemapper;
|
import us.myles.ViaVersion.api.remapper.PacketRemapper;
|
||||||
import us.myles.ViaVersion.api.type.Type;
|
import us.myles.ViaVersion.api.type.Type;
|
||||||
import us.myles.ViaVersion.api.type.types.version.Types1_14;
|
import us.myles.ViaVersion.api.type.types.version.Types1_14;
|
||||||
import us.myles.ViaVersion.api.type.types.version.Types1_17;
|
import us.myles.ViaVersion.api.type.types.version.Types1_17;
|
||||||
import us.myles.ViaVersion.protocols.protocol1_16_2to1_16_1.ClientboundPackets1_16_2;
|
import us.myles.ViaVersion.protocols.protocol1_16_2to1_16_1.ClientboundPackets1_16_2;
|
||||||
|
import us.myles.ViaVersion.protocols.protocol1_17to1_16_4.ClientboundPackets1_17;
|
||||||
import us.myles.ViaVersion.protocols.protocol1_17to1_16_4.Protocol1_17To1_16_4;
|
import us.myles.ViaVersion.protocols.protocol1_17to1_16_4.Protocol1_17To1_16_4;
|
||||||
import us.myles.ViaVersion.protocols.protocol1_17to1_16_4.metadata.MetadataRewriter1_17To1_16_4;
|
import us.myles.ViaVersion.protocols.protocol1_17to1_16_4.metadata.MetadataRewriter1_17To1_16_4;
|
||||||
|
|
||||||
@ -19,6 +21,17 @@ public class EntityPackets {
|
|||||||
metadataRewriter.registerMetadataRewriter(ClientboundPackets1_16_2.ENTITY_METADATA, Types1_14.METADATA_LIST, Types1_17.METADATA_LIST);
|
metadataRewriter.registerMetadataRewriter(ClientboundPackets1_16_2.ENTITY_METADATA, Types1_14.METADATA_LIST, Types1_17.METADATA_LIST);
|
||||||
metadataRewriter.registerEntityDestroy(ClientboundPackets1_16_2.DESTROY_ENTITIES);
|
metadataRewriter.registerEntityDestroy(ClientboundPackets1_16_2.DESTROY_ENTITIES);
|
||||||
|
|
||||||
|
protocol.registerOutgoing(ClientboundPackets1_16_2.ENTITY_PROPERTIES, new PacketRemapper() {
|
||||||
|
@Override
|
||||||
|
public void registerMap() {
|
||||||
|
map(Type.VAR_INT); // Entity id
|
||||||
|
handler(wrapper -> {
|
||||||
|
// Collection length is now a var int
|
||||||
|
wrapper.write(Type.VAR_INT, wrapper.read(Type.INT));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
protocol.registerOutgoing(ClientboundPackets1_16_2.PLAYER_POSITION, new PacketRemapper() {
|
protocol.registerOutgoing(ClientboundPackets1_16_2.PLAYER_POSITION, new PacketRemapper() {
|
||||||
@Override
|
@Override
|
||||||
public void registerMap() {
|
public void registerMap() {
|
||||||
@ -35,5 +48,34 @@ public class EntityPackets {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
protocol.registerOutgoing(ClientboundPackets1_16_2.COMBAT_EVENT, null, new PacketRemapper() {
|
||||||
|
@Override
|
||||||
|
public void registerMap() {
|
||||||
|
handler(wrapper -> {
|
||||||
|
// Combat packet actions have been split into individual packets (the content hasn't changed)
|
||||||
|
int type = wrapper.read(Type.VAR_INT);
|
||||||
|
ClientboundPacketType packetType;
|
||||||
|
switch (type) {
|
||||||
|
case 0:
|
||||||
|
packetType = ClientboundPackets1_17.COMBAT_ENTER;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
packetType = ClientboundPackets1_17.COMBAT_END;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
packetType = ClientboundPackets1_17.COMBAT_KILL;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new IllegalArgumentException("Invalid combat type received: " + type);
|
||||||
|
}
|
||||||
|
|
||||||
|
wrapper.setId(packetType.ordinal());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// The parent class of the other entity move packets that is never actually used has finally been removed from the id list
|
||||||
|
protocol.cancelOutgoing(ClientboundPackets1_16_2.ENTITY_MOVEMENT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,11 +10,13 @@ import us.myles.ViaVersion.api.data.UserConnection;
|
|||||||
import us.myles.ViaVersion.api.entities.Entity1_17Types;
|
import us.myles.ViaVersion.api.entities.Entity1_17Types;
|
||||||
import us.myles.ViaVersion.api.minecraft.chunks.Chunk;
|
import us.myles.ViaVersion.api.minecraft.chunks.Chunk;
|
||||||
import us.myles.ViaVersion.api.minecraft.chunks.ChunkSection;
|
import us.myles.ViaVersion.api.minecraft.chunks.ChunkSection;
|
||||||
|
import us.myles.ViaVersion.api.protocol.ClientboundPacketType;
|
||||||
import us.myles.ViaVersion.api.remapper.PacketRemapper;
|
import us.myles.ViaVersion.api.remapper.PacketRemapper;
|
||||||
import us.myles.ViaVersion.api.rewriters.BlockRewriter;
|
import us.myles.ViaVersion.api.rewriters.BlockRewriter;
|
||||||
import us.myles.ViaVersion.api.type.Type;
|
import us.myles.ViaVersion.api.type.Type;
|
||||||
import us.myles.ViaVersion.protocols.protocol1_16_2to1_16_1.ClientboundPackets1_16_2;
|
import us.myles.ViaVersion.protocols.protocol1_16_2to1_16_1.ClientboundPackets1_16_2;
|
||||||
import us.myles.ViaVersion.protocols.protocol1_16_2to1_16_1.types.Chunk1_16_2Type;
|
import us.myles.ViaVersion.protocols.protocol1_16_2to1_16_1.types.Chunk1_16_2Type;
|
||||||
|
import us.myles.ViaVersion.protocols.protocol1_17to1_16_4.ClientboundPackets1_17;
|
||||||
import us.myles.ViaVersion.protocols.protocol1_17to1_16_4.Protocol1_17To1_16_4;
|
import us.myles.ViaVersion.protocols.protocol1_17to1_16_4.Protocol1_17To1_16_4;
|
||||||
import us.myles.ViaVersion.protocols.protocol1_17to1_16_4.storage.BiomeStorage;
|
import us.myles.ViaVersion.protocols.protocol1_17to1_16_4.storage.BiomeStorage;
|
||||||
import us.myles.ViaVersion.protocols.protocol1_17to1_16_4.storage.EntityTracker1_17;
|
import us.myles.ViaVersion.protocols.protocol1_17to1_16_4.storage.EntityTracker1_17;
|
||||||
@ -34,6 +36,41 @@ public class WorldPackets {
|
|||||||
blockRewriter.registerVarLongMultiBlockChange(ClientboundPackets1_16_2.MULTI_BLOCK_CHANGE);
|
blockRewriter.registerVarLongMultiBlockChange(ClientboundPackets1_16_2.MULTI_BLOCK_CHANGE);
|
||||||
blockRewriter.registerAcknowledgePlayerDigging(ClientboundPackets1_16_2.ACKNOWLEDGE_PLAYER_DIGGING);
|
blockRewriter.registerAcknowledgePlayerDigging(ClientboundPackets1_16_2.ACKNOWLEDGE_PLAYER_DIGGING);
|
||||||
|
|
||||||
|
protocol.registerOutgoing(ClientboundPackets1_16_2.WORLD_BORDER, null, new PacketRemapper() {
|
||||||
|
@Override
|
||||||
|
public void registerMap() {
|
||||||
|
handler(wrapper -> {
|
||||||
|
// Border packet actions have been split into individual packets (the content hasn't changed)
|
||||||
|
int type = wrapper.read(Type.VAR_INT);
|
||||||
|
ClientboundPacketType packetType;
|
||||||
|
switch (type) {
|
||||||
|
case 0:
|
||||||
|
packetType = ClientboundPackets1_17.WORLD_BORDER_SIZE;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
packetType = ClientboundPackets1_17.WORLD_BORDER_LERP_SIZE;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
packetType = ClientboundPackets1_17.WORLD_BORDER_CENTER;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
packetType = ClientboundPackets1_17.WORLD_BORDER_INIT;
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
packetType = ClientboundPackets1_17.WORLD_BORDER_WARNING_DELAY;
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
packetType = ClientboundPackets1_17.WORLD_BORDER_WARNING_DISTANCE;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new IllegalArgumentException("Invalid world border type received: " + type);
|
||||||
|
}
|
||||||
|
|
||||||
|
wrapper.setId(packetType.ordinal());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
protocol.registerOutgoing(ClientboundPackets1_16_2.UPDATE_LIGHT, new PacketRemapper() {
|
protocol.registerOutgoing(ClientboundPackets1_16_2.UPDATE_LIGHT, new PacketRemapper() {
|
||||||
@Override
|
@Override
|
||||||
public void registerMap() {
|
public void registerMap() {
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>viaversion-parent</artifactId>
|
<artifactId>viaversion-parent</artifactId>
|
||||||
<groupId>us.myles</groupId>
|
<groupId>us.myles</groupId>
|
||||||
<version>3.3.0-21w07a</version>
|
<version>3.3.0-21w08a</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>viaversion-parent</artifactId>
|
<artifactId>viaversion-parent</artifactId>
|
||||||
<groupId>us.myles</groupId>
|
<groupId>us.myles</groupId>
|
||||||
<version>3.3.0-21w07a</version>
|
<version>3.3.0-21w08a</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<name>viaversion-jar</name>
|
<name>viaversion-jar</name>
|
||||||
|
2
pom.xml
2
pom.xml
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<groupId>us.myles</groupId>
|
<groupId>us.myles</groupId>
|
||||||
<artifactId>viaversion-parent</artifactId>
|
<artifactId>viaversion-parent</artifactId>
|
||||||
<version>3.3.0-21w07a</version>
|
<version>3.3.0-21w08a</version>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
<name>viaversion-parent</name>
|
<name>viaversion-parent</name>
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>viaversion-parent</artifactId>
|
<artifactId>viaversion-parent</artifactId>
|
||||||
<groupId>us.myles</groupId>
|
<groupId>us.myles</groupId>
|
||||||
<version>3.3.0-21w07a</version>
|
<version>3.3.0-21w08a</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>viaversion-parent</artifactId>
|
<artifactId>viaversion-parent</artifactId>
|
||||||
<groupId>us.myles</groupId>
|
<groupId>us.myles</groupId>
|
||||||
<version>3.3.0-21w07a</version>
|
<version>3.3.0-21w08a</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>viaversion-parent</artifactId>
|
<artifactId>viaversion-parent</artifactId>
|
||||||
<groupId>us.myles</groupId>
|
<groupId>us.myles</groupId>
|
||||||
<version>3.3.0-21w07a</version>
|
<version>3.3.0-21w08a</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user