Bump Classic4J to use maven central release.

This commit is contained in:
FlorianMichael 2023-10-14 18:49:16 +02:00
parent fd58471f43
commit 32b8dc46c4
No known key found for this signature in database
GPG Key ID: C2FB87E71C425126
3 changed files with 11 additions and 4 deletions

View File

@ -15,7 +15,7 @@ archives_base_name=viafabricplus
# base lib
raknet_transport_version=1.0.0.CR1-SNAPSHOT
classic4j_version=2.0.1-SNAPSHOT
classic4j_version=2.0.1
# viaversion (and required) libs
viaversion_version=4.9.0-23w40a-SNAPSHOT

View File

@ -73,6 +73,7 @@ public class ViaFabricPlus {
// Load overriding jars first so other code can access the new classes
ViaJarReplacer.loadOverridingJars();
// PreLoad Callback (for example to register new protocols)
PreLoadCallback.EVENT.invoker().onLoad();
// Classic Stuff

View File

@ -19,22 +19,28 @@ package de.florianmichael.viafabricplus.protocolhack.provider.vialegacy;
import com.viaversion.viaversion.api.connection.UserConnection;
import de.florianmichael.classic4j.BetaCraftHandler;
import de.florianmichael.viafabricplus.ViaFabricPlus;
import de.florianmichael.viafabricplus.integration.Classic4JImpl;
import de.florianmichael.viafabricplus.base.settings.groups.AuthenticationSettings;
import net.raphimc.vialegacy.protocols.classic.protocola1_0_15toc0_28_30.providers.ClassicMPPassProvider;
import net.raphimc.vialegacy.protocols.release.protocol1_7_2_5to1_6_4.storage.HandshakeStorage;
public class ViaFabricPlusClassicMPPassProvider extends ClassicMPPassProvider {
public static String classiCubeMPPass;
@Override
public String getMpPass(UserConnection user) {
if (classiCubeMPPass != null) return classiCubeMPPass;
if (classiCubeMPPass != null) {
return classiCubeMPPass;
}
if (AuthenticationSettings.INSTANCE.useBetaCraftAuthentication.getValue()) {
final HandshakeStorage handshakeStorage = user.get(HandshakeStorage.class);
return BetaCraftHandler.requestMPPass(user.getProtocolInfo().getUsername(), handshakeStorage.getHostname(), handshakeStorage.getPort(), Classic4JImpl.JOIN_SERVER_CALL);
if (handshakeStorage == null) {
return super.getMpPass(user);
}
return BetaCraftHandler.requestMPPass(user.getProtocolInfo().getUsername(), handshakeStorage.getHostname(), handshakeStorage.getPort(), Classic4JImpl.JOIN_SERVER_CALL, throwable ->
ViaFabricPlus.LOGGER.error("Error occurred while requesting the MP-Pass to verify session", throwable));
} else {
return super.getMpPass(user);
}