Skip to content

Commit

Permalink
ACTUALLY fix the condition this time
Browse files Browse the repository at this point in the history
  • Loading branch information
Wyvest committed Jun 20, 2024
1 parent 97cc8c9 commit ebeef89
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
19 changes: 11 additions & 8 deletions src/main/java/org/polyfrost/hytils/config/HytilsConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -1245,17 +1245,20 @@ public HytilsConfig() {
}

initialize();
Class<?> autoGGClass = null;
try {
autoGGClass = Class.forName("club.sk1er.mods.autogg.config.AutoGGConfig");

HytilsReborn.INSTANCE.isSk1erAutoGG = true;
} catch (ClassNotFoundException ignored) {
}

if (configNumber != 3) { // Config version has not been set or is outdated
if (configNumber == 1) {
overlayAmount = 300;
}
if (configNumber <= 2) {
try {
Class<?> clazz = Class.forName("club.sk1er.mods.autogg.config.AutoGGConfig");

HytilsReborn.INSTANCE.isSk1erAutoGG = true;

if (autoGGClass != null) {
if (AutoGG.INSTANCE.getAutoGGConfig().isModEnabled()) {
autoGG = true;
}
Expand Down Expand Up @@ -1285,7 +1288,7 @@ public HytilsConfig() {
}

try {
Field sk1erEnabled = clazz.getDeclaredField("autoGGEnabled");
Field sk1erEnabled = autoGGClass.getDeclaredField("autoGGEnabled");
sk1erEnabled.setAccessible(true);
sk1erEnabled.set(AutoGG.INSTANCE.getAutoGGConfig(), false);

Expand All @@ -1296,9 +1299,8 @@ public HytilsConfig() {
}

Notifications.INSTANCE.send("Hytils Reborn", "AutoGG settings have been migrated to Hytils Reborn. You can now configure them in the Hytils Reborn settings, and remove Sk1erLLC's AutoGG.", 5);
} catch (ClassNotFoundException ignored) {

}

try {
Class.forName("club.sk1er.lobbysounds.config.Sounds");
boolean modified = false;
Expand Down Expand Up @@ -1418,6 +1420,7 @@ public HytilsConfig() {
addDependency("autoGGFirstPhraseDelay", "Sk1er's AutoGG Enabled", autoGGEnabled);
addDependency("autoGGMessage2", "Sk1er's AutoGG Enabled", autoGGEnabled);
addDependency("autoGGSecondPhraseDelay", "Sk1er's AutoGG Enabled", autoGGEnabled);
addDependency("antiGG", "Sk1er's AutoGG Enabled", autoGGEnabled);

addDependency("glPhrase", "autoGL");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ private boolean hasGameEnded(String message) {

@Override
public boolean isEnabled() {
return HytilsConfig.autoGG && (!HytilsReborn.INSTANCE.isSk1erAutoGG || club.sk1er.mods.autogg.AutoGG.INSTANCE.getAutoGGConfig().isModEnabled()); // If Sk1er's AutoGG is enabled, we don't want to interfere with it.
return HytilsConfig.autoGG && (!HytilsReborn.INSTANCE.isSk1erAutoGG || !club.sk1er.mods.autogg.AutoGG.INSTANCE.getAutoGGConfig().isModEnabled()); // If Sk1er's AutoGG is enabled, we don't want to interfere with it.
}

@Override
Expand Down

0 comments on commit ebeef89

Please sign in to comment.