Automatically add add-opens if Java version >= 9
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
This commit is contained in:
parent
8a6776731a
commit
87bcefd08a
@ -50,11 +50,11 @@ QString JavaVersion::toString()
|
|||||||
|
|
||||||
bool JavaVersion::requiresPermGen()
|
bool JavaVersion::requiresPermGen()
|
||||||
{
|
{
|
||||||
if(m_parseable)
|
return !m_parseable || m_major < 8;
|
||||||
{
|
}
|
||||||
return m_major < 8;
|
|
||||||
}
|
bool JavaVersion::isModular() {
|
||||||
return true;
|
return m_parseable && m_major >= 9;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool JavaVersion::operator<(const JavaVersion &rhs)
|
bool JavaVersion::operator<(const JavaVersion &rhs)
|
||||||
|
@ -25,6 +25,8 @@ public:
|
|||||||
|
|
||||||
bool requiresPermGen();
|
bool requiresPermGen();
|
||||||
|
|
||||||
|
bool isModular();
|
||||||
|
|
||||||
QString toString();
|
QString toString();
|
||||||
|
|
||||||
int major()
|
int major()
|
||||||
|
@ -440,15 +440,15 @@ QStringList MinecraftInstance::javaArguments()
|
|||||||
|
|
||||||
args << "-Duser.language=en";
|
args << "-Duser.language=en";
|
||||||
|
|
||||||
|
if (javaVersion.isModular() && traits().contains("legacySkins") && settings()->get("LegacySkinFix").toBool())
|
||||||
|
args << "--add-opens" << "java.base/java.net=ALL-UNNAMED";
|
||||||
|
|
||||||
return args;
|
return args;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString MinecraftInstance::getLauncher()
|
QString MinecraftInstance::getLauncher() {
|
||||||
{
|
|
||||||
auto profile = m_components->getProfile();
|
|
||||||
|
|
||||||
// use legacy launcher if the traits are set
|
// use legacy launcher if the traits are set
|
||||||
if (profile->getTraits().contains("legacyLaunch") || profile->getTraits().contains("alphaLaunch"))
|
if (traits().contains("legacyLaunch") || traits().contains("alphaLaunch"))
|
||||||
return "legacy";
|
return "legacy";
|
||||||
|
|
||||||
return "standard";
|
return "standard";
|
||||||
|
@ -62,8 +62,7 @@ public final class SkinFix implements Fix, URLStreamHandlerFactory {
|
|||||||
public boolean isApplicable(Parameters params) {
|
public boolean isApplicable(Parameters params) {
|
||||||
if (!UrlUtils.isSupported() || !Base64.isSupported()) {
|
if (!UrlUtils.isSupported() || !Base64.isSupported()) {
|
||||||
Log.warning("Cannot access the necessary Java internals for skin fix");
|
Log.warning("Cannot access the necessary Java internals for skin fix");
|
||||||
Log.warning("Try adding '--add-opens java.base/java.net=ALL-UNNAMED' to your Java arguments");
|
Log.warning("Turning off legacy skin fix in Settings > Miscellaneous will silence the warnings");
|
||||||
Log.warning("Alternatively, turning off legacy skin fix in Settings > Miscellaneous will silence the warnings");
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user