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

Can we extract more block values? #11

Open
lluiscab opened this issue Aug 28, 2018 · 2 comments
Open

Can we extract more block values? #11

lluiscab opened this issue Aug 28, 2018 · 2 comments
Assignees

Comments

@lluiscab
Copy link

I've been looking at the game code with MCP and I've found some calls to setLightOpacity and setLightLevel. Could this data be extracted?

I'd also like to get whatever the block is transparent or not and if possible, it's bounding box, even tho I think I can get the bounding box from the block model.

I've been trying to read the burger code to try and understand what's happening and how it works but no luck. I'd really appreciate if I could get such data for minecraft-data. Would make updating versions much easier.

@lluiscab lluiscab changed the title Extract more block values Can we extract more block values? Aug 28, 2018
@Pokechu22 Pokechu22 self-assigned this Aug 28, 2018
@Pokechu22
Copy link
Owner

For light, it seems possibly useful and probably possible to do fairly easily, assuming that the properties are set by calling methods (if it were overriding methods things would be harder).

Transparency, I'm not sure about. Might be possible or it might not; I haven't looked at the implementation.

For hitboxes, I'm pretty sure that that is done by overriding methods and isn't really feasible to do generally (especially since some blocks such as fences and stairs have very complicated hitboxes that depend on the block state).

Burger's code is definitely rather hard to understand, unfortunately :/. The one thing to note to start with is that it works by following the bytecode and looking at method calls, and that there aren't any names on the methods at this point (so code is a lot harder to follow than in MCP).

Pokechu22 added a commit that referenced this issue Sep 13, 2018
See #11.  Note that these may be 3 times smaller than the values on the wiki (or 5 times smaller), due to how the calculation works ingame.
Pokechu22 added a commit that referenced this issue Sep 13, 2018
See #11.  Only present for blocks that have it.
@Pokechu22
Copy link
Owner

I've implemented blast resistance (you didn't ask for it, but it seemed useful) and light level. Opacity seems to be a lot harder to do in 1.13, as it's not actually a fixed property (for instance, ice defers to water), so for the moment I'm not doing it. Transparency also seems hard, since I'm just not sure what the right definition of transparency even is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants