3
0
Mirror von https://github.com/ViaVersion/ViaBackwards.git synchronisiert 2024-12-26 00:00:33 +01:00
Dieser Commit ist enthalten in:
Nassim Jahnke 2023-10-26 13:13:23 +10:00
Ursprung 232180ee61
Commit 59fc7f6a1a
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: EF6771C01F6EF02F
15 geänderte Dateien mit 76 neuen und 61 gelöschten Zeilen

Datei anzeigen

@ -57,7 +57,7 @@ public class Protocol1_10To1_11 extends BackwardsProtocol<ClientboundPackets1_9_
public void init(UserConnection user) { public void init(UserConnection user) {
// Register ClientWorld // Register ClientWorld
if (!user.has(ClientWorld.class)) { if (!user.has(ClientWorld.class)) {
user.put(new ClientWorld(user)); user.put(new ClientWorld());
} }
user.addEntityTracker(this.getClass(), new EntityTrackerBase(user, EntityTypes1_11.EntityType.PLAYER)); user.addEntityTracker(this.getClass(), new EntityTrackerBase(user, EntityTypes1_11.EntityType.PLAYER));

Datei anzeigen

@ -71,7 +71,7 @@ public class Protocol1_11_1To1_12 extends BackwardsProtocol<ClientboundPackets1_
public void init(UserConnection user) { public void init(UserConnection user) {
// Register ClientWorld // Register ClientWorld
if (!user.has(ClientWorld.class)) { if (!user.has(ClientWorld.class)) {
user.put(new ClientWorld(user)); user.put(new ClientWorld());
} }
user.addEntityTracker(this.getClass(), new EntityTrackerBase(user, EntityTypes1_12.EntityType.PLAYER)); user.addEntityTracker(this.getClass(), new EntityTrackerBase(user, EntityTypes1_12.EntityType.PLAYER));

Datei anzeigen

@ -47,7 +47,7 @@ public class Protocol1_11To1_11_1 extends BackwardsProtocol<ClientboundPackets1_
public void init(UserConnection user) { public void init(UserConnection user) {
// Register ClientWorld // Register ClientWorld
if (!user.has(ClientWorld.class)) { if (!user.has(ClientWorld.class)) {
user.put(new ClientWorld(user)); user.put(new ClientWorld());
} }
user.addEntityTracker(this.getClass(), new EntityTrackerBase(user, EntityTypes1_11.EntityType.PLAYER)); user.addEntityTracker(this.getClass(), new EntityTrackerBase(user, EntityTypes1_11.EntityType.PLAYER));

Datei anzeigen

@ -115,7 +115,7 @@ public class Protocol1_12_2To1_13 extends BackwardsProtocol<ClientboundPackets1_
public void init(UserConnection user) { public void init(UserConnection user) {
// Register ClientWorld // Register ClientWorld
if (!user.has(ClientWorld.class)) { if (!user.has(ClientWorld.class)) {
user.put(new ClientWorld(user)); user.put(new ClientWorld());
} }
user.addEntityTracker(this.getClass(), new EntityTrackerBase(user, EntityTypes1_13.EntityType.PLAYER)); user.addEntityTracker(this.getClass(), new EntityTrackerBase(user, EntityTypes1_13.EntityType.PLAYER));

Datei anzeigen

@ -164,7 +164,7 @@ public class Protocol1_13_2To1_14 extends BackwardsProtocol<ClientboundPackets1_
public void init(UserConnection user) { public void init(UserConnection user) {
// Register ClientWorld // Register ClientWorld
if (!user.has(ClientWorld.class)) { if (!user.has(ClientWorld.class)) {
user.put(new ClientWorld(user)); user.put(new ClientWorld());
} }
user.addEntityTracker(this.getClass(), new EntityTrackerBase(user, EntityTypes1_14.PLAYER)); user.addEntityTracker(this.getClass(), new EntityTrackerBase(user, EntityTypes1_14.PLAYER));

Datei anzeigen

@ -210,7 +210,7 @@ public class Protocol1_13To1_13_1 extends BackwardsProtocol<ClientboundPackets1_
user.addEntityTracker(getClass(), new EntityTrackerBase(user, EntityTypes1_13.EntityType.PLAYER)); user.addEntityTracker(getClass(), new EntityTrackerBase(user, EntityTypes1_13.EntityType.PLAYER));
if (!user.has(ClientWorld.class)) { if (!user.has(ClientWorld.class)) {
user.put(new ClientWorld(user)); user.put(new ClientWorld());
} }
} }

Datei anzeigen

@ -165,7 +165,7 @@ public class Protocol1_15_2To1_16 extends BackwardsProtocol<ClientboundPackets1_
@Override @Override
public void init(UserConnection user) { public void init(UserConnection user) {
if (!user.has(ClientWorld.class)) { if (!user.has(ClientWorld.class)) {
user.put(new ClientWorld(user)); user.put(new ClientWorld());
} }
user.put(new PlayerSneakStorage()); user.put(new PlayerSneakStorage());

Datei anzeigen

@ -20,8 +20,8 @@ package com.viaversion.viabackwards.protocol.protocol1_20_2to1_20_3;
import com.viaversion.viabackwards.api.BackwardsProtocol; import com.viaversion.viabackwards.api.BackwardsProtocol;
import com.viaversion.viabackwards.api.data.BackwardsMappings; import com.viaversion.viabackwards.api.data.BackwardsMappings;
import com.viaversion.viabackwards.api.rewriters.SoundRewriter; import com.viaversion.viabackwards.api.rewriters.SoundRewriter;
import com.viaversion.viabackwards.protocol.protocol1_20_2to1_20_3.rewriter.EntityPacketRewriter1_20_3;
import com.viaversion.viabackwards.protocol.protocol1_20_2to1_20_3.rewriter.BlockItemPacketRewriter1_20_3; import com.viaversion.viabackwards.protocol.protocol1_20_2to1_20_3.rewriter.BlockItemPacketRewriter1_20_3;
import com.viaversion.viabackwards.protocol.protocol1_20_2to1_20_3.rewriter.EntityPacketRewriter1_20_3;
import com.viaversion.viaversion.api.connection.UserConnection; import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.api.minecraft.entities.EntityTypes1_19_4; import com.viaversion.viaversion.api.minecraft.entities.EntityTypes1_19_4;
import com.viaversion.viaversion.api.protocol.packet.ClientboundPacketType; import com.viaversion.viaversion.api.protocol.packet.ClientboundPacketType;
@ -38,30 +38,45 @@ import com.viaversion.viaversion.protocols.protocol1_20_2to1_20.packet.Clientbou
import com.viaversion.viaversion.protocols.protocol1_20_2to1_20.packet.ServerboundConfigurationPackets1_20_2; import com.viaversion.viaversion.protocols.protocol1_20_2to1_20.packet.ServerboundConfigurationPackets1_20_2;
import com.viaversion.viaversion.protocols.protocol1_20_2to1_20.packet.ServerboundPackets1_20_2; import com.viaversion.viaversion.protocols.protocol1_20_2to1_20.packet.ServerboundPackets1_20_2;
import com.viaversion.viaversion.protocols.protocol1_20_3to1_20_2.Protocol1_20_3To1_20_2; import com.viaversion.viaversion.protocols.protocol1_20_3to1_20_2.Protocol1_20_3To1_20_2;
import com.viaversion.viaversion.protocols.protocol1_20_3to1_20_2.packet.ClientboundPackets1_20_3;
import com.viaversion.viaversion.protocols.protocol1_20_3to1_20_2.packet.ServerboundPackets1_20_3; import com.viaversion.viaversion.protocols.protocol1_20_3to1_20_2.packet.ServerboundPackets1_20_3;
import java.util.BitSet; import java.util.BitSet;
public final class Protocol1_20_2To1_20_3 extends BackwardsProtocol<ClientboundPackets1_20_2, ClientboundPackets1_20_2, ServerboundPackets1_20_3, ServerboundPackets1_20_2> { public final class Protocol1_20_2To1_20_3 extends BackwardsProtocol<ClientboundPackets1_20_3, ClientboundPackets1_20_2, ServerboundPackets1_20_3, ServerboundPackets1_20_2> {
public static final BackwardsMappings MAPPINGS = new BackwardsMappings("1.20.3", "1.20.2", Protocol1_20_3To1_20_2.class); public static final BackwardsMappings MAPPINGS = new BackwardsMappings("1.20.3", "1.20.2", Protocol1_20_3To1_20_2.class);
private final EntityPacketRewriter1_20_3 entityRewriter = new EntityPacketRewriter1_20_3(this); private final EntityPacketRewriter1_20_3 entityRewriter = new EntityPacketRewriter1_20_3(this);
private final BlockItemPacketRewriter1_20_3 itemRewriter = new BlockItemPacketRewriter1_20_3(this); private final BlockItemPacketRewriter1_20_3 itemRewriter = new BlockItemPacketRewriter1_20_3(this);
public Protocol1_20_2To1_20_3() { public Protocol1_20_2To1_20_3() {
super(ClientboundPackets1_20_2.class, ClientboundPackets1_20_2.class, ServerboundPackets1_20_3.class, ServerboundPackets1_20_2.class); super(ClientboundPackets1_20_3.class, ClientboundPackets1_20_2.class, ServerboundPackets1_20_3.class, ServerboundPackets1_20_2.class);
} }
@Override @Override
protected void registerPackets() { protected void registerPackets() {
super.registerPackets(); super.registerPackets();
final SoundRewriter<ClientboundPackets1_20_2> soundRewriter = new SoundRewriter<>(this); final SoundRewriter<ClientboundPackets1_20_3> soundRewriter = new SoundRewriter<>(this);
soundRewriter.register1_19_3Sound(ClientboundPackets1_20_2.SOUND); soundRewriter.register1_19_3Sound(ClientboundPackets1_20_3.SOUND);
soundRewriter.registerEntitySound(ClientboundPackets1_20_2.ENTITY_SOUND); soundRewriter.registerEntitySound(ClientboundPackets1_20_3.ENTITY_SOUND);
soundRewriter.registerStopSound(ClientboundPackets1_20_2.STOP_SOUND); soundRewriter.registerStopSound(ClientboundPackets1_20_3.STOP_SOUND);
cancelClientbound(ClientboundPackets1_20_3.TICKING_STATE);
cancelClientbound(ClientboundPackets1_20_3.TICKING_STEP);
registerServerbound(ServerboundPackets1_20_2.UPDATE_JIGSAW_BLOCK, wrapper -> {
wrapper.passthrough(Type.POSITION1_14); // Position
wrapper.passthrough(Type.STRING); // Name
wrapper.passthrough(Type.STRING); // Target
wrapper.passthrough(Type.STRING); // Pool
wrapper.passthrough(Type.STRING); // Final state
wrapper.passthrough(Type.STRING); // Joint type
wrapper.write(Type.VAR_INT, 0); // Selection priority
wrapper.write(Type.VAR_INT, 0); // Placement priority
});
// Components are now (mostly) written as nbt instead of json strings // Components are now (mostly) written as nbt instead of json strings
registerClientbound(ClientboundPackets1_20_2.ADVANCEMENTS, wrapper -> { registerClientbound(ClientboundPackets1_20_3.ADVANCEMENTS, wrapper -> {
wrapper.passthrough(Type.BOOLEAN); // Reset/clear wrapper.passthrough(Type.BOOLEAN); // Reset/clear
final int size = wrapper.passthrough(Type.VAR_INT); // Mapping size final int size = wrapper.passthrough(Type.VAR_INT); // Mapping size
for (int i = 0; i < size; i++) { for (int i = 0; i < size; i++) {
@ -94,7 +109,7 @@ public final class Protocol1_20_2To1_20_3 extends BackwardsProtocol<ClientboundP
wrapper.passthrough(Type.BOOLEAN); // Send telemetry wrapper.passthrough(Type.BOOLEAN); // Send telemetry
} }
}); });
registerClientbound(ClientboundPackets1_20_2.TAB_COMPLETE, wrapper -> { registerClientbound(ClientboundPackets1_20_3.TAB_COMPLETE, wrapper -> {
wrapper.passthrough(Type.VAR_INT); // Transaction id wrapper.passthrough(Type.VAR_INT); // Transaction id
wrapper.passthrough(Type.VAR_INT); // Start wrapper.passthrough(Type.VAR_INT); // Start
wrapper.passthrough(Type.VAR_INT); // Length wrapper.passthrough(Type.VAR_INT); // Length
@ -105,7 +120,7 @@ public final class Protocol1_20_2To1_20_3 extends BackwardsProtocol<ClientboundP
convertOptionalComponent(wrapper); // Tooltip convertOptionalComponent(wrapper); // Tooltip
} }
}); });
registerClientbound(ClientboundPackets1_20_2.MAP_DATA, wrapper -> { registerClientbound(ClientboundPackets1_20_3.MAP_DATA, wrapper -> {
wrapper.passthrough(Type.VAR_INT); // Map id wrapper.passthrough(Type.VAR_INT); // Map id
wrapper.passthrough(Type.BYTE); // Scale wrapper.passthrough(Type.BYTE); // Scale
wrapper.passthrough(Type.BOOLEAN); // Locked wrapper.passthrough(Type.BOOLEAN); // Locked
@ -120,7 +135,7 @@ public final class Protocol1_20_2To1_20_3 extends BackwardsProtocol<ClientboundP
} }
} }
}); });
registerClientbound(ClientboundPackets1_20_2.BOSSBAR, wrapper -> { registerClientbound(ClientboundPackets1_20_3.BOSSBAR, wrapper -> {
wrapper.passthrough(Type.UUID); // Id wrapper.passthrough(Type.UUID); // Id
final int action = wrapper.passthrough(Type.VAR_INT); final int action = wrapper.passthrough(Type.VAR_INT);
@ -128,7 +143,7 @@ public final class Protocol1_20_2To1_20_3 extends BackwardsProtocol<ClientboundP
convertComponent(wrapper); convertComponent(wrapper);
} }
}); });
registerClientbound(ClientboundPackets1_20_2.PLAYER_CHAT, wrapper -> { registerClientbound(ClientboundPackets1_20_3.PLAYER_CHAT, wrapper -> {
wrapper.passthrough(Type.UUID); // Sender wrapper.passthrough(Type.UUID); // Sender
wrapper.passthrough(Type.VAR_INT); // Index wrapper.passthrough(Type.VAR_INT); // Index
wrapper.passthrough(Type.OPTIONAL_SIGNATURE_BYTES); // Signature wrapper.passthrough(Type.OPTIONAL_SIGNATURE_BYTES); // Signature
@ -155,14 +170,14 @@ public final class Protocol1_20_2To1_20_3 extends BackwardsProtocol<ClientboundP
convertComponent(wrapper); // Sender convertComponent(wrapper); // Sender
convertOptionalComponent(wrapper); // Target convertOptionalComponent(wrapper); // Target
}); });
registerClientbound(ClientboundPackets1_20_2.SCOREBOARD_OBJECTIVE, wrapper -> { registerClientbound(ClientboundPackets1_20_3.SCOREBOARD_OBJECTIVE, wrapper -> {
wrapper.passthrough(Type.STRING); // Objective Name wrapper.passthrough(Type.STRING); // Objective Name
final byte action = wrapper.passthrough(Type.BYTE); // Mode final byte action = wrapper.passthrough(Type.BYTE); // Mode
if (action == 0 || action == 2) { if (action == 0 || action == 2) {
convertComponent(wrapper); // Display Name convertComponent(wrapper); // Display Name
} }
}); });
registerClientbound(ClientboundPackets1_20_2.TEAMS, wrapper -> { registerClientbound(ClientboundPackets1_20_3.TEAMS, wrapper -> {
wrapper.passthrough(Type.STRING); // Team Name wrapper.passthrough(Type.STRING); // Team Name
final byte action = wrapper.passthrough(Type.BYTE); // Mode final byte action = wrapper.passthrough(Type.BYTE); // Mode
if (action == 0 || action == 2) { if (action == 0 || action == 2) {
@ -178,15 +193,15 @@ public final class Protocol1_20_2To1_20_3 extends BackwardsProtocol<ClientboundP
registerClientbound(State.CONFIGURATION, ClientboundConfigurationPackets1_20_2.DISCONNECT.getId(), ClientboundConfigurationPackets1_20_2.DISCONNECT.getId(), this::convertComponent); registerClientbound(State.CONFIGURATION, ClientboundConfigurationPackets1_20_2.DISCONNECT.getId(), ClientboundConfigurationPackets1_20_2.DISCONNECT.getId(), this::convertComponent);
registerClientbound(State.CONFIGURATION, ClientboundConfigurationPackets1_20_2.RESOURCE_PACK.getId(), ClientboundConfigurationPackets1_20_2.RESOURCE_PACK.getId(), resourcePackHandler()); registerClientbound(State.CONFIGURATION, ClientboundConfigurationPackets1_20_2.RESOURCE_PACK.getId(), ClientboundConfigurationPackets1_20_2.RESOURCE_PACK.getId(), resourcePackHandler());
registerClientbound(ClientboundPackets1_20_2.DISCONNECT, this::convertComponent); registerClientbound(ClientboundPackets1_20_3.DISCONNECT, this::convertComponent);
registerClientbound(ClientboundPackets1_20_2.RESOURCE_PACK, resourcePackHandler()); registerClientbound(ClientboundPackets1_20_3.RESOURCE_PACK, resourcePackHandler());
registerClientbound(ClientboundPackets1_20_2.SERVER_DATA, this::convertComponent); registerClientbound(ClientboundPackets1_20_3.SERVER_DATA, this::convertComponent);
registerClientbound(ClientboundPackets1_20_2.ACTIONBAR, this::convertComponent); registerClientbound(ClientboundPackets1_20_3.ACTIONBAR, this::convertComponent);
registerClientbound(ClientboundPackets1_20_2.TITLE_TEXT, this::convertComponent); registerClientbound(ClientboundPackets1_20_3.TITLE_TEXT, this::convertComponent);
registerClientbound(ClientboundPackets1_20_2.TITLE_SUBTITLE, this::convertComponent); registerClientbound(ClientboundPackets1_20_3.TITLE_SUBTITLE, this::convertComponent);
registerClientbound(ClientboundPackets1_20_2.DISGUISED_CHAT, this::convertComponent); registerClientbound(ClientboundPackets1_20_3.DISGUISED_CHAT, this::convertComponent);
registerClientbound(ClientboundPackets1_20_2.SYSTEM_CHAT, this::convertComponent); registerClientbound(ClientboundPackets1_20_3.SYSTEM_CHAT, this::convertComponent);
registerClientbound(ClientboundPackets1_20_2.OPEN_WINDOW, wrapper -> { registerClientbound(ClientboundPackets1_20_3.OPEN_WINDOW, wrapper -> {
wrapper.passthrough(Type.VAR_INT); // Container id wrapper.passthrough(Type.VAR_INT); // Container id
final int containerTypeId = wrapper.read(Type.VAR_INT); final int containerTypeId = wrapper.read(Type.VAR_INT);
@ -200,19 +215,19 @@ public final class Protocol1_20_2To1_20_3 extends BackwardsProtocol<ClientboundP
convertComponent(wrapper); convertComponent(wrapper);
}); });
registerClientbound(ClientboundPackets1_20_2.TAB_LIST, wrapper -> { registerClientbound(ClientboundPackets1_20_3.TAB_LIST, wrapper -> {
convertComponent(wrapper); convertComponent(wrapper);
convertComponent(wrapper); convertComponent(wrapper);
}); });
registerClientbound(ClientboundPackets1_20_2.COMBAT_KILL, new PacketHandlers() { registerClientbound(ClientboundPackets1_20_3.COMBAT_KILL, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.VAR_INT); // Duration map(Type.VAR_INT); // Duration
handler(wrapper -> convertComponent(wrapper)); handler(wrapper -> convertComponent(wrapper));
} }
}); });
registerClientbound(ClientboundPackets1_20_2.PLAYER_INFO_UPDATE, wrapper -> { registerClientbound(ClientboundPackets1_20_3.PLAYER_INFO_UPDATE, wrapper -> {
final BitSet actions = wrapper.passthrough(Type.PROFILE_ACTIONS_ENUM); final BitSet actions = wrapper.passthrough(Type.PROFILE_ACTIONS_ENUM);
final int entries = wrapper.passthrough(Type.VAR_INT); final int entries = wrapper.passthrough(Type.VAR_INT);
for (int i = 0; i < entries; i++) { for (int i = 0; i < entries; i++) {

Datei anzeigen

@ -21,12 +21,12 @@ import com.viaversion.viabackwards.api.rewriters.ItemRewriter;
import com.viaversion.viabackwards.protocol.protocol1_20_2to1_20_3.Protocol1_20_2To1_20_3; import com.viaversion.viabackwards.protocol.protocol1_20_2to1_20_3.Protocol1_20_2To1_20_3;
import com.viaversion.viaversion.api.type.Type; import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.api.type.types.chunk.ChunkType1_20_2; import com.viaversion.viaversion.api.type.types.chunk.ChunkType1_20_2;
import com.viaversion.viaversion.protocols.protocol1_20_2to1_20.packet.ClientboundPackets1_20_2;
import com.viaversion.viaversion.protocols.protocol1_20_2to1_20.packet.ServerboundPackets1_20_2; import com.viaversion.viaversion.protocols.protocol1_20_2to1_20.packet.ServerboundPackets1_20_2;
import com.viaversion.viaversion.protocols.protocol1_20_2to1_20.rewriter.RecipeRewriter1_20_2; import com.viaversion.viaversion.protocols.protocol1_20_2to1_20.rewriter.RecipeRewriter1_20_2;
import com.viaversion.viaversion.protocols.protocol1_20_3to1_20_2.packet.ClientboundPackets1_20_3;
import com.viaversion.viaversion.rewriter.BlockRewriter; import com.viaversion.viaversion.rewriter.BlockRewriter;
public final class BlockItemPacketRewriter1_20_3 extends ItemRewriter<ClientboundPackets1_20_2, ServerboundPackets1_20_2, Protocol1_20_2To1_20_3> { public final class BlockItemPacketRewriter1_20_3 extends ItemRewriter<ClientboundPackets1_20_3, ServerboundPackets1_20_2, Protocol1_20_2To1_20_3> {
public BlockItemPacketRewriter1_20_3(final Protocol1_20_2To1_20_3 protocol) { public BlockItemPacketRewriter1_20_3(final Protocol1_20_2To1_20_3 protocol) {
super(protocol, Type.ITEM1_20_2, Type.ITEM1_20_2_ARRAY); super(protocol, Type.ITEM1_20_2, Type.ITEM1_20_2_ARRAY);
@ -34,24 +34,24 @@ public final class BlockItemPacketRewriter1_20_3 extends ItemRewriter<Clientboun
@Override @Override
public void registerPackets() { public void registerPackets() {
final BlockRewriter<ClientboundPackets1_20_2> blockRewriter = BlockRewriter.for1_20_2(protocol); final BlockRewriter<ClientboundPackets1_20_3> blockRewriter = BlockRewriter.for1_20_2(protocol);
blockRewriter.registerBlockAction(ClientboundPackets1_20_2.BLOCK_ACTION); blockRewriter.registerBlockAction(ClientboundPackets1_20_3.BLOCK_ACTION);
blockRewriter.registerBlockChange(ClientboundPackets1_20_2.BLOCK_CHANGE); blockRewriter.registerBlockChange(ClientboundPackets1_20_3.BLOCK_CHANGE);
blockRewriter.registerVarLongMultiBlockChange1_20(ClientboundPackets1_20_2.MULTI_BLOCK_CHANGE); blockRewriter.registerVarLongMultiBlockChange1_20(ClientboundPackets1_20_3.MULTI_BLOCK_CHANGE);
blockRewriter.registerEffect(ClientboundPackets1_20_2.EFFECT, 1010, 2001); blockRewriter.registerEffect(ClientboundPackets1_20_3.EFFECT, 1010, 2001);
blockRewriter.registerChunkData1_19(ClientboundPackets1_20_2.CHUNK_DATA, ChunkType1_20_2::new); blockRewriter.registerChunkData1_19(ClientboundPackets1_20_3.CHUNK_DATA, ChunkType1_20_2::new);
blockRewriter.registerBlockEntityData(ClientboundPackets1_20_2.BLOCK_ENTITY_DATA); blockRewriter.registerBlockEntityData(ClientboundPackets1_20_3.BLOCK_ENTITY_DATA);
registerSetCooldown(ClientboundPackets1_20_2.COOLDOWN); registerSetCooldown(ClientboundPackets1_20_3.COOLDOWN);
registerWindowItems1_17_1(ClientboundPackets1_20_2.WINDOW_ITEMS); registerWindowItems1_17_1(ClientboundPackets1_20_3.WINDOW_ITEMS);
registerSetSlot1_17_1(ClientboundPackets1_20_2.SET_SLOT); registerSetSlot1_17_1(ClientboundPackets1_20_3.SET_SLOT);
registerEntityEquipmentArray(ClientboundPackets1_20_2.ENTITY_EQUIPMENT); registerEntityEquipmentArray(ClientboundPackets1_20_3.ENTITY_EQUIPMENT);
registerClickWindow1_17_1(ServerboundPackets1_20_2.CLICK_WINDOW); registerClickWindow1_17_1(ServerboundPackets1_20_2.CLICK_WINDOW);
registerTradeList1_19(ClientboundPackets1_20_2.TRADE_LIST); registerTradeList1_19(ClientboundPackets1_20_3.TRADE_LIST);
registerCreativeInvAction(ServerboundPackets1_20_2.CREATIVE_INVENTORY_ACTION); registerCreativeInvAction(ServerboundPackets1_20_2.CREATIVE_INVENTORY_ACTION);
registerWindowPropertyEnchantmentHandler(ClientboundPackets1_20_2.WINDOW_PROPERTY); registerWindowPropertyEnchantmentHandler(ClientboundPackets1_20_3.WINDOW_PROPERTY);
registerSpawnParticle1_19(ClientboundPackets1_20_2.SPAWN_PARTICLE); registerSpawnParticle1_19(ClientboundPackets1_20_3.SPAWN_PARTICLE);
new RecipeRewriter1_20_2<>(protocol).register(ClientboundPackets1_20_2.DECLARE_RECIPES); new RecipeRewriter1_20_2<>(protocol).register(ClientboundPackets1_20_3.DECLARE_RECIPES);
} }
} }

Datei anzeigen

@ -28,10 +28,10 @@ import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.api.type.types.version.Types1_20_2; import com.viaversion.viaversion.api.type.types.version.Types1_20_2;
import com.viaversion.viaversion.api.type.types.version.Types1_20_3; import com.viaversion.viaversion.api.type.types.version.Types1_20_3;
import com.viaversion.viaversion.protocols.protocol1_20_2to1_20.packet.ClientboundConfigurationPackets1_20_2; import com.viaversion.viaversion.protocols.protocol1_20_2to1_20.packet.ClientboundConfigurationPackets1_20_2;
import com.viaversion.viaversion.protocols.protocol1_20_2to1_20.packet.ClientboundPackets1_20_2;
import com.viaversion.viaversion.protocols.protocol1_20_3to1_20_2.Protocol1_20_3To1_20_2; import com.viaversion.viaversion.protocols.protocol1_20_3to1_20_2.Protocol1_20_3To1_20_2;
import com.viaversion.viaversion.protocols.protocol1_20_3to1_20_2.packet.ClientboundPackets1_20_3;
public final class EntityPacketRewriter1_20_3 extends EntityRewriter<ClientboundPackets1_20_2, Protocol1_20_2To1_20_3> { public final class EntityPacketRewriter1_20_3 extends EntityRewriter<ClientboundPackets1_20_3, Protocol1_20_2To1_20_3> {
public EntityPacketRewriter1_20_3(final Protocol1_20_2To1_20_3 protocol) { public EntityPacketRewriter1_20_3(final Protocol1_20_2To1_20_3 protocol) {
super(protocol); super(protocol);
@ -39,9 +39,9 @@ public final class EntityPacketRewriter1_20_3 extends EntityRewriter<Clientbound
@Override @Override
public void registerPackets() { public void registerPackets() {
registerSpawnTracker(ClientboundPackets1_20_2.SPAWN_ENTITY); registerSpawnTracker(ClientboundPackets1_20_3.SPAWN_ENTITY);
registerMetadataRewriter(ClientboundPackets1_20_2.ENTITY_METADATA, Types1_20_3.METADATA_LIST, Types1_20_2.METADATA_LIST); registerMetadataRewriter(ClientboundPackets1_20_3.ENTITY_METADATA, Types1_20_3.METADATA_LIST, Types1_20_2.METADATA_LIST);
registerRemoveEntities(ClientboundPackets1_20_2.REMOVE_ENTITIES); registerRemoveEntities(ClientboundPackets1_20_3.REMOVE_ENTITIES);
protocol.registerClientbound(State.CONFIGURATION, ClientboundConfigurationPackets1_20_2.REGISTRY_DATA, new PacketHandlers() { protocol.registerClientbound(State.CONFIGURATION, ClientboundConfigurationPackets1_20_2.REGISTRY_DATA, new PacketHandlers() {
@Override @Override
@ -52,7 +52,7 @@ public final class EntityPacketRewriter1_20_3 extends EntityRewriter<Clientbound
} }
}); });
protocol.registerClientbound(ClientboundPackets1_20_2.JOIN_GAME, new PacketHandlers() { protocol.registerClientbound(ClientboundPackets1_20_3.JOIN_GAME, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.INT); // Entity id map(Type.INT); // Entity id
@ -70,7 +70,7 @@ public final class EntityPacketRewriter1_20_3 extends EntityRewriter<Clientbound
} }
}); });
protocol.registerClientbound(ClientboundPackets1_20_2.RESPAWN, new PacketHandlers() { protocol.registerClientbound(ClientboundPackets1_20_3.RESPAWN, new PacketHandlers() {
@Override @Override
public void register() { public void register() {
map(Type.STRING); // Dimension map(Type.STRING); // Dimension

Datei anzeigen

@ -114,7 +114,7 @@ public class Protocol1_9_1_2To1_9_3_4 extends AbstractProtocol<ClientboundPacket
@Override @Override
public void init(UserConnection userConnection) { public void init(UserConnection userConnection) {
if (!userConnection.has(ClientWorld.class)) { if (!userConnection.has(ClientWorld.class)) {
userConnection.put(new ClientWorld(userConnection)); userConnection.put(new ClientWorld());
} }
} }
} }

Datei anzeigen

@ -93,7 +93,7 @@ public class Protocol1_9_4To1_10 extends BackwardsProtocol<ClientboundPackets1_9
public void init(UserConnection user) { public void init(UserConnection user) {
// Register ClientWorld // Register ClientWorld
if (!user.has(ClientWorld.class)) { if (!user.has(ClientWorld.class)) {
user.put(new ClientWorld(user)); user.put(new ClientWorld());
} }
user.addEntityTracker(this.getClass(), new EntityTrackerBase(user, EntityTypes1_10.EntityType.PLAYER)); user.addEntityTracker(this.getClass(), new EntityTrackerBase(user, EntityTypes1_10.EntityType.PLAYER));

Datei anzeigen

@ -1,4 +1,4 @@
projectVersion=4.9.0-23w42a-SNAPSHOT projectVersion=4.9.0-23w43a-SNAPSHOT
# Smile emoji # Smile emoji
mcVersions=1.20.2, 1.20.1, 1.20, 1.19.4, 1.19.3, 1.19.2, 1.19.1, 1.19, 1.18.2, 1.18.1, 1.18, 1.17.1, 1.17, 1.16.5, 1.16.4, 1.16.3, 1.16.2, 1.16.1, 1.16, 1.15.2, 1.15.1, 1.15, 1.14.4, 1.14.3, 1.14.2, 1.14.1, 1.14, 1.13.2, 1.13.1, 1.13, 1.12.2, 1.12.1, 1.12, 1.11.2, 1.11.1, 1.11, 1.10.2, 1.10.1, 1.10 mcVersions=1.20.2, 1.20.1, 1.20, 1.19.4, 1.19.3, 1.19.2, 1.19.1, 1.19, 1.18.2, 1.18.1, 1.18, 1.17.1, 1.17, 1.16.5, 1.16.4, 1.16.3, 1.16.2, 1.16.1, 1.16, 1.15.2, 1.15.1, 1.15, 1.14.4, 1.14.3, 1.14.2, 1.14.1, 1.14, 1.13.2, 1.13.1, 1.13, 1.12.2, 1.12.1, 1.12, 1.11.2, 1.11.1, 1.11, 1.10.2, 1.10.1, 1.10

Datei anzeigen

@ -3,7 +3,7 @@ metadata.format.version = "1.1"
[versions] [versions]
# ViaVersion # ViaVersion
viaver = "4.9.0-23w42a-SNAPSHOT" viaver = "4.9.0-23w43a-SNAPSHOT"
# Common provided # Common provided
netty = "4.0.20.Final" netty = "4.0.20.Final"