Skip to content

Commit

Permalink
Disable conflicting blockstate property optimizations with Sponge ins…
Browse files Browse the repository at this point in the history
…talled

Related: #96
  • Loading branch information
embeddedt committed Apr 21, 2024
1 parent 07f75cc commit 56589e1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,17 @@ public void acceptTargets(Set<String> set, Set<String> set1) {
}

public static boolean isMixinClassApplied(String name) {
String unprefixedName = name.replace(PACKAGE_PREFIX, "");
String baseName = mixinClassNameToBaseName(name);
// texture optimization causes issues when OF is installed
if(baseName.startsWith("mixin.textures") && VintageFixCore.OPTIFINE) {
return false;
}
// property optimizations are redundant with Sponge installed
if(unprefixedName.startsWith("mixin.blockstates.Property") && VintageFixCore.SPONGE) {
return false;
}
// check the config
boolean isEnabled = Boolean.parseBoolean(config.getProperty(baseName, ""));
if(!isEnabled) {
LOGGER.warn("Not applying mixin '{}' as '{}' is disabled in config", name, baseName);
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 SPONGE;
private static final int MAXIMUM_RESOURCE_CACHE_SIZE = 20 * 1024 * 1024;

public VintageFixCore() {
Expand Down Expand Up @@ -113,6 +114,7 @@ public String getAccessTransformerClass() {

private static void applyMixinFix() {
OPTIFINE = classExists("ofdev.launchwrapper.OptifineDevTweakerWrapper") || classExists("optifine.OptiFineForgeTweaker");
SPONGE = classExists("org.spongepowered.mod.SpongeCoremod");
/* https://github.com/FabricMC/Mixin/pull/99 */
try {
Field groupMembersField = InjectorGroupInfo.class.getDeclaredField("members");
Expand Down

0 comments on commit 56589e1

Please sign in to comment.