From 57bca0057edcb20dc805af0692d9d52d8d57157d Mon Sep 17 00:00:00 2001 From: Matyrobbrt Date: Tue, 11 Jun 2024 13:52:12 +0300 Subject: [PATCH] Remove IItemExtension#onArmorTick --- .../minecraft/world/entity/player/Inventory.java.patch | 5 +---- .../neoforge/common/extensions/IItemExtension.java | 8 -------- .../common/extensions/IItemStackExtension.java | 10 ---------- 3 files changed, 1 insertion(+), 22 deletions(-) diff --git a/patches/net/minecraft/world/entity/player/Inventory.java.patch b/patches/net/minecraft/world/entity/player/Inventory.java.patch index 839ed70305..661a168207 100644 --- a/patches/net/minecraft/world/entity/player/Inventory.java.patch +++ b/patches/net/minecraft/world/entity/player/Inventory.java.patch @@ -9,7 +9,7 @@ return l; } } -@@ -214,13 +_,18 @@ +@@ -214,11 +_,15 @@ } public void tick() { @@ -25,10 +25,7 @@ + slot++; } } -+ armor.forEach(e -> e.onArmorTick(player.level(), player)); } - - public boolean add(ItemStack p_36055_) { @@ -268,6 +_,8 @@ } catch (Throwable throwable) { CrashReport crashreport = CrashReport.forThrowable(throwable, "Adding item to inventory"); diff --git a/src/main/java/net/neoforged/neoforge/common/extensions/IItemExtension.java b/src/main/java/net/neoforged/neoforge/common/extensions/IItemExtension.java index 69c91ec5d3..575a436143 100644 --- a/src/main/java/net/neoforged/neoforge/common/extensions/IItemExtension.java +++ b/src/main/java/net/neoforged/neoforge/common/extensions/IItemExtension.java @@ -266,14 +266,6 @@ default boolean doesSneakBypassUse(ItemStack stack, net.minecraft.world.level.Le return false; } - /** - * Called to tick armor in the armor slot. Override to do something - * - * @deprecated Use {@link Item#inventoryTick(ItemStack, Level, Entity, int, boolean)} by checking that the slot argument is an armor slot. Armor slots are 36, 37, 38 and 39. - */ - @Deprecated(forRemoval = true, since = "1.20.4") - default void onArmorTick(ItemStack stack, Level level, Player player) {} - /** * Determines if the specific ItemStack can be placed in the specified armor * slot, for the entity. diff --git a/src/main/java/net/neoforged/neoforge/common/extensions/IItemStackExtension.java b/src/main/java/net/neoforged/neoforge/common/extensions/IItemStackExtension.java index 1f491ee984..fec7137877 100644 --- a/src/main/java/net/neoforged/neoforge/common/extensions/IItemStackExtension.java +++ b/src/main/java/net/neoforged/neoforge/common/extensions/IItemStackExtension.java @@ -273,16 +273,6 @@ default float getXpRepairRatio() { return self().getItem().getXpRepairRatio(self()); } - /** - * Called to tick armor in the armor slot. Override to do something - * - * @deprecated Use {@link Item#inventoryTick(ItemStack, Level, Entity, int, boolean)} by checking that the slot argument is an armor slot. Armor slots are 36, 37, 38 and 39. - */ - @Deprecated(forRemoval = true, since = "1.20.4") - default void onArmorTick(Level level, Player player) { - self().getItem().onArmorTick(self(), level, player); - } - /** * Called every tick when this item is equipped {@linkplain Mob#isBodyArmorItem(ItemStack) as an armor item} by a horse {@linkplain Mob#canWearBodyArmor()} that can wear armor}. *