Add Safe stop option to efly
All checks were successful
/ Build BaseBand (push) Successful in 2m48s

This commit is contained in:
Daniella / Tove 2024-10-04 23:13:08 +02:00
parent 92e0b46c4c
commit e72db8f9ff
Signed by: TudbuT
GPG key ID: B3CF345217F202D3

View file

@ -35,6 +35,11 @@ public class ElytraFly extends Feature {
@Marker(4) @Marker(4)
public boolean stopOnDisable = false; public boolean stopOnDisable = false;
@Config("Safe stop")
@Description("At the expense of convenience, make stopping less likely to kill you from false fall damage.")
@Gate(4)
public boolean safeStop = false;
@Config("Mixin (recommended)") @Config("Mixin (recommended)")
@Description("Use the client's mixin for ElytraFly control, which is more accurate but can theoretically be broken by other clients.") @Description("Use the client's mixin for ElytraFly control, which is more accurate but can theoretically be broken by other clients.")
@Marker(2) @Marker(2)
@ -118,12 +123,12 @@ public class ElytraFly extends Feature {
public void onDisable() { public void onDisable() {
init = false; init = false;
if(stopOnDisable && !notIngame()) { if(stopOnDisable && !notIngame()) {
if(mc.player.motionY >= -0.1 && mc.player.rotationPitch < 40) { if(!safeStop && mc.player.motionY >= -0.1 && mc.player.rotationPitch < 40) {
sendDisablePackets(); sendDisablePackets();
} }
else { else {
// stop fall dmg // stop fall dmg
mc.player.connection.sendPacket(new CPacketPlayer.Rotation(mc.player.rotationYaw, 0, false)); mc.player.connection.sendPacket(new CPacketPlayer.PositionRotation(mc.player.posX, mc.player.posY, mc.player.posZ, mc.player.rotationYaw, 0, false));
mc.player.rotationPitch = 0; mc.player.rotationPitch = 0;
mc.player.motionY = 0.1; mc.player.motionY = 0.1;
sendDisableTimer = ServerDataManager.timeToSurelyTicked(); sendDisableTimer = ServerDataManager.timeToSurelyTicked();