Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id("fpgradle-minecraft") version ("0.10.1")
id("com.falsepattern.fpgradle-mc") version ("0.15.1")
}

group = "com.falsepattern"
Expand Down Expand Up @@ -70,6 +70,8 @@ dependencies {

compileOnly("makamys:neodymium-mc1.7.10:0.4.3-unofficial:dev")

compileOnly("mega:fluidlogged-mc1.7.10:0.1.2")

compileOnly("com.github.GTNewHorizons:lwjgl3ify:2.1.5:dev")

compileOnly(deobf("optifine:optifine:1.7.10_hd_u_e7"))
Expand Down Expand Up @@ -101,4 +103,12 @@ dependencies {
compileOnly(deobfCurse("malisiscore-223896:2283267"))
// SecurityCraft 1.8.13
compileOnly(deobfCurse("securitycraft-64760:2818228"))
// Storage Drawers 1.7.10-1.10.9
compileOnly(deobfCurse("storage-drawers-223852:2469586"))
// CoFH Core [1.7.10]3.1.4-329
compileOnly(deobfCurse("cofh-core-69162:2388750"))
// Thermal Foundation [1.7.10]1.2.6-118
compileOnly(deobfCurse("thermal-foundation-222880:2388752"))
// Thermal Expansion [1.7.10]4.1.5-248
compileOnly(deobfCurse("thermal-expansion-69163:2388758"))
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
6 changes: 3 additions & 3 deletions gradlew
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ case "$( uname )" in #(
NONSTOP* ) nonstop=true ;;
esac

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
CLASSPATH="\\\"\\\""


# Determine the Java command to use to start the JVM.
Expand Down Expand Up @@ -205,15 +205,15 @@ fi
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
"$@"

# Stop when "xargs" is not available.
Expand Down
4 changes: 2 additions & 2 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ goto fail
:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
set CLASSPATH=


@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*

:end
@rem End local scope for the variables with windows NT shell
Expand Down
30 changes: 0 additions & 30 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,33 +1,3 @@
pluginManagement {
repositories {
maven {
url = uri("https://mvn.falsepattern.com/fpgradle/")
name = "fpgradle"
content {
includeModule("com.gtnewhorizons", "retrofuturagradle")
includeModule("com.falsepattern", "fpgradle-plugin")
includeModule("fpgradle-minecraft", "fpgradle-minecraft.gradle.plugin")
}
}
maven {
url = uri("https://mvn.falsepattern.com/releases/")
name = "mavenpattern"
content {
includeGroup("com.falsepattern")
}
}
maven {
url = uri("https://mvn.falsepattern.com/jitpack/")
name = "jitpack"
content {
includeModule("io.github.LegacyModdingMC.MappingGenerator", "MappingGenerator")
}
}
mavenCentral()
gradlePluginPortal()
}
}

plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version("0.9.0")
}
Expand Down
150 changes: 85 additions & 65 deletions src/main/java/com/falsepattern/falsetweaks/Compat.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,96 +35,117 @@
import net.minecraft.block.Block;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.launchwrapper.Launch;
import net.minecraft.launchwrapper.LaunchClassLoader;
import net.minecraft.world.IBlockAccess;
import cpw.mods.fml.common.Loader;

import java.io.IOException;

