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:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user