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.*
plugins {
id("jfmod") version "1.2-SNAPSHOT"
id("io.gitlab.jfronny.libjf.libjf-config-compiler-plugin")
id("jfmod") version "1.3-SNAPSHOT"
}
dependencies {
modImplementation("io.gitlab.jfronny.libjf:libjf-config-core-v1:${prop("libjf_version")}")
// 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-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/
minecraft_version=1.19.3
yarn_mappings=build.2
loader_version=0.14.11
yarn_mappings=build.5
loader_version=0.14.12
maven_group=io.gitlab.jfronny
archives_base_name=yescheat
@ -9,5 +9,5 @@ archives_base_name=yescheat
modrinth_id=yescheat
modrinth_required_dependencies=libjf
libjf_version=3.3.1
fabric_version=0.68.1+1.19.3
libjf_version=3.4.1
fabric_version=0.70.0+1.19.3

View File

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

View File

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

View File

@ -22,25 +22,29 @@ public class Plugin implements IMixinConfigPlugin {
@SuppressWarnings("ReferenceToMixin")
@Override
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;
else if (Objects.equals(mixinClassName, UncapEnchants.class.getName()))
else if (Objects.equals(mixinClassName, "UncapEnchants"))
return Cfg.uncapEnchants;
else if (Objects.equals(mixinClassName, IgnoreEula.class.getName()))
else if (Objects.equals(mixinClassName, "IgnoreEula"))
return true;
else if (Objects.equals(mixinClassName, DistantContainers3x3.class.getName())
|| Objects.equals(mixinClassName, DistantContainerXx9.class.getName()))
else if (Objects.equals(mixinClassName, "DistantContainers3x3")
|| Objects.equals(mixinClassName, "DistantContainerXx9"))
return Cfg.distantContainers;
else if (Objects.equals(mixinClassName, UnlockMendingInfinity.class.getName()))
else if (Objects.equals(mixinClassName, "UnlockMendingInfinity"))
return Cfg.unlockMending;
else if (Objects.equals(mixinClassName, DistantBreaking.class.getName()))
else if (Objects.equals(mixinClassName, "DistantBreaking"))
return Cfg.distantBreaking;
else if (Objects.equals(mixinClassName, RemoveRubberbanding.class.getName()))
else if (Objects.equals(mixinClassName, "RemoveRubberbanding"))
return Cfg.antiRubberband;
else if (Objects.equals(mixinClassName, VillagersFollowEmeralds.class.getName()))
else if (Objects.equals(mixinClassName, "VillagersFollowEmeralds"))
return Cfg.villagersFollowEmeralds;
else
throw new IllegalStateException("Unrecognized mixin: " + mixinClassName + "! This should never happen");
throw new IllegalArgumentException("Unrecognized mixin: " + mixinClassName + "! This should never happen");
}
@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.tooltip": "Prevent rubber-banding by removing serverside movement checks",
"yescheat.jfconfig.uncapEnchants": "Uncap Enchantments",

View File

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