From b006f5344d5430b7d26261dabb47046580cd3016 Mon Sep 17 00:00:00 2001 From: Michael Hillcox Date: Mon, 11 Nov 2024 10:09:03 +0000 Subject: [PATCH] feat: back ported to 1.20.1 --- CHANGELOG.md | 4 +- build.gradle | 48 ++----------------- gradle.properties | 8 ++-- .../java/pro/mikey/kubeutils/KubeUtils.java | 7 ++- .../kubeutils/events/OnPlayerLoginEvent.java | 4 +- src/main/resources/META-INF/mods.toml | 13 ++--- src/main/resources/kubeutils.mixins.json | 10 ---- 7 files changed, 19 insertions(+), 75 deletions(-) delete mode 100644 src/main/resources/kubeutils.mixins.json diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d07234..438a3e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ # Kube Utils Changelog -## [20.4.0] +## [20.1.0] ### Changed -- Updated to 1.20.4 +- Backported to 1.20.1 diff --git a/build.gradle b/build.gradle index b653afe..c6a6eb3 100644 --- a/build.gradle +++ b/build.gradle @@ -20,9 +20,6 @@ base { java.toolchain.languageVersion = JavaLanguageVersion.of(17) -//def MAVEN_URL = "https://maven.saps.dev/${SNAPSHOT ? "snapshots" : "releases"}" -//def MAVEN_VERSION = project.version + (SNAPSHOT ? "-SNAPSHOT" : "") - runs { configureEach { systemProperty 'forge.logging.markers', 'REGISTRIES' @@ -51,30 +48,10 @@ configurations { runtimeClasspath.extendsFrom localRuntime } -//loom { -// silentMojangMappingsLicense() -// -// forge { -// mixinConfigs = [ -// "kubeutils.mixins.json" -// ] -// -// dataGen { -// mod project.mod_id -// } -// } -// -// launches { -// data { -// arg "--existing", file("src/main/resources").absolutePath -// } -// } -//} - dependencies { - implementation "net.neoforged:neoforge:${mcBase}.${neoforge_version}" + implementation "net.neoforged:forge:${minecraft_version}-${neoforge_version}" - implementation "dev.latvian.mods:kubejs-neoforge:${kubejs_version}" + implementation "dev.latvian.mods:kubejs-forge:${kubejs_version}" } repositories { @@ -122,25 +99,6 @@ idea { downloadJavadoc = true } } -// -//if (ENV.CURSEFORGE_KEY) { -// curseforge { -// apiKey = ENV.CURSEFORGE_KEY -// project { -// id = project.curseforge_id -// releaseType = "release" -// addGameVersion "Forge" -// addGameVersion "Java 17" -// addGameVersion project.minecraft_version -// mainArtifact(remapJar.archiveFile) -// relations { -// requiredDependency 'kubejs' -// } -// changelog = file("./CHANGELOG.md") -// changelogType = 'markdown' -// } -// } -//} publishing { publications { @@ -167,7 +125,7 @@ publishMods { changelog = file("./CHANGELOG.md").text version = project.version file = project.provider { project.tasks.jar }.flatMap { it.archiveFile } - modLoaders.add("neoforge") + modLoaders.add("forge") type = STABLE displayName = "[${minecraft_version}] KubeUtils ${project.version}" diff --git a/gradle.properties b/gradle.properties index e235f15..0f3ef35 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,10 +2,10 @@ org.gradle.jvmargs=-Xmx2G # The MC version is used to determine the base the version for neo and the mod -minecraft_version=1.20.4 +minecraft_version=1.20.1 -neoforge_version=237 -neoforge_loader_version=2 +neoforge_version=47.1.28 +neoforge_loader_version=47 mod_version=0 maven_group=pro.mikey.mods @@ -16,4 +16,4 @@ mod_author=ErrorMikey/Mikey curseforge_id=678815 modrinth_id=JHdL51WR -kubejs_version=2004.7.0-build.24 +kubejs_version=2001.6.5-build.16 diff --git a/src/main/java/pro/mikey/kubeutils/KubeUtils.java b/src/main/java/pro/mikey/kubeutils/KubeUtils.java index 4cc3498..4a7510c 100644 --- a/src/main/java/pro/mikey/kubeutils/KubeUtils.java +++ b/src/main/java/pro/mikey/kubeutils/KubeUtils.java @@ -1,7 +1,7 @@ package pro.mikey.kubeutils; -import net.neoforged.fml.common.Mod; -import net.neoforged.neoforge.common.NeoForge; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.fml.common.Mod; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import pro.mikey.kubeutils.events.OnPlayerLoginEvent; @@ -11,9 +11,8 @@ public class KubeUtils { public static final String MOD_ID = "kubeutils"; public static final Logger LOGGER = LogManager.getLogger(); - public KubeUtils() { - NeoForge.EVENT_BUS.register(new OnPlayerLoginEvent()); + MinecraftForge.EVENT_BUS.register(new OnPlayerLoginEvent()); } public static String getId() { diff --git a/src/main/java/pro/mikey/kubeutils/events/OnPlayerLoginEvent.java b/src/main/java/pro/mikey/kubeutils/events/OnPlayerLoginEvent.java index d1cd6a4..175c140 100644 --- a/src/main/java/pro/mikey/kubeutils/events/OnPlayerLoginEvent.java +++ b/src/main/java/pro/mikey/kubeutils/events/OnPlayerLoginEvent.java @@ -1,8 +1,8 @@ package pro.mikey.kubeutils.events; import dev.latvian.mods.kubejs.core.EntityKJS; -import net.neoforged.bus.api.SubscribeEvent; -import net.neoforged.neoforge.event.entity.player.PlayerEvent; +import net.minecraftforge.event.entity.player.PlayerEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; import pro.mikey.kubeutils.kubejs.events.KuEventsGroup; import pro.mikey.kubeutils.kubejs.events.PlayerStarterItems; diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index e5c345e..fdd340d 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -12,25 +12,22 @@ Provides extra methods and tools to the standard KubeJS mod ''' [[dependencies.kubeutils]] -modId = "neoforge" -required = true -versionRange = "[${neoforge_base_two},)" +modId = "forge" +mandatory = true +versionRange = "[47,)" ordering = "NONE" side = "BOTH" [[dependencies.kubeutils]] modId = "minecraft" -required = true +mandatory = true versionRange = "[${minecraft_version},)" ordering = "NONE" side = "BOTH" [[dependencies.kubeutils]] modId = "kubejs" -required = true +mandatory = true versionRange = "[${kubejs_version},)" ordering = "NONE" side = "BOTH" - -[[mixins]] -config = "kubeutils.mixins.json" diff --git a/src/main/resources/kubeutils.mixins.json b/src/main/resources/kubeutils.mixins.json deleted file mode 100644 index 449d939..0000000 --- a/src/main/resources/kubeutils.mixins.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "required": true, - "package": "pro.mikey.kubeutils.mixin", - "compatibilityLevel": "JAVA_17", - "mixins": [], - "client": [], - "injectors": { - "defaultRequire": 1 - } -}