1
0
mirror of https://github.com/GeyserMC/Geyser.git synced 2025-12-19 14:59:27 +00:00

Fixed nautilus dash cooldown, condition for canUseSlot.

This commit is contained in:
oryxel1
2025-12-12 19:01:35 +07:00
parent 1d3ed4bd0a
commit f2ad5535dc
2 changed files with 13 additions and 3 deletions

View File

@@ -168,6 +168,15 @@ public abstract class AbstractNautilusEntity extends TameableEntity implements C
@Override
public boolean isClientControlled() {
return !this.passengers.isEmpty() && this.passengers.get(0) == session.getPlayerEntity();
return getFlag(EntityFlag.SADDLED) && !this.passengers.isEmpty() && this.passengers.get(0) == session.getPlayerEntity();
}
@Override
protected boolean canUseSlot(EquipmentSlot slot) {
if (slot != EquipmentSlot.SADDLE && slot != EquipmentSlot.BODY) {
return super.canUseSlot(slot);
} else {
return isAlive() && !isBaby() && getFlag(EntityFlag.TAMED);
}
}
}

View File

@@ -63,7 +63,9 @@ public class NautilusVehicleComponent extends VehicleComponent<AbstractNautilusE
float jumpStrength = player.getVehicleJumpStrength();
player.setVehicleJumpStrength(0);
if (this.dashCooldown <= 0 && jumpStrength > 0) {
// We don't check for dash cooldown here since we already send a vehicle jump packet beforehand, which the server can send us back
// the metadata that set dash cooldown before we can handle the input vector.
if (jumpStrength > 0) {
final Vector3f viewVector = MathUtils.calculateViewVector(player.getPitch(), player.getYaw());
float movementMultiplier = getVelocityMultiplier(ctx);
@@ -99,7 +101,6 @@ public class NautilusVehicleComponent extends VehicleComponent<AbstractNautilusE
public void setDashCooldown(int cooldown) {
this.dashCooldown = this.dashCooldown == 0 ? cooldown : this.dashCooldown;
vehicle.setFlag(EntityFlag.HAS_DASH_COOLDOWN, this.dashCooldown > 0);
vehicle.updateBedrockMetadata();
}