diff --git a/build.gradle b/build.gradle index f99d828..eef3e38 100644 --- a/build.gradle +++ b/build.gradle @@ -4,11 +4,13 @@ plugins { id 'java' id 'maven-publish' id 'signing' - id 'net.neoforged.gradle' version '[6.0.18,6.2)' + id 'net.neoforged.gradle.userdev' version '7.0.97' } group = "io.codechicken" -archivesBaseName = "Translocators" +base { + archivesName = "Translocators" +} java { toolchain { @@ -22,27 +24,23 @@ sourceSets.main.resources.srcDirs += "src/main/generated" mod_version = "${mod_version}." + (System.getenv("BUILD_NUMBER") ?: "1") version = "${mc_version}-${mod_version}" -println "Starting build of ${archivesBaseName}, Version: ${mod_version}" +println "Starting build of ${base.archivesName.get()}, Version: ${mod_version}" println "Using Forge: ${forge_version}, for Minecraft: ${mc_version}" minecraft { - mappings channel: 'official', version: mc_version - accessTransformer = file("src/main/resources/META-INF/accesstransformer.cfg") - runs { - client { - workingDirectory file('run') - mods { translocators { source sourceSets.main } } - } - server { - workingDirectory file('run') - mods { translocators { source sourceSets.main } } - } - data { - workingDirectory file('run') - jvmArgs.add("-XstartOnFirstThread") - args '--mod', 'translocators', '--all', '--output', file("src/main/generated"), '--existing', file("src/main/resources") - mods { translocators { source sourceSets.main } } - } + accessTransformers.file file("src/main/resources/META-INF/accesstransformer.cfg") +} + +runs { + client { + workingDirectory file('run') + } + server { + workingDirectory file('run') + } + data { + workingDirectory file('run') + programArguments.addAll '--mod', 'translocators', '--all', '--output', file("src/main/generated"), '--existing', file("src/main/resources") } } @@ -52,12 +50,12 @@ repositories { } dependencies { - minecraft "net.neoforged:forge:${mc_version}-${forge_version}" - implementation fg.deobf("io.codechicken:CodeChickenLib:${mc_version}-${ccl_version}:universal") - implementation fg.deobf("io.codechicken:CBMultipart:${mc_version}-${cbmp_version}:universal") + implementation "net.neoforged:neoforge:${forge_version}" + implementation"io.codechicken:CodeChickenLib:${mc_version}-${ccl_version}" + implementation"io.codechicken:CBMultipart:${mc_version}-${cbmp_version}" } -def publishingMetadata = project.layout.buildDirectory.file("libs/$archivesBaseName-$version-publishing.json") +def publishingMetadata = project.layout.buildDirectory.file("libs/${base.archivesName.get()}-$version-publishing.json") def publishingMetadataTask = tasks.register("publishingMetadata") { outputs.file(publishingMetadata) doFirst { @@ -66,7 +64,7 @@ def publishingMetadataTask = tasks.register("publishingMetadata") { 'displayName' : "Translocators ${version}", 'mcVersion' : "${mc_version}", 'version' : "${mod_version}", - 'classifier' : 'universal', + 'classifier' : null, 'modLoader' : 'neoforge', 'curseforgeId': '247695', 'modrinthId' : 'WIxTuRkQ', @@ -108,13 +106,11 @@ processResources { task -> } jar { - finalizedBy 'reobfJar' - archiveClassifier = 'universal' manifest { - attributes 'Specification-Title': archivesBaseName + attributes 'Specification-Title': base.archivesName.get() attributes 'Specification-Vendor': 'covers1624' attributes 'Specification-Version': "1" - attributes 'Implementation-Title': archivesBaseName + attributes 'Implementation-Title': base.archivesName.get() attributes 'Implementation-Vendor': 'covers1624' attributes 'Implementation-Version': version attributes 'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ") @@ -124,7 +120,6 @@ jar { tasks.register("signJar") { dependsOn("jar") - dependsOn("reobfJar") doFirst { def args = [:] @@ -170,7 +165,7 @@ publishing { publications { Translocators(MavenPublication) { groupId project.group - artifactId project.archivesBaseName + artifactId project.base.archivesName.get() version project.version artifact jar artifact sourcesJar @@ -181,23 +176,23 @@ publishing { } pom { - name = archivesBaseName - description = archivesBaseName - url = "https://github.com/TheCBProject/${archivesBaseName}" + name = base.archivesName.get() + description = base.archivesName.get() + url = "https://github.com/TheCBProject/${base.archivesName.get()}" scm { - url = "https://github.com/TheCBProject/${archivesBaseName}" - connection = "scm:git:git://github.com/TheCBProject/${archivesBaseName}.git" - connection = "scm:git:git@github.com:TheCBProject/${archivesBaseName}.git" + url = "https://github.com/TheCBProject/${base.archivesName.get()}" + connection = "scm:git:git://github.com/TheCBProject/${base.archivesName.get()}.git" + connection = "scm:git:git@github.com:TheCBProject/${base.archivesName.get()}.git" } issueManagement { system = 'github' - url = "https://github.com/TheCBProject/${archivesBaseName}/issues" + url = "https://github.com/TheCBProject/${base.archivesName.get()}/issues" } licenses { license { name = "MIT" - url = "https://raw.githubusercontent.com/TheCBProject/${archivesBaseName}/master/LICENSE.txt" + url = "https://raw.githubusercontent.com/TheCBProject/${base.archivesName.get()}/master/LICENSE.txt" distribution = 'repo' } } diff --git a/gradle.properties b/gradle.properties index b794073..44209f3 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ -mc_version=1.20.1 -forge_version=47.1.65 -ccl_version=4.4.0.+ +mc_version=1.20.4 +forge_version=20.4.237 +ccl_version=4.5.0.+ ccl_version_max=5.0.0 -mod_version=2.6.0 -cbmp_version=3.3.0.+ +mod_version=2.7.0 +cbmp_version=3.4.0.+ cbmp_version_max=4.0.0 diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index c1962a7..d64cd49 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 0c85a1f..a80b22c 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index aeb74cb..1aa94a4 100755 --- a/gradlew +++ b/gradlew @@ -83,7 +83,8 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -130,10 +131,13 @@ location of your Java installation." fi else JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. @@ -141,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -149,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -198,11 +202,11 @@ fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/gradlew.bat b/gradlew.bat index 93e3f59..25da30d 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -43,11 +43,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail diff --git a/settings.gradle b/settings.gradle index a26ba08..932b08d 100644 --- a/settings.gradle +++ b/settings.gradle @@ -8,4 +8,8 @@ pluginManagement { } } +plugins { + id 'org.gradle.toolchains.foojay-resolver-convention' version '0.8.0' +} + rootProject.name = 'Translocators' diff --git a/src/main/generated/.cache/43dbc3018fae92cc3d6afd06fdaf4aa8082196e8 b/src/main/generated/.cache/43dbc3018fae92cc3d6afd06fdaf4aa8082196e8 new file mode 100644 index 0000000..46074ee --- /dev/null +++ b/src/main/generated/.cache/43dbc3018fae92cc3d6afd06fdaf4aa8082196e8 @@ -0,0 +1,5 @@ +// 1.20.4 2024-09-23T12:56:44.961332023 translocators Recipes. +b86470478db7aa35494ea40f2fe420003555cf16 data/minecraft/recipes/diamond.json +6904d2eed5f0e1469ce69b43adb15c52407ae1fa data/translocators/recipes/diamond_nugget.json +7a9427757b6ee11b237438bb0bccfcdd1f9d4660 data/translocators/recipes/fluid_translocator.json +4fc343ddcd448bc38629bfdeafa0a8b1f4846b8c data/translocators/recipes/item_translocator.json diff --git a/src/main/generated/.cache/47c388603704cfebbc251cedb6a1ad15cd223a5a b/src/main/generated/.cache/47c388603704cfebbc251cedb6a1ad15cd223a5a new file mode 100644 index 0000000..3837139 --- /dev/null +++ b/src/main/generated/.cache/47c388603704cfebbc251cedb6a1ad15cd223a5a @@ -0,0 +1,4 @@ +// 1.20.4 2024-09-23T12:56:44.960306364 translocators Item models. +da255926859262bfe389edf0508370a46f27b10b assets/translocators/models/item/diamond_nugget.json +bf3ca3ac3b818476d9758b2d31f8a54aa5e73cd9 assets/translocators/models/item/fluid_translocator.json +4f201565e027550b795bb556d73c00a7cec99da0 assets/translocators/models/item/item_translocator.json diff --git a/src/main/generated/.cache/5f0a708f96a608e3cd1bae634a0e2a9d76ba23f0 b/src/main/generated/.cache/5f0a708f96a608e3cd1bae634a0e2a9d76ba23f0 new file mode 100644 index 0000000..7aa2475 --- /dev/null +++ b/src/main/generated/.cache/5f0a708f96a608e3cd1bae634a0e2a9d76ba23f0 @@ -0,0 +1 @@ +// 1.20.4 2024-09-23T12:56:44.961438784 Tags for minecraft:block mod id translocators diff --git a/src/main/generated/.cache/7504cef79c788f2bdce19ded1ca0a6ca9e0712e0 b/src/main/generated/.cache/7504cef79c788f2bdce19ded1ca0a6ca9e0712e0 new file mode 100644 index 0000000..6f968c5 --- /dev/null +++ b/src/main/generated/.cache/7504cef79c788f2bdce19ded1ca0a6ca9e0712e0 @@ -0,0 +1,4 @@ +// 1.20.4 2024-09-23T12:56:44.961106271 Tags for minecraft:item mod id translocators +066595d5295e47124940b94a294b3e09c7fc1844 data/forge/tags/items/nuggets.json +066595d5295e47124940b94a294b3e09c7fc1844 data/forge/tags/items/nuggets/diamond.json +31730a223d67604c9b5e88893621ed3113ca3e6a data/translocators/tags/items/regulate.json diff --git a/src/main/generated/.cache/cache b/src/main/generated/.cache/cache deleted file mode 100644 index e59bf22..0000000 --- a/src/main/generated/.cache/cache +++ /dev/null @@ -1,16 +0,0 @@ -e4dac6f996e27e1a67e718b15b1eea73b96d8321 assets/translocators/blockstates/crafting_grid.json -bef99cceffc2ba4e0d32ac385f4c4a749b49cd16 assets/translocators/models/block/dummy.json -b138aa34919eb220e3b6d44698cbe36919d6155f assets/translocators/models/item/diamond_nugget.json -47376b609429605639ab76cf964518032bb5721e assets/translocators/models/item/fluid_translocator.json -47376b609429605639ab76cf964518032bb5721e assets/translocators/models/item/item_translocator.json -b229496abaa755aebcec1713fd9fafa2515bb03d data/forge/tags/items/nuggets.json -b229496abaa755aebcec1713fd9fafa2515bb03d data/forge/tags/items/nuggets/diamond.json -af58b553f70b44c184ed4abb0ae40d6494c40c39 data/translocators/advancements/recipes/misc/diamond.json -c1df2e809865be31eb17038325b175ffb5a9b5bf data/translocators/advancements/recipes/misc/diamond_nugget.json -3e308ad144ec552b8ef036158b95ca5e0d2e52e4 data/translocators/advancements/recipes/redstone/fluid_translocator.json -c78de140ffcfcf173bee6552687984178d0fe06d data/translocators/advancements/recipes/redstone/item_translocator.json -3d849e904a74fa318d421ddbafc291886e51864a data/translocators/recipes/diamond.json -8d274a9862442b9da7e39c85c8760e740424fc2b data/translocators/recipes/diamond_nugget.json -b272aa8bdeac90684570d1320bfd3db87728d5c9 data/translocators/recipes/fluid_translocator.json -7947f9d80ea0be45b3330c8398f8e9e26a3e1e0c data/translocators/recipes/item_translocator.json -9c21a247605d72371d77970a304ad4143b4b9949 data/translocators/tags/items/regulate.json diff --git a/src/main/generated/.cache/eddaa00703c70c4767c23281f132e682544d96ed b/src/main/generated/.cache/eddaa00703c70c4767c23281f132e682544d96ed new file mode 100644 index 0000000..53edbb8 --- /dev/null +++ b/src/main/generated/.cache/eddaa00703c70c4767c23281f132e682544d96ed @@ -0,0 +1,3 @@ +// 1.20.4 2024-09-23T12:56:44.961227232 Block States: translocators +ba04de053f1f9b61db84a6b3395823abb1a1cd09 assets/translocators/blockstates/crafting_grid.json +f142b327b9d3b70140ba25dd6eeed2cdb27d7952 assets/translocators/models/block/dummy.json diff --git a/src/main/generated/assets/translocators/models/block/dummy.json b/src/main/generated/assets/translocators/models/block/dummy.json index e45481c..8e64319 100644 --- a/src/main/generated/assets/translocators/models/block/dummy.json +++ b/src/main/generated/assets/translocators/models/block/dummy.json @@ -1,6 +1,6 @@ { "parent": "minecraft:block/block", "textures": { - "particle": "translocators:blocks/crafting_grid" + "particle": "translocators:block/crafting_grid" } } \ No newline at end of file diff --git a/src/main/generated/assets/translocators/models/item/fluid_translocator.json b/src/main/generated/assets/translocators/models/item/fluid_translocator.json index 1bcbb31..80befac 100644 --- a/src/main/generated/assets/translocators/models/item/fluid_translocator.json +++ b/src/main/generated/assets/translocators/models/item/fluid_translocator.json @@ -1,3 +1,5 @@ { - "parent": "minecraft:item/generated" + "parent": "minecraft:item/generated", + "class": "codechicken.translocators.client.render.RenderTranslocatorItem$Fluid", + "loader": "codechickenlib:class" } \ No newline at end of file diff --git a/src/main/generated/assets/translocators/models/item/item_translocator.json b/src/main/generated/assets/translocators/models/item/item_translocator.json index 1bcbb31..11e87fc 100644 --- a/src/main/generated/assets/translocators/models/item/item_translocator.json +++ b/src/main/generated/assets/translocators/models/item/item_translocator.json @@ -1,3 +1,5 @@ { - "parent": "minecraft:item/generated" + "parent": "minecraft:item/generated", + "class": "codechicken.translocators.client.render.RenderTranslocatorItem$Item", + "loader": "codechickenlib:class" } \ No newline at end of file diff --git a/src/main/generated/data/forge/tags/items/nuggets.json b/src/main/generated/data/forge/tags/items/nuggets.json index e12c91b..80b8c29 100644 --- a/src/main/generated/data/forge/tags/items/nuggets.json +++ b/src/main/generated/data/forge/tags/items/nuggets.json @@ -1,5 +1,4 @@ { - "replace": false, "values": [ "translocators:diamond_nugget" ] diff --git a/src/main/generated/data/forge/tags/items/nuggets/diamond.json b/src/main/generated/data/forge/tags/items/nuggets/diamond.json index e12c91b..80b8c29 100644 --- a/src/main/generated/data/forge/tags/items/nuggets/diamond.json +++ b/src/main/generated/data/forge/tags/items/nuggets/diamond.json @@ -1,5 +1,4 @@ { - "replace": false, "values": [ "translocators:diamond_nugget" ] diff --git a/src/main/generated/data/translocators/recipes/diamond.json b/src/main/generated/data/minecraft/recipes/diamond.json similarity index 96% rename from src/main/generated/data/translocators/recipes/diamond.json rename to src/main/generated/data/minecraft/recipes/diamond.json index 3e0f6b0..475b079 100644 --- a/src/main/generated/data/translocators/recipes/diamond.json +++ b/src/main/generated/data/minecraft/recipes/diamond.json @@ -1,5 +1,6 @@ { "type": "minecraft:crafting_shapeless", + "category": "misc", "ingredients": [ { "item": "translocators:diamond_nugget" diff --git a/src/main/generated/data/translocators/advancements/recipes/misc/diamond.json b/src/main/generated/data/translocators/advancements/recipes/misc/diamond.json deleted file mode 100644 index ef03be8..0000000 --- a/src/main/generated/data/translocators/advancements/recipes/misc/diamond.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "rewards": { - "recipes": [ - "translocators:diamond" - ] - }, - "criteria": { - "has_diamond_nugget": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { - "item": "translocators:diamond_nugget" - } - ] - } - }, - "has_the_recipe": { - "trigger": "minecraft:recipe_unlocked", - "conditions": { - "recipe": "translocators:diamond" - } - } - }, - "requirements": [ - [ - "has_diamond_nugget", - "has_the_recipe" - ] - ] -} \ No newline at end of file diff --git a/src/main/generated/data/translocators/advancements/recipes/misc/diamond_nugget.json b/src/main/generated/data/translocators/advancements/recipes/misc/diamond_nugget.json deleted file mode 100644 index 7c12c09..0000000 --- a/src/main/generated/data/translocators/advancements/recipes/misc/diamond_nugget.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "rewards": { - "recipes": [ - "translocators:diamond_nugget" - ] - }, - "criteria": { - "has_diamond": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { - "item": "minecraft:diamond" - } - ] - } - }, - "has_the_recipe": { - "trigger": "minecraft:recipe_unlocked", - "conditions": { - "recipe": "translocators:diamond_nugget" - } - } - }, - "requirements": [ - [ - "has_diamond", - "has_the_recipe" - ] - ] -} \ No newline at end of file diff --git a/src/main/generated/data/translocators/advancements/recipes/redstone/fluid_translocator.json b/src/main/generated/data/translocators/advancements/recipes/redstone/fluid_translocator.json deleted file mode 100644 index 0933bf0..0000000 --- a/src/main/generated/data/translocators/advancements/recipes/redstone/fluid_translocator.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "rewards": { - "recipes": [ - "translocators:fluid_translocator" - ] - }, - "criteria": { - "has_redstone": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { - "tag": "forge:dusts/redstone" - } - ] - } - }, - "has_ender_pearl": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { - "tag": "forge:ender_pearls" - } - ] - } - }, - "has_iron_ingot": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { - "tag": "forge:ingots/iron" - } - ] - } - }, - "has_piston": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { - "item": "minecraft:piston" - } - ] - } - }, - "has_lapis": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { - "tag": "forge:gems/lapis" - } - ] - } - }, - "has_the_recipe": { - "trigger": "minecraft:recipe_unlocked", - "conditions": { - "recipe": "translocators:fluid_translocator" - } - } - }, - "requirements": [ - [ - "has_redstone", - "has_ender_pearl", - "has_iron_ingot", - "has_piston", - "has_lapis", - "has_the_recipe" - ] - ] -} \ No newline at end of file diff --git a/src/main/generated/data/translocators/advancements/recipes/redstone/item_translocator.json b/src/main/generated/data/translocators/advancements/recipes/redstone/item_translocator.json deleted file mode 100644 index eb8f623..0000000 --- a/src/main/generated/data/translocators/advancements/recipes/redstone/item_translocator.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "rewards": { - "recipes": [ - "translocators:item_translocator" - ] - }, - "criteria": { - "has_redstone": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { - "tag": "forge:dusts/redstone" - } - ] - } - }, - "has_ender_pearl": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { - "tag": "forge:ender_pearls" - } - ] - } - }, - "has_iron_ingot": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { - "tag": "forge:ingots/iron" - } - ] - } - }, - "has_piston": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { - "item": "minecraft:piston" - } - ] - } - }, - "has_gold_ingot": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { - "tag": "forge:ingots/gold" - } - ] - } - }, - "has_the_recipe": { - "trigger": "minecraft:recipe_unlocked", - "conditions": { - "recipe": "translocators:item_translocator" - } - } - }, - "requirements": [ - [ - "has_redstone", - "has_ender_pearl", - "has_iron_ingot", - "has_piston", - "has_gold_ingot", - "has_the_recipe" - ] - ] -} \ No newline at end of file diff --git a/src/main/generated/data/translocators/recipes/diamond_nugget.json b/src/main/generated/data/translocators/recipes/diamond_nugget.json index ab2b579..261804a 100644 --- a/src/main/generated/data/translocators/recipes/diamond_nugget.json +++ b/src/main/generated/data/translocators/recipes/diamond_nugget.json @@ -1,12 +1,13 @@ { "type": "minecraft:crafting_shapeless", + "category": "misc", "ingredients": [ { "item": "minecraft:diamond" } ], "result": { - "item": "translocators:diamond_nugget", - "count": 9 + "count": 9, + "item": "translocators:diamond_nugget" } } \ No newline at end of file diff --git a/src/main/generated/data/translocators/recipes/fluid_translocator.json b/src/main/generated/data/translocators/recipes/fluid_translocator.json index 013e6fa..6cf2604 100644 --- a/src/main/generated/data/translocators/recipes/fluid_translocator.json +++ b/src/main/generated/data/translocators/recipes/fluid_translocator.json @@ -1,29 +1,30 @@ { "type": "minecraft:crafting_shaped", - "pattern": [ - "RER", - "IPI", - "RLR" - ], + "category": "misc", "key": { - "R": { - "tag": "forge:dusts/redstone" - }, "E": { "tag": "forge:ender_pearls" }, "I": { "tag": "forge:ingots/iron" }, + "L": { + "tag": "forge:gems/lapis" + }, "P": { "item": "minecraft:piston" }, - "L": { - "tag": "forge:gems/lapis" + "R": { + "tag": "forge:dusts/redstone" } }, + "pattern": [ + "RER", + "IPI", + "RLR" + ], "result": { - "item": "translocators:fluid_translocator", - "count": 2 + "count": 2, + "item": "translocators:fluid_translocator" } } \ No newline at end of file diff --git a/src/main/generated/data/translocators/recipes/item_translocator.json b/src/main/generated/data/translocators/recipes/item_translocator.json index af177c0..d8aded3 100644 --- a/src/main/generated/data/translocators/recipes/item_translocator.json +++ b/src/main/generated/data/translocators/recipes/item_translocator.json @@ -1,29 +1,30 @@ { "type": "minecraft:crafting_shaped", - "pattern": [ - "RER", - "IPI", - "RGR" - ], + "category": "misc", "key": { - "R": { - "tag": "forge:dusts/redstone" - }, "E": { "tag": "forge:ender_pearls" }, + "G": { + "tag": "forge:ingots/gold" + }, "I": { "tag": "forge:ingots/iron" }, "P": { "item": "minecraft:piston" }, - "G": { - "tag": "forge:ingots/gold" + "R": { + "tag": "forge:dusts/redstone" } }, + "pattern": [ + "RER", + "IPI", + "RGR" + ], "result": { - "item": "translocators:item_translocator", - "count": 2 + "count": 2, + "item": "translocators:item_translocator" } } \ No newline at end of file diff --git a/src/main/generated/data/translocators/tags/items/regulate.json b/src/main/generated/data/translocators/tags/items/regulate.json index 11f2547..c7776da 100644 --- a/src/main/generated/data/translocators/tags/items/regulate.json +++ b/src/main/generated/data/translocators/tags/items/regulate.json @@ -1,5 +1,4 @@ { - "replace": false, "values": [ "#forge:nuggets/diamond" ] diff --git a/src/main/java/codechicken/translocators/Translocators.java b/src/main/java/codechicken/translocators/Translocators.java index e2f1922..70c0e36 100644 --- a/src/main/java/codechicken/translocators/Translocators.java +++ b/src/main/java/codechicken/translocators/Translocators.java @@ -2,27 +2,41 @@ import codechicken.translocators.handler.ConfigHandler; import codechicken.translocators.init.ClientInit; +import codechicken.translocators.init.DataGenerators; import codechicken.translocators.init.TranslocatorsModContent; import codechicken.translocators.network.TranslocatorNetwork; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.fml.DistExecutor; -import net.minecraftforge.fml.common.Mod; -import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; +import net.neoforged.bus.api.IEventBus; +import net.neoforged.fml.ModContainer; +import net.neoforged.fml.common.Mod; +import net.neoforged.fml.loading.FMLEnvironment; +import org.jetbrains.annotations.Nullable; import java.nio.file.Paths; import static codechicken.translocators.Translocators.MOD_ID; +import static java.util.Objects.requireNonNull; @Mod (MOD_ID) public class Translocators { public static final String MOD_ID = "translocators"; - public Translocators() { - TranslocatorsModContent.init(); + private static @Nullable ModContainer container; + + public Translocators(ModContainer container, IEventBus modBus) { + Translocators.container = container; + TranslocatorsModContent.init(modBus); ConfigHandler.init(Paths.get("./config/translocators.cfg")); ConfigHandler.loadConfig(); - TranslocatorNetwork.init(); - DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> ClientInit::init); + TranslocatorNetwork.init(modBus); + if (FMLEnvironment.dist.isClient()) { + ClientInit.init(modBus); + } + + DataGenerators.init(modBus); + } + + public static ModContainer container() { + return requireNonNull(container); } } diff --git a/src/main/java/codechicken/translocators/client/gui/GuiTranslocator.java b/src/main/java/codechicken/translocators/client/gui/GuiTranslocator.java index da325af..81c5afe 100644 --- a/src/main/java/codechicken/translocators/client/gui/GuiTranslocator.java +++ b/src/main/java/codechicken/translocators/client/gui/GuiTranslocator.java @@ -21,7 +21,7 @@ public GuiTranslocator(ContainerItemTranslocator container, Inventory playerInve @Override public void render(GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) { - renderBackground(graphics); + renderBackground(graphics, mouseX, mouseY, partialTicks); super.render(graphics, mouseX, mouseY, partialTicks); renderTooltip(graphics, mouseX, mouseY); } diff --git a/src/main/java/codechicken/translocators/client/render/FluidTranslocatorPartRenderer.java b/src/main/java/codechicken/translocators/client/render/FluidTranslocatorPartRenderer.java index d2781b1..2b5ceaf 100644 --- a/src/main/java/codechicken/translocators/client/render/FluidTranslocatorPartRenderer.java +++ b/src/main/java/codechicken/translocators/client/render/FluidTranslocatorPartRenderer.java @@ -11,9 +11,9 @@ import net.minecraft.client.renderer.MultiBufferSource; import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.resources.model.Material; -import net.minecraftforge.client.ForgeHooksClient; -import net.minecraftforge.client.extensions.common.IClientFluidTypeExtensions; -import net.minecraftforge.fluids.FluidStack; +import net.neoforged.neoforge.client.ClientHooks; +import net.neoforged.neoforge.client.extensions.common.IClientFluidTypeExtensions; +import net.neoforged.neoforge.fluids.FluidStack; /** * Created by covers1624 on 4/5/23. @@ -45,7 +45,7 @@ private static void drawLiquidSpiral(CCRenderState ccrs, Matrix4 mat, int src, i } IClientFluidTypeExtensions props = IClientFluidTypeExtensions.of(stack.getFluid()); - Material material = ForgeHooksClient.getBlockMaterial(props.getStillTexture(stack)); + Material material = ClientHooks.getBlockMaterial(props.getStillTexture(stack)); TextureAtlasSprite tex = material.sprite(); ccrs.colour = props.getTintColor(stack) << 8 | 255;//Set ccrs.colour opposed to baseColour as we call writeVert manually bellow. @@ -76,13 +76,13 @@ private static void drawLiquidSpiral(CCRenderState ccrs, Matrix4 mat, int src, i next[3].set(p).add(a.x * s1 + b.x * s2, a.y * s1 + b.y * s2, a.z * s1 + b.z * s2); if (di > end) { - double u1 = tex.getU(Math.abs(di) * 16); - double u2 = tex.getU(Math.abs(di - tess) * 16); + double u1 = tex.getU((float) Math.abs(di)); + double u2 = tex.getU((float) Math.abs(di - tess)); for (int i = 0; i < 4; i++) { int j = (i + 1) % 4; Vector3 axis = next[j].copy().subtract(next[i]); - double v1 = tex.getV(Math.abs(next[i].scalarProject(axis)) * 16); - double v2 = tex.getV(Math.abs(next[j].scalarProject(axis)) * 16); + double v1 = tex.getV((float) Math.abs(next[i].scalarProject(axis))); + double v2 = tex.getV((float) Math.abs(next[j].scalarProject(axis))); ccrs.vert.set(next[i], u1, v1).apply(mat); ccrs.writeVert(); diff --git a/src/main/java/codechicken/translocators/client/render/RenderTranslocatorItem.java b/src/main/java/codechicken/translocators/client/render/RenderTranslocatorItem.java index 25f428b..809afa4 100644 --- a/src/main/java/codechicken/translocators/client/render/RenderTranslocatorItem.java +++ b/src/main/java/codechicken/translocators/client/render/RenderTranslocatorItem.java @@ -45,4 +45,18 @@ public boolean isGui3d() { public boolean usesBlockLight() { return true; } + + public static class Item extends RenderTranslocatorItem { + + public Item() { + super(0); + } + } + + public static class Fluid extends RenderTranslocatorItem { + + public Fluid() { + super(1); + } + } } diff --git a/src/main/java/codechicken/translocators/handler/CraftingGridKeyHandler.java b/src/main/java/codechicken/translocators/handler/CraftingGridKeyHandler.java index a6f6f20..bdd6ec0 100644 --- a/src/main/java/codechicken/translocators/handler/CraftingGridKeyHandler.java +++ b/src/main/java/codechicken/translocators/handler/CraftingGridKeyHandler.java @@ -10,10 +10,10 @@ import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.HitResult; -import net.minecraftforge.client.event.RegisterKeyMappingsEvent; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.TickEvent; -import net.minecraftforge.eventbus.api.IEventBus; +import net.neoforged.bus.api.IEventBus; +import net.neoforged.neoforge.client.event.RegisterKeyMappingsEvent; +import net.neoforged.neoforge.common.NeoForge; +import net.neoforged.neoforge.event.TickEvent; import org.lwjgl.glfw.GLFW; public class CraftingGridKeyHandler { @@ -23,7 +23,8 @@ public class CraftingGridKeyHandler { public static void init(IEventBus modBus) { modBus.addListener(CraftingGridKeyHandler::registerKeyBinding); - MinecraftForge.EVENT_BUS.addListener(CraftingGridKeyHandler::onClientTick); + + NeoForge.EVENT_BUS.addListener(CraftingGridKeyHandler::onClientTick); } private static void registerKeyBinding(RegisterKeyMappingsEvent event) { diff --git a/src/main/java/codechicken/translocators/init/ClientInit.java b/src/main/java/codechicken/translocators/init/ClientInit.java index 5eb39aa..5daf2a4 100644 --- a/src/main/java/codechicken/translocators/init/ClientInit.java +++ b/src/main/java/codechicken/translocators/init/ClientInit.java @@ -1,51 +1,40 @@ package codechicken.translocators.init; -import codechicken.lib.model.ModelRegistryHelper; import codechicken.multipart.api.MultipartClientRegistry; import codechicken.translocators.client.gui.GuiTranslocator; import codechicken.translocators.client.render.FluidTranslocatorPartRenderer; import codechicken.translocators.client.render.ItemTranslocatorPartRenderer; -import codechicken.translocators.client.render.RenderTranslocatorItem; import codechicken.translocators.client.render.TileCraftingGridRenderer; import codechicken.translocators.handler.CraftingGridKeyHandler; import net.covers1624.quack.util.CrashLock; -import net.minecraft.client.gui.screens.MenuScreens; -import net.minecraft.client.resources.model.ModelResourceLocation; -import net.minecraftforge.client.event.EntityRenderersEvent; -import net.minecraftforge.client.event.RegisterKeyMappingsEvent; -import net.minecraftforge.eventbus.api.IEventBus; -import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; -import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; - -import static codechicken.translocators.init.TranslocatorsModContent.fluidTranslocatorItem; -import static codechicken.translocators.init.TranslocatorsModContent.itemTranslocatorItem; +import net.neoforged.bus.api.IEventBus; +import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent; +import net.neoforged.neoforge.client.event.EntityRenderersEvent; +import net.neoforged.neoforge.client.event.RegisterMenuScreensEvent; public class ClientInit { private static final CrashLock LOCK = new CrashLock("Already Initialized."); - public static final ModelRegistryHelper modelHelper = new ModelRegistryHelper(); - - public static void init() { - IEventBus bus = FMLJavaModLoadingContext.get().getModEventBus(); - bus.addListener(ClientInit::clientSetup); - bus.addListener(ClientInit::registerRenderers); - CraftingGridKeyHandler.init(bus); - TranslocatorTextures.init(bus); - } - private static void clientSetup(FMLClientSetupEvent event) { - MenuScreens.register(TranslocatorsModContent.containerItemTranslocator.get(), GuiTranslocator::new); + public static void init(IEventBus modBus) { + LOCK.lock(); - ModelResourceLocation itemTranslocatorInv = new ModelResourceLocation(itemTranslocatorItem.getId(), "inventory"); - ModelResourceLocation fluidTranslocatorInv = new ModelResourceLocation(fluidTranslocatorItem.getId(), "inventory"); + modBus.addListener(ClientInit::clientSetup); + modBus.addListener(ClientInit::onRegisterMenuScreens); + modBus.addListener(ClientInit::registerRenderers); - modelHelper.register(itemTranslocatorInv, new RenderTranslocatorItem(0)); - modelHelper.register(fluidTranslocatorInv, new RenderTranslocatorItem(1)); + CraftingGridKeyHandler.init(modBus); + TranslocatorTextures.init(modBus); + } + private static void clientSetup(FMLClientSetupEvent event) { MultipartClientRegistry.register(TranslocatorsModContent.itemTranslocatorPartType.get(), new ItemTranslocatorPartRenderer()); MultipartClientRegistry.register(TranslocatorsModContent.fluidTranslocatorPartType.get(), new FluidTranslocatorPartRenderer()); } + private static void onRegisterMenuScreens(RegisterMenuScreensEvent event) { + event.register(TranslocatorsModContent.containerItemTranslocator.get(), GuiTranslocator::new); + } private static void registerRenderers(EntityRenderersEvent.RegisterRenderers event) { event.registerBlockEntityRenderer(TranslocatorsModContent.tileCraftingGridType.get(), TileCraftingGridRenderer::new); diff --git a/src/main/java/codechicken/translocators/init/DataGenerators.java b/src/main/java/codechicken/translocators/init/DataGenerators.java index 630c73e..e7781cd 100644 --- a/src/main/java/codechicken/translocators/init/DataGenerators.java +++ b/src/main/java/codechicken/translocators/init/DataGenerators.java @@ -2,30 +2,37 @@ import codechicken.lib.datagen.ItemModelProvider; import codechicken.lib.datagen.recipe.RecipeProvider; +import codechicken.translocators.client.render.RenderTranslocatorItem; +import net.covers1624.quack.util.CrashLock; import net.minecraft.core.HolderLookup; import net.minecraft.data.DataGenerator; import net.minecraft.data.PackOutput; import net.minecraft.data.tags.ItemTagsProvider; import net.minecraft.world.item.Items; import net.minecraft.world.level.block.Block; -import net.minecraftforge.client.model.generators.BlockStateProvider; -import net.minecraftforge.client.model.generators.ModelFile; -import net.minecraftforge.common.Tags; -import net.minecraftforge.common.data.BlockTagsProvider; -import net.minecraftforge.common.data.ExistingFileHelper; -import net.minecraftforge.data.event.GatherDataEvent; -import net.minecraftforge.eventbus.api.SubscribeEvent; -import net.minecraftforge.fml.common.Mod; +import net.neoforged.bus.api.IEventBus; +import net.neoforged.neoforge.client.model.generators.BlockStateProvider; +import net.neoforged.neoforge.client.model.generators.ModelFile; +import net.neoforged.neoforge.common.Tags; +import net.neoforged.neoforge.common.data.BlockTagsProvider; +import net.neoforged.neoforge.common.data.ExistingFileHelper; +import net.neoforged.neoforge.data.event.GatherDataEvent; import java.util.concurrent.CompletableFuture; import static codechicken.translocators.Translocators.MOD_ID; -@Mod.EventBusSubscriber (modid = MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD) public class DataGenerators { - @SubscribeEvent - public static void gatherDataGenerators(GatherDataEvent event) { + private static final CrashLock LOCK = new CrashLock("Already Initialized."); + + public static void init(IEventBus modBus) { + LOCK.lock(); + + modBus.addListener(DataGenerators::gatherDataGenerators); + } + + private static void gatherDataGenerators(GatherDataEvent event) { DataGenerator gen = event.getGenerator(); PackOutput output = gen.getPackOutput(); CompletableFuture lookupProvider = event.getLookupProvider(); @@ -33,7 +40,7 @@ public static void gatherDataGenerators(GatherDataEvent event) { gen.addProvider(event.includeClient(), new ItemModels(output, files)); gen.addProvider(event.includeClient(), new BlockStates(output, files)); - BlockTags blockTags = new BlockTags(output, lookupProvider, files); + BlockTags blockTags = gen.addProvider(event.includeServer(), new BlockTags(output, lookupProvider, files)); gen.addProvider(event.includeServer(), new ItemTags(output, lookupProvider, blockTags.contentsGetter(), files)); gen.addProvider(event.includeServer(), new Recipes(output)); } @@ -46,8 +53,8 @@ public ItemModels(PackOutput output, ExistingFileHelper existingFileHelper) { @Override protected void registerModels() { - generated(TranslocatorsModContent.itemTranslocatorItem).texture(null); - generated(TranslocatorsModContent.fluidTranslocatorItem).texture(null); + clazz(TranslocatorsModContent.itemTranslocatorItem, RenderTranslocatorItem.Item.class); + clazz(TranslocatorsModContent.fluidTranslocatorItem, RenderTranslocatorItem.Fluid.class); generated(TranslocatorsModContent.diamondNuggetItem); } } @@ -62,7 +69,7 @@ public BlockStates(PackOutput output, ExistingFileHelper exFileHelper) { protected void registerStatesAndModels() { ModelFile model = models() .withExistingParent("dummy", "block") - .texture("particle", "translocators:blocks/crafting_grid"); + .texture("particle", "translocators:block/crafting_grid"); simpleBlock(TranslocatorsModContent.blockCraftingGrid.get(), model); } } diff --git a/src/main/java/codechicken/translocators/init/TranslocatorTextures.java b/src/main/java/codechicken/translocators/init/TranslocatorTextures.java index 0b570a8..d285744 100644 --- a/src/main/java/codechicken/translocators/init/TranslocatorTextures.java +++ b/src/main/java/codechicken/translocators/init/TranslocatorTextures.java @@ -3,8 +3,8 @@ import net.minecraft.client.renderer.texture.TextureAtlas; import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.resources.ResourceLocation; -import net.minecraftforge.client.event.TextureStitchEvent; -import net.minecraftforge.eventbus.api.IEventBus; +import net.neoforged.bus.api.IEventBus; +import net.neoforged.neoforge.client.event.TextureAtlasStitchedEvent; /** * Created by covers1624 on 14/11/2017. @@ -25,7 +25,7 @@ public static void init(IEventBus bus) { bus.addListener(TranslocatorTextures::textureStitchPost); } - private static void textureStitchPost(TextureStitchEvent.Post event) { + private static void textureStitchPost(TextureAtlasStitchedEvent event) { TextureAtlas atlas = event.getAtlas(); if (!atlas.location().equals(TextureAtlas.LOCATION_BLOCKS)) return; diff --git a/src/main/java/codechicken/translocators/init/TranslocatorsModContent.java b/src/main/java/codechicken/translocators/init/TranslocatorsModContent.java index 0d3b011..5ec25fe 100644 --- a/src/main/java/codechicken/translocators/init/TranslocatorsModContent.java +++ b/src/main/java/codechicken/translocators/init/TranslocatorsModContent.java @@ -11,6 +11,7 @@ import codechicken.translocators.part.ItemTranslocatorPart; import codechicken.translocators.tile.TileCraftingGrid; import net.covers1624.quack.util.CrashLock; +import net.minecraft.core.registries.Registries; import net.minecraft.resources.ResourceLocation; import net.minecraft.tags.ItemTags; import net.minecraft.tags.TagKey; @@ -19,12 +20,10 @@ import net.minecraft.world.item.Item; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.entity.BlockEntityType; -import net.minecraftforge.event.BuildCreativeModeTabContentsEvent; -import net.minecraftforge.eventbus.api.IEventBus; -import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; -import net.minecraftforge.registries.DeferredRegister; -import net.minecraftforge.registries.ForgeRegistries; -import net.minecraftforge.registries.RegistryObject; +import net.neoforged.bus.api.IEventBus; +import net.neoforged.neoforge.event.BuildCreativeModeTabContentsEvent; +import net.neoforged.neoforge.registries.DeferredHolder; +import net.neoforged.neoforge.registries.DeferredRegister; import static codechicken.translocators.Translocators.MOD_ID; @@ -35,66 +34,65 @@ public class TranslocatorsModContent { private static final CrashLock LOCK = new CrashLock("Already Initialized."); - private static final DeferredRegister ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, MOD_ID); - private static final DeferredRegister BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, MOD_ID); - private static final DeferredRegister> TILES = DeferredRegister.create(ForgeRegistries.BLOCK_ENTITY_TYPES, MOD_ID); + private static final DeferredRegister ITEMS = DeferredRegister.create(Registries.ITEM, MOD_ID); + private static final DeferredRegister BLOCKS = DeferredRegister.create(Registries.BLOCK, MOD_ID); + private static final DeferredRegister> TILES = DeferredRegister.create(Registries.BLOCK_ENTITY_TYPE, MOD_ID); private static final DeferredRegister> PARTS = DeferredRegister.create(MultipartType.MULTIPART_TYPES, MOD_ID); - private static final DeferredRegister> MENU_TYPES = DeferredRegister.create(ForgeRegistries.MENU_TYPES, MOD_ID); + private static final DeferredRegister> MENU_TYPES = DeferredRegister.create(Registries.MENU, MOD_ID); public static TagKey diamondNuggetTag = ItemTags.create(new ResourceLocation("forge:nuggets/diamond")); public static TagKey regulateItemsTag = ItemTags.create(new ResourceLocation("translocators:regulate")); //region Items. - public static RegistryObject itemTranslocatorItem = ITEMS.register("item_translocator", () -> + public static DeferredHolder itemTranslocatorItem = ITEMS.register("item_translocator", () -> new ItemTranslocatorItem(new Item.Properties())); - public static RegistryObject fluidTranslocatorItem = ITEMS.register("fluid_translocator", () -> + public static DeferredHolder fluidTranslocatorItem = ITEMS.register("fluid_translocator", () -> new FluidTranslocatorItem(new Item.Properties())); - public static RegistryObject diamondNuggetItem = ITEMS.register("diamond_nugget", () -> + public static DeferredHolder diamondNuggetItem = ITEMS.register("diamond_nugget", () -> new Item(new Item.Properties())); //endregion //region Blocks. - public static RegistryObject blockCraftingGrid = BLOCKS.register("crafting_grid", BlockCraftingGrid::new); + public static DeferredHolder blockCraftingGrid = BLOCKS.register("crafting_grid", BlockCraftingGrid::new); //endregion //region TileEntityTypes. - public static RegistryObject> tileCraftingGridType = TILES.register("crafting_grid", () -> + public static DeferredHolder, BlockEntityType> tileCraftingGridType = TILES.register("crafting_grid", () -> BlockEntityType.Builder.of(TileCraftingGrid::new, blockCraftingGrid.get()).build(null)); //endregion //region MultiPartTypes. - public static RegistryObject> itemTranslocatorPartType = PARTS.register("item_translocator", () -> + public static DeferredHolder, MultipartType> itemTranslocatorPartType = PARTS.register("item_translocator", () -> new SimpleMultipartType<>(s -> new ItemTranslocatorPart())); - public static RegistryObject> fluidTranslocatorPartType = PARTS.register("fluid_translocator", () -> + public static DeferredHolder, MultipartType> fluidTranslocatorPartType = PARTS.register("fluid_translocator", () -> new SimpleMultipartType<>(s -> new FluidTranslocatorPart())); //endregion //region ContainerTypes. - public static RegistryObject> containerItemTranslocator = MENU_TYPES.register("item_translocator", () -> + public static DeferredHolder, MenuType> containerItemTranslocator = MENU_TYPES.register("item_translocator", () -> ICCLContainerType.create(ContainerItemTranslocator::new)); //endregion. - public static void init() { + public static void init(IEventBus modBus) { LOCK.lock(); - IEventBus bus = FMLJavaModLoadingContext.get().getModEventBus(); - ITEMS.register(bus); - BLOCKS.register(bus); - TILES.register(bus); - PARTS.register(bus); - MENU_TYPES.register(bus); - bus.addListener(TranslocatorsModContent::onCreativeTabBuild); + ITEMS.register(modBus); + BLOCKS.register(modBus); + TILES.register(modBus); + PARTS.register(modBus); + MENU_TYPES.register(modBus); + modBus.addListener(TranslocatorsModContent::onCreativeTabBuild); } private static void onCreativeTabBuild(BuildCreativeModeTabContentsEvent event) { if (event.getTabKey() == CreativeModeTabs.REDSTONE_BLOCKS) { - event.accept(itemTranslocatorItem); - event.accept(fluidTranslocatorItem); + event.accept(itemTranslocatorItem.get()); + event.accept(fluidTranslocatorItem.get()); } if (event.getTabKey() == CreativeModeTabs.INGREDIENTS) { - event.accept(diamondNuggetItem); + event.accept(diamondNuggetItem.get()); } } } diff --git a/src/main/java/codechicken/translocators/item/FluidTranslocatorItem.java b/src/main/java/codechicken/translocators/item/FluidTranslocatorItem.java index 4964ea0..9931f7f 100644 --- a/src/main/java/codechicken/translocators/item/FluidTranslocatorItem.java +++ b/src/main/java/codechicken/translocators/item/FluidTranslocatorItem.java @@ -3,8 +3,10 @@ import codechicken.multipart.api.MultipartType; import codechicken.translocators.init.TranslocatorsModContent; import codechicken.translocators.part.FluidTranslocatorPart; -import net.minecraftforge.common.capabilities.Capability; -import net.minecraftforge.common.capabilities.ForgeCapabilities; +import net.minecraft.core.Direction; +import net.neoforged.neoforge.capabilities.BlockCapability; +import net.neoforged.neoforge.capabilities.Capabilities; +import org.jetbrains.annotations.Nullable; /** * Created by covers1624 on 4/20/20. @@ -21,7 +23,7 @@ public MultipartType getType() { } @Override - public Capability getTargetCapability() { - return ForgeCapabilities.FLUID_HANDLER; + public BlockCapability getTargetCapability() { + return Capabilities.FluidHandler.BLOCK; } } diff --git a/src/main/java/codechicken/translocators/item/ItemTranslocatorItem.java b/src/main/java/codechicken/translocators/item/ItemTranslocatorItem.java index 5415d1d..163559f 100644 --- a/src/main/java/codechicken/translocators/item/ItemTranslocatorItem.java +++ b/src/main/java/codechicken/translocators/item/ItemTranslocatorItem.java @@ -3,8 +3,10 @@ import codechicken.multipart.api.MultipartType; import codechicken.translocators.init.TranslocatorsModContent; import codechicken.translocators.part.ItemTranslocatorPart; -import net.minecraftforge.common.capabilities.Capability; -import net.minecraftforge.common.capabilities.ForgeCapabilities; +import net.minecraft.core.Direction; +import net.neoforged.neoforge.capabilities.BlockCapability; +import net.neoforged.neoforge.capabilities.Capabilities; +import org.jetbrains.annotations.Nullable; /** * Created by covers1624 on 4/20/20. @@ -21,7 +23,7 @@ public MultipartType getType() { } @Override - public Capability getTargetCapability() { - return ForgeCapabilities.ITEM_HANDLER; + public BlockCapability getTargetCapability() { + return Capabilities.ItemHandler.BLOCK; } } diff --git a/src/main/java/codechicken/translocators/item/TranslocatorItem.java b/src/main/java/codechicken/translocators/item/TranslocatorItem.java index f9ba167..a75ba14 100644 --- a/src/main/java/codechicken/translocators/item/TranslocatorItem.java +++ b/src/main/java/codechicken/translocators/item/TranslocatorItem.java @@ -7,14 +7,10 @@ import codechicken.translocators.part.TranslocatorPart; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; -import net.minecraft.core.NonNullList; -import net.minecraft.world.item.CreativeModeTab; import net.minecraft.world.item.Item; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.context.UseOnContext; import net.minecraft.world.level.Level; -import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraftforge.common.capabilities.Capability; +import net.neoforged.neoforge.capabilities.BlockCapability; +import org.jetbrains.annotations.Nullable; /** * Created by covers1624 on 10/11/2017. @@ -27,15 +23,14 @@ public TranslocatorItem(Item.Properties props) { public abstract MultipartType getType(); - public abstract Capability getTargetCapability(); + public abstract BlockCapability getTargetCapability(); @Override public MultiPart newPart(MultipartPlaceContext context) { Level world = context.getLevel(); Direction side = context.getClickedFace(); BlockPos onPos = context.getClickedPos().relative(side.getOpposite()); - BlockEntity tile = world.getBlockEntity(onPos); - if (tile != null && tile.getCapability(getTargetCapability(), side).isPresent()) { + if (world.getCapability(getTargetCapability(), onPos, side) != null) { TranslocatorPart part = world.isClientSide() ? getType().createPartClient(null) : getType().createPartServer(null); return part.setupPlacement(context.getPlayer(), side); } diff --git a/src/main/java/codechicken/translocators/network/TranslocatorCPH.java b/src/main/java/codechicken/translocators/network/TranslocatorCPH.java index 5c7d770..1a71973 100644 --- a/src/main/java/codechicken/translocators/network/TranslocatorCPH.java +++ b/src/main/java/codechicken/translocators/network/TranslocatorCPH.java @@ -3,7 +3,6 @@ import codechicken.lib.packet.ICustomPacketHandler.IClientPacketHandler; import codechicken.lib.packet.PacketCustom; import net.minecraft.client.Minecraft; -import net.minecraft.client.multiplayer.ClientPacketListener; import static codechicken.translocators.network.TranslocatorNetwork.C_CRAFTING_GRID_UPDATE; import static codechicken.translocators.network.TranslocatorNetwork.C_FILTER_GUI_SET_SLOT; @@ -11,7 +10,7 @@ public class TranslocatorCPH implements IClientPacketHandler { @Override - public void handlePacket(PacketCustom packet, Minecraft mc, ClientPacketListener handler) { + public void handlePacket(PacketCustom packet, Minecraft mc) { switch (packet.getType()) { case C_FILTER_GUI_SET_SLOT: mc.player.containerMenu.getSlot(packet.readUByte()).set(packet.readItemStack()); diff --git a/src/main/java/codechicken/translocators/network/TranslocatorNetwork.java b/src/main/java/codechicken/translocators/network/TranslocatorNetwork.java index 55b6676..1ccc72d 100644 --- a/src/main/java/codechicken/translocators/network/TranslocatorNetwork.java +++ b/src/main/java/codechicken/translocators/network/TranslocatorNetwork.java @@ -1,8 +1,9 @@ package codechicken.translocators.network; -import codechicken.lib.packet.PacketCustomChannelBuilder; +import codechicken.lib.packet.PacketCustomChannel; +import codechicken.translocators.Translocators; import net.minecraft.resources.ResourceLocation; -import net.minecraftforge.network.event.EventNetworkChannel; +import net.neoforged.bus.api.IEventBus; /** * Created by covers1624 on 4/19/20. @@ -10,7 +11,10 @@ public class TranslocatorNetwork { public static final ResourceLocation NET_CHANNEL = new ResourceLocation("translocators:network"); - public static EventNetworkChannel netChannel; + public static final PacketCustomChannel channel = new PacketCustomChannel(NET_CHANNEL) + .versioned(Translocators.container().getModInfo().getVersion().toString()) + .client(() -> TranslocatorCPH::new) + .server(() -> TranslocatorSPH::new); public static final int C_FILTER_GUI_SET_SLOT = 1; public static final int C_CRAFTING_GRID_UPDATE = 2; @@ -18,11 +22,8 @@ public class TranslocatorNetwork { public static final int S_CRAFTING_GRID_PLACE = 1; public static final int S_CRAFTING_GRID_EXECUTE = 2; - public static void init() { - netChannel = PacketCustomChannelBuilder.named(NET_CHANNEL) - .assignClientHandler(() -> TranslocatorCPH::new) - .assignServerHandler(() -> TranslocatorSPH::new) - .build(); + public static void init(IEventBus modBus) { + channel.init(modBus); } } diff --git a/src/main/java/codechicken/translocators/network/TranslocatorSPH.java b/src/main/java/codechicken/translocators/network/TranslocatorSPH.java index 6e170ec..c5493cd 100644 --- a/src/main/java/codechicken/translocators/network/TranslocatorSPH.java +++ b/src/main/java/codechicken/translocators/network/TranslocatorSPH.java @@ -5,7 +5,6 @@ import codechicken.translocators.init.TranslocatorsModContent; import codechicken.translocators.tile.TileCraftingGrid; import net.minecraft.server.level.ServerPlayer; -import net.minecraft.server.network.ServerGamePacketListenerImpl; import static codechicken.translocators.network.TranslocatorNetwork.S_CRAFTING_GRID_EXECUTE; import static codechicken.translocators.network.TranslocatorNetwork.S_CRAFTING_GRID_PLACE; @@ -13,7 +12,7 @@ public class TranslocatorSPH implements IServerPacketHandler { @Override - public void handlePacket(PacketCustom packet, ServerPlayer sender, ServerGamePacketListenerImpl handler) { + public void handlePacket(PacketCustom packet, ServerPlayer sender) { switch (packet.getType()) { case S_CRAFTING_GRID_PLACE -> TranslocatorsModContent.blockCraftingGrid.get().placeBlock(sender.level(), sender, packet.readPos(), packet.readDirection()); case S_CRAFTING_GRID_EXECUTE -> { diff --git a/src/main/java/codechicken/translocators/part/FluidTranslocatorPart.java b/src/main/java/codechicken/translocators/part/FluidTranslocatorPart.java index 0ea0c2c..f45c9f6 100644 --- a/src/main/java/codechicken/translocators/part/FluidTranslocatorPart.java +++ b/src/main/java/codechicken/translocators/part/FluidTranslocatorPart.java @@ -7,11 +7,11 @@ import codechicken.translocators.init.TranslocatorsModContent; import net.minecraft.core.Direction; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.common.capabilities.ForgeCapabilities; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.capability.IFluidHandler; -import net.minecraftforge.fluids.capability.IFluidHandler.FluidAction; -import net.minecraftforge.fluids.capability.templates.EmptyFluidHandler; +import net.neoforged.neoforge.capabilities.Capabilities; +import net.neoforged.neoforge.fluids.FluidStack; +import net.neoforged.neoforge.fluids.capability.IFluidHandler; +import net.neoforged.neoforge.fluids.capability.IFluidHandler.FluidAction; +import net.neoforged.neoforge.fluids.capability.templates.EmptyFluidHandler; import java.util.*; @@ -40,7 +40,7 @@ public MultipartType getType() { @Override public boolean canStay() { - return capCache().getCapability(ForgeCapabilities.FLUID_HANDLER, Direction.BY_3D_DATA[side]).isPresent(); + return capCache().getCapability(Capabilities.FluidHandler.BLOCK, Direction.BY_3D_DATA[side]) != null; } @Override @@ -64,7 +64,7 @@ public void tick() { for (int i = 0; i < 6; i++) { //Fill with empty if the translocator doesnt exist or is the incorrect type. if (canInsert(i) || i == side) { - attached[i] = capCache().getCapabilityOr(ForgeCapabilities.FLUID_HANDLER, Direction.BY_3D_DATA[i], EmptyFluidHandler.INSTANCE); + attached[i] = capCache().getCapabilityOr(Capabilities.FluidHandler.BLOCK, Direction.BY_3D_DATA[i], EmptyFluidHandler.INSTANCE); } else { attached[i] = EmptyFluidHandler.INSTANCE; } @@ -73,7 +73,7 @@ public void tick() { FluidStack drain = myHandler.drain(fast ? 1000 : 100, FluidAction.SIMULATE); //Check if we have any fluid to transfer. - if (drain != null && drain.getAmount() != 0) { + if (drain.getAmount() != 0) { List transfers = new ArrayList<>(); FluidStack move = drain.copy(); spreadOutput(move, getOutputs(), attached, transfers); @@ -112,8 +112,7 @@ public int[] getOutputs() { int r_a = 0; for (int i = 0; i < 6; i++) { MultiPart p = tile().getSlottedPart(i); - if (p instanceof FluidTranslocatorPart) { - FluidTranslocatorPart part = (FluidTranslocatorPart) p; + if (p instanceof FluidTranslocatorPart part) { //If the part can accept stuffs. if (!part.canEject() && i != side) { //Add it to separate arrays. @@ -189,28 +188,8 @@ public void readIncUpdate(MCDataInput packet) { } } -// @Override -// public void renderDynamic(MatrixStack mStack, IRenderTypeBuffer buffers, int packedLight, int packedOverlay, float partialTicks) { -// RenderTranslocator.renderFluid(this, mStack, buffers, partialTicks); -// super.renderDynamic(mStack, buffers, packedLight, packedOverlay, partialTicks); -// } - - // @Override -// public void renderDynamic(Vector3 pos, int pass, float delta) { -// RenderTranslocator.renderFluid(this, pos, delta); -// super.renderDynamic(pos, pass, delta); -// } - //Network object for client sync. - private class FluidTransfer { - - int dst; - FluidStack fluid; - - public FluidTransfer(int dst, FluidStack fluid) { - this.dst = dst; - this.fluid = fluid; - } + private record FluidTransfer(int dst, FluidStack fluid) { } public class MovingLiquid { diff --git a/src/main/java/codechicken/translocators/part/ItemTranslocatorPart.java b/src/main/java/codechicken/translocators/part/ItemTranslocatorPart.java index 4d032f1..a95869d 100644 --- a/src/main/java/codechicken/translocators/part/ItemTranslocatorPart.java +++ b/src/main/java/codechicken/translocators/part/ItemTranslocatorPart.java @@ -26,9 +26,9 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; import net.minecraft.world.level.block.Blocks; -import net.minecraftforge.common.capabilities.ForgeCapabilities; -import net.minecraftforge.items.IItemHandler; -import net.minecraftforge.items.wrapper.EmptyHandler; +import net.neoforged.neoforge.capabilities.Capabilities; +import net.neoforged.neoforge.items.IItemHandler; +import net.neoforged.neoforge.items.wrapper.EmptyHandler; import java.util.ArrayList; import java.util.LinkedList; @@ -76,7 +76,7 @@ public int getIconIndex() { @Override public boolean canStay() { - return capCache().getCapability(ForgeCapabilities.ITEM_HANDLER, Direction.BY_3D_DATA[side]).isPresent(); + return capCache().getCapability(Capabilities.ItemHandler.BLOCK, Direction.BY_3D_DATA[side]) != null; } @Override @@ -90,7 +90,7 @@ public void tick() { for (int i = 0; i < 6; i++) { //Fill with empty if the translocator doesnt exist or is the incorrect type. if (canInsert(i) || i == side) { - handlers[i] = capCache().getCapabilityOr(ForgeCapabilities.ITEM_HANDLER, Direction.BY_3D_DATA[i], EmptyHandler.INSTANCE); + handlers[i] = capCache().getCapabilityOr(Capabilities.ItemHandler.BLOCK, Direction.BY_3D_DATA[i], EmptyHandler.INSTANCE); } else { handlers[i] = EmptyHandler.INSTANCE; } @@ -136,7 +136,7 @@ public void tick() { if (signal) { IItemHandler[] handlers = new IItemHandler[6]; for (int i = 0; i < 6; i++) { - handlers[i] = capCache().getCapabilityOr(ForgeCapabilities.ITEM_HANDLER, Direction.BY_3D_DATA[side], EmptyHandler.INSTANCE); + handlers[i] = capCache().getCapabilityOr(Capabilities.ItemHandler.BLOCK, Direction.BY_3D_DATA[side], EmptyHandler.INSTANCE); } if (a_eject) { boolean allSatisfied = true; @@ -470,12 +470,6 @@ protected void readFlags(int flags) { signal = (flags & (1 << 4)) != 0; a_powering = (flags & (1 << 5)) != 0; } -// -// @Override -// public void renderDynamic(MatrixStack mStack, IRenderTypeBuffer buffers, int packedLight, int packedOverlay, float partialTicks) { -// super.renderDynamic(mStack, buffers, packedLight, packedOverlay, partialTicks); -// RenderTranslocator.renderItem(this, mStack, buffers, packedLight, packedOverlay, partialTicks); -// } @Override public int strongPowerLevel(int side) { diff --git a/src/main/java/codechicken/translocators/tile/TileCraftingGrid.java b/src/main/java/codechicken/translocators/tile/TileCraftingGrid.java index 4bc38fd..2d4f851 100644 --- a/src/main/java/codechicken/translocators/tile/TileCraftingGrid.java +++ b/src/main/java/codechicken/translocators/tile/TileCraftingGrid.java @@ -10,6 +10,7 @@ import codechicken.lib.vec.Vector3; import codechicken.translocators.init.TranslocatorsModContent; import net.minecraft.core.BlockPos; +import net.minecraft.core.Holder; import net.minecraft.core.NonNullList; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.Connection; @@ -26,12 +27,13 @@ import net.minecraft.world.inventory.TransientCraftingContainer; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.CraftingRecipe; +import net.minecraft.world.item.crafting.RecipeHolder; import net.minecraft.world.item.crafting.RecipeType; import net.minecraft.world.level.GameRules; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.common.ForgeHooks; -import net.minecraftforge.event.ForgeEventFactory; +import net.neoforged.neoforge.common.CommonHooks; +import net.neoforged.neoforge.event.EventHooks; import java.util.Arrays; import java.util.Collections; @@ -155,9 +157,9 @@ private void updateResult() { CraftingContainer craftMatrix = getCraftMatrix(); for (int i = 0; i < 4; i++) { - Optional mresult = level.getRecipeManager().getRecipeFor(RecipeType.CRAFTING, craftMatrix, level); + Optional> mresult = level.getRecipeManager().getRecipeFor(RecipeType.CRAFTING, craftMatrix, level); if (mresult.isPresent()) { - result = mresult.get().assemble(craftMatrix, level.registryAccess()); + result = mresult.get().value().assemble(craftMatrix, level.registryAccess()); return; } @@ -179,11 +181,12 @@ public void craft(ServerPlayer player) { CraftingContainer craftMatrix = getCraftMatrix(); for (int i = 0; i < 4; i++) { - Optional mresult = level.getRecipeManager().getRecipeFor(RecipeType.CRAFTING, craftMatrix, level); + Optional> mresult = level.getRecipeManager().getRecipeFor(RecipeType.CRAFTING, craftMatrix, level); if (mresult.isPresent()) { - CraftingRecipe recipe = mresult.get(); - if (recipe.isSpecial() || !level.getGameRules().getBoolean(GameRules.RULE_LIMITED_CRAFTING) || player.getRecipeBook().contains(recipe)) { - doCraft(recipe, recipe.assemble(craftMatrix, level.registryAccess()), craftMatrix, player); + RecipeHolder holder = mresult.get(); + CraftingRecipe recipe = holder.value(); + if (recipe.isSpecial() || !level.getGameRules().getBoolean(GameRules.RULE_LIMITED_CRAFTING) || player.getRecipeBook().contains(holder)) { + doCraft(holder, recipe.assemble(craftMatrix, level.registryAccess()), craftMatrix, player); break; } } @@ -205,18 +208,21 @@ private CraftingContainer getCraftMatrix() { return craftMatrix; } - private void doCraft(CraftingRecipe recipe, ItemStack mresult, CraftingContainer craftMatrix, Player player) { + private void doCraft(RecipeHolder holder, ItemStack mresult, CraftingContainer craftMatrix, Player player) { giveOrDropItem(mresult, player); mresult.onCraftedBy(level, player, mresult.getCount()); - ForgeEventFactory.firePlayerCraftingEvent(player, mresult, craftMatrix); + EventHooks.firePlayerCraftingEvent(player, mresult, craftMatrix); + player.triggerRecipeCrafted(holder, craftMatrix.getItems()); + + CraftingRecipe recipe = holder.value(); if (!recipe.isSpecial()) { - player.awardRecipes(Collections.singleton(recipe)); + player.awardRecipes(Collections.singleton(holder)); } - ForgeHooks.setCraftingPlayer(player); + CommonHooks.setCraftingPlayer(player); NonNullList remaining = recipe.getRemainingItems(craftMatrix); - ForgeHooks.setCraftingPlayer(null); + CommonHooks.setCraftingPlayer(null); for (int i = 0; i < remaining.size(); i++) { ItemStack invStack = craftMatrix.getItem(i); diff --git a/src/main/resources/META-INF/accesstransformer.cfg b/src/main/resources/META-INF/accesstransformer.cfg index 4aff306..fe644cf 100644 --- a/src/main/resources/META-INF/accesstransformer.cfg +++ b/src/main/resources/META-INF/accesstransformer.cfg @@ -1,5 +1,5 @@ # Translocators Access Transformer -public net.minecraft.core.Direction f_122348_ # BY_3D_DATA +public net.minecraft.core.Direction BY_3D_DATA public net.minecraft.client.renderer.RenderStateShard * # Everything. public net.minecraft.client.renderer.RenderType *() # All Methods diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index fdf4740..73fec41 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -1,5 +1,5 @@ modLoader="javafml" -loaderVersion="[${lang_version},)" +loaderVersion="[2,)" issueTrackerURL="https://github.com/TheCBProject/Translocators" license="The MIT License (MIT)" @@ -16,26 +16,26 @@ Translocates stuff! Credits: MouseCop - Textures ''' [[dependencies.translocators]] - modId="forge" - mandatory=true + modId="neoforge" + type="required" versionRange="[${forge_version},)" ordering="NONE" side="BOTH" [[dependencies.translocators]] modId="minecraft" - mandatory=true - versionRange="[1.20.1]" + type="required" + versionRange="[1.20.4]" ordering="NONE" side="BOTH" [[dependencies.translocators]] modId="codechickenlib" - mandatory=true + type="required" versionRange="${ccl_version_range}" ordering="AFTER" side="BOTH" [[dependencies.translocators]] modId="cb_multipart" - mandatory=true + type="required" versionRange="${cbmp_version_range}" ordering="AFTER" side="BOTH"