Use new config compiler plugin
ci/woodpecker/push/jfmod Pipeline was successful Details

This commit is contained in:
Johannes Frohnmeyer 2022-12-29 14:25:02 +01:00
parent 1e07944141
commit 4cf78fd350
Signed by: Johannes
GPG Key ID: E76429612C2929F4
7 changed files with 26 additions and 24 deletions

View File

@ -1,16 +1,14 @@
import io.gitlab.jfronny.scripts.* import io.gitlab.jfronny.scripts.*
plugins { plugins {
id("jfmod") version "1.2-SNAPSHOT" id("jfmod") version "1.3-SNAPSHOT"
id("io.gitlab.jfronny.libjf.libjf-config-compiler-plugin")
} }
dependencies { dependencies {
modImplementation("io.gitlab.jfronny.libjf:libjf-config-core-v1:${prop("libjf_version")}") modImplementation("io.gitlab.jfronny.libjf:libjf-config-core-v1:${prop("libjf_version")}")
// Dev env // Dev env
modLocalRuntime("io.gitlab.jfronny.libjf:libjf-config-reflect-v1:${prop("libjf_version")}")
modLocalRuntime("io.gitlab.jfronny.libjf:libjf-config-ui-tiny-v1:${prop("libjf_version")}") modLocalRuntime("io.gitlab.jfronny.libjf:libjf-config-ui-tiny-v1:${prop("libjf_version")}")
modLocalRuntime("io.gitlab.jfronny.libjf:libjf-devutil:${prop("libjf_version")}") modLocalRuntime("io.gitlab.jfronny.libjf:libjf-devutil:${prop("libjf_version")}")
modLocalRuntime("com.terraformersmc:modmenu:5.0.0-alpha.4") modLocalRuntime("com.terraformersmc:modmenu:5.0.2")
} }

View File

@ -1,7 +1,7 @@
# https://fabricmc.net/develop/ # https://fabricmc.net/develop/
minecraft_version=1.19.3 minecraft_version=1.19.3
yarn_mappings=build.2 yarn_mappings=build.5
loader_version=0.14.11 loader_version=0.14.12
maven_group=io.gitlab.jfronny maven_group=io.gitlab.jfronny
archives_base_name=yescheat archives_base_name=yescheat
@ -9,5 +9,5 @@ archives_base_name=yescheat
modrinth_id=yescheat modrinth_id=yescheat
modrinth_required_dependencies=libjf modrinth_required_dependencies=libjf
libjf_version=3.3.1 libjf_version=3.4.1
fabric_version=0.68.1+1.19.3 fabric_version=0.70.0+1.19.3

View File

@ -1,13 +1,9 @@
pluginManagement { pluginManagement {
val libjf_version: String by settings
repositories { repositories {
maven("https://maven.fabricmc.net/") // FabricMC maven("https://maven.fabricmc.net/") // FabricMC
maven("https://maven.frohnmeyer-wds.de/artifacts") // scripts maven("https://maven.frohnmeyer-wds.de/artifacts") // scripts
gradlePluginPortal() gradlePluginPortal()
} }
plugins {
id("io.gitlab.jfronny.libjf.libjf-config-compiler-plugin") version libjf_version
}
} }
rootProject.name = "yescheat" rootProject.name = "yescheat"

View File

@ -12,4 +12,8 @@ public class Cfg {
@Entry public static boolean unlockMending = true; @Entry public static boolean unlockMending = true;
@Entry public static boolean distantBreaking = true; @Entry public static boolean distantBreaking = true;
@Entry public static boolean villagersFollowEmeralds = true; @Entry public static boolean villagersFollowEmeralds = true;
static {
JFC_Cfg.ensureInitialized();
}
} }

View File

@ -22,25 +22,29 @@ public class Plugin implements IMixinConfigPlugin {
@SuppressWarnings("ReferenceToMixin") @SuppressWarnings("ReferenceToMixin")
@Override @Override
public boolean shouldApplyMixin(String targetClassName, String mixinClassName) { public boolean shouldApplyMixin(String targetClassName, String mixinClassName) {
if (Objects.equals(mixinClassName, UnblockChests.class.getName())) final String prefix = "io.gitlab.jfronny.yescheat.mixin.";
if (!mixinClassName.startsWith(prefix)) throw new IllegalArgumentException("Mixin in unexpected package: " + mixinClassName);
mixinClassName = mixinClassName.substring(prefix.length());
if (Objects.equals(mixinClassName, "UnblockChests"))
return Cfg.unblockChests; return Cfg.unblockChests;
else if (Objects.equals(mixinClassName, UncapEnchants.class.getName())) else if (Objects.equals(mixinClassName, "UncapEnchants"))
return Cfg.uncapEnchants; return Cfg.uncapEnchants;
else if (Objects.equals(mixinClassName, IgnoreEula.class.getName())) else if (Objects.equals(mixinClassName, "IgnoreEula"))
return true; return true;
else if (Objects.equals(mixinClassName, DistantContainers3x3.class.getName()) else if (Objects.equals(mixinClassName, "DistantContainers3x3")
|| Objects.equals(mixinClassName, DistantContainerXx9.class.getName())) || Objects.equals(mixinClassName, "DistantContainerXx9"))
return Cfg.distantContainers; return Cfg.distantContainers;
else if (Objects.equals(mixinClassName, UnlockMendingInfinity.class.getName())) else if (Objects.equals(mixinClassName, "UnlockMendingInfinity"))
return Cfg.unlockMending; return Cfg.unlockMending;
else if (Objects.equals(mixinClassName, DistantBreaking.class.getName())) else if (Objects.equals(mixinClassName, "DistantBreaking"))
return Cfg.distantBreaking; return Cfg.distantBreaking;
else if (Objects.equals(mixinClassName, RemoveRubberbanding.class.getName())) else if (Objects.equals(mixinClassName, "RemoveRubberbanding"))
return Cfg.antiRubberband; return Cfg.antiRubberband;
else if (Objects.equals(mixinClassName, VillagersFollowEmeralds.class.getName())) else if (Objects.equals(mixinClassName, "VillagersFollowEmeralds"))
return Cfg.villagersFollowEmeralds; return Cfg.villagersFollowEmeralds;
else else
throw new IllegalStateException("Unrecognized mixin: " + mixinClassName + "! This should never happen"); throw new IllegalArgumentException("Unrecognized mixin: " + mixinClassName + "! This should never happen");
} }
@Override @Override

View File

@ -1,5 +1,5 @@
{ {
"yescheat.jfconfig.title": "YesCheat", "yescheat.jfconfig.title": "YesCheat (restart after changing)",
"yescheat.jfconfig.antiRubberband": "Anti-Rubberband", "yescheat.jfconfig.antiRubberband": "Anti-Rubberband",
"yescheat.jfconfig.antiRubberband.tooltip": "Prevent rubber-banding by removing serverside movement checks", "yescheat.jfconfig.antiRubberband.tooltip": "Prevent rubber-banding by removing serverside movement checks",
"yescheat.jfconfig.uncapEnchants": "Uncap Enchantments", "yescheat.jfconfig.uncapEnchants": "Uncap Enchantments",

View File

@ -15,7 +15,7 @@
"icon": "assets/yescheat/icon.png", "icon": "assets/yescheat/icon.png",
"environment": "*", "environment": "*",
"entrypoints": { "entrypoints": {
"libjf:config": ["io.gitlab.jfronny.yescheat.Cfg"] "libjf:config": ["io.gitlab.jfronny.yescheat.JFC_Cfg"]
}, },
"mixins": [ "mixins": [
"YesCheat.mixins.json" "YesCheat.mixins.json"