-
Notifications
You must be signed in to change notification settings - Fork 277
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
Implement slime blocks pushing and proper handling of non-movable blocks by pistons #1017
Conversation
This enum specifies behavior of blocks that are going to be moved (pushed or pulled) by a piston. Values are: MOVE, BREAK (e.g. flowers), DONT_MOVE (e.g. bedrock)
…ior for slime block
I think I've fixed all the stuff I needed to fix. Material push/pull behaviors are not filled yet though. Works only for cobweb and bedrock just as an example of non-pushable/drop-on-move blocks. |
|
||
// remove piston head after retracting | ||
setType(me.getRelative(pistonBlockFace), 0, 0); | ||
private void breakBlock(GlowBlock block) { |
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.
This logic doesn't take into account stuff like the doTileDrops
gamerule and breaking containers (dropping chest contents). This kind of logic is already implemented in the DiggingMessage handler. Could you somehow merge this code?
If not, please leave a TODO and open an issue to support this.
Based on https://minecraft.gamepedia.com/Piston#Usage Entities (like item frames and paintings) not included.
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.
What are the correct piston behaviors for water and lava? Also, do we need special handling for blocks that can fall after being pushed (sand, gravel, concrete powder, dragon egg)?
Merging this because it's a great start in our incomplete server implementation. Will iterate further based on reviews in this PR. |
@Pr0methean Movement behaviors for liquids are specified in material values. The only difference is that Regarding gravity-affected stuff, it's hard to say because it is hardly working already, e.g. blocks don't fall when a block below them is destroyed. Maybe I'll try to find out how to make blocks fall when I get some free time. |
Added PistonMoveBehavior enum and corresponding methods in MaterialValueManager to store information about blocks push/pull behavior (e.g. bedrock does not push and pull, flowers drop when pushed and can't be pulled). All blocks can be pushed and pulled by default.
Pistons (including sticky variant) handle the behavior.
I haven't filled materialValues.yml yet so only bedrock and cobweb work for now.