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

Fix player ChangeInventoryEvent.Pickup.Pre #3334

Merged
merged 1 commit into from May 22, 2021

Conversation

Yeregorix
Copy link
Member

This PR fixes two issues with Pickup.Pre:

  1. The event is fired when a player collides an item even when it is not pickable (eg. pickup delay).
  2. Item pickup animation and sound are not played when custom ItemStackSnapshots are set.

Pickup.Pre is now fired after pickability conditions are verified, right before Pickup.
Having ItemStackSnapshots set no longer cancel the vanilla behavior (item removal, animation packet, stat increase).
This new implementation for players is close to the one for hoppers.

@ImMorpheus ImMorpheus added version: 1.12 (u) API: 7 (unsupported since May 21st 2021) status: needs review a code review is needed status: needs testing does this run, does it solve the issue etc labels Mar 14, 2021
@dualspiral dualspiral merged commit 256d1ad into SpongePowered:stable-7 May 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs review a code review is needed status: needs testing does this run, does it solve the issue etc version: 1.12 (u) API: 7 (unsupported since May 21st 2021)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants