mirror of
https://github.com/ViaVersion/ViaFabric.git
synced 2024-11-15 10:35:14 +01:00
Don't rely on deprecated Via API
This commit is contained in:
parent
1f9cbd2853
commit
08f153f434
@ -3,19 +3,20 @@ package com.viaversion.fabric.common.protocol;
|
||||
import com.viaversion.fabric.common.AddressParser;
|
||||
import com.viaversion.viaversion.api.protocol.AbstractSimpleProtocol;
|
||||
import com.viaversion.viaversion.api.protocol.packet.PacketWrapper;
|
||||
import com.viaversion.viaversion.api.protocol.remapper.PacketRemapper;
|
||||
import com.viaversion.viaversion.api.protocol.remapper.PacketHandlers;
|
||||
import com.viaversion.viaversion.api.protocol.remapper.ValueTransformer;
|
||||
import com.viaversion.viaversion.api.type.Type;
|
||||
import com.viaversion.viaversion.api.protocol.packet.State;
|
||||
import com.viaversion.viaversion.protocols.base.ServerboundHandshakePackets;
|
||||
|
||||
public class HostnameParserProtocol extends AbstractSimpleProtocol {
|
||||
public static final HostnameParserProtocol INSTANCE = new HostnameParserProtocol();
|
||||
|
||||
@Override
|
||||
protected void registerPackets() {
|
||||
registerServerbound(State.HANDSHAKE, 0, 0, new PacketRemapper() {
|
||||
registerServerbound(State.HANDSHAKE, ServerboundHandshakePackets.CLIENT_INTENTION.getId(), ServerboundHandshakePackets.CLIENT_INTENTION.getId(), new PacketHandlers() {
|
||||
@Override
|
||||
public void registerMap() {
|
||||
protected void register() {
|
||||
map(Type.VAR_INT); // Protocol version
|
||||
map(Type.STRING, new ValueTransformer<String, String>(Type.STRING) {
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user