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

Conversation

Projects
None yet
2 participants
@kaenganxt
Member

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

This comment has been minimized.

Member

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

This comment has been minimized.

Member

kaenganxt commented Dec 9, 2017

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

@mastercoms

This comment has been minimized.

Member

mastercoms commented Dec 9, 2017

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

@kaenganxt

This comment has been minimized.

Member

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

This comment has been minimized.

Member

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

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