Hey Arti!
Thanks for pointing out that bug with Killaura and MaceDMG not working together. I'll make sure this is fixed in the next update.
Regarding the sendFakeY(Math.sqrt(500));
line, there is a comment in the code that explains why it's set up this way:
// See ServerPlayNetworkHandler.onPlayerMove()
// for why it's using these numbers.
// Also, let me know if you find a way to bypass that check in 1.21.
for(int i = 0; i < 4; i++)
sendFakeY(0);
sendFakeY(Math.sqrt(500));
sendFakeY(0);
If you look at the code in ServerPlayNetworkHandler.onPlayerMove()
, you can see why the sqrt(500)
is needed (I've added some comments to highlight the important parts):
// ...
double o = this.player.getVelocity().lengthSquared(); // <-- it's important that this is a squared value
double p = l * l + m * m + n * n;
if (this.player.isSleeping()) {
// ...
} else {
boolean bl = this.player.isFallFlying();
if (serverWorld.getTickManager().shouldTick()) {
this.movePacketsCount++;
int q = this.movePacketsCount - this.lastTickMovePacketsCount;
if (q > 5) { // <-- up to 5 packets in one tick are allowed here
LOGGER.debug("{} is sending move packets too frequently ({} packets since last tick)", this.player.getName().getString(), q);
q = 1;
}
if (!this.player.isInTeleportationState() && (!this.player.getWorld().getGameRules().getBoolean(GameRules.DISABLE_ELYTRA_MOVEMENT_CHECK) || !bl)) {
float r = bl ? 300.0F : 100.0F; // <-- up to 100 per packet are allowed without elytra
if (p - o > (double)(r * (float)q) && !this.isHost()) { // <-- it's comparing against the squared velocity, so instead of 500 we can only do sqrt(500)
LOGGER.warn("{} moved too quickly! {},{},{}", this.player.getName().getString(), l, m, n);
this.requestTeleport(this.player.getX(), this.player.getY(), this.player.getZ(), this.player.getYaw(), this.player.getPitch());
return;
}
}
}
// ...
}
// ...
So, basically Math.sqrt(500)
is the highest value we can use without the server rejecting it and taking away almost all of the damage bonus.
Hope that clears it up!
Update: This bug has been fixed in Wurst 7.45.