From 5df8395298e9867f2c44bdb0c715426ad349735e Mon Sep 17 00:00:00 2001 From: ChaoticByte Date: Fri, 1 Nov 2024 21:37:33 +0100 Subject: [PATCH] Updated code and dependencies for minecraft 1.21.3 --- README.md | 11 +---------- gradle.properties | 10 +++++----- .../net/chaoticbyte/hardboiled/HardBoiledItems.java | 11 +++++------ .../hardboiled/recipe/hardboiled_egg_campfire.json | 4 +--- .../hardboiled/recipe/hardboiled_egg_furnace.json | 4 +--- src/main/resources/fabric.mod.json | 4 ++-- 6 files changed, 15 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index d495594..98a39ef 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,6 @@ # Hard Boiled -This Minecraft mod allows cooking egg into hard-boiled egg, using +This Minecraft Fabric mod allows cooking egg into hard-boiled egg, using - a campfire - a furnace - -## Supported Minecraft Versions / Mod Loaders - -This is a Fabric-only mod. - -The following Minecraft versions are supported: - -- 1.20.1 -- 1.21.1 diff --git a/gradle.properties b/gradle.properties index 2c96f32..dc2ead3 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.21.1 -yarn_mappings=1.21.1+build.3 -loader_version=0.16.5 +minecraft_version=1.21.3 +yarn_mappings=1.21.3+build.2 +loader_version=0.16.9 # Mod Properties -mod_version=1.0.1 +mod_version=1.0.3 maven_group=net.chaoticbyte.hardboiled archives_base_name=hardboiled # Dependencies -fabric_version=0.104.0+1.21.1 \ No newline at end of file +fabric_version=0.107.0+1.21.3 \ No newline at end of file diff --git a/src/main/java/net/chaoticbyte/hardboiled/HardBoiledItems.java b/src/main/java/net/chaoticbyte/hardboiled/HardBoiledItems.java index b22a356..ae360da 100644 --- a/src/main/java/net/chaoticbyte/hardboiled/HardBoiledItems.java +++ b/src/main/java/net/chaoticbyte/hardboiled/HardBoiledItems.java @@ -2,22 +2,21 @@ import net.minecraft.component.type.FoodComponent; import net.minecraft.item.Item; -import net.minecraft.registry.Registries; -import net.minecraft.registry.Registry; +import net.minecraft.item.Items; +import net.minecraft.registry.RegistryKey; +import net.minecraft.registry.RegistryKeys; import net.minecraft.util.Identifier; public class HardBoiledItems { // default food component public static final FoodComponent foodComponent = new FoodComponent.Builder() .nutrition(3) - .snack() .build(); // register item public static Item register(String id) { + final RegistryKey regKey = RegistryKey.of(RegistryKeys.ITEM, Identifier.of(HardBoiled.MOD_ID, id)); Item.Settings settings = new Item.Settings().food(foodComponent); - Identifier itemId = Identifier.of(HardBoiled.MOD_ID, id); - Item item = new Item(settings); - return Registry.register(Registries.ITEM, itemId, item); + return Items.register(regKey, Item::new, settings); } // dummy init method public static void init() {} diff --git a/src/main/resources/data/hardboiled/recipe/hardboiled_egg_campfire.json b/src/main/resources/data/hardboiled/recipe/hardboiled_egg_campfire.json index 0dbb2d5..c898a70 100644 --- a/src/main/resources/data/hardboiled/recipe/hardboiled_egg_campfire.json +++ b/src/main/resources/data/hardboiled/recipe/hardboiled_egg_campfire.json @@ -1,8 +1,6 @@ { "type": "minecraft:campfire_cooking", - "ingredient": { - "item": "minecraft:egg" - }, + "ingredient": "minecraft:egg", "result": { "id": "hardboiled:hardboiled_egg" }, diff --git a/src/main/resources/data/hardboiled/recipe/hardboiled_egg_furnace.json b/src/main/resources/data/hardboiled/recipe/hardboiled_egg_furnace.json index 287c277..1e0043d 100644 --- a/src/main/resources/data/hardboiled/recipe/hardboiled_egg_furnace.json +++ b/src/main/resources/data/hardboiled/recipe/hardboiled_egg_furnace.json @@ -1,8 +1,6 @@ { "type": "minecraft:smelting", - "ingredient": { - "item": "minecraft:egg" - }, + "ingredient": "minecraft:egg", "result": { "id": "hardboiled:hardboiled_egg" }, diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 13dfdc0..0beaa70 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -21,8 +21,8 @@ }, "mixins": [], "depends": { - "fabricloader": ">=0.16.5", - "minecraft": "~1.21.1", + "fabricloader": ">=0.16.9", + "minecraft": "1.21.3", "java": ">=21", "fabric-api": "*" },