Skip to content

Commit

Permalink
Add auto-detection to Cleanroom
Browse files Browse the repository at this point in the history
  • Loading branch information
kappa-maintainer committed Jun 23, 2024
1 parent 8773b10 commit 0d0f581
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 11 deletions.
11 changes: 5 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,20 @@ buildscript {
gradlePluginPortal()
}
dependencies {
classpath "com.github.johnrengelman:shadow:8.1.1"
classpath "io.github.goooler.shadow:shadow-gradle-plugin:8.1.7"
classpath 'net.minecraftforge.gradle:ForgeGradle:6.0.+'
classpath "org.spongepowered:mixingradle:0.7.+"
}
}

apply plugin: 'net.minecraftforge.gradle'
// Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
apply plugin: 'eclipse'
apply plugin: 'maven-publish'
apply plugin: "com.github.johnrengelman.shadow"
apply plugin: "io.github.goooler.shadow"
apply plugin: 'org.spongepowered.mixin'


version "1.3.3-beta"
version "1.3.4-beta"
group "gkappa.wrapfix"
archivesBaseName = "WrapFix"

Expand Down Expand Up @@ -111,7 +110,7 @@ dependencies {
exclude module: "gson"
exclude module: "commons-io"
}*/
shade "com.ibm.icu:icu4j:74.2"
shade "com.ibm.icu:icu4j:75.1"

// Common:
annotationProcessor 'org.ow2.asm:asm-debug-all:5.2'
Expand Down Expand Up @@ -196,7 +195,7 @@ shadowJar {
configurations = [project.configurations.shade]
relocate('com.ibm.icu','repack.com.ibm.icu')
dependencies {
include(dependency("com.ibm.icu:icu4j:74.2"))
include(dependency("com.ibm.icu:icu4j:75.1"))
}
manifest {
inheritFrom jar.manifest
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
2 changes: 1 addition & 1 deletion src/main/java/gkappa/wrapfix/WrapFix.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
public class WrapFix {
public static final String MODID = "wrapfix";
public static final String NAME = "WrapFix";
public static final String VERSION = "1.3.3-beta";
public static final String VERSION = "1.3.4-beta";

public static final BreakIterator BREAK_ITERATOR = BreakIterator.getLineInstance();
public static Logger logger;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/gkappa/wrapfix/WrapFixConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

@Config(modid = WrapFix.MODID, name = WrapFix.MODID)
public class WrapFixConfig {
@Config.Comment("Do not set to true on Cleanroom")
@Config.Comment("Won't work on Cleanroom")
public static boolean patchVanilla = true;
public static boolean patchIndustrialWires = true;
public static boolean patchBetterQuesting = true;
Expand Down
12 changes: 11 additions & 1 deletion src/main/java/gkappa/wrapfix/WrapFixLoadingPlugin.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package gkappa.wrapfix;

import com.cleanroommc.configanytime.ConfigAnytime;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.common.asm.FMLSanityChecker;
import net.minecraftforge.fml.relauncher.FMLLaunchHandler;
import net.minecraftforge.fml.relauncher.FMLSecurityManager;
import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin;
import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin.MCVersion;
import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin.SortingIndex;
Expand All @@ -19,8 +23,14 @@
@MCVersion("1.12.2")
public class WrapFixLoadingPlugin
implements IFMLLoadingPlugin, IEarlyMixinLoader {
private static boolean isCleanroom = true;
public WrapFixLoadingPlugin() {
ConfigAnytime.register(WrapFixConfig.class);
try {
Class.forName("com.cleanroommc.common.CleanroomVersion");
} catch (Throwable e) {
isCleanroom = false;
}
}
public String[] getASMTransformerClass() {
return new String[0];
Expand Down Expand Up @@ -53,7 +63,7 @@ public List<String> getMixinConfigs() {
@Override
public boolean shouldMixinConfigQueue(String mixinConfig) {
if(mixinConfig.equals("wrapfix.mixins.json")) {
return WrapFixConfig.patchVanilla;
return WrapFixConfig.patchVanilla && !isCleanroom;
}
return IEarlyMixinLoader.super.shouldMixinConfigQueue(mixinConfig);
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/mcmod.info
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"modid": "wrapfix",
"name": "WrapFix",
"description": "Fix line wrapping",
"version": "1.3.3-beta",
"version": "1.3.4-beta",
"mcversion": "1.12.2",
"url": "",
"updateUrl": "",
Expand Down

0 comments on commit 0d0f581

Please sign in to comment.