Skip to content

Commit

Permalink
Handle incompatibility of realms button tweak, closes #232
Browse files Browse the repository at this point in the history
  • Loading branch information
ACGaming committed Jul 14, 2023
1 parent 19197b6 commit c758820
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1340,7 +1340,11 @@ public static class TweaksMiscCategory

@Config.RequiresMcRestart
@Config.Name("Remove Realms Button")
@Config.Comment("Removes the redundant Minecraft Realms button from the main menu")
@Config.Comment
({
"Removes the redundant Minecraft Realms button from the main menu",
"Incompatible with RandomPatches"
})
public boolean utRealmsButtonToggle = true;

@Config.RequiresMcRestart
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public class UTLoadingPlugin implements IFMLLoadingPlugin, IEarlyMixinLoader
{
public static final boolean isClient = FMLLaunchHandler.side().isClient();
public static final boolean isDev = FMLLaunchHandler.isDeobfuscatedEnvironment();
public static boolean randomPatchesLoaded;
public static boolean spongeForgeLoaded;
public static long launchTime;

Expand All @@ -33,6 +34,13 @@ public class UTLoadingPlugin implements IFMLLoadingPlugin, IEarlyMixinLoader
Locale.setDefault(Locale.ENGLISH);
}

try
{
Class.forName("com.therandomlabs.randompatches.RandomPatches");
randomPatchesLoaded = true;
}
catch (ClassNotFoundException ignored) {}

try
{
Class.forName("org.spongepowered.mod.SpongeCoremod");
Expand Down Expand Up @@ -296,7 +304,7 @@ public boolean shouldMixinConfigQueue(String mixinConfig)
case "mixins.tweaks.items.itementities.client.json":
return UTConfig.TWEAKS_ITEMS.ITEM_ENTITIES.utItemEntitiesToggle;
case "mixins.tweaks.misc.buttons.realms.json":
return UTConfig.TWEAKS_MISC.utRealmsButtonToggle;
return UTConfig.TWEAKS_MISC.utRealmsButtonToggle && !randomPatchesLoaded;
case "mixins.tweaks.misc.buttons.snooper.client.json":
return UTConfig.TWEAKS_MISC.utSnooperToggle;
case "mixins.tweaks.misc.commands.seed.json":
Expand Down

0 comments on commit c758820

Please sign in to comment.