From 6a2bf8ddbf9befc22d7058309ab0145b64a12bcc Mon Sep 17 00:00:00 2001 From: Adrian Siekierka Date: Tue, 21 Feb 2017 11:29:45 +0100 Subject: [PATCH] FoamFix 0.6.0-beta3 --- build.gradle | 2 +- .../java/pl/asie/foamfix/coremod/FoamFixCore.java | 14 ++++++++++++++ .../java/pl/asie/foamfix/shared/FoamFixConfig.java | 2 ++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index f891671..fbb72c4 100644 --- a/build.gradle +++ b/build.gradle @@ -12,7 +12,7 @@ buildscript { apply plugin: 'net.minecraftforge.gradle.forge' apply plugin: 'com.github.johnrengelman.shadow' -version = "0.6.0-beta2" +version = "0.6.0-beta3" group= "pl.asie.foamfix" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "foamfix" diff --git a/src/main/java/pl/asie/foamfix/coremod/FoamFixCore.java b/src/main/java/pl/asie/foamfix/coremod/FoamFixCore.java index e5cf5d6..34f4c3b 100644 --- a/src/main/java/pl/asie/foamfix/coremod/FoamFixCore.java +++ b/src/main/java/pl/asie/foamfix/coremod/FoamFixCore.java @@ -28,6 +28,7 @@ import java.io.File; import java.util.Map; +import net.minecraft.launchwrapper.LaunchClassLoader; import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin; import pl.asie.foamfix.shared.FoamFixShared; @@ -51,6 +52,19 @@ public String getSetupClass() { public void injectData(final Map data) { FoamFixShared.coremodEnabled = true; FoamFixShared.config.init(new File(new File("config"), "foamfix.cfg"), true); + + if (FoamFixShared.config.geBlacklistLibraryTransformers) { + LaunchClassLoader classLoader = (LaunchClassLoader) getClass().getClassLoader(); + classLoader.addTransformerExclusion("com.ibm.icu."); + classLoader.addTransformerExclusion("com.sun."); + classLoader.addTransformerExclusion("gnu.trove."); + classLoader.addTransformerExclusion("io.netty."); + classLoader.addTransformerExclusion("it.unimi.dsi.fastutil."); + classLoader.addTransformerExclusion("joptsimple."); + classLoader.addTransformerExclusion("org.apache."); + classLoader.addTransformerExclusion("oshi."); + classLoader.addTransformerExclusion("scala."); + } } public String getAccessTransformerClass() { diff --git a/src/main/java/pl/asie/foamfix/shared/FoamFixConfig.java b/src/main/java/pl/asie/foamfix/shared/FoamFixConfig.java index 9deb87b..4ea47b5 100644 --- a/src/main/java/pl/asie/foamfix/shared/FoamFixConfig.java +++ b/src/main/java/pl/asie/foamfix/shared/FoamFixConfig.java @@ -37,6 +37,7 @@ public class FoamFixConfig { public boolean lwWeakenResourceCache, lwDummyPackageManifestMap; public boolean clDeduplicate, clCleanRedundantModelRegistry, clDynamicItemModels; public boolean clFasterResourceLoading; + public boolean geBlacklistLibraryTransformers; public boolean geBlockPosPatch, clBlockInfoPatch, clTextureDoubleBuffering; public boolean geDynamicRegistrySizeScaling; public boolean geSmallPropertyStorage; @@ -77,6 +78,7 @@ public void init(File file, boolean isCoremod) { if (isCoremod) { // clTextureDoubleBuffering = getBoolean("textureDoubleBuffering", "experimental", true, "Makes texture animations double-buffered, letting the GPU process them independently of scene rendering."); + geBlacklistLibraryTransformers = getBoolean("blacklistLibraryTransformers", "coremod", true, "Stops certain non-Minecraft-related libraries from being ASM transformed. You shouldn't be transforming those anyway."); geSmallPropertyStorage = getBoolean("smallPropertyStorage", "experimental", true, "Replaces the default BlockState/ExtendedBlockState implementations with a far more memory-efficient variant."); geBlockPosPatch = getBoolean("optimizedBlockPos", "coremod", true, "Optimizes BlockPos mutable/immutable getters to run on the same variables, letting them be inlined and thus theoretically increasing performance."); clBlockInfoPatch = getBoolean("optimizedBlockInfo", "coremod", true, "Prevents BlockInfo from generating as many BlockPos objects; also, fixes a lighting bug.");