-
-
Notifications
You must be signed in to change notification settings - Fork 200
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
Partial Redstone #621
base: master
Are you sure you want to change the base?
Partial Redstone #621
Conversation
Do you think you could add pressure plates in this PR as well?. This would require to make a system that sends an event when an entity collides with an blocks which we also would need for other things (e.g. Eggs, Snowballs, Enderperals...) |
I also think https://redstone.build/ is a great website to see and understand the existing Vanilla redstone logic |
I think vanilla treats throwables differently than other entities. Since arrows get turned into a pickable item after they land they are slighly different than other throwables. That is why they can activate pressure plates. I think the algorithm for collisions is pretty simple from what I saw in the vanilla code. I think I can implement it in #523. Redstone/pressureplace collisions would just be the same collision function just run on each tick rather than calculated on each tick and in between (think a snowball not colliding because it moved >1 block in-between ticks). |
Possibly after I'm done with everything else. |
I'm pretty familiar with redstone, the part I'm worried about is locationality |
pumpkin-data/build/block.rs
Outdated
@@ -6,6 +6,19 @@ use serde::Deserialize; | |||
use std::collections::{HashMap, HashSet}; | |||
use syn::{Ident, LitBool, LitInt, LitStr}; | |||
|
|||
fn is_state_solid(state: &BlockState, all_shapes: &Vec<CollisionShape>) -> bool { |
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.
fn is_state_solid(state: &BlockState, all_shapes: &Vec<CollisionShape>) -> bool { | |
fn is_state_solid(state: &BlockState, all_shapes: &[CollisionShape]) -> bool { |
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.
(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.
Thanks, but I'm ignoring clippy for now
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.
I added some comments.
Also you're going to hate me but is there any possibility of adding tests for redstone? :p
The first thing i got when started the server
My region folder was empty |
Try now |
Description
This is a partial redstone implementation that makes a great base for implementing new blocks that use redstone. It also revamped the block state packets, neighbor updates and state updates
Testing
Please follow our Coding Guidelines