-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add onEntityCollide function when entity are above a block #6347
Conversation
This does not really check if there is a collision so if there is a slab between the magma block and the player, the player will be burned. |
Thanks for the feedback, it's fixed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current implementation only works for collsions on down side. An appropriate solution to the problem would be to detect when colliding with any face of the block, not just one.
Fixed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Look OK to me
Why not keep this name and call this function just if |
Because this will cause unexpected behaviour. No one expected these two functions to be bound together in the first place. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like what we actually need for this is a function that gets called when an entity is inside an adjacent block. Then, it should be up to the block to decide how much distance is allowed between the entity and the block to apply the effects.
This PR has been marked as "Waiting on Author", but we haven't seen any activity in 7 days. If there is no further activity, it will be closed in 28 days. Note for maintainers: Adding an assignee to the PR will prevent it from being marked as stale. |
A little update on this: I attempted to implement this with an "adjacent" check, but it turns out that the extended AABB collision scanning has a significant performance impact. I probably should've realized this sooner considering how much effort I previously invested into optimising AABB collision checking. Not sure what other options there are except specializing for this particular case. |
I tried to create an |
This PR has been marked as "Waiting on Author", but we haven't seen any activity in 7 days. If there is no further activity, it will be closed in 28 days. Note for maintainers: Adding an assignee to the PR will prevent it from being marked as stale. |
As this PR hasn't been updated for a while, unfortunately we'll have to close it. |
Introduction
PocketMine don't have function to detect if an entity are above a block.
So i add a function and fix the bug with magma block.
But there are other bug of this type (with top of cactus...), so i must to be fix in this pr or open an other pr to fix them ?
Relevant issues
Fix #2041
Changes
API changes
Add
Block::onEntityCollide()
Follow-up
Tests
Add-Magma-Block-PMMP.mp4