From 9036edb227df0b40d19fc36624ab182e233c473a Mon Sep 17 00:00:00 2001 From: Apex Date: Fri, 18 Oct 2024 06:29:14 +0100 Subject: [PATCH] Remove deprecated `onEntitySwing` methods --- .../common/extensions/IItemExtension.java | 15 +-------------- .../common/extensions/IItemStackExtension.java | 13 ------------- 2 files changed, 1 insertion(+), 27 deletions(-) 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 b4cc31de7d..ab5cc0f8e1 100644 --- a/src/main/java/net/neoforged/neoforge/common/extensions/IItemExtension.java +++ b/src/main/java/net/neoforged/neoforge/common/extensions/IItemExtension.java @@ -314,19 +314,6 @@ default ResourceLocation getArmorTexture(ItemStack stack, EquipmentModel.LayerTy return null; } - /** - * Called when a entity tries to play the 'swing' animation. - * - * @param entity The entity swinging the item. - * @return True to cancel any further processing by {@link LivingEntity} - * @deprecated To be replaced with hand sensitive version in 21.2 - * @see #onEntitySwing(ItemStack, LivingEntity, InteractionHand) - */ - @Deprecated(forRemoval = true, since = "21.1") - default boolean onEntitySwing(ItemStack stack, LivingEntity entity) { - return false; - } - /** * Called when a entity tries to play the 'swing' animation. * @@ -334,7 +321,7 @@ default boolean onEntitySwing(ItemStack stack, LivingEntity entity) { * @return True to cancel any further processing by {@link LivingEntity} */ default boolean onEntitySwing(ItemStack stack, LivingEntity entity, InteractionHand hand) { - return onEntitySwing(stack, entity); + return false; } /** 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 68a254a3dc..0b18ba462f 100644 --- a/src/main/java/net/neoforged/neoforge/common/extensions/IItemStackExtension.java +++ b/src/main/java/net/neoforged/neoforge/common/extensions/IItemStackExtension.java @@ -195,19 +195,6 @@ default boolean canDisableShield(ItemStack shield, LivingEntity entity, LivingEn return self().getItem().canDisableShield(self(), shield, entity, attacker); } - /** - * Called when a entity tries to play the 'swing' animation. - * - * @param entity The entity swinging the item. - * @return True to cancel any further processing by {@link LivingEntity} - * @deprecated To be replaced with hand sensitive version in 21.2 - * @see #onEntitySwing(LivingEntity, InteractionHand) - */ - @Deprecated(forRemoval = true, since = "21.1") - default boolean onEntitySwing(LivingEntity entity) { - return self().getItem().onEntitySwing(self(), entity); - } - /** * Called when a entity tries to play the 'swing' animation. *