From af2780cbcd5d4aeb7b7f9e22a7a765f1f120108c Mon Sep 17 00:00:00 2001 From: arcade_kappa Date: Sun, 15 Sep 2024 18:19:35 +0800 Subject: [PATCH] Add Carry On patch --- README.md | 3 ++- build.gradle | 3 +++ .../fugue/common/FugueMixinConfigPlugin.java | 1 + .../cleanroommc/fugue/config/ModPatchConfig.java | 2 ++ .../fugue/mixin/carryon/ItemTileMixin.java | 15 +++++++++++++++ src/main/resources/fugue.mixin.mod.json | 1 + 6 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 src/main/java/com/cleanroommc/fugue/mixin/carryon/ItemTileMixin.java diff --git a/README.md b/README.md index 44dce70..fccc8d2 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,8 @@ If you are still using 0.1.0 Cleanroom, use 0.5.4. But that's not recommended. * Ears * Colytra * Crossbow -* Polyfrost mods +* Polyfrost mods +* Carry On ## Note Add + to start of the file if it's not there. \ No newline at end of file diff --git a/build.gradle b/build.gradle index 97837d2..beed016 100644 --- a/build.gradle +++ b/build.gradle @@ -223,6 +223,9 @@ dependencies { //InfinityLib compileOnly(fg.deobf("curse.maven:inflib-251396:3317119")) + //Carry on + compileOnly(fg.deobf("curse.maven:carry-274259:4507139")) + implementation("com.cleanroommc:groovyscript:1.1.1") { transitive = false diff --git a/src/main/java/com/cleanroommc/fugue/common/FugueMixinConfigPlugin.java b/src/main/java/com/cleanroommc/fugue/common/FugueMixinConfigPlugin.java index f093679..a99f88f 100644 --- a/src/main/java/com/cleanroommc/fugue/common/FugueMixinConfigPlugin.java +++ b/src/main/java/com/cleanroommc/fugue/common/FugueMixinConfigPlugin.java @@ -53,6 +53,7 @@ public boolean shouldApplyMixin(String targetClassName, String mixinClassName) { case "refinedstorage" -> Loader.isModLoaded("refinedstorage") && FugueConfig.modPatchConfig.enableMoreRefinedStorage && Fugue.isModNewerThan("refinedstorage", "2.0.0"); case "jei" -> Loader.isModLoaded("jei") && FugueConfig.modPatchConfig.enableHEI && Fugue.isModNewerThan("jei", "4.17.0"); case "infinitylib" -> Loader.isModLoaded("infinitylib") && FugueConfig.modPatchConfig.enableInfLib; + case "carryon" -> Loader.isModLoaded("carryon") && FugueConfig.modPatchConfig.enableCarryon; default -> true; }; } diff --git a/src/main/java/com/cleanroommc/fugue/config/ModPatchConfig.java b/src/main/java/com/cleanroommc/fugue/config/ModPatchConfig.java index ee02b0c..3a43f70 100644 --- a/src/main/java/com/cleanroommc/fugue/config/ModPatchConfig.java +++ b/src/main/java/com/cleanroommc/fugue/config/ModPatchConfig.java @@ -116,4 +116,6 @@ public class ModPatchConfig { public boolean enablePolyForst = true; @Config.Name("Enable Dropt Patch") public boolean enableDropt = true; + @Config.Name("Enable Carryon Patch") + public boolean enableCarryon = true; } diff --git a/src/main/java/com/cleanroommc/fugue/mixin/carryon/ItemTileMixin.java b/src/main/java/com/cleanroommc/fugue/mixin/carryon/ItemTileMixin.java new file mode 100644 index 0000000..9236c65 --- /dev/null +++ b/src/main/java/com/cleanroommc/fugue/mixin/carryon/ItemTileMixin.java @@ -0,0 +1,15 @@ +package com.cleanroommc.fugue.mixin.carryon; + +import com.google.common.base.CharMatcher; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Redirect; +import tschipp.carryon.common.item.ItemTile; + +@Mixin(ItemTile.class) +public class ItemTileMixin { + @Redirect(method = "onItemUse", at = @At(value = "FIELD", target = "Lcom/google/common/base/CharMatcher;JAVA_UPPER_CASE:Lcom/google/common/base/CharMatcher;")) + private CharMatcher getCharMatcher() { + return CharMatcher.javaUpperCase(); + } +} diff --git a/src/main/resources/fugue.mixin.mod.json b/src/main/resources/fugue.mixin.mod.json index 07a632c..28ebabe 100644 --- a/src/main/resources/fugue.mixin.mod.json +++ b/src/main/resources/fugue.mixin.mod.json @@ -10,6 +10,7 @@ "armourers_workshop.GlobalTaskMixin", "armourers_workshop.SkinTextureMixin", "astralsorcery.PerkAttributeTypeMixin", + "carryon.ItemTileMixin", "charset.ColorspacesMixin", "codechickenlib.ReflectionManagerMixin", "customnpcs.ScriptPlayerEventHandlerMixin",