Skip to content

Commit

Permalink
Remove deprecated Item onEntitySwing methods (#1602)
Browse files Browse the repository at this point in the history
  • Loading branch information
ApexModder authored Oct 20, 2024
1 parent 547cf7f commit bcfa8af
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -314,27 +314,14 @@ 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.
*
* @param entity The entity swinging the item.
* @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;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down

0 comments on commit bcfa8af

Please sign in to comment.