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

Consider using blockstates instead of simple blocks #471

Closed
wants to merge 4 commits into from

Conversation

suprohub
Copy link
Contributor

Description

i maked blockstates working in chunks, but needs fix anvil loading

Testing

cargo run
see what all works, without anvil loading
Please follow our Coding Guidelines

@kralverde
Copy link
Contributor

State ids are all unique, so I don't know what you are doing bit shifting the block id in there. That is useless information.

@kralverde
Copy link
Contributor

It seems you're misunderstanding something because multi block and multi block state are the same thing conceptually. The u16s are the state ids which are unique across all blocks

@kralverde
Copy link
Contributor

From_block and from_block_props are already implemented somewhere I believe. The block macro?

@kralverde
Copy link
Contributor

I don't like the to i32 and u32 implementations, if anything, it should only be the state_id

@suprohub
Copy link
Contributor Author

From_block and from_block_props are already implemented somewhere I believe. The block macro?

I didnt found any block props creator

@suprohub
Copy link
Contributor Author

And from block too, so if you find make me know

@kralverde
Copy link
Contributor

From_block and from_block_props are already implemented somewhere I believe. The block macro?

I didnt found any block props creator

Looks like it was removed when the ill-fated runtime migration happened, but it should be implemented as a part of: https://github.com/Pumpkin-MC/Pumpkin/blob/master/pumpkin-macros/src/block_state.rs#L19

@suprohub
Copy link
Contributor Author

It seems you're misunderstanding something because multi block and multi block state are the same thing conceptually. The u16s are the state ids which are unique across all blocks

No, blockstate structure its u32, while simple block its u16

@suprohub
Copy link
Contributor Author

Or you mean what its u16 its a block state?

@suprohub
Copy link
Contributor Author

If that, why anywhere whe uses block id, instead of state id?

@suprohub
Copy link
Contributor Author

Its a different things

@kralverde
Copy link
Contributor

It seems you're misunderstanding something because multi block and multi block state are the same thing conceptually. The u16s are the state ids which are unique across all blocks

No, blockstate structure its u32, while simple block its u16

That's because that's how we define a var int. We use a u16 simply because there is less that 65535 unique block states and we can save memory

@kralverde
Copy link
Contributor

If that, why anywhere whe uses block id, instead of state id?

This is just for a quick check if two states are of the same block. It is not used in chunk serialization

@suprohub
Copy link
Contributor Author

If that, why anywhere whe uses block id, instead of state id?

This is just for a quick check if two states are of the same block. It is not used in chunk serialization

Can you more explain?

@kralverde
Copy link
Contributor

It should be "block state id" I'm pretty sure the comments were made before all this complexity came in

@suprohub
Copy link
Contributor Author

It should be "block state id" I'm pretty sure the comments were made before all this complexity came in

No, before this its also be block id.
Its confusing

@suprohub suprohub closed this Jan 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants