added -DVFPDebug Property to show debug logs

This commit is contained in:
FlorianMichael 2023-04-20 13:33:03 +02:00
parent 12163042f5
commit 9a9c079d13
3 changed files with 17 additions and 8 deletions

View File

@ -55,14 +55,17 @@ public class ViaFabricPlus {
// Classic Stuff
CustomClassicProtocolExtensions.create();
ClassicProtocolCommands.create();
ClassiCubeAccountHandler.create();
ClassicItemSelectionScreen.create();
// Bedrock Stuff
// Account Handler
ClassiCubeAccountHandler.create();
BedrockAccountHandler.create();
// Protocol Translator
// Fixes which requires to be loaded pre
ChatLengthCalculation.create();
FontCacheFix.init();
// Protocol Translator
ProtocolHack.init();
FinishMinecraftLoadCallback.EVENT.register(() -> {
@ -70,9 +73,7 @@ public class ViaFabricPlus {
settingsSystem.init();
informationSystem.init();
// Stuff which requires Minecraft to be initialized
ClassicItemSelectionScreen.create();
// Mappings which requires Minecraft to be initialized
PackFormatsMappings.load();
ItemReleaseVersionMappings.create();
ArmorPointsMappings.load();

View File

@ -59,7 +59,11 @@ public class BedrockAccountHandler extends FileSaver {
account = MinecraftAuth.Bedrock.Title.MC_CHAIN.refresh(httpClient, account);
}
} catch (Exception e) {
ViaFabricPlus.LOGGER.error("Failed to log into Bedrock account!", e);
if (System.getProperty("VFPDebug") != null) {
ViaFabricPlus.LOGGER.error("Failed to log into Bedrock account!", e);
} else {
ViaFabricPlus.LOGGER.error("Failed to log into Bedrock account! Use -DVFPDebug to show the log");
}
}
}

View File

@ -58,7 +58,11 @@ public class ClassiCubeAccountHandler extends FileSaver {
try {
account = ClassiCubeAccount.fromJson(object);
} catch (Exception e) {
ViaFabricPlus.LOGGER.error("Failed to log into ClassiCube account!", e);
if (System.getProperty("VFPDebug") != null) {
ViaFabricPlus.LOGGER.error("Failed to log into ClassiCube account!", e);
} else {
ViaFabricPlus.LOGGER.error("Failed to log into ClassiCube account! Use -DVFPDebug to show the log");
}
}
}