-
Notifications
You must be signed in to change notification settings - Fork 39
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
Switched to vanilla values to stop movement from flagging anticheats #112
base: master
Are you sure you want to change the base?
Conversation
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.
Listing
@@ -533,7 +535,7 @@ function Physics (mcData, world) { | |||
// Calculate what the speed is (0.1 if no modification) | |||
const attributeSpeed = attribute.getAttributeValue(playerSpeedAttribute) | |||
inertia = (blockSlipperiness[blockUnder.type] || physics.defaultSlipperiness) * 0.91 | |||
acceleration = attributeSpeed * (0.1627714 / (inertia * inertia * inertia)) | |||
acceleration = attributeSpeed * (0.16277136 / (inertia * inertia * inertia)) |
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 is the only actual change in this PR. The other changes have no effect, you can revert them. If there are errors in calculation, they are likely to be caused by 64-bit vs 32-bit float differences, and that's what Math.fround is supposed to fix.
Very likely that these values differ between versions. |
How do you measure 99.9999999793 accuracy?
…On Wed, Nov 29, 2023, 21:42 Frej Alexander Nielsen ***@***.***> wrote:
Very likely that these values differ between versions.
—
Reply to this email directly, view it on GitHub
<#112 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAR437WQWLEJBVQHS3TFGOTYG6M3NAVCNFSM6AAAAAA75LW2CCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMZSGY3TANBQGA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
I measured the difference in speed values across many different situations and it was off by 0.0000000207. The difference somes from 32 bit to 64 bit conversions from floats to doubles. |
@@ -690,7 +692,7 @@ function Physics (mcData, world) { | |||
vel.y += 0.04 | |||
} else if (entity.onGround && entity.jumpTicks === 0) { | |||
const blockBelow = world.getBlock(entity.pos.floored().offset(0, -0.5, 0)) | |||
vel.y = Math.fround(0.42) * ((blockBelow && blockBelow.type === honeyblockId) ? physics.honeyblockJumpSpeed : 1) | |||
vel.y = 0.42 * ((blockBelow && blockBelow.type === honeyblockId) ? physics.honeyblockJumpSpeed : 1) |
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 change is incorrect. Current version is right.
See https://github.com/extremeheat/extracted_minecraft_data/blob/client1.19.3/client/net/minecraft/world/entity/LivingEntity.java#L2019 for reference.
please fix |
The values in the current version flag some anticheats. I switched them to the values from MoveEntityWithHeading in EntityLivingBase.java. These values now emulate vanilla movement with 99.9999999793% accuracy.