diff --git a/.gitattributes b/.gitattributes index dfe0770..097f9f9 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,9 @@ -# Auto detect text files and perform LF normalization -* text=auto +# +# https://help.github.com/articles/dealing-with-line-endings/ +# +# Linux start script should use lf +/gradlew text eol=lf + +# These are Windows script files and should use crlf +*.bat text eol=crlf + diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e2fa68a..b01da52 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,29 +12,26 @@ jobs: matrix: # Use these Java versions java: [ - 17, # Current Java LTS & minimum supported by Minecraft + 21, # Current Java LTS ] - # and run on both Linux and Windows - os: [ubuntu-22.04, windows-2022] - runs-on: ${{ matrix.os }} + runs-on: ubuntu-22.04 steps: - name: checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: validate gradle wrapper - uses: gradle/wrapper-validation-action@v1 + uses: gradle/wrapper-validation-action@v2 - name: setup jdk ${{ matrix.java }} - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: ${{ matrix.java }} distribution: 'microsoft' - name: make gradle wrapper executable - if: ${{ runner.os != 'Windows' }} run: chmod +x ./gradlew - name: build run: ./gradlew build - name: capture build artifacts - if: ${{ runner.os == 'Linux' && matrix.java == '17' }} # Only upload artifacts built from latest java on one OS - uses: actions/upload-artifact@v3 + if: ${{ matrix.java == '21' }} # Only upload artifacts built from latest java + uses: actions/upload-artifact@v4 with: name: Artifacts - path: build/libs/ + path: build/libs/ \ No newline at end of file diff --git a/build.gradle b/build.gradle index 930f6e2..b52abf5 100644 --- a/build.gradle +++ b/build.gradle @@ -1,11 +1,15 @@ plugins { - id 'fabric-loom' version '1.1-SNAPSHOT' + id 'fabric-loom' version '1.7-SNAPSHOT' id 'maven-publish' } version = project.mod_version group = project.maven_group +base { + archivesName = project.archives_base_name +} + repositories { // Add repositories to retrieve artifacts from in here. // You should only use this when depending on other mods because @@ -14,29 +18,27 @@ repositories { // for more information about repositories. } +loom { + splitEnvironmentSourceSets() + + mods { + "modid" { + sourceSet sourceSets.main + sourceSet sourceSets.client + } + } + +} + dependencies { // To change the versions see the gradle.properties file minecraft "com.mojang:minecraft:${project.minecraft_version}" - //mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2" - mappings loom.layered { - //it.parchment("org.parchmentmc.data:parchment-1.19.3:2022.12.18@zip") - it.officialMojangMappings { - setNameSyntheticMembers(false) - } - } + mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2" modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" // Fabric API. This is technically optional, but you probably want it anyway. modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" - - // Uncomment the following line to enable the deprecated Fabric API modules. - // These are included in the Fabric API production distribution and allow you to update your mod to the latest modules at a later more convenient time. - - // modImplementation "net.fabricmc.fabric-api:fabric-api-deprecated:${project.fabric_version}" -} - -base { - archivesName = project.archives_base_name + } processResources { @@ -48,8 +50,7 @@ processResources { } tasks.withType(JavaCompile).configureEach { - // Minecraft 1.18 (1.18-pre2) upwards uses Java 17. - it.options.release = 17 + it.options.release = 21 } java { @@ -58,20 +59,21 @@ java { // If you remove this line, sources will not be generated. withSourcesJar() - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_21 + targetCompatibility = JavaVersion.VERSION_21 } jar { from("LICENSE") { - rename { "${it}_${base.archivesName.get()}"} + rename { "${it}_${project.base.archivesName.get()}"} } } // configure the maven publication publishing { publications { - mavenJava(MavenPublication) { + create("mavenJava", MavenPublication) { + artifactId = project.archives_base_name from components.java } } @@ -84,3 +86,7 @@ publishing { // retrieving dependencies. } } + +fabricApi { + configureDataGeneration() +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 3901ea2..eafc759 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,14 +4,14 @@ org.gradle.parallel=true # Fabric Properties # check these on https://fabricmc.net/develop -minecraft_version=1.20.4 -yarn_mappings=1.20.4+build.2 -loader_version=0.15.1 +minecraft_version=1.21.1 +yarn_mappings=1.21.1+build.3 +loader_version=0.16.2 # Mod Properties -mod_version = 0.2.1-1.20.x -maven_group = me.jonasjones -archives_base_name = not-enough-cursedness +mod_version=0.2.1-1.21.x +maven_group=me.jonasjones +archives_base_name=not-enough-cursedness # Dependencies -fabric_version=0.91.2+1.20.4 +fabric_version=0.102.1+1.21.1 \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index ccebba7..a4b76b9 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 fc10b60..9355b41 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.0.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 79a61d4..f5feea6 100755 --- a/gradlew +++ b/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -55,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -83,10 +85,9 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -# 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"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -133,10 +134,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. @@ -144,7 +148,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 @@ -152,7 +156,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 @@ -197,11 +201,15 @@ if "$cygwin" || "$msys" ; then done fi -# 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. + +# 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, 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..9d21a21 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## @@ -43,11 +45,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 +59,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 b02216b..75c4d72 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,10 +1,10 @@ pluginManagement { - repositories { - maven { - name = 'Fabric' - url = 'https://maven.fabricmc.net/' - } - mavenCentral() - gradlePluginPortal() - } -} + repositories { + maven { + name = 'Fabric' + url = 'https://maven.fabricmc.net/' + } + mavenCentral() + gradlePluginPortal() + } +} \ No newline at end of file diff --git a/src/main/java/me/jonasjones/nec/NotEnoughCursedness.java b/src/main/java/me/jonasjones/nec/NotEnoughCursedness.java index 5850795..90616f2 100644 --- a/src/main/java/me/jonasjones/nec/NotEnoughCursedness.java +++ b/src/main/java/me/jonasjones/nec/NotEnoughCursedness.java @@ -4,25 +4,9 @@ import me.jonasjones.nec.block.ModBlocks; import me.jonasjones.nec.item.ModItems; import me.jonasjones.nec.util.ModRegistries; import net.fabricmc.api.ModInitializer; -import net.fabricmc.fabric.api.itemgroup.v1.FabricItemGroup; -import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents; -import net.fabricmc.fabric.impl.itemgroup.FabricItemGroupBuilderImpl; -import net.minecraft.Util; -import net.minecraft.core.Registry; -import net.minecraft.core.registries.BuiltInRegistries; -import net.minecraft.core.registries.Registries; -import net.minecraft.network.chat.Component; -import net.minecraft.resources.ResourceKey; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.Util.*; -import net.minecraft.world.item.CreativeModeTab; -import net.minecraft.world.item.CreativeModeTabs; -import net.minecraft.world.item.ItemStack; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import static net.fabricmc.fabric.api.client.model.loading.v1.ModelLoadingPlugin.register; - public class NotEnoughCursedness implements ModInitializer { // This logger is used to write text to the console and the log file. // It is considered best practice to use your mod id as the logger's name. diff --git a/src/main/java/me/jonasjones/nec/block/ModBlocks.java b/src/main/java/me/jonasjones/nec/block/ModBlocks.java index 0a5dd91..b778596 100644 --- a/src/main/java/me/jonasjones/nec/block/ModBlocks.java +++ b/src/main/java/me/jonasjones/nec/block/ModBlocks.java @@ -1,19 +1,22 @@ package me.jonasjones.nec.block; import me.jonasjones.nec.util.ModRegistries; -import net.fabricmc.fabric.api.item.v1.FabricItemSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; -import net.minecraft.core.Registry; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.item.BlockItem; -import net.minecraft.world.level.block.*; +import net.minecraft.block.Block; +import net.minecraft.block.Blocks; +import net.minecraft.block.PillarBlock; +import net.minecraft.block.StairsBlock; +import net.minecraft.item.BlockItem; +import net.minecraft.item.Item; +import net.minecraft.registry.Registry; +import net.minecraft.util.Identifier; import static me.jonasjones.nec.NotEnoughCursedness.MOD_ID; -import static net.minecraft.core.registries.BuiltInRegistries.BLOCK; -import static net.minecraft.core.registries.BuiltInRegistries.ITEM; +import static net.minecraft.registry.Registries.BLOCK; +import static net.minecraft.registry.Registries.ITEM; public class ModBlocks { - public static final Block GREEN_BIRCH_LOG = new RotatedPillarBlock(FabricBlockSettings.copyOf(Blocks.BIRCH_LOG).strength(4.0f)); + public static final Block GREEN_BIRCH_LOG = new PillarBlock(FabricBlockSettings.copyOf(Blocks.BIRCH_LOG).strength(4.0f)); public static final Block BLAZE_BLOCK = new Block(FabricBlockSettings.copyOf(Blocks.DIAMOND_BLOCK).strength(4.0F)); public static final Block GUN_BLOCK = new Block(FabricBlockSettings.copyOf(Blocks.DIAMOND_BLOCK).strength(4.0F)); public static final Block DIAMOND_ORE_ORE = new Block(FabricBlockSettings.copyOf(Blocks.DIAMOND_ORE).strength(4.0F)); @@ -42,37 +45,37 @@ public class ModBlocks { //public static final Block STRIPPED_GREEN_BIRCH_WOOD = new PillarBlock(FabricBlockSettings.of(Material.WOOD).strength(4.0f)); public static void register() { - BLAZE_BLOCK_BLOCK = Registry.register(BLOCK, new ResourceLocation(MOD_ID, "blaze_block"), BLAZE_BLOCK); - BLAZE_BLOCK_ITEM = Registry.register(ITEM, new ResourceLocation(MOD_ID, "blaze_block"), new BlockItem(BLAZE_BLOCK, new FabricItemSettings())); + BLAZE_BLOCK_BLOCK = Registry.register(BLOCK, Identifier.of(MOD_ID, "blaze_block"), BLAZE_BLOCK); + BLAZE_BLOCK_ITEM = Registry.register(ITEM, Identifier.of(MOD_ID, "blaze_block"), new BlockItem(BLAZE_BLOCK, new Item.Settings())); ModRegistries.register_item(BLAZE_BLOCK_ITEM); - GREEEN_BIRCH_LOG_BLOCK = Registry.register(BLOCK, new ResourceLocation(MOD_ID, "green_birch_log"), GREEN_BIRCH_LOG); - GREEN_BIRCH_LOG_ITEM = Registry.register(ITEM, new ResourceLocation(MOD_ID, "green_birch_log"), new BlockItem(GREEN_BIRCH_LOG, new FabricItemSettings())); + GREEEN_BIRCH_LOG_BLOCK = Registry.register(BLOCK, Identifier.of(MOD_ID, "green_birch_log"), GREEN_BIRCH_LOG); + GREEN_BIRCH_LOG_ITEM = Registry.register(ITEM, Identifier.of(MOD_ID, "green_birch_log"), new BlockItem(GREEN_BIRCH_LOG, new Item.Settings())); ModRegistries.register_item(GREEN_BIRCH_LOG_ITEM); - GUN_BLOCK_BLOCK = Registry.register(BLOCK, new ResourceLocation(MOD_ID, "gun_block"), GUN_BLOCK); - GUN_BLOCK_ITEM = Registry.register(ITEM, new ResourceLocation(MOD_ID, "gun_block"), new BlockItem(GUN_BLOCK, new FabricItemSettings())); + GUN_BLOCK_BLOCK = Registry.register(BLOCK, Identifier.of(MOD_ID, "gun_block"), GUN_BLOCK); + GUN_BLOCK_ITEM = Registry.register(ITEM, Identifier.of(MOD_ID, "gun_block"), new BlockItem(GUN_BLOCK, new Item.Settings())); ModRegistries.register_item(GUN_BLOCK_ITEM); - DIAMOND_ORE_ORE_BLOCK = Registry.register(BLOCK, new ResourceLocation(MOD_ID, "diamond_ore_ore"), DIAMOND_ORE_ORE); - DIAMOND_ORE_ORE_ITEM = Registry.register(ITEM, new ResourceLocation(MOD_ID, "diamond_ore_ore"), new BlockItem(DIAMOND_ORE_ORE, new FabricItemSettings())); + DIAMOND_ORE_ORE_BLOCK = Registry.register(BLOCK, Identifier.of(MOD_ID, "diamond_ore_ore"), DIAMOND_ORE_ORE); + DIAMOND_ORE_ORE_ITEM = Registry.register(ITEM, Identifier.of(MOD_ID, "diamond_ore_ore"), new BlockItem(DIAMOND_ORE_ORE, new Item.Settings())); ModRegistries.register_item(DIAMOND_ORE_ORE_ITEM); - DEEPSLATE_DIAMOND_ORE_ORE_BLOCK = Registry.register(BLOCK, new ResourceLocation(MOD_ID, "deepslate_diamond_ore_ore"), DEEPSLATE_DIAMOND_ORE_ORE); - DEEPSLATE_DIAMOND_ORE_ORE_ITEM = Registry.register(ITEM, new ResourceLocation(MOD_ID, "deepslate_diamond_ore_ore"), new BlockItem(DEEPSLATE_DIAMOND_ORE_ORE, new FabricItemSettings())); + DEEPSLATE_DIAMOND_ORE_ORE_BLOCK = Registry.register(BLOCK, Identifier.of(MOD_ID, "deepslate_diamond_ore_ore"), DEEPSLATE_DIAMOND_ORE_ORE); + DEEPSLATE_DIAMOND_ORE_ORE_ITEM = Registry.register(ITEM, Identifier.of(MOD_ID, "deepslate_diamond_ore_ore"), new BlockItem(DEEPSLATE_DIAMOND_ORE_ORE, new Item.Settings())); ModRegistries.register_item(DEEPSLATE_DIAMOND_ORE_ORE_ITEM); - JAVA_BLOCK_BLOCK = Registry.register(BLOCK, new ResourceLocation(MOD_ID, "java_block"), JAVA_BLOCK); - JAVA_BLOCK_ITEM = Registry.register(ITEM, new ResourceLocation(MOD_ID, "java_block"), new BlockItem(JAVA_BLOCK, new FabricItemSettings())); + JAVA_BLOCK_BLOCK = Registry.register(BLOCK, Identifier.of(MOD_ID, "java_block"), JAVA_BLOCK); + JAVA_BLOCK_ITEM = Registry.register(ITEM, Identifier.of(MOD_ID, "java_block"), new BlockItem(JAVA_BLOCK, new Item.Settings())); ModRegistries.register_item(JAVA_BLOCK_ITEM); - POCKET_BLOCK_BLOCK = Registry.register(BLOCK, new ResourceLocation(MOD_ID, "pocket_block"), POCKET_BLOCK); - POCKET_BLOCK_ITEM = Registry.register(ITEM, new ResourceLocation(MOD_ID, "pocket_block"), new BlockItem(POCKET_BLOCK, new FabricItemSettings())); + POCKET_BLOCK_BLOCK = Registry.register(BLOCK, Identifier.of(MOD_ID, "pocket_block"), POCKET_BLOCK); + POCKET_BLOCK_ITEM = Registry.register(ITEM, Identifier.of(MOD_ID, "pocket_block"), new BlockItem(POCKET_BLOCK, new Item.Settings())); ModRegistries.register_item(POCKET_BLOCK_ITEM); - FLETCHING_STAIRS_BLOCK = new StairBlock(GREEEN_BIRCH_LOG_BLOCK.defaultBlockState(), FabricBlockSettings.copyOf(Blocks.OAK_STAIRS).strength(1.0F)); - FLETCHING_STAIRS_BLOCK_BLOCK = Registry.register(BLOCK, new ResourceLocation(MOD_ID, "fletching_stairs"), FLETCHING_STAIRS_BLOCK); - FLETCHING_STAIRS_TIEM = Registry.register(ITEM, new ResourceLocation(MOD_ID, "fletching_stairs"), new BlockItem(FLETCHING_STAIRS_BLOCK, new FabricItemSettings())); + FLETCHING_STAIRS_BLOCK = new StairsBlock(GREEEN_BIRCH_LOG_BLOCK.getDefaultState(), FabricBlockSettings.copyOf(Blocks.OAK_STAIRS).strength(1.0F)); + FLETCHING_STAIRS_BLOCK_BLOCK = Registry.register(BLOCK, Identifier.of(MOD_ID, "fletching_stairs"), FLETCHING_STAIRS_BLOCK); + FLETCHING_STAIRS_TIEM = Registry.register(ITEM, Identifier.of(MOD_ID, "fletching_stairs"), new BlockItem(FLETCHING_STAIRS_BLOCK, new Item.Settings())); ModRegistries.register_item(FLETCHING_STAIRS_TIEM); } } diff --git a/src/main/java/me/jonasjones/nec/datagen/NecDataGen.java.broken b/src/main/java/me/jonasjones/nec/datagen/NecDataGen.java.broken new file mode 100644 index 0000000..ec592ee --- /dev/null +++ b/src/main/java/me/jonasjones/nec/datagen/NecDataGen.java.broken @@ -0,0 +1,79 @@ +package me.jonasjones.nec.datagen; + +import net.fabricmc.fabric.api.datagen.v1.DataGeneratorEntrypoint; +import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator; +import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; +import net.fabricmc.fabric.api.datagen.v1.provider.FabricAdvancementProvider; +import net.minecraft.advancement.*; + +import java.util.concurrent.CompletableFuture; +import java.util.function.Consumer; +import net.minecraft.advancement.criterion.ConsumeItemCriterion; +import net.minecraft.advancement.criterion.InventoryChangedCriterion; +import net.minecraft.item.Items; +import net.minecraft.registry.RegistryWrapper; +import net.minecraft.text.Text; +import net.minecraft.util.Identifier; + +public class NecDataGen implements DataGeneratorEntrypoint { + @Override + public void onInitializeDataGenerator(FabricDataGenerator fabricDataGenerator) { + FabricDataGenerator.Pack pack = fabricDataGenerator.createPack(); + + pack.addProvider(AdvancementsProvider::new); + } + + static class AdvancementsProvider extends FabricAdvancementProvider { + protected AdvancementsProvider(FabricDataOutput output, CompletableFuture registryLookup) { + super(output, registryLookup); + } + + @Override + public void generateAdvancement(RegistryWrapper.WrapperLookup registryLookup, Consumer consumer) { + AdvancementEntry rootAdvancement = Advancement.Builder.create() + .display( + Items.DIRT, // The display icon + Text.literal("Your First Dirt Block"), // The title + Text.literal("Now make a three by three"), // The description + new Identifier("textures/gui/advancements/backgrounds/adventure.png"), // Background image used + AdvancementFrame.TASK, // Options: TASK, CHALLENGE, GOAL + true, // Show toast top right + true, // Announce to chat + false // Hidden in the advancement tab + ) + // The first string used in criterion is the name referenced by other advancements when they want to have 'requirements' + .criterion("got_dirt", InventoryChangedCriterion.Conditions.items(Items.DIRT)) + .build(consumer, "your_mod_id_please_change_me" + "/root"); + + AdvancementEntry gotOakAdvancement = Advancement.Builder.create().parent(rootAdvancement) + .display( + Items.OAK_LOG, + Text.literal("Your First Log"), + Text.literal("Bare fisted"), + null, // children to parent advancements don't need a background set + AdvancementFrame.TASK, + true, + true, + false + ) + .rewards(AdvancementRewards.Builder.experience(1000)) + .criterion("got_wood", InventoryChangedCriterion.Conditions.items(Items.OAK_LOG)) + .build(consumer, "your_mod_id_please_change_me" + "/got_wood"); + + AdvancementEntry eatAppleAdvancement = Advancement.Builder.create().parent(rootAdvancement) + .display( + Items.APPLE, + Text.literal("Apple and Beef"), + Text.literal("Ate an apple and beef"), + null, // children to parent advancements don't need a background set + AdvancementFrame.CHALLENGE, + true, + true, + false + ) + .criterion("ate_apple", ConsumeItemCriterion.Conditions.item(Items.APPLE)) + .criterion("ate_cooked_beef", ConsumeItemCriterion.Conditions.item(Items.COOKED_BEEF)) + .build(consumer, "your_mod_id_please_change_me" + "/ate_apple_and_beef"); + } + } +} \ No newline at end of file diff --git a/src/main/java/me/jonasjones/nec/item/ModItems.java b/src/main/java/me/jonasjones/nec/item/ModItems.java index c477520..d5be030 100644 --- a/src/main/java/me/jonasjones/nec/item/ModItems.java +++ b/src/main/java/me/jonasjones/nec/item/ModItems.java @@ -2,19 +2,17 @@ package me.jonasjones.nec.item; import me.jonasjones.nec.item.materials.DirtToolMaterial; import me.jonasjones.nec.util.ModRegistries; -import net.fabricmc.fabric.api.item.v1.FabricItemSettings; -import net.minecraft.core.Registry; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.item.Item; -import net.minecraft.world.item.SwordItem; -import net.minecraft.world.item.TieredItem; -import static net.minecraft.core.registries.BuiltInRegistries.ITEM; +import net.minecraft.item.Item; +import net.minecraft.item.SwordItem; +import net.minecraft.registry.Registry; +import net.minecraft.util.Identifier; import static me.jonasjones.nec.NotEnoughCursedness.MOD_ID; +import static net.minecraft.registry.Registries.ITEM; public class ModItems { public static Item STEEL_ITEM; - public static TieredItem DIRT_SWORD_ITEM; + public static SwordItem DIRT_SWORD_ITEM; public static Item NEGATIVE_FLINT_ITEM; public static Item LETTER_ITEM; public static Item CHAINMAIL_ITEM; @@ -22,32 +20,32 @@ public class ModItems { public static Item HELMET_ON_A_STICK_ITEM; public static void register() { - TieredItem DIRT_SWORD = new SwordItem(DirtToolMaterial.INSTANCE, 1, -3.0F, new Item.Properties()); - DIRT_SWORD_ITEM = Registry.register(ITEM, new ResourceLocation(MOD_ID, "dirt_sword"), DIRT_SWORD); - ModRegistries.register_item(DIRT_SWORD_ITEM); + SwordItem DIRT_SWORD = new SwordItem(DirtToolMaterial.INSTANCE, new Item.Settings()); + DIRT_SWORD_ITEM = Registry.register(ITEM, Identifier.of(MOD_ID, "dirt_sword"), DIRT_SWORD); + //ModRegistries.register_item(DIRT_SWORD_ITEM); - Item STEEL = new Item(new FabricItemSettings()); - STEEL_ITEM = Registry.register(ITEM, new ResourceLocation(MOD_ID, "steel"), STEEL); - ModRegistries.register_item(STEEL_ITEM); + Item STEEL = new Item(new Item.Settings()); + STEEL_ITEM = Registry.register(ITEM, Identifier.of(MOD_ID, "steel"), STEEL); + //ModRegistries.register_item(STEEL_ITEM); - Item NEGATIVE_FLINT = new Item(new FabricItemSettings()); - NEGATIVE_FLINT_ITEM = Registry.register(ITEM, new ResourceLocation(MOD_ID, "negative_flint"), NEGATIVE_FLINT); - ModRegistries.register_item(NEGATIVE_FLINT_ITEM); + Item NEGATIVE_FLINT = new Item(new Item.Settings()); + NEGATIVE_FLINT_ITEM = Registry.register(ITEM, Identifier.of(MOD_ID, "negative_flint"), NEGATIVE_FLINT); + //ModRegistries.register_item(NEGATIVE_FLINT_ITEM); - Item LETTER = new Item(new FabricItemSettings()); - LETTER_ITEM = Registry.register(ITEM, new ResourceLocation(MOD_ID, "letter"), LETTER); - ModRegistries.register_item(LETTER_ITEM); + Item LETTER = new Item(new Item.Settings()); + LETTER_ITEM = Registry.register(ITEM, Identifier.of(MOD_ID, "letter"), LETTER); + //ModRegistries.register_item(LETTER_ITEM); - Item CHAINMAIL = new Item(new FabricItemSettings()); - CHAINMAIL_ITEM = Registry.register(ITEM, new ResourceLocation(MOD_ID, "chainmail"), CHAINMAIL); - ModRegistries.register_item(CHAINMAIL_ITEM); + Item CHAINMAIL = new Item(new Item.Settings()); + CHAINMAIL_ITEM = Registry.register(ITEM, Identifier.of(MOD_ID, "chainmail"), CHAINMAIL); + //ModRegistries.register_item(CHAINMAIL_ITEM); - Item AK47 = new Item(new FabricItemSettings()); - AK47_ITEM = Registry.register(ITEM, new ResourceLocation(MOD_ID, "ak_47"), AK47); - ModRegistries.register_item(AK47_ITEM); + Item AK47 = new Item(new Item.Settings()); + AK47_ITEM = Registry.register(ITEM, Identifier.of(MOD_ID, "ak_47"), AK47); + //ModRegistries.register_item(AK47_ITEM); - Item HELMET_ON_A_STICK = new Item(new FabricItemSettings()); - HELMET_ON_A_STICK_ITEM = Registry.register(ITEM, new ResourceLocation(MOD_ID, "helmet_on_a_stick"), HELMET_ON_A_STICK); - ModRegistries.register_item(HELMET_ON_A_STICK_ITEM); + Item HELMET_ON_A_STICK = new Item(new Item.Settings()); + HELMET_ON_A_STICK_ITEM = Registry.register(ITEM, Identifier.of(MOD_ID, "helmet_on_a_stick"), HELMET_ON_A_STICK); + //ModRegistries.register_item(HELMET_ON_A_STICK_ITEM); } } diff --git a/src/main/java/me/jonasjones/nec/item/materials/DirtToolMaterial.java b/src/main/java/me/jonasjones/nec/item/materials/DirtToolMaterial.java index b8bd16c..d0db437 100644 --- a/src/main/java/me/jonasjones/nec/item/materials/DirtToolMaterial.java +++ b/src/main/java/me/jonasjones/nec/item/materials/DirtToolMaterial.java @@ -1,41 +1,43 @@ package me.jonasjones.nec.item.materials; -import net.minecraft.world.item.Items; -import net.minecraft.world.item.Tier; -import net.minecraft.world.item.crafting.Ingredient; +import net.minecraft.block.Block; +import net.minecraft.item.Items; +import net.minecraft.item.ToolMaterial; +import net.minecraft.recipe.Ingredient; +import net.minecraft.registry.tag.TagKey; -public class DirtToolMaterial implements Tier { +public class DirtToolMaterial implements ToolMaterial { public static final DirtToolMaterial INSTANCE = new DirtToolMaterial(); @Override - public int getUses() { + public int getDurability() { return 5; } @Override - public float getSpeed() { + public float getMiningSpeedMultiplier() { return 1; } @Override - public float getAttackDamageBonus() { + public float getAttackDamage() { return 2; } @Override - public int getLevel() { - return 0; + public TagKey getInverseTag() { + return null; } @Override - public int getEnchantmentValue() { + public int getEnchantability() { return 100; } @Override public Ingredient getRepairIngredient() { - return Ingredient.of(Items.DIRT, Items.COARSE_DIRT, Items.DIRT_PATH, Items.ROOTED_DIRT); + return Ingredient.ofItems(Items.DIRT, Items.COARSE_DIRT, Items.DIRT_PATH, Items.ROOTED_DIRT); } } \ No newline at end of file diff --git a/src/main/java/me/jonasjones/nec/mixin/ExampleMixin.java b/src/main/java/me/jonasjones/nec/mixin/ExampleMixin.java deleted file mode 100644 index 19bed5e..0000000 --- a/src/main/java/me/jonasjones/nec/mixin/ExampleMixin.java +++ /dev/null @@ -1,16 +0,0 @@ -package me.jonasjones.nec.mixin; - -import me.jonasjones.nec.NotEnoughCursedness; -import net.minecraft.client.gui.screens.TitleScreen; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -@Mixin(TitleScreen.class) -public class ExampleMixin { - @Inject(at = @At("HEAD"), method = "init()V") - private void init(CallbackInfo info) { - //NotEnoughCursedness.LOGGER.info("This line is printed by an example mod mixin!"); - } -} diff --git a/src/main/java/me/jonasjones/nec/util/ModRegistries.java b/src/main/java/me/jonasjones/nec/util/ModRegistries.java index 3b895ee..5151707 100644 --- a/src/main/java/me/jonasjones/nec/util/ModRegistries.java +++ b/src/main/java/me/jonasjones/nec/util/ModRegistries.java @@ -3,24 +3,21 @@ package me.jonasjones.nec.util; import me.jonasjones.nec.block.ModBlocks; import me.jonasjones.nec.item.ModItems; import net.fabricmc.fabric.api.itemgroup.v1.FabricItemGroup; -import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents; import net.fabricmc.fabric.api.registry.FlammableBlockRegistry; import net.fabricmc.fabric.api.registry.FuelRegistry; import net.fabricmc.fabric.api.registry.StrippableBlockRegistry; -import net.minecraft.core.Registry; -import net.minecraft.core.registries.BuiltInRegistries; -import net.minecraft.network.chat.Component; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.item.CreativeModeTab; -import net.minecraft.world.item.CreativeModeTabs; -import net.minecraft.world.item.Item; -import net.minecraft.world.item.ItemStack; +import net.minecraft.item.BlockItem; +import net.minecraft.item.ItemGroup; +import net.minecraft.item.ItemStack; +import net.minecraft.registry.Registries; +import net.minecraft.registry.Registry; +import net.minecraft.text.Text; +import net.minecraft.util.Identifier; import static me.jonasjones.nec.NotEnoughCursedness.MOD_ID; public class ModRegistries { - public static CreativeModeTab ITEM_GROUP = FabricItemGroup.builder().title(Component.translatable("itemGroup.nec.not_enough_cursedness")).icon(() -> new ItemStack(ModBlocks.GREEN_BIRCH_LOG_ITEM)).build(); - + public static ItemGroup NEC_GROUP = null; public static void registerModStuffs() { registerFuels(); @@ -57,38 +54,37 @@ public class ModRegistries { //ServerPlayerEvents.COPY_FROM.register(new ModPlayerEventCopyFrom()); } - public static void register_item(Item CUSTOM_ITEM) { + public static void register_item(BlockItem CUSTOM_ITEM) { //ItemGroupEvents.modifyEntriesEvent(ITEM_GROUP).register(content -> { // content.add(CUSTOM_ITEM); //}); } public static void register_itemGroup() { + NEC_GROUP = FabricItemGroup.builder() + .icon(() -> new ItemStack(ModItems.DIRT_SWORD_ITEM)) + .displayName(Text.translatable("itemGroup.nec.not_enough_cursedness")) + .entries(((displayContext, entries) -> { + entries.add(new ItemStack(ModBlocks.GREEN_BIRCH_LOG_ITEM)); + entries.add(new ItemStack(ModBlocks.BLAZE_BLOCK)); + entries.add(new ItemStack(ModBlocks.GUN_BLOCK)); + entries.add(new ItemStack(ModBlocks.DIAMOND_ORE_ORE)); + entries.add(new ItemStack(ModBlocks.DEEPSLATE_DIAMOND_ORE_ORE)); + entries.add(new ItemStack(ModBlocks.JAVA_BLOCK)); + entries.add(new ItemStack(ModBlocks.POCKET_BLOCK)); + entries.add(new ItemStack(ModBlocks.FLETCHING_STAIRS_BLOCK)); - ItemGroupEvents.modifyEntriesEvent(CreativeModeTabs.BUILDING_BLOCKS).register(content -> { - content.accept(new ItemStack(ModBlocks.GREEN_BIRCH_LOG_ITEM)); - content.accept(new ItemStack(ModBlocks.BLAZE_BLOCK)); - content.accept(new ItemStack(ModBlocks.GUN_BLOCK)); - content.accept(new ItemStack(ModBlocks.DIAMOND_ORE_ORE)); - content.accept(new ItemStack(ModBlocks.DEEPSLATE_DIAMOND_ORE_ORE)); - content.accept(new ItemStack(ModBlocks.JAVA_BLOCK)); - content.accept(new ItemStack(ModBlocks.POCKET_BLOCK)); - content.accept(new ItemStack(ModBlocks.FLETCHING_STAIRS_BLOCK)); - }); + entries.add(new ItemStack(ModItems.STEEL_ITEM)); + entries.add(new ItemStack(ModItems.NEGATIVE_FLINT_ITEM)); + entries.add(new ItemStack(ModItems.LETTER_ITEM)); + entries.add(new ItemStack(ModItems.CHAINMAIL_ITEM)); - ItemGroupEvents.modifyEntriesEvent(CreativeModeTabs.INGREDIENTS).register(content -> { - content.accept(new ItemStack(ModItems.STEEL_ITEM)); - content.accept(new ItemStack(ModItems.NEGATIVE_FLINT_ITEM)); - content.accept(new ItemStack(ModItems.LETTER_ITEM)); - content.accept(new ItemStack(ModItems.CHAINMAIL_ITEM)); - }); + entries.add(new ItemStack(ModItems.DIRT_SWORD_ITEM)); + entries.add(new ItemStack(ModItems.AK47_ITEM)); + entries.add(new ItemStack(ModItems.HELMET_ON_A_STICK_ITEM)); + })) + .build(); - ItemGroupEvents.modifyEntriesEvent(CreativeModeTabs.COMBAT).register(content -> { - content.accept(new ItemStack(ModItems.DIRT_SWORD_ITEM)); - content.accept(new ItemStack(ModItems.AK47_ITEM)); - content.accept(new ItemStack(ModItems.HELMET_ON_A_STICK_ITEM)); - }); - - ITEM_GROUP = Registry.register(BuiltInRegistries.CREATIVE_MODE_TAB, new ResourceLocation(MOD_ID, "nec"), ITEM_GROUP); + Registry.register(Registries.ITEM_GROUP, Identifier.of(MOD_ID, "nec"), NEC_GROUP); } } diff --git a/src/main/resources/data/nec/advancements/ak47.json b/src/main/resources/data/nec/advancement/ak47.json similarity index 100% rename from src/main/resources/data/nec/advancements/ak47.json rename to src/main/resources/data/nec/advancement/ak47.json diff --git a/src/main/resources/data/nec/advancements/bedrock.json b/src/main/resources/data/nec/advancement/bedrock.json similarity index 100% rename from src/main/resources/data/nec/advancements/bedrock.json rename to src/main/resources/data/nec/advancement/bedrock.json diff --git a/src/main/resources/data/nec/advancements/dirt_sword.json b/src/main/resources/data/nec/advancement/dirt_sword.json similarity index 100% rename from src/main/resources/data/nec/advancements/dirt_sword.json rename to src/main/resources/data/nec/advancement/dirt_sword.json diff --git a/src/main/resources/data/nec/advancements/fletching_stairs.json b/src/main/resources/data/nec/advancement/fletching_stairs.json similarity index 100% rename from src/main/resources/data/nec/advancements/fletching_stairs.json rename to src/main/resources/data/nec/advancement/fletching_stairs.json diff --git a/src/main/resources/data/nec/advancements/java_block.json b/src/main/resources/data/nec/advancement/java_block.json similarity index 100% rename from src/main/resources/data/nec/advancements/java_block.json rename to src/main/resources/data/nec/advancement/java_block.json diff --git a/src/main/resources/data/nec/advancements/nec.json b/src/main/resources/data/nec/advancement/nec.json similarity index 100% rename from src/main/resources/data/nec/advancements/nec.json rename to src/main/resources/data/nec/advancement/nec.json diff --git a/src/main/resources/data/nec/advancements/pocket_block.json b/src/main/resources/data/nec/advancement/pocket_block.json similarity index 100% rename from src/main/resources/data/nec/advancements/pocket_block.json rename to src/main/resources/data/nec/advancement/pocket_block.json diff --git a/src/main/resources/data/nec/recipe/ak_47.json b/src/main/resources/data/nec/recipe/ak_47.json new file mode 100644 index 0000000..5de0607 --- /dev/null +++ b/src/main/resources/data/nec/recipe/ak_47.json @@ -0,0 +1,14 @@ +{ + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { + "item": "minecraft:bow" + }, + { + "item": "minecraft:iron_ingot" + } + ], + "result": { + "id": "nec:ak_47" + } +} \ No newline at end of file diff --git a/src/main/resources/data/nec/recipes/bedrock.json b/src/main/resources/data/nec/recipe/bedrock.json similarity index 84% rename from src/main/resources/data/nec/recipes/bedrock.json rename to src/main/resources/data/nec/recipe/bedrock.json index 6b9ffc0..cd37a5f 100644 --- a/src/main/resources/data/nec/recipes/bedrock.json +++ b/src/main/resources/data/nec/recipe/bedrock.json @@ -9,6 +9,6 @@ } ], "result": { - "item": "minecraft:bedrock" + "id": "minecraft:bedrock" } } diff --git a/src/main/resources/data/nec/recipes/blaze_block.json b/src/main/resources/data/nec/recipe/blaze_block.json similarity index 88% rename from src/main/resources/data/nec/recipes/blaze_block.json rename to src/main/resources/data/nec/recipe/blaze_block.json index b7c9bac..2c1fc93 100644 --- a/src/main/resources/data/nec/recipes/blaze_block.json +++ b/src/main/resources/data/nec/recipe/blaze_block.json @@ -12,7 +12,7 @@ "###" ], "result": { - "item": "nec:blaze_block" + "id": "nec:blaze_block" }, "show_notification": true } \ No newline at end of file diff --git a/src/main/resources/data/nec/recipes/blaze_rod.json b/src/main/resources/data/nec/recipe/blaze_rod.json similarity index 79% rename from src/main/resources/data/nec/recipes/blaze_rod.json rename to src/main/resources/data/nec/recipe/blaze_rod.json index 49a2931..9a7d5fb 100644 --- a/src/main/resources/data/nec/recipes/blaze_rod.json +++ b/src/main/resources/data/nec/recipe/blaze_rod.json @@ -6,7 +6,7 @@ } ], "result": { - "item": "minecraft:blaze_powder", + "id": "minecraft:blaze_powder", "count": 9 } } diff --git a/src/main/resources/data/nec/recipes/chainmail.json b/src/main/resources/data/nec/recipe/chainmail.json similarity index 86% rename from src/main/resources/data/nec/recipes/chainmail.json rename to src/main/resources/data/nec/recipe/chainmail.json index 594e020..f442e20 100644 --- a/src/main/resources/data/nec/recipes/chainmail.json +++ b/src/main/resources/data/nec/recipe/chainmail.json @@ -9,7 +9,7 @@ } ], "result": { - "item": "nec:chainmail", + "id": "nec:chainmail", "count": 1 } } diff --git a/src/main/resources/data/nec/recipes/chainmail_boots.json b/src/main/resources/data/nec/recipe/chainmail_boots.json similarity index 81% rename from src/main/resources/data/nec/recipes/chainmail_boots.json rename to src/main/resources/data/nec/recipe/chainmail_boots.json index a923450..b2ac1bb 100644 --- a/src/main/resources/data/nec/recipes/chainmail_boots.json +++ b/src/main/resources/data/nec/recipe/chainmail_boots.json @@ -11,6 +11,6 @@ } }, "result": { - "item": "minecraft:chainmail_boots" + "id": "minecraft:chainmail_boots" } } \ No newline at end of file diff --git a/src/main/resources/data/nec/recipes/chainmail_chestplate.json b/src/main/resources/data/nec/recipe/chainmail_chestplate.json similarity index 79% rename from src/main/resources/data/nec/recipes/chainmail_chestplate.json rename to src/main/resources/data/nec/recipe/chainmail_chestplate.json index 72586cb..01f9ee2 100644 --- a/src/main/resources/data/nec/recipes/chainmail_chestplate.json +++ b/src/main/resources/data/nec/recipe/chainmail_chestplate.json @@ -11,6 +11,6 @@ } }, "result": { - "item": "minecraft:chainmail_chestplate" + "id": "minecraft:chainmail_chestplate" } } \ No newline at end of file diff --git a/src/main/resources/data/nec/recipes/chainmail_helmet.json b/src/main/resources/data/nec/recipe/chainmail_helmet.json similarity index 81% rename from src/main/resources/data/nec/recipes/chainmail_helmet.json rename to src/main/resources/data/nec/recipe/chainmail_helmet.json index 9d147e2..2611e95 100644 --- a/src/main/resources/data/nec/recipes/chainmail_helmet.json +++ b/src/main/resources/data/nec/recipe/chainmail_helmet.json @@ -11,6 +11,6 @@ } }, "result": { - "item": "minecraft:chainmail_helmet" + "id": "minecraft:chainmail_helmet" } } \ No newline at end of file diff --git a/src/main/resources/data/nec/recipes/chainmail_leggings.json b/src/main/resources/data/nec/recipe/chainmail_leggings.json similarity index 80% rename from src/main/resources/data/nec/recipes/chainmail_leggings.json rename to src/main/resources/data/nec/recipe/chainmail_leggings.json index bfa08e7..d9a411f 100644 --- a/src/main/resources/data/nec/recipes/chainmail_leggings.json +++ b/src/main/resources/data/nec/recipe/chainmail_leggings.json @@ -11,6 +11,6 @@ } }, "result": { - "item": "minecraft:chainmail_leggings" + "id": "minecraft:chainmail_leggings" } } \ No newline at end of file diff --git a/src/main/resources/data/nec/recipes/crossbow.json b/src/main/resources/data/nec/recipe/crossbow.json similarity index 89% rename from src/main/resources/data/nec/recipes/crossbow.json rename to src/main/resources/data/nec/recipe/crossbow.json index c13c6e6..7c76d21 100644 --- a/src/main/resources/data/nec/recipes/crossbow.json +++ b/src/main/resources/data/nec/recipe/crossbow.json @@ -17,6 +17,6 @@ } }, "result": { - "item": "minecraft:crossbow" + "id": "minecraft:crossbow" } } \ No newline at end of file diff --git a/src/main/resources/data/nec/recipes/deepslate_diamond_ore_ore.json b/src/main/resources/data/nec/recipe/deepslate_diamond_ore_ore.json similarity index 84% rename from src/main/resources/data/nec/recipes/deepslate_diamond_ore_ore.json rename to src/main/resources/data/nec/recipe/deepslate_diamond_ore_ore.json index 99bf71f..175075e 100644 --- a/src/main/resources/data/nec/recipes/deepslate_diamond_ore_ore.json +++ b/src/main/resources/data/nec/recipe/deepslate_diamond_ore_ore.json @@ -14,6 +14,6 @@ } }, "result": { - "item": "nec:deepslate_diamond_ore_ore" + "id": "nec:deepslate_diamond_ore_ore" } } \ No newline at end of file diff --git a/src/main/resources/data/nec/recipes/diamond_ore.json b/src/main/resources/data/nec/recipe/diamond_ore.json similarity index 86% rename from src/main/resources/data/nec/recipes/diamond_ore.json rename to src/main/resources/data/nec/recipe/diamond_ore.json index 563051c..f78742b 100644 --- a/src/main/resources/data/nec/recipes/diamond_ore.json +++ b/src/main/resources/data/nec/recipe/diamond_ore.json @@ -14,6 +14,6 @@ } }, "result": { - "item": "minecraft:diamond_ore" + "id": "minecraft:diamond_ore" } } \ No newline at end of file diff --git a/src/main/resources/data/nec/recipes/diamond_ore_ore.json b/src/main/resources/data/nec/recipe/diamond_ore_ore.json similarity index 87% rename from src/main/resources/data/nec/recipes/diamond_ore_ore.json rename to src/main/resources/data/nec/recipe/diamond_ore_ore.json index 6fad817..d783504 100644 --- a/src/main/resources/data/nec/recipes/diamond_ore_ore.json +++ b/src/main/resources/data/nec/recipe/diamond_ore_ore.json @@ -14,6 +14,6 @@ } }, "result": { - "item": "nec:diamond_ore_ore" + "id": "nec:diamond_ore_ore" } } \ No newline at end of file diff --git a/src/main/resources/data/nec/recipes/dirt_sword.json b/src/main/resources/data/nec/recipe/dirt_sword.json similarity index 88% rename from src/main/resources/data/nec/recipes/dirt_sword.json rename to src/main/resources/data/nec/recipe/dirt_sword.json index c62dd2c..6b29afd 100644 --- a/src/main/resources/data/nec/recipes/dirt_sword.json +++ b/src/main/resources/data/nec/recipe/dirt_sword.json @@ -14,6 +14,6 @@ } }, "result": { - "item": "nec:dirt_sword" + "id": "nec:dirt_sword" } } \ No newline at end of file diff --git a/src/main/resources/data/nec/recipes/fletching_stairs.json b/src/main/resources/data/nec/recipe/fletching_stairs.json similarity index 84% rename from src/main/resources/data/nec/recipes/fletching_stairs.json rename to src/main/resources/data/nec/recipe/fletching_stairs.json index 750e87c..26ce1d9 100644 --- a/src/main/resources/data/nec/recipes/fletching_stairs.json +++ b/src/main/resources/data/nec/recipe/fletching_stairs.json @@ -11,7 +11,7 @@ } }, "result": { - "item": "nec:fletching_stairs", + "id": "nec:fletching_stairs", "count": 4 } } \ No newline at end of file diff --git a/src/main/resources/data/nec/recipes/golden_sword.json b/src/main/resources/data/nec/recipe/golden_sword.json similarity index 81% rename from src/main/resources/data/nec/recipes/golden_sword.json rename to src/main/resources/data/nec/recipe/golden_sword.json index 98f8d41..2564ef2 100644 --- a/src/main/resources/data/nec/recipes/golden_sword.json +++ b/src/main/resources/data/nec/recipe/golden_sword.json @@ -7,6 +7,6 @@ "item": "minecraft:gold_ingot" }, "result": { - "item": "minecraft:golden_sword" + "id": "minecraft:golden_sword" } } \ No newline at end of file diff --git a/src/main/resources/data/nec/recipes/green_birch.json b/src/main/resources/data/nec/recipe/green_birch.json similarity index 84% rename from src/main/resources/data/nec/recipes/green_birch.json rename to src/main/resources/data/nec/recipe/green_birch.json index 2527e78..507ddc6 100644 --- a/src/main/resources/data/nec/recipes/green_birch.json +++ b/src/main/resources/data/nec/recipe/green_birch.json @@ -9,6 +9,6 @@ } ], "result": { - "item": "nec:green_birch_log" + "id": "nec:green_birch_log" } } diff --git a/src/main/resources/data/nec/recipes/gun_block.json b/src/main/resources/data/nec/recipe/gun_block.json similarity index 89% rename from src/main/resources/data/nec/recipes/gun_block.json rename to src/main/resources/data/nec/recipe/gun_block.json index 4db63b5..1270634 100644 --- a/src/main/resources/data/nec/recipes/gun_block.json +++ b/src/main/resources/data/nec/recipe/gun_block.json @@ -12,7 +12,7 @@ "###" ], "result": { - "item": "nec:gun_block" + "id": "nec:gun_block" }, "show_notification": true } \ No newline at end of file diff --git a/src/main/resources/data/nec/recipes/gunpowder.json b/src/main/resources/data/nec/recipe/gunpowder.json similarity index 80% rename from src/main/resources/data/nec/recipes/gunpowder.json rename to src/main/resources/data/nec/recipe/gunpowder.json index d54c7a8..9efeb6b 100644 --- a/src/main/resources/data/nec/recipes/gunpowder.json +++ b/src/main/resources/data/nec/recipe/gunpowder.json @@ -6,7 +6,7 @@ } ], "result": { - "item": "minecraft:gunpowder", + "id": "minecraft:gunpowder", "count": 9 } } diff --git a/src/main/resources/data/nec/recipes/java_block.json b/src/main/resources/data/nec/recipe/java_block.json similarity index 86% rename from src/main/resources/data/nec/recipes/java_block.json rename to src/main/resources/data/nec/recipe/java_block.json index 608a143..e7f554c 100644 --- a/src/main/resources/data/nec/recipes/java_block.json +++ b/src/main/resources/data/nec/recipe/java_block.json @@ -7,7 +7,7 @@ } ], "result": { - "item": "nec:java_block" + "id": "nec:java_block" }, "show_notification": true } \ No newline at end of file diff --git a/src/main/resources/data/nec/recipes/mail.json b/src/main/resources/data/nec/recipe/mail.json similarity index 90% rename from src/main/resources/data/nec/recipes/mail.json rename to src/main/resources/data/nec/recipe/mail.json index 5cd14b0..7a53a2a 100644 --- a/src/main/resources/data/nec/recipes/mail.json +++ b/src/main/resources/data/nec/recipe/mail.json @@ -14,7 +14,7 @@ } }, "result": { - "item": "nec:letter", + "id": "nec:letter", "count": 8 } } \ No newline at end of file diff --git a/src/main/resources/data/nec/recipes/netherite_chestplate.json b/src/main/resources/data/nec/recipe/netherite_chestplate.json similarity index 87% rename from src/main/resources/data/nec/recipes/netherite_chestplate.json rename to src/main/resources/data/nec/recipe/netherite_chestplate.json index 1b6d6f6..fdf697d 100644 --- a/src/main/resources/data/nec/recipes/netherite_chestplate.json +++ b/src/main/resources/data/nec/recipe/netherite_chestplate.json @@ -15,7 +15,7 @@ "222" ], "result": { - "item": "minecraft:netherite_chestplate" + "id": "minecraft:netherite_chestplate" }, "show_notification": true } \ No newline at end of file diff --git a/src/main/resources/data/nec/recipes/pocket_block.json b/src/main/resources/data/nec/recipe/pocket_block.json similarity index 85% rename from src/main/resources/data/nec/recipes/pocket_block.json rename to src/main/resources/data/nec/recipe/pocket_block.json index 03cbcc3..64a1ef2 100644 --- a/src/main/resources/data/nec/recipes/pocket_block.json +++ b/src/main/resources/data/nec/recipe/pocket_block.json @@ -7,7 +7,7 @@ } ], "result": { - "item": "nec:pocket_block" + "id": "nec:pocket_block" }, "show_notification": true } \ No newline at end of file diff --git a/src/main/resources/data/nec/recipes/skeleton_skull.json b/src/main/resources/data/nec/recipe/skeleton_skull.json similarity index 82% rename from src/main/resources/data/nec/recipes/skeleton_skull.json rename to src/main/resources/data/nec/recipe/skeleton_skull.json index bd27cb7..0142732 100644 --- a/src/main/resources/data/nec/recipes/skeleton_skull.json +++ b/src/main/resources/data/nec/recipe/skeleton_skull.json @@ -9,6 +9,6 @@ } ], "result": { - "item": "minecraft:skeleton_skull" + "id": "minecraft:skeleton_skull" } } diff --git a/src/main/resources/data/nec/recipes/steel.json b/src/main/resources/data/nec/recipe/steel.json similarity index 88% rename from src/main/resources/data/nec/recipes/steel.json rename to src/main/resources/data/nec/recipe/steel.json index 1d8ddda..977f87d 100644 --- a/src/main/resources/data/nec/recipes/steel.json +++ b/src/main/resources/data/nec/recipe/steel.json @@ -9,6 +9,6 @@ } ], "result": { - "item": "nec:steel" + "id": "nec:steel" } } diff --git a/src/main/resources/data/nec/recipes/stone_sword.json b/src/main/resources/data/nec/recipe/stone_sword.json similarity index 88% rename from src/main/resources/data/nec/recipes/stone_sword.json rename to src/main/resources/data/nec/recipe/stone_sword.json index 7258609..930ee89 100644 --- a/src/main/resources/data/nec/recipes/stone_sword.json +++ b/src/main/resources/data/nec/recipe/stone_sword.json @@ -17,6 +17,6 @@ } }, "result": { - "item": "minecraft:stone_sword" + "id": "minecraft:stone_sword" } } \ No newline at end of file diff --git a/src/main/resources/data/nec/recipes/zombie_spawn_egg.json b/src/main/resources/data/nec/recipe/zombie_spawn_egg.json similarity index 81% rename from src/main/resources/data/nec/recipes/zombie_spawn_egg.json rename to src/main/resources/data/nec/recipe/zombie_spawn_egg.json index caf9003..5e74282 100644 --- a/src/main/resources/data/nec/recipes/zombie_spawn_egg.json +++ b/src/main/resources/data/nec/recipe/zombie_spawn_egg.json @@ -9,6 +9,6 @@ } ], "result": { - "item": "minecraft:zombie_spawn_egg" + "id": "minecraft:zombie_spawn_egg" } } diff --git a/src/main/resources/data/nec/recipes/ak_47.json b/src/main/resources/data/nec/recipes/ak_47.json deleted file mode 100644 index c53c9d9..0000000 --- a/src/main/resources/data/nec/recipes/ak_47.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "type": "minecraft:smithing", - "base": { - "item": "minecraft:bow" - }, - "addition": { - "item": "minecraft:iron_ingot" - }, - "result": { - "item": "nec:ak_47" - } -} \ No newline at end of file diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 23c914c..537fc04 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -19,6 +19,9 @@ "environment": "*", "entrypoints": { + "fabric-datagen": [ + "me.jonasjones.nec.datagen.NecDataGen" + ], "main": [ "me.jonasjones.nec.NotEnoughCursedness" ] diff --git a/src/main/resources/nec.mixins.json b/src/main/resources/nec.mixins.json index 44fb5eb..4c283fc 100644 --- a/src/main/resources/nec.mixins.json +++ b/src/main/resources/nec.mixins.json @@ -2,12 +2,9 @@ "required": true, "minVersion": "0.8", "package": "me.jonasjones.nec.mixin", - "compatibilityLevel": "JAVA_17", + "compatibilityLevel": "JAVA_21", "mixins": [ ], - "client": [ - "ExampleMixin" - ], "injectors": { "defaultRequire": 1 }