3
0
Mirror von https://github.com/ViaVersion/ViaBackwards.git synchronisiert 2024-11-18 05:50:08 +01:00

23w41a (probably)

Dieser Commit ist enthalten in:
Nassim Jahnke 2023-10-12 01:53:44 +10:00
Ursprung 2e0acf169b
Commit f78d166acf
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: EF6771C01F6EF02F
6 geänderte Dateien mit 60 neuen und 1 gelöschten Zeilen

Datei anzeigen

@ -18,7 +18,10 @@
package com.viaversion.viabackwards.protocol.protocol1_20_2to1_20_3;
import com.viaversion.viabackwards.api.BackwardsProtocol;
import com.viaversion.viabackwards.api.data.BackwardsMappings;
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.ItemPacketRewriter1_20_3;
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.api.minecraft.entities.Entity1_19_4Types;
import com.viaversion.viaversion.api.protocol.packet.ClientboundPacketType;
@ -39,7 +42,9 @@ import java.util.BitSet;
public final class Protocol1_20_2To1_20_3 extends BackwardsProtocol<ClientboundPackets1_20_2, ClientboundPackets1_20_2, ServerboundPackets1_20_2, ServerboundPackets1_20_2> {
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 ItemPacketRewriter1_20_3 itemRewriter = new ItemPacketRewriter1_20_3(this);
public Protocol1_20_2To1_20_3() {
super(ClientboundPackets1_20_2.class, ClientboundPackets1_20_2.class, ServerboundPackets1_20_2.class, ServerboundPackets1_20_2.class);
@ -49,6 +54,11 @@ public final class Protocol1_20_2To1_20_3 extends BackwardsProtocol<ClientboundP
protected void registerPackets() {
super.registerPackets();
final SoundRewriter<ClientboundPackets1_20_2> soundRewriter = new SoundRewriter<>(this);
soundRewriter.register1_19_3Sound(ClientboundPackets1_20_2.SOUND);
soundRewriter.registerEntitySound(ClientboundPackets1_20_2.ENTITY_SOUND);
soundRewriter.registerStopSound(ClientboundPackets1_20_2.STOP_SOUND);
// Components are now (mostly) written as nbt instead of json strings
registerClientbound(ClientboundPackets1_20_2.ADVANCEMENTS, wrapper -> {
wrapper.passthrough(Type.BOOLEAN); // Reset/clear
@ -256,6 +266,16 @@ public final class Protocol1_20_2To1_20_3 extends BackwardsProtocol<ClientboundP
return ClientboundConfigurationPackets1_20_2.FINISH_CONFIGURATION;
}
@Override
public BackwardsMappings getMappingData() {
return MAPPINGS;
}
@Override
public ItemPacketRewriter1_20_3 getItemRewriter() {
return itemRewriter;
}
@Override
public EntityPacketRewriter1_20_3 getEntityRewriter() {
return entityRewriter;

Datei anzeigen

@ -52,6 +52,8 @@ public final class EntityPacketRewriter1_20_3 extends EntityRewriter<Clientbound
meta.setMetaType(Types1_20_2.META_TYPES.byId(type.typeId()));
}
});
registerMetaTypeHandler(null, null, null, Types1_20_2.META_TYPES.particleType);
}
@Override

Datei anzeigen

@ -0,0 +1,36 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2023 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.viaversion.viabackwards.protocol.protocol1_20_2to1_20_3.rewriter;
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.viaversion.api.type.Type;
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;
public final class ItemPacketRewriter1_20_3 extends ItemRewriter<ClientboundPackets1_20_2, ServerboundPackets1_20_2, Protocol1_20_2To1_20_3> {
public ItemPacketRewriter1_20_3(final Protocol1_20_2To1_20_3 protocol) {
super(protocol, Type.ITEM1_20_2, Type.ITEM1_20_2_VAR_INT_ARRAY);
}
@Override
public void registerPackets() {
registerSpawnParticle1_19(ClientboundPackets1_20_2.SPAWN_PARTICLE);
}
}

Datei anzeigen

@ -1,4 +1,4 @@
projectVersion=4.9.0-23w40a-SNAPSHOT
projectVersion=4.9.0-23w41a-SNAPSHOT
# 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

Datei anzeigen

@ -4,6 +4,7 @@ rootProject.name = "viabackwards-parent"
dependencyResolutionManagement {
repositories {
mavenLocal()
maven("https://repo.viaversion.com")
maven("https://repo.papermc.io/repository/maven-public/")
maven("https://oss.sonatype.org/content/repositories/snapshots/")