Skip to content

Commit

Permalink
Disable incompatible optimizations with Vintagium present
Browse files Browse the repository at this point in the history
  • Loading branch information
embeddedt committed Jun 3, 2024
1 parent 6ebc4e0 commit 9b42645
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ public void acceptTargets(Set<String> set, Set<String> set1) {
}

private static final List<String> OPTIFINE_DISABLED_PACKAGES = ImmutableList.of("mixin.textures", "mixin.bugfix.entity_disappearing", "mixin.invisible_subchunks");
private static final List<String> VINTAGIUM_DISABLED_PACKAGES = ImmutableList.of("mixin.bugfix.entity_disappearing", "mixin.invisible_subchunks");

public static boolean isMixinClassApplied(String name) {
String unprefixedName = name.replace(PACKAGE_PREFIX, "");
Expand All @@ -180,6 +181,9 @@ public static boolean isMixinClassApplied(String name) {
if(VintageFixCore.OPTIFINE && OPTIFINE_DISABLED_PACKAGES.stream().anyMatch(baseName::startsWith)) {
return false;
}
if(VintageFixCore.VINTAGIUM && VINTAGIUM_DISABLED_PACKAGES.stream().anyMatch(baseName::startsWith)) {
return false;
}
// property optimizations are redundant with Sponge installed
if(unprefixedName.startsWith("mixin.blockstates.Property") && VintageFixCore.SPONGE) {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
@IFMLLoadingPlugin.MCVersion("1.12.2")
public class VintageFixCore implements IFMLLoadingPlugin, IEarlyMixinLoader {
public static boolean OPTIFINE;
public static boolean VINTAGIUM;
public static boolean SPONGE;
private static final int MAXIMUM_RESOURCE_CACHE_SIZE = 20 * 1024 * 1024;

Expand Down Expand Up @@ -115,6 +116,7 @@ public String getAccessTransformerClass() {
private static void applyMixinFix() {
OPTIFINE = classExists("ofdev.launchwrapper.OptifineDevTweakerWrapper") || classExists("optifine.OptiFineForgeTweaker");
SPONGE = classExists("org.spongepowered.mod.SpongeCoremod");
VINTAGIUM = classExists("me.jellysquid.mods.sodium.client.SodiumMixinTweaker");
/* https://github.com/FabricMC/Mixin/pull/99 */
try {
Field groupMembersField = InjectorGroupInfo.class.getDeclaredField("members");
Expand Down

0 comments on commit 9b42645

Please sign in to comment.