From ec983f684cce96b5b4c3aaf6a684ecec0c893c6e Mon Sep 17 00:00:00 2001 From: SLH335 <114884726+SLH335@users.noreply.github.com> Date: Mon, 5 Aug 2024 12:01:52 +0200 Subject: [PATCH] feat: update to minecraft 1.21 --- gradle.properties | 16 ++++++++-------- .../hafemann/netheriteextras/item/ModItems.java | 2 +- .../item/NetheriteHorseArmorItem.java | 2 +- .../item/NetheriteWolfArmorItem.java | 2 +- .../mixin/NetheriteWolfArmorEquipMixin.java | 9 +++++++++ .../enchanted_netherite_apple_smithing.json | 0 .../netherite_apple_smithing.json | 0 .../netherite_horse_armor_smithing.json | 0 .../netherite_ingot_from_nuggets.json | 0 .../{recipes => recipe}/netherite_nugget.json | 0 .../netherite_wolf_armor_smithing.json | 0 .../totem_of_neverdying_smithing.json | 0 src/main/resources/fabric.mod.json | 2 +- 13 files changed, 21 insertions(+), 12 deletions(-) rename src/main/resources/data/netheriteextras/{recipes => recipe}/enchanted_netherite_apple_smithing.json (100%) rename src/main/resources/data/netheriteextras/{recipes => recipe}/netherite_apple_smithing.json (100%) rename src/main/resources/data/netheriteextras/{recipes => recipe}/netherite_horse_armor_smithing.json (100%) rename src/main/resources/data/netheriteextras/{recipes => recipe}/netherite_ingot_from_nuggets.json (100%) rename src/main/resources/data/netheriteextras/{recipes => recipe}/netherite_nugget.json (100%) rename src/main/resources/data/netheriteextras/{recipes => recipe}/netherite_wolf_armor_smithing.json (100%) rename src/main/resources/data/netheriteextras/{recipes => recipe}/totem_of_neverdying_smithing.json (100%) diff --git a/gradle.properties b/gradle.properties index adca65e..11cdc76 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,15 +3,15 @@ org.gradle.jvmargs=-Xmx1G org.gradle.parallel=true # Fabric Properties - # check these on https://fabricmc.net/develop - minecraft_version=1.20.5 - yarn_mappings=1.20.5+build.1 - loader_version=0.15.10 +# check these on https://fabricmc.net/develop +minecraft_version=1.21 +yarn_mappings=1.21+build.9 +loader_version=0.15.11 # Mod Properties - mod_version = 0.3.1+mc1.20.5 - maven_group = xyz.hafemann - archives_base_name = netheriteextras +mod_version = 0.3.2+mc1.21 +maven_group = xyz.hafemann +archives_base_name = netheriteextras # Dependencies - fabric_version=0.97.5+1.20.5 +fabric_version=0.101.1+1.21 diff --git a/src/main/java/xyz/hafemann/netheriteextras/item/ModItems.java b/src/main/java/xyz/hafemann/netheriteextras/item/ModItems.java index c3b82b8..0777b20 100644 --- a/src/main/java/xyz/hafemann/netheriteextras/item/ModItems.java +++ b/src/main/java/xyz/hafemann/netheriteextras/item/ModItems.java @@ -41,7 +41,7 @@ public class ModItems { new Item(new Item.Settings().maxCount(1).maxDamage(4).rarity(Rarity.UNCOMMON).fireproof())); private static Item registerItem(String name, Item item) { - return Registry.register(Registries.ITEM, new Identifier(NetheriteExtras.MOD_ID, name), item); + return Registry.register(Registries.ITEM, Identifier.of(NetheriteExtras.MOD_ID, name), item); } public static void registerModItems() { diff --git a/src/main/java/xyz/hafemann/netheriteextras/item/NetheriteHorseArmorItem.java b/src/main/java/xyz/hafemann/netheriteextras/item/NetheriteHorseArmorItem.java index e5f5267..6db1b22 100644 --- a/src/main/java/xyz/hafemann/netheriteextras/item/NetheriteHorseArmorItem.java +++ b/src/main/java/xyz/hafemann/netheriteextras/item/NetheriteHorseArmorItem.java @@ -13,6 +13,6 @@ public NetheriteHorseArmorItem(Settings settings) { @Override public Identifier getEntityTexture() { String entityTexture = "textures/entity/horse/armor/horse_armor_netherite.png"; - return new Identifier(NetheriteExtras.MOD_ID, entityTexture); + return Identifier.of(NetheriteExtras.MOD_ID, entityTexture); } } diff --git a/src/main/java/xyz/hafemann/netheriteextras/item/NetheriteWolfArmorItem.java b/src/main/java/xyz/hafemann/netheriteextras/item/NetheriteWolfArmorItem.java index d7c5553..0a44095 100644 --- a/src/main/java/xyz/hafemann/netheriteextras/item/NetheriteWolfArmorItem.java +++ b/src/main/java/xyz/hafemann/netheriteextras/item/NetheriteWolfArmorItem.java @@ -13,6 +13,6 @@ public NetheriteWolfArmorItem(Settings settings) { @Override public Identifier getEntityTexture() { String entityTexture = "textures/entity/wolf/wolf_armor_netherite.png"; - return new Identifier(NetheriteExtras.MOD_ID, entityTexture); + return Identifier.of(NetheriteExtras.MOD_ID, entityTexture); } } diff --git a/src/main/java/xyz/hafemann/netheriteextras/mixin/NetheriteWolfArmorEquipMixin.java b/src/main/java/xyz/hafemann/netheriteextras/mixin/NetheriteWolfArmorEquipMixin.java index 3adb706..5ecbc9e 100644 --- a/src/main/java/xyz/hafemann/netheriteextras/mixin/NetheriteWolfArmorEquipMixin.java +++ b/src/main/java/xyz/hafemann/netheriteextras/mixin/NetheriteWolfArmorEquipMixin.java @@ -9,6 +9,7 @@ import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.ArmorMaterials; import net.minecraft.item.ItemStack; +import net.minecraft.item.Items; import net.minecraft.recipe.Ingredient; import net.minecraft.registry.entry.RegistryEntry; import net.minecraft.sound.SoundEvents; @@ -30,6 +31,14 @@ protected NetheriteWolfArmorEquipMixin(EntityType enti super(entityType, world); } + @Inject( + method = "hasArmor", + at = @At("TAIL"), + cancellable = true) + public void hasArmor(CallbackInfoReturnable cir) { + cir.setReturnValue(this.getBodyArmor().isOf(Items.WOLF_ARMOR) || this.getBodyArmor().isOf(ModItems.NETHERITE_WOLF_ARMOR)); + } + @Inject( method = "interactMob", at = @At("HEAD"), diff --git a/src/main/resources/data/netheriteextras/recipes/enchanted_netherite_apple_smithing.json b/src/main/resources/data/netheriteextras/recipe/enchanted_netherite_apple_smithing.json similarity index 100% rename from src/main/resources/data/netheriteextras/recipes/enchanted_netherite_apple_smithing.json rename to src/main/resources/data/netheriteextras/recipe/enchanted_netherite_apple_smithing.json diff --git a/src/main/resources/data/netheriteextras/recipes/netherite_apple_smithing.json b/src/main/resources/data/netheriteextras/recipe/netherite_apple_smithing.json similarity index 100% rename from src/main/resources/data/netheriteextras/recipes/netherite_apple_smithing.json rename to src/main/resources/data/netheriteextras/recipe/netherite_apple_smithing.json diff --git a/src/main/resources/data/netheriteextras/recipes/netherite_horse_armor_smithing.json b/src/main/resources/data/netheriteextras/recipe/netherite_horse_armor_smithing.json similarity index 100% rename from src/main/resources/data/netheriteextras/recipes/netherite_horse_armor_smithing.json rename to src/main/resources/data/netheriteextras/recipe/netherite_horse_armor_smithing.json diff --git a/src/main/resources/data/netheriteextras/recipes/netherite_ingot_from_nuggets.json b/src/main/resources/data/netheriteextras/recipe/netherite_ingot_from_nuggets.json similarity index 100% rename from src/main/resources/data/netheriteextras/recipes/netherite_ingot_from_nuggets.json rename to src/main/resources/data/netheriteextras/recipe/netherite_ingot_from_nuggets.json diff --git a/src/main/resources/data/netheriteextras/recipes/netherite_nugget.json b/src/main/resources/data/netheriteextras/recipe/netherite_nugget.json similarity index 100% rename from src/main/resources/data/netheriteextras/recipes/netherite_nugget.json rename to src/main/resources/data/netheriteextras/recipe/netherite_nugget.json diff --git a/src/main/resources/data/netheriteextras/recipes/netherite_wolf_armor_smithing.json b/src/main/resources/data/netheriteextras/recipe/netherite_wolf_armor_smithing.json similarity index 100% rename from src/main/resources/data/netheriteextras/recipes/netherite_wolf_armor_smithing.json rename to src/main/resources/data/netheriteextras/recipe/netherite_wolf_armor_smithing.json diff --git a/src/main/resources/data/netheriteextras/recipes/totem_of_neverdying_smithing.json b/src/main/resources/data/netheriteextras/recipe/totem_of_neverdying_smithing.json similarity index 100% rename from src/main/resources/data/netheriteextras/recipes/totem_of_neverdying_smithing.json rename to src/main/resources/data/netheriteextras/recipe/totem_of_neverdying_smithing.json diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 4ed8e4f..770c5ba 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -32,7 +32,7 @@ "depends": { "fabricloader": ">=0.15.10", "fabric-api": "*", - "minecraft": "~1.20.5", + "minecraft": "~1.21", "java": ">=21" }, "suggests": {