mirror of
https://github.com/ViaVersion/ViaProxy.git
synced 2024-10-01 04:47:32 +02:00
Added new setting for legacy skin loading
This commit is contained in:
parent
8e097df090
commit
63e22d06ba
@ -66,7 +66,7 @@ dependencies {
|
|||||||
exclude group: "com.google.guava", module: "guava"
|
exclude group: "com.google.guava", module: "guava"
|
||||||
}
|
}
|
||||||
include "com.viaversion:viarewind-core:2.0.4-SNAPSHOT"
|
include "com.viaversion:viarewind-core:2.0.4-SNAPSHOT"
|
||||||
include "net.raphimc:ViaLegacy:2.2.9"
|
include "net.raphimc:ViaLegacy:2.2.10"
|
||||||
include "net.raphimc:ViaAprilFools:2.0.6"
|
include "net.raphimc:ViaAprilFools:2.0.6"
|
||||||
include("net.raphimc:ViaProtocolHack:2.2.2") {
|
include("net.raphimc:ViaProtocolHack:2.2.2") {
|
||||||
exclude group: "org.slf4j", module: "slf4j-api"
|
exclude group: "org.slf4j", module: "slf4j-api"
|
||||||
|
@ -48,6 +48,7 @@ public class Options {
|
|||||||
// GUI only config options
|
// GUI only config options
|
||||||
public static Account MC_ACCOUNT;
|
public static Account MC_ACCOUNT;
|
||||||
public static String CLASSIC_MP_PASS;
|
public static String CLASSIC_MP_PASS;
|
||||||
|
public static Boolean LEGACY_SKIN_LOADING;
|
||||||
|
|
||||||
// CLI only config options
|
// CLI only config options
|
||||||
public static int COMPRESSION_THRESHOLD = 256;
|
public static int COMPRESSION_THRESHOLD = 256;
|
||||||
|
@ -0,0 +1,37 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of ViaProxy - https://github.com/RaphiMC/ViaProxy
|
||||||
|
* Copyright (C) 2023 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.viaproxy.injection.transformer;
|
||||||
|
|
||||||
|
import net.lenni0451.classtransform.InjectionCallback;
|
||||||
|
import net.lenni0451.classtransform.annotations.CTarget;
|
||||||
|
import net.lenni0451.classtransform.annotations.CTransformer;
|
||||||
|
import net.lenni0451.classtransform.annotations.injection.CInject;
|
||||||
|
import net.raphimc.vialegacy.ViaLegacyConfig;
|
||||||
|
import net.raphimc.viaproxy.cli.options.Options;
|
||||||
|
|
||||||
|
@CTransformer(ViaLegacyConfig.class)
|
||||||
|
public abstract class ViaLegacyConfigTransformer {
|
||||||
|
|
||||||
|
@CInject(method = "isLegacySkinLoading", target = @CTarget("HEAD"), cancellable = true)
|
||||||
|
private void makeGUIConfigurable(final InjectionCallback ic) {
|
||||||
|
if (Options.LEGACY_SKIN_LOADING != null) {
|
||||||
|
ic.setReturnValue(Options.LEGACY_SKIN_LOADING);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -30,6 +30,7 @@ public class AdvancedTab extends AUITab {
|
|||||||
JSpinner bindPort;
|
JSpinner bindPort;
|
||||||
JTextField proxy;
|
JTextField proxy;
|
||||||
JCheckBox proxyOnlineMode;
|
JCheckBox proxyOnlineMode;
|
||||||
|
JCheckBox legacySkinLoading;
|
||||||
|
|
||||||
public AdvancedTab(final ViaProxyUI frame) {
|
public AdvancedTab(final ViaProxyUI frame) {
|
||||||
super(frame, "Advanced");
|
super(frame, "Advanced");
|
||||||
@ -76,6 +77,13 @@ public class AdvancedTab extends AUITab {
|
|||||||
ViaProxy.saveManager.uiSave.loadCheckBox("proxy_online_mode", this.proxyOnlineMode);
|
ViaProxy.saveManager.uiSave.loadCheckBox("proxy_online_mode", this.proxyOnlineMode);
|
||||||
contentPane.add(this.proxyOnlineMode);
|
contentPane.add(this.proxyOnlineMode);
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
this.legacySkinLoading = new JCheckBox("Legacy Skin Loading");
|
||||||
|
this.legacySkinLoading.setBounds(10, 140, 465, 20);
|
||||||
|
this.legacySkinLoading.setToolTipText("Enabling Legacy Skin Loading allows you to see skins on <= 1.6.4 servers");
|
||||||
|
ViaProxy.saveManager.uiSave.loadCheckBox("legacy_skin_loading", this.legacySkinLoading);
|
||||||
|
contentPane.add(this.legacySkinLoading);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -202,6 +202,7 @@ public class GeneralTab extends AUITab {
|
|||||||
final int authMethod = this.authMethod.getSelectedIndex();
|
final int authMethod = this.authMethod.getSelectedIndex();
|
||||||
final boolean betaCraftAuth = this.betaCraftAuth.isSelected();
|
final boolean betaCraftAuth = this.betaCraftAuth.isSelected();
|
||||||
final boolean proxyOnlineMode = ViaProxy.ui.advancedTab.proxyOnlineMode.isSelected();
|
final boolean proxyOnlineMode = ViaProxy.ui.advancedTab.proxyOnlineMode.isSelected();
|
||||||
|
final boolean legacySkinLoading = ViaProxy.ui.advancedTab.legacySkinLoading.isSelected();
|
||||||
final String proxyUrl = ViaProxy.ui.advancedTab.proxy.getText();
|
final String proxyUrl = ViaProxy.ui.advancedTab.proxy.getText();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -238,6 +239,7 @@ public class GeneralTab extends AUITab {
|
|||||||
Options.ONLINE_MODE = proxyOnlineMode;
|
Options.ONLINE_MODE = proxyOnlineMode;
|
||||||
Options.PROTOCOL_VERSION = serverVersion;
|
Options.PROTOCOL_VERSION = serverVersion;
|
||||||
Options.BETACRAFT_AUTH = betaCraftAuth;
|
Options.BETACRAFT_AUTH = betaCraftAuth;
|
||||||
|
Options.LEGACY_SKIN_LOADING = legacySkinLoading;
|
||||||
|
|
||||||
if (authMethod == 2) {
|
if (authMethod == 2) {
|
||||||
Options.OPENAUTHMOD_AUTH = true;
|
Options.OPENAUTHMOD_AUTH = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user