added own setting for skin loading

This commit is contained in:
FlorianMichael 2023-04-01 00:11:51 +02:00
parent 8648d050ee
commit c1e1f3705f
4 changed files with 43 additions and 4 deletions

View File

@ -0,0 +1,34 @@
/*
* This file is part of ViaFabricPlus - https://github.com/FlorianMichael/ViaFabricPlus
* Copyright (C) 2021-2023 FlorianMichael/EnZaXD 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 de.florianmichael.viafabricplus.injection.mixin.fixes.vialegacy;
import de.florianmichael.viafabricplus.settings.groups.MPPassSettings;
import net.raphimc.vialegacy.ViaLegacyConfig;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@Mixin(value = ViaLegacyConfig.class, remap = false)
public class MixinViaLegacyConfig {
@Inject(method = "isLegacySkinLoading", at = @At("HEAD"), cancellable = true)
public void overwriteValue(CallbackInfoReturnable<Boolean> cir) {
cir.setReturnValue(MPPassSettings.INSTANCE.allowViaLegacyToLoadSkinsInLegacyVersions.getValue());
}
}

View File

@ -29,6 +29,7 @@ public class MPPassSettings extends SettingGroup {
public final BooleanSetting disconnectIfJoinServerCallFails = new BooleanSetting(this, Text.translatable("mppass.viafabricplus.fail"), true); public final BooleanSetting disconnectIfJoinServerCallFails = new BooleanSetting(this, Text.translatable("mppass.viafabricplus.fail"), true);
public final BooleanSetting forceCPEIfUsingClassiCube = new BooleanSetting(this, Text.translatable("mppass.viafabricplus.classicube"), true); public final BooleanSetting forceCPEIfUsingClassiCube = new BooleanSetting(this, Text.translatable("mppass.viafabricplus.classicube"), true);
public final BooleanSetting spoofUserNameIfUsingClassiCube = new BooleanSetting(this, Text.translatable("mppass.viafabricplus.spoof"), true); public final BooleanSetting spoofUserNameIfUsingClassiCube = new BooleanSetting(this, Text.translatable("mppass.viafabricplus.spoof"), true);
public final BooleanSetting allowViaLegacyToLoadSkinsInLegacyVersions = new BooleanSetting(this, Text.translatable("mppass.viafabricplus.skin"), true);
public MPPassSettings() { public MPPassSettings() {
super("MP Pass"); super("MP Pass");

View File

@ -41,6 +41,7 @@
"mppass.viafabricplus.fail": "Disconnect if joinServer() call fails", "mppass.viafabricplus.fail": "Disconnect if joinServer() call fails",
"mppass.viafabricplus.classicube": "Force CPE Version if using ClassiCube", "mppass.viafabricplus.classicube": "Force CPE Version if using ClassiCube",
"mppass.viafabricplus.spoof": "Spoof Username to ClassiCube Name if using ClassiCube", "mppass.viafabricplus.spoof": "Spoof Username to ClassiCube Name if using ClassiCube",
"mppass.viafabricplus.skin": "Allow ViaLegacy to load skins in legacy versions",
"visual.viafabricplus.secure": "Disable secure chat warning", "visual.viafabricplus.secure": "Disable secure chat warning",
"visual.viafabricplus.indicator": "Hide signature indicator", "visual.viafabricplus.indicator": "Hide signature indicator",

View File

@ -11,6 +11,7 @@
"base.MixinMinecraftClient", "base.MixinMinecraftClient",
"base.MixinMultiplayerScreen", "base.MixinMultiplayerScreen",
"base.MixinMultiplayerServerListPinger", "base.MixinMultiplayerServerListPinger",
"base.MixinSharedConstants",
"bridge.MixinAddServerScreen", "bridge.MixinAddServerScreen",
"bridge.MixinConnectScreen", "bridge.MixinConnectScreen",
"bridge.MixinDebugHud", "bridge.MixinDebugHud",
@ -24,6 +25,7 @@
"fixes.minecraft.MixinInGameHud", "fixes.minecraft.MixinInGameHud",
"fixes.minecraft.MixinItemRenderer", "fixes.minecraft.MixinItemRenderer",
"fixes.minecraft.MixinMinecraftClient", "fixes.minecraft.MixinMinecraftClient",
"fixes.minecraft.MixinMultiplayerServerListPinger",
"fixes.minecraft.MixinPendingUpdateManager", "fixes.minecraft.MixinPendingUpdateManager",
"fixes.minecraft.MixinPlayerEntityRenderer", "fixes.minecraft.MixinPlayerEntityRenderer",
"fixes.minecraft.MixinPlayerPublicKey_PublicKeyData", "fixes.minecraft.MixinPlayerPublicKey_PublicKeyData",
@ -106,7 +108,6 @@
"fixes.minecraft.screen.MixinGameModeSelectionScreen_GameModeSelection", "fixes.minecraft.screen.MixinGameModeSelectionScreen_GameModeSelection",
"fixes.minecraft.screen.MixinJigsawBlockScreen", "fixes.minecraft.screen.MixinJigsawBlockScreen",
"fixes.minecraft.screen.MixinMultiplayerScreen", "fixes.minecraft.screen.MixinMultiplayerScreen",
"fixes.minecraft.MixinMultiplayerServerListPinger",
"fixes.minecraft.screen.MixinStructureBlockScreen_1", "fixes.minecraft.screen.MixinStructureBlockScreen_1",
"fixes.minecraft.screen.merchant.MixinMerchantScreen", "fixes.minecraft.screen.merchant.MixinMerchantScreen",
"fixes.minecraft.screen.merchant.MixinMerchantScreenHandler", "fixes.minecraft.screen.merchant.MixinMerchantScreenHandler",
@ -149,10 +150,12 @@
"fixes.viaversion.protocol1_9to1_8.MixinViaIdleThread", "fixes.viaversion.protocol1_9to1_8.MixinViaIdleThread",
"jsonwebtoken.MixinClasses", "jsonwebtoken.MixinClasses",
"jsonwebtoken.MixinDefaultCompressionCodecResolver", "jsonwebtoken.MixinDefaultCompressionCodecResolver",
"jsonwebtoken.MixinDefaultJwtParserBuilder", "jsonwebtoken.MixinDefaultJwtParserBuilder"
"base.MixinSharedConstants"
], ],
"injectors": { "injectors": {
"defaultRequire": 1 "defaultRequire": 1
} },
"mixins": [
"fixes.vialegacy.MixinViaLegacyConfig"
]
} }