-
Notifications
You must be signed in to change notification settings - Fork 4
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
Entity data mining #9
base: main
Are you sure you want to change the base?
Conversation
jsonObject.add("angry", camelSitting); | ||
} | ||
|
||
// TODO: Player - Sneaking, Gliding, Swimming, Sleeping |
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 logic for Player is missing:
- Sneaking
- Gliding
- Swimming
- Sleeping
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 will look into sneaking/sleeping/swimming states for the data generation. Here's mostly a question
BigDecimal normalWidth = BigDecimal.valueOf(mojangEntityType.getWidth()); | ||
BigDecimal normalHeight = BigDecimal.valueOf(mojangEntityType.getHeight()); | ||
BigDecimal normalEyeHeight = BigDecimal.valueOf(mojangEntityType.getDimensions().eyeHeight()); | ||
|
||
BigDecimal babyWidth = normalWidth.multiply(scale); | ||
BigDecimal babyHeight = normalHeight.multiply(scale); | ||
BigDecimal babyEyeHeight = BigDecimal.ZERO; | ||
if (BigDecimal.ZERO.compareTo(normalHeight) != 0) | ||
{ | ||
babyEyeHeight = babyHeight.multiply(normalEyeHeight).divide(normalHeight, RoundingMode.HALF_UP); | ||
} |
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.
Why do you convert from float to big decimal and then back to double. From my knowledge this should be fine by just converting directly from double, if theres a reason behind this? Floating point precission?
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's mostly related with the precision in the divisions and multiplication. Because when i attempted to do the maths with the double, the values were off by a significant margin. And when copying the generated files to the mockbukkit project it would replace the correct values with the "bad values".
- Refactored Base Damage in arrows - Added support for Base Damage in arrows
It's now ready for review. |
This PR adds the ability to automatically mine entity data from the source code. This PR is related with MockBukkit/MockBukkit#1101.
This implementation extracts: