Skip to content

Commit

Permalink
Remove deprecated onEntitySwing methods
Browse files Browse the repository at this point in the history
  • Loading branch information
ApexModder committed Oct 18, 2024
1 parent f08da3e commit 9036edb
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 9036edb

Please sign in to comment.