Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.21.2] Remove deprecated Item onEntitySwing methods #1602

Merged
merged 2 commits into from
Oct 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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