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

Improve hanging entities #597

Merged
merged 2 commits into from Dec 9, 2017
Merged

Conversation

@kaenganxt
Copy link
Member

@kaenganxt kaenganxt commented Dec 8, 2017

This pull request fixes several bugs and implements some events regarding item frames and paintings.

The following bugs/features are fixed/implemented:

  • Call HangingBreakByEntityEvent when player breaks the item frame/painting
  • Don't drop item frame if player is in creative
  • Call EntityDamageByEntityEvent when item is removed from item frame (equals spigot behaviour)
  • Only drop item frame content if player is in creative
  • Don't reset rotation when item is removed or placed (equals vanilla behaviour)
  • Remove useless/wrong check for air behind a painting, since the call to isObstructed() is executed before that and performs a wider check
@mastercoms
Copy link
Member

@mastercoms mastercoms commented Dec 9, 2017

Shouldn't the pulse() method check !isObstructed() to see if the painting can't survive at its current location? Or are the docs wrong for it? @return true if the painting can survive, false otherwise

@kaenganxt
Copy link
Member Author

@kaenganxt kaenganxt commented Dec 9, 2017

The method returns true if the painting should drop, so the docs are wrong.

@mastercoms
Copy link
Member

@mastercoms mastercoms commented Dec 9, 2017

And vanilla drops paintings if any block behind them is air? How do secret painting doors exist?

@kaenganxt
Copy link
Member Author

@kaenganxt kaenganxt commented Dec 9, 2017

Yes, vanilla drops paintings if there's at least one block of air (I justed tested it). For secret doors, there's a ladder or a sign behind the painting.

@mastercoms
Copy link
Member

@mastercoms mastercoms commented Dec 9, 2017

Ah ok, thank you for your contribution.

@mastercoms mastercoms merged commit 2ad4d75 into GlowstoneMC:dev Dec 9, 2017
1 check passed
1 check passed
license/cla Contributor License Agreement is signed.
Details
@kaenganxt kaenganxt deleted the kaenganxt:hangingBreakEvents branch Dec 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants