Updated Via*

This commit is contained in:
RaphiMC 2023-02-20 15:38:52 +01:00
parent 3f899f1d92
commit 829b8006e1
3 changed files with 5 additions and 10 deletions

View File

@ -68,7 +68,7 @@ dependencies {
include "com.viaversion:viarewind-core:2.0.3-SNAPSHOT" include "com.viaversion:viarewind-core:2.0.3-SNAPSHOT"
include "net.raphimc:ViaLegacy:2.2.6" include "net.raphimc:ViaLegacy:2.2.6"
include "net.raphimc:ViaAprilFools:2.0.4" include "net.raphimc:ViaAprilFools:2.0.4"
include("net.raphimc:ViaProtocolHack:2.1.3") { include("net.raphimc:ViaProtocolHack:2.1.4") {
exclude group: "org.slf4j", module: "slf4j-api" exclude group: "org.slf4j", module: "slf4j-api"
} }

View File

@ -25,14 +25,12 @@ import com.viaversion.viaversion.api.protocol.packet.State;
import com.viaversion.viaversion.api.protocol.remapper.PacketHandlers; import com.viaversion.viaversion.api.protocol.remapper.PacketHandlers;
import com.viaversion.viaversion.api.type.Type; import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.api.type.types.BitSetType; import com.viaversion.viaversion.api.type.types.BitSetType;
import com.viaversion.viaversion.api.type.types.ByteArrayType;
import com.viaversion.viaversion.protocols.base.ClientboundLoginPackets; import com.viaversion.viaversion.protocols.base.ClientboundLoginPackets;
import com.viaversion.viaversion.protocols.protocol1_19_1to1_19.ClientboundPackets1_19_1; import com.viaversion.viaversion.protocols.protocol1_19_1to1_19.ClientboundPackets1_19_1;
import com.viaversion.viaversion.protocols.protocol1_19_1to1_19.ServerboundPackets1_19_1; import com.viaversion.viaversion.protocols.protocol1_19_1to1_19.ServerboundPackets1_19_1;
import com.viaversion.viaversion.protocols.protocol1_19_3to1_19_1.ClientboundPackets1_19_3; import com.viaversion.viaversion.protocols.protocol1_19_3to1_19_1.ClientboundPackets1_19_3;
import com.viaversion.viaversion.protocols.protocol1_19_3to1_19_1.ServerboundPackets1_19_3; import com.viaversion.viaversion.protocols.protocol1_19_3to1_19_1.ServerboundPackets1_19_3;
import net.lenni0451.classtransform.InjectionCallback; import net.lenni0451.classtransform.InjectionCallback;
import net.lenni0451.classtransform.annotations.CShadow;
import net.lenni0451.classtransform.annotations.CTarget; import net.lenni0451.classtransform.annotations.CTarget;
import net.lenni0451.classtransform.annotations.CTransformer; import net.lenni0451.classtransform.annotations.CTransformer;
import net.lenni0451.classtransform.annotations.injection.CInject; import net.lenni0451.classtransform.annotations.injection.CInject;
@ -44,9 +42,6 @@ import java.util.BitSet;
@CTransformer(Protocol1_19_1To1_19_3.class) @CTransformer(Protocol1_19_1To1_19_3.class)
public abstract class Protocol1_19_1To1_19_3Transformer extends BackwardsProtocol<ClientboundPackets1_19_3, ClientboundPackets1_19_1, ServerboundPackets1_19_3, ServerboundPackets1_19_1> { public abstract class Protocol1_19_1To1_19_3Transformer extends BackwardsProtocol<ClientboundPackets1_19_3, ClientboundPackets1_19_1, ServerboundPackets1_19_3, ServerboundPackets1_19_1> {
@CShadow
private static ByteArrayType.OptionalByteArrayType OPTIONAL_SIGNATURE_BYTES_TYPE;
@CInject(method = "registerPackets", target = @CTarget("RETURN")) @CInject(method = "registerPackets", target = @CTarget("RETURN"))
private void allowSignatures(InjectionCallback ic) { private void allowSignatures(InjectionCallback ic) {
this.registerClientbound(State.LOGIN, ClientboundLoginPackets.GAME_PROFILE.getId(), ClientboundLoginPackets.GAME_PROFILE.getId(), new PacketHandlers() { this.registerClientbound(State.LOGIN, ClientboundLoginPackets.GAME_PROFILE.getId(), ClientboundLoginPackets.GAME_PROFILE.getId(), new PacketHandlers() {
@ -84,9 +79,9 @@ public abstract class Protocol1_19_1To1_19_3Transformer extends BackwardsProtoco
final long salt = wrapper.get(Type.LONG, 1); final long salt = wrapper.get(Type.LONG, 1);
final MessageMetadata metadata = new MessageMetadata(null, timestamp, salt); final MessageMetadata metadata = new MessageMetadata(null, timestamp, salt);
wrapper.write(OPTIONAL_SIGNATURE_BYTES_TYPE, chatSession.signChatMessage(metadata, message, new PlayerMessageSignature[0])); // Signature wrapper.write(Protocol1_19_1To1_19_3.OPTIONAL_SIGNATURE_BYTES_TYPE, chatSession.signChatMessage(metadata, message, new PlayerMessageSignature[0])); // Signature
} else { } else {
wrapper.write(OPTIONAL_SIGNATURE_BYTES_TYPE, null); // Signature wrapper.write(Protocol1_19_1To1_19_3.OPTIONAL_SIGNATURE_BYTES_TYPE, null); // Signature
} }
wrapper.write(Type.VAR_INT, 0); // Offset wrapper.write(Type.VAR_INT, 0); // Offset

View File

@ -36,8 +36,8 @@ public class ProtocolHack {
public static void init() { public static void init() {
patchConfigs(); patchConfigs();
final Supplier<?>[] additionalPlatformSuppliers = PluginManager.EVENT_MANAGER.call(new ProtocolHackInitEvent(ViaAprilFoolsPlatformImpl::new)).getPlatformSuppliers().toArray(new Supplier[0]); final Supplier<?>[] platformSuppliers = PluginManager.EVENT_MANAGER.call(new ProtocolHackInitEvent(ViaBackwardsPlatformImpl::new, ViaRewindPlatformImpl::new, ViaLegacyPlatformImpl::new, ViaAprilFoolsPlatformImpl::new)).getPlatformSuppliers().toArray(new Supplier[0]);
ViaProtocolHack.init(new ViaProxyViaVersionPlatformImpl(), new ViaProxyVPLoader(), null, null, ViaBackwardsPlatformImpl::new, ViaRewindPlatformImpl::new, ViaLegacyPlatformImpl::new, additionalPlatformSuppliers); ViaProtocolHack.init(new ViaProxyViaVersionPlatformImpl(), new ViaProxyVPLoader(), null, null, platformSuppliers);
} }
private static void patchConfigs() { private static void patchConfigs() {