public class Compat {
private static Boolean NEODYMIUM = null;
private static Boolean OPTIFINE = null;
private static Boolean DYNLIGHTS = null;
private static Boolean SHADERS = null;
private static Boolean LWJGL3IFY = null;
private static class NEODYMIUM {
private static final boolean PRESENT;
static {
boolean present;
try {
present = Launch.classLoader.getClassBytes("makamys.neodymium.Neodymium") != null;
} catch (IOException e) {
e.printStackTrace();
present = false;
}
PRESENT = present;
}
}
private static class OPTIFINE {
private static final boolean PRESENT;
static {
boolean present;
try {
present = Launch.classLoader.getClassBytes("Config") != null;
} catch (IOException e) {
e.printStackTrace();
present = false;
}
PRESENT = present;
}
}
private static class DYNLIGHTS {
private static final boolean PRESENT;
static {
boolean present;
try {
present = Launch.classLoader.getClassBytes("DynamicLights") != null;
} catch (IOException e) {
e.printStackTrace();
present = false;
}
PRESENT = present;
}
}
private static class SHADERS {
private static final boolean PRESENT;
static {
boolean present;
try {
present = Launch.classLoader.getClassBytes("shadersmod.client.Shaders") != null;
} catch (IOException e) {
e.printStackTrace();
present = false;
}
PRESENT = present;
}
}
private static class LWJGL3IFY {
private static final boolean PRESENT;
static {
boolean present;
try {
present = Launch.classLoader.getClassBytes("me.eigenraven.lwjgl3ify.core.Lwjgl3ifyCoremod") != null;
} catch (IOException e) {
e.printStackTrace();
present = false;
}
PRESENT = present;
}
}
private static class FLUIDLOGGED {
private static final boolean PRESENT;
static {
boolean present;
try {
present = Launch.classLoader.getClassBytes("mega.fluidlogged.internal.core.CoreLoadingPlugin") != null;
} catch (IOException e) {
e.printStackTrace();
present = false;
}
PRESENT = present;
}
}

public static boolean neodymiumInstalled() {
if (NEODYMIUM != null) {
return NEODYMIUM;
}
try {
NEODYMIUM = ((LaunchClassLoader) Compat.class.getClassLoader()).getClassBytes("makamys.neodymium.Neodymium") != null;
} catch (IOException e) {
e.printStackTrace();
NEODYMIUM = false;
}
return NEODYMIUM;
return NEODYMIUM.PRESENT;
}

public static boolean neodymiumActive() {
return neodymiumInstalled() && Neodymium.isActive();
}

public static boolean optiFineInstalled() {
if (OPTIFINE != null) {
return OPTIFINE;
}
try {
OPTIFINE = Launch.classLoader.getClassBytes("Config") != null;
} catch (IOException e) {
e.printStackTrace();
OPTIFINE = false;
}
return OPTIFINE;
return OPTIFINE.PRESENT;
}

public static boolean dynamicLightsPresent() {
return ModuleConfig.DYNAMIC_LIGHTS || optiFineHasDynamicLights();
}

public static boolean optiFineHasDynamicLights() {
if (!optiFineInstalled()) {
return false;
}
if (DYNLIGHTS != null) {
return DYNLIGHTS;
}
try {
DYNLIGHTS = Launch.classLoader.getClassBytes("DynamicLights") != null;
} catch (IOException e) {
e.printStackTrace();
DYNLIGHTS = false;
}
return DYNLIGHTS;
return OPTIFINE.PRESENT && DYNLIGHTS.PRESENT;
}

public static boolean optiFineHasShaders() {
if (!optiFineInstalled()) {
return false;
}
if (SHADERS != null) {
return SHADERS;
}
try {
SHADERS = Launch.classLoader.getClassBytes("shadersmod.client.Shaders") != null;
} catch (IOException e) {
e.printStackTrace();
SHADERS = false;
}
return SHADERS;
return OPTIFINE.PRESENT && SHADERS.PRESENT;
}

public static boolean lwjgl3ifyLoaded() {
if (LWJGL3IFY != null) {
return LWJGL3IFY;
}
try {
LWJGL3IFY = Launch.classLoader.getClassBytes("me.eigenraven.lwjgl3ify.core.Lwjgl3ifyCoremod") != null;
} catch (IOException e) {
e.printStackTrace();
LWJGL3IFY = false;
}
return LWJGL3IFY;
public static boolean fluidloggedInstalled() {
return FLUIDLOGGED.PRESENT;
}

public static void applyCompatibilityTweaks() {
Expand Down Expand Up @@ -152,7 +173,7 @@ public static boolean isShaders() {

public static boolean isSTBIStitcher() {
try {
return lwjgl3ifyLoaded() && LWJGL3IfyCompat.stbiTextureStitching();
return LWJGL3IFY.PRESENT && LWJGL3IfyCompat.stbiTextureStitching();
} catch (Throwable t) {
t.printStackTrace();
return false;
Expand All @@ -166,7 +187,6 @@ public static float getAmbientOcclusionLightValue(Block block, int x, int y, int
return block.getAmbientOcclusionLightValue();
}
}

private static class ApparatusCompat {
@Getter
private static boolean apparatusPresent = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ public class FalseTweaksTransformer extends MergeableTurboTransformer {
private static List<TurboClassTransformer> transformers() {
val transformers = new ArrayList<TurboClassTransformer>();
if (FMLLaunchHandler.side().isClient()) {
transformers.add(new RenderGlobalDeOptimizer());
if (ModuleConfig.THREADED_CHUNK_UPDATES()) {
transformers.add(new RenderGlobalDeOptimizer());
transformers.add(new Threading_AngelicaCompatFixer());
transformers.add(new Threading_RenderBlocksASM());
transformers.add(new Threading_TessellatorUseReplacement());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,12 @@ public static boolean hasOptiFine() {
if (detected == null) {
if (FMLLaunchHandler.side().isClient()) {
try {
//We might be too early but let's try the standard way
detected = FMLClientHandler.instance().hasOptifine();
} catch (Throwable ignored) {
//Ok, we'll do it manually then
try {
ClassLoader cl;
cl = Loader.instance().getModClassLoader();
if (cl == null) {
cl = Launch.classLoader;
}
Class.forName("Config", false, cl);
detected = true;
} catch (Throwable ignored1) {
//99.9% sure that optifine is not present
detected = false;
}
ClassLoader cl = Launch.classLoader;
Class.forName("Config", false, cl);
detected = true;
} catch (Throwable ignored1) {
//99.9% sure that optifine is not present
detected = false;
}
} else {
//server shouldn't have OF
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,8 @@
*/
public class RenderGlobalDeOptimizer implements TurboClassTransformer {
private static final String OWNER_INTERNAL_NAME = "net/minecraft/client/renderer/RenderGlobal";
private static final String BAD_FIELD_NAME = "t";
private static final String BAD_FIELD_DESC = "LCompactArrayList;";
private static final String BAD_METHOD_OWNER = "CompactArrayList";
private static final String TARGET_FIELD_NAME = "field_72767_j";
private static final String TARGET_FIELD_DESC = "Ljava/util/List;";
private static final String TARGET_METHOD_OWNER = "java/util/List";

Expand Down Expand Up @@ -79,8 +77,7 @@ public boolean transformClass(@NotNull String className, @NotNull ClassNodeHandl
val insn = insnList.next();
if (insn instanceof FieldInsnNode) {
val field = (FieldInsnNode) insn;
if (OWNER_INTERNAL_NAME.equals(field.owner) && BAD_FIELD_NAME.equals(field.name) && BAD_FIELD_DESC.equals(field.desc)) {
field.name = TARGET_FIELD_NAME;
if (OWNER_INTERNAL_NAME.equals(field.owner) && BAD_FIELD_DESC.equals(field.desc)) {
field.desc = TARGET_FIELD_DESC;
modified = true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public byte[] transform(String name, String transformedName, byte[] bytes) {
return null;

val reader = new ClassReader(bytes);
val writer = new ClassWriter(ClassWriter.COMPUTE_MAXS);
val writer = new ClassWriter(0);
val remapAdapter = new AngelicaRemappingAdapter(writer);
reader.accept(remapAdapter, ClassReader.EXPAND_FRAMES);
return writer.toByteArray();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ public class ModuleConfig {
"Makes translucent geometry of chunks render slightly closer to the camera. (experimental)",
"This reduces Z-Fighting on blocks which have overlapping opaque and translucent geometry,",
"at the cost of far away geometry sometimes rendering on top of opaque geometry. (>100~ blocks)",
"Don't turn this on unless you absolutely need it.",
"FPS impact: Unknown"
})
@Config.LangKey("config.falsetweaks.translucent_block_layers_fix")
Expand Down
Loading