Don't register unneeded base protocols

This commit is contained in:
RaphiMC 2024-02-18 20:16:04 +01:00
parent b7a83e3e0f
commit 435f845885
No known key found for this signature in database
GPG Key ID: 0F6BB0657A03AC94
2 changed files with 0 additions and 35 deletions

View File

@ -1,29 +0,0 @@
/*
* This file is part of ViaLegacy - https://github.com/RaphiMC/ViaLegacy
* Copyright (C) 2020-2024 RK_01/RaphiMC 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 net.raphimc.vialegacy.api.protocol;
import com.viaversion.viaversion.api.protocol.AbstractSimpleProtocol;
public class EmptyBaseProtocol extends AbstractSimpleProtocol {
@Override
public boolean isBaseProtocol() {
return true;
}
}

View File

@ -17,14 +17,12 @@
*/
package net.raphimc.vialegacy.platform;
import com.google.common.collect.Range;
import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.api.protocol.ProtocolManager;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import net.raphimc.vialegacy.ViaLegacy;
import net.raphimc.vialegacy.ViaLegacyConfig;
import net.raphimc.vialegacy.api.LegacyProtocolVersion;
import net.raphimc.vialegacy.api.protocol.EmptyBaseProtocol;
import net.raphimc.vialegacy.protocols.alpha.protocola1_0_16_2toa1_0_15.Protocola1_0_16_2toa1_0_15;
import net.raphimc.vialegacy.protocols.alpha.protocola1_0_17_1_0_17_4toa1_0_16_2.Protocola1_0_17_1_0_17_4toa1_0_16_2;
import net.raphimc.vialegacy.protocols.alpha.protocola1_1_0_1_1_2_1toa1_0_17_1_0_17_4.Protocola1_1_0_1_1_2_1toa1_0_17_1_0_17_4;
@ -117,10 +115,6 @@ public interface ViaLegacyPlatform {
protocolManager.registerProtocol(new Protocolc0_0_19a_06toc0_0_18a_02(), LegacyProtocolVersion.c0_0_19a_06, LegacyProtocolVersion.c0_0_18a_02);
protocolManager.registerProtocol(new Protocolc0_0_18a_02toc0_0_16a_02(), LegacyProtocolVersion.c0_0_18a_02, LegacyProtocolVersion.c0_0_16a_02);
protocolManager.registerProtocol(new Protocolc0_0_16a_02to0_0_15a_1(), LegacyProtocolVersion.c0_0_16a_02, LegacyProtocolVersion.c0_0_15a_1);
for (ProtocolVersion version : LegacyProtocolVersion.PROTOCOLS) {
Via.getManager().getProtocolManager().registerBaseProtocol(new EmptyBaseProtocol(), Range.singleton(version));
}
}
Logger getLogger();