diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6d07234..63791b0 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,7 +1,7 @@
# Kube Utils Changelog
-## [20.4.0]
+## [21.1.0]
### Changed
-- Updated to 1.20.4
+- Updated to 1.21.1 thanks to [@Saereth](https://github.com/Saereth)
diff --git a/build.gradle b/build.gradle
index b653afe..672b7ac 100644
--- a/build.gradle
+++ b/build.gradle
@@ -3,7 +3,7 @@ plugins {
id 'eclipse'
id 'idea'
id 'maven-publish'
- id 'net.neoforged.gradle.userdev' version '7.0.142'
+ id 'net.neoforged.gradle.userdev' version '7.0.145'
id "me.modmuss50.mod-publish-plugin" version "0.5.1"
}
@@ -18,10 +18,8 @@ base {
archivesName =project.archives_base_name
}
-java.toolchain.languageVersion = JavaLanguageVersion.of(17)
+java.toolchain.languageVersion = JavaLanguageVersion.of(21)
-//def MAVEN_URL = "https://maven.saps.dev/${SNAPSHOT ? "snapshots" : "releases"}"
-//def MAVEN_VERSION = project.version + (SNAPSHOT ? "-SNAPSHOT" : "")
runs {
configureEach {
@@ -51,29 +49,8 @@ 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:neoforge:${neoforge_full_version}"
implementation "dev.latvian.mods:kubejs-neoforge:${kubejs_version}"
}
@@ -82,9 +59,10 @@ repositories {
maven {
name = "Kubejs"
- url "https://maven.saps.dev/minecraft"
+ url "https://maven.latvian.dev/releases"
content {
includeGroup "dev.latvian.mods"
+ includeGroup "dev.latvian.apps"
}
}
@@ -101,13 +79,15 @@ tasks.withType(ProcessResources).configureEach {
minecraft_version : minecraft_version,
neoforge_base_two : mcBase,
neoforge_loader_version: neoforge_loader_version,
+ neoforge_full_version: neoforge_full_version,
version : version,
+ neo_version_range: neo_version_range,
kubejs_version : kubejs_version
]
inputs.properties replaceProperties
- filesMatching(['META-INF/mods.toml']) {
+ filesMatching(['META-INF/neoforge.mods.toml']) {
expand replaceProperties
}
}
@@ -122,25 +102,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 {
diff --git a/gradle.properties b/gradle.properties
index e235f15..76ce0f8 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -2,11 +2,13 @@
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.21.1
-neoforge_version=237
-neoforge_loader_version=2
+neoforge_version=55
+neoforge_full_version=21.1.55
+neoforge_loader_version=4
mod_version=0
+neo_version_range=[21.1.0-beta,)
maven_group=pro.mikey.mods
archives_base_name=kube-utils
@@ -16,4 +18,4 @@ mod_author=ErrorMikey/Mikey
curseforge_id=678815
modrinth_id=JHdL51WR
-kubejs_version=2004.7.0-build.24
+kubejs_version=2101.7.0-build.131
diff --git a/settings.gradle b/settings.gradle
index ada876e..fd1434c 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -8,4 +8,4 @@ pluginManagement {
plugins {
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.8.0'
-}
+}
\ No newline at end of file
diff --git a/src/main/java/pro/mikey/kubeutils/KubeUtils.java b/src/main/java/pro/mikey/kubeutils/KubeUtils.java
index 4cc3498..fda0720 100644
--- a/src/main/java/pro/mikey/kubeutils/KubeUtils.java
+++ b/src/main/java/pro/mikey/kubeutils/KubeUtils.java
@@ -1,5 +1,6 @@
package pro.mikey.kubeutils;
+import net.minecraft.resources.ResourceLocation;
import net.neoforged.fml.common.Mod;
import net.neoforged.neoforge.common.NeoForge;
import org.apache.logging.log4j.LogManager;
@@ -19,4 +20,8 @@ public KubeUtils() {
public static String getId() {
return MOD_ID;
}
+
+ public static ResourceLocation id(String path) {
+ return ResourceLocation.fromNamespaceAndPath(MOD_ID, path);
+ }
}
diff --git a/src/main/java/pro/mikey/kubeutils/kubejs/KubeUtilsPlugin.java b/src/main/java/pro/mikey/kubeutils/kubejs/KubeUtilsPlugin.java
index fa93342..c21a9f8 100644
--- a/src/main/java/pro/mikey/kubeutils/kubejs/KubeUtilsPlugin.java
+++ b/src/main/java/pro/mikey/kubeutils/kubejs/KubeUtilsPlugin.java
@@ -1,25 +1,25 @@
package pro.mikey.kubeutils.kubejs;
-import dev.latvian.mods.kubejs.KubeJSPlugin;
-import dev.latvian.mods.kubejs.script.BindingsEvent;
+import dev.latvian.mods.kubejs.event.EventGroupRegistry;
+import dev.latvian.mods.kubejs.plugin.ClassFilter;
+import dev.latvian.mods.kubejs.plugin.KubeJSPlugin;
+import dev.latvian.mods.kubejs.script.BindingRegistry;
import dev.latvian.mods.kubejs.script.ScriptType;
-import dev.latvian.mods.kubejs.util.ClassFilter;
import pro.mikey.kubeutils.kubejs.events.KuEventsGroup;
import pro.mikey.kubeutils.utils.Utils;
-public class KubeUtilsPlugin extends KubeJSPlugin {
+public class KubeUtilsPlugin implements KubeJSPlugin {
@Override
- public void registerBindings(BindingsEvent event) {
- event.add("Ku", BaseBindings.class);
+ public void registerBindings(BindingRegistry bindings){
+ bindings.add("Ku", BaseBindings.class);
}
@Override
- public void registerEvents() {
- KuEventsGroup.GROUP.register();
+ public void registerEvents(EventGroupRegistry registry) {
+ registry.register(KuEventsGroup.GROUP);
}
- @Override
- public void registerClasses(ScriptType type, ClassFilter filter) {
+ public void registerWrappers(ScriptType type, ClassFilter filter) {
filter.deny(Utils.class);
filter.deny(BaseBindings.class);
filter.deny(KubeUtilsPlugin.class);
diff --git a/src/main/java/pro/mikey/kubeutils/kubejs/events/PlayerStarterItems.java b/src/main/java/pro/mikey/kubeutils/kubejs/events/PlayerStarterItems.java
index bed98ba..f2a3791 100644
--- a/src/main/java/pro/mikey/kubeutils/kubejs/events/PlayerStarterItems.java
+++ b/src/main/java/pro/mikey/kubeutils/kubejs/events/PlayerStarterItems.java
@@ -2,11 +2,14 @@
import dev.latvian.mods.kubejs.core.EntityKJS;
import dev.latvian.mods.kubejs.event.EventResult;
+import dev.latvian.mods.kubejs.event.KubeEvent;
import dev.latvian.mods.kubejs.item.ItemHandlerUtils;
-import dev.latvian.mods.kubejs.player.PlayerEventJS;
+import dev.latvian.mods.kubejs.player.KubeJSPlayerEventHandler;
+import dev.latvian.mods.rhino.Context;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
+import org.jetbrains.annotations.Nullable;
import pro.mikey.kubeutils.events.KuEvents;
import pro.mikey.kubeutils.kubejs.modules.PlayerKu;
import pro.mikey.kubeutils.utils.Utils;
@@ -32,7 +35,7 @@
* structureTemplate = level.getServer().getStructureManager().get(structureLocation);
structureTemplate.ifPresent(e -> e.placeInWorld(level, spawnLocation, spawnLocation, new StructurePlaceSettings(), level.random, Block.UPDATE_ALL));
diff --git a/src/main/java/pro/mikey/kubeutils/kubejs/modules/PlayerKu.java b/src/main/java/pro/mikey/kubeutils/kubejs/modules/PlayerKu.java
index 88ff11f..eeae6fb 100644
--- a/src/main/java/pro/mikey/kubeutils/kubejs/modules/PlayerKu.java
+++ b/src/main/java/pro/mikey/kubeutils/kubejs/modules/PlayerKu.java
@@ -1,8 +1,8 @@
package pro.mikey.kubeutils.kubejs.modules;
+import dev.latvian.mods.kubejs.color.Color;
import dev.latvian.mods.kubejs.core.ComponentKJS;
import dev.latvian.mods.kubejs.core.EntityKJS;
-import dev.latvian.mods.rhino.mod.util.color.Color;
import net.minecraft.client.player.LocalPlayer;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.chat.Component;
@@ -26,7 +26,7 @@ public PlayerKu(Player player) {
* the {@link Component} class can offer whilst having alternative methods to display simpler text like a string.
*
* @see #showActionBar(String)
- * @see #showActionBar(String, Color, boolean, boolean)
+ *
*
* Example
*
diff --git a/src/main/java/pro/mikey/kubeutils/kubejs/modules/UtilsKu.java b/src/main/java/pro/mikey/kubeutils/kubejs/modules/UtilsKu.java
index 546be2d..e71d340 100644
--- a/src/main/java/pro/mikey/kubeutils/kubejs/modules/UtilsKu.java
+++ b/src/main/java/pro/mikey/kubeutils/kubejs/modules/UtilsKu.java
@@ -14,8 +14,8 @@
import net.minecraft.world.level.material.Fluids;
public class UtilsKu {
- private static final ResourceLocation EMPTY_LOCATION = new ResourceLocation("minecraft:empty");
- private static final ResourceLocation AIR_LOCATION = new ResourceLocation("minecraft:air");
+ private static final ResourceLocation EMPTY_LOCATION = ResourceLocation.withDefaultNamespace("empty");
+ private static final ResourceLocation AIR_LOCATION = ResourceLocation.withDefaultNamespace("air");
public UtilsKu() {
}
diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/neoforge.mods.toml
similarity index 100%
rename from src/main/resources/META-INF/mods.toml
rename to src/main/resources/META-INF/neoforge.mods.toml