mirror of
https://github.com/ViaVersion/ViaFabricPlus.git
synced 2024-11-21 11:46:49 +01:00
Bump Classic4J to use maven central release.
This commit is contained in:
parent
fd58471f43
commit
32b8dc46c4
@ -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
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user