Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-12-27 16:40:10 +01:00
Don't add base protocols when using special versions (#3704)
Dieser Commit ist enthalten in:
Ursprung
48241ba841
Commit
78aecbddf8
@ -59,6 +59,7 @@ public enum VersionType {
|
|||||||
* Any version that doesn't fit in the above categories (e.g. April Fools).
|
* Any version that doesn't fit in the above categories (e.g. April Fools).
|
||||||
* <p>
|
* <p>
|
||||||
* Protocol versions using this type must override the compareTo method.
|
* Protocol versions using this type must override the compareTo method.
|
||||||
|
* Protocol versions using this type must add base protocols to the pipeline manually.
|
||||||
*/
|
*/
|
||||||
SPECIAL
|
SPECIAL
|
||||||
}
|
}
|
@ -30,6 +30,7 @@ import com.viaversion.viaversion.api.protocol.packet.State;
|
|||||||
import com.viaversion.viaversion.api.protocol.packet.provider.PacketTypesProvider;
|
import com.viaversion.viaversion.api.protocol.packet.provider.PacketTypesProvider;
|
||||||
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
||||||
import com.viaversion.viaversion.api.protocol.version.VersionProvider;
|
import com.viaversion.viaversion.api.protocol.version.VersionProvider;
|
||||||
|
import com.viaversion.viaversion.api.protocol.version.VersionType;
|
||||||
import com.viaversion.viaversion.api.type.Type;
|
import com.viaversion.viaversion.api.type.Type;
|
||||||
import com.viaversion.viaversion.protocols.base.packet.BaseClientboundPacket;
|
import com.viaversion.viaversion.protocols.base.packet.BaseClientboundPacket;
|
||||||
import com.viaversion.viaversion.protocols.base.packet.BasePacketTypesProvider;
|
import com.viaversion.viaversion.protocols.base.packet.BasePacketTypesProvider;
|
||||||
@ -93,7 +94,9 @@ public class BaseProtocol extends AbstractProtocol<BaseClientboundPacket, BaseCl
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add Base Protocol
|
// Add Base Protocol
|
||||||
pipeline.add(Via.getManager().getProtocolManager().getBaseProtocol(serverProtocol));
|
if (!serverProtocol.getVersionType().equals(VersionType.SPECIAL)) {
|
||||||
|
pipeline.add(Via.getManager().getProtocolManager().getBaseProtocol(serverProtocol));
|
||||||
|
}
|
||||||
|
|
||||||
if (Via.getManager().isDebug()) {
|
if (Via.getManager().isDebug()) {
|
||||||
Via.getPlatform().getLogger().info("User connected with protocol: " + info.protocolVersion() + " and serverProtocol: " + info.serverProtocolVersion());
|
Via.getPlatform().getLogger().info("User connected with protocol: " + info.protocolVersion() + " and serverProtocol: " + info.serverProtocolVersion());
|
||||||
@ -139,4 +142,4 @@ public class BaseProtocol extends AbstractProtocol<BaseClientboundPacket, BaseCl
|
|||||||
protected PacketTypesProvider<BaseClientboundPacket, BaseClientboundPacket, BaseServerboundPacket, BaseServerboundPacket> createPacketTypesProvider() {
|
protected PacketTypesProvider<BaseClientboundPacket, BaseClientboundPacket, BaseServerboundPacket, BaseServerboundPacket> createPacketTypesProvider() {
|
||||||
return BasePacketTypesProvider.INSTANCE;
|
return BasePacketTypesProvider.INSTANCE;
|
||||||
}
|
}
|
||||||
}
|
}
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren