From 0f79787ce7832ebddc9eaea3b925471e4d26d804 Mon Sep 17 00:00:00 2001 From: Arthur-GYT Date: Thu, 18 Jul 2024 22:30:46 +0200 Subject: [PATCH] Add `elytra_repair_ingredients` tag --- CHANGELOG.md | 12 ++---------- README.md | 1 + .../quilt_tag_plus/mixin/ElytraItemMixin.java | 17 +++++++++++++++++ .../quilt_tag_plus/utils/ModItemTags.java | 1 + .../tags/item/animal_breeding.json | 5 ----- .../tags/item/elytra_repair_ingredients.json | 5 +++++ src/main/resources/quilt_tag_plus.mixins.json | 3 ++- 7 files changed, 28 insertions(+), 16 deletions(-) create mode 100644 src/main/java/fr/mysteriousdev/quilt_tag_plus/mixin/ElytraItemMixin.java delete mode 100644 src/main/resources/data/quilt_tag_plus/tags/item/animal_breeding.json create mode 100644 src/main/resources/data/quilt_tag_plus/tags/item/elytra_repair_ingredients.json diff --git a/CHANGELOG.md b/CHANGELOG.md index 5aa5af3..706510f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,3 @@ +## Additions - -## Modifications - -- **Update to Minecraft 1.21** -- Update to QFAPI 11.0.0-alpha.3 -- Update to Gradle 8.6 - -## Removals - -- Remove `animal_breeding` tag +- Add `elytra_repair_ingredients` tag which controls which blocks azalea's can be placed on diff --git a/README.md b/README.md index ce6ce21..fcf2e85 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,7 @@ This can be usefull for compatibility (this avoids possible conflicts with Mixin **Item Tags are located in `data/quilt_tag_plus/tags/item` folder** +- `elytra_repair_ingredients` which controls which items can be used to repair elytra - `iron_golem_healing` which controls which items can be used to heal Iron Golem - `minecart_furnace_fuel` which controls which items can be used for Minecart with Furnace - `respawn_anchor_charges` which controls which items can be used to fill respawn anchor diff --git a/src/main/java/fr/mysteriousdev/quilt_tag_plus/mixin/ElytraItemMixin.java b/src/main/java/fr/mysteriousdev/quilt_tag_plus/mixin/ElytraItemMixin.java new file mode 100644 index 0000000..e0e0adf --- /dev/null +++ b/src/main/java/fr/mysteriousdev/quilt_tag_plus/mixin/ElytraItemMixin.java @@ -0,0 +1,17 @@ +package fr.mysteriousdev.quilt_tag_plus.mixin; + +import fr.mysteriousdev.quilt_tag_plus.utils.ModItemTags; +import net.minecraft.item.ElytraItem; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Redirect; + +@Mixin(ElytraItem.class) +public class ElytraItemMixin { + @Redirect(method = "canRepair", at = @At(value = "INVOKE", target = "Lnet/minecraft/item/ItemStack;isOf(Lnet/minecraft/item/Item;)Z", ordinal = 0)) + private boolean canRepair(ItemStack instance, Item item) { + return instance.isIn(ModItemTags.ELYTRA_REPAIR_INGREDIENTS); + } +} diff --git a/src/main/java/fr/mysteriousdev/quilt_tag_plus/utils/ModItemTags.java b/src/main/java/fr/mysteriousdev/quilt_tag_plus/utils/ModItemTags.java index 0fa6f89..a71f180 100644 --- a/src/main/java/fr/mysteriousdev/quilt_tag_plus/utils/ModItemTags.java +++ b/src/main/java/fr/mysteriousdev/quilt_tag_plus/utils/ModItemTags.java @@ -12,5 +12,6 @@ public class ModItemTags { public static final TagKey MINECART_FURNACE_FUEL = TagKey.of(RegistryKeys.ITEM, Identifier.of(Main.MODID, "minecart_furnace_fuel")); public static final TagKey RESPAWN_ANCHOR_CHARGES = TagKey.of(RegistryKeys.ITEM, Identifier.of(Main.MODID, "respawn_anchor_charges")); public static final TagKey TNT_IGNITERS = TagKey.of(RegistryKeys.ITEM, Identifier.of(Main.MODID, "tnt_igniters")); + public static final TagKey ELYTRA_REPAIR_INGREDIENTS = TagKey.of(RegistryKeys.ITEM, Identifier.of(Main.MODID, "elytra_repair_ingredients")); } diff --git a/src/main/resources/data/quilt_tag_plus/tags/item/animal_breeding.json b/src/main/resources/data/quilt_tag_plus/tags/item/animal_breeding.json deleted file mode 100644 index 74d8484..0000000 --- a/src/main/resources/data/quilt_tag_plus/tags/item/animal_breeding.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "values": [ - "minecraft:wheat" - ] -} diff --git a/src/main/resources/data/quilt_tag_plus/tags/item/elytra_repair_ingredients.json b/src/main/resources/data/quilt_tag_plus/tags/item/elytra_repair_ingredients.json new file mode 100644 index 0000000..0f0ae7e --- /dev/null +++ b/src/main/resources/data/quilt_tag_plus/tags/item/elytra_repair_ingredients.json @@ -0,0 +1,5 @@ +{ + "values": [ + "minecraft:phantom_membrane" + ] +} diff --git a/src/main/resources/quilt_tag_plus.mixins.json b/src/main/resources/quilt_tag_plus.mixins.json index 4ce0ddd..018e022 100644 --- a/src/main/resources/quilt_tag_plus.mixins.json +++ b/src/main/resources/quilt_tag_plus.mixins.json @@ -15,7 +15,8 @@ "RespawnAnchorBlockMixin", "SugarCaneBlockMixin", "TntBlockMixin", - "WitherRoseBlockMixin" + "WitherRoseBlockMixin", + "ElytraItemMixin" ], "client": [], "injectors": {