mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-21 10:27:44 +01:00
Drowning Settings
This commit is contained in:
@@ -67,6 +67,15 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3460,7 +_,7 @@
|
||||
}
|
||||
|
||||
public int getMaxAirSupply() {
|
||||
- return this.maxAirTicks; // CraftBukkit - SPIGOT-6907: re-implement LivingEntity#setMaximumAir()
|
||||
+ return this.level == null? this.maxAirTicks : this.level().purpurConfig.drowningAirTicks; // CraftBukkit - SPIGOT-6907: re-implement LivingEntity#setMaximumAir() // Purpur - Drowning Settings
|
||||
}
|
||||
|
||||
public int getAirSupply() {
|
||||
@@ -3955,7 +_,7 @@
|
||||
// CraftBukkit end
|
||||
|
||||
|
||||
@@ -13,6 +13,24 @@
|
||||
this.hurtServer(serverLevel1, this.damageSources().outOfBorder(), Math.max(1, Mth.floor(-d * damagePerBlock)));
|
||||
}
|
||||
}
|
||||
@@ -472,7 +_,7 @@
|
||||
&& (!flag || !((Player)this).getAbilities().invulnerable);
|
||||
if (flag1) {
|
||||
this.setAirSupply(this.decreaseAirSupply(this.getAirSupply()));
|
||||
- if (this.getAirSupply() == -20) {
|
||||
+ if (this.getAirSupply() == -this.level().purpurConfig.drowningDamageInterval) { // Purpur - Drowning Settings
|
||||
this.setAirSupply(0);
|
||||
Vec3 deltaMovement = this.getDeltaMovement();
|
||||
|
||||
@@ -492,7 +_,7 @@
|
||||
);
|
||||
}
|
||||
|
||||
- this.hurt(this.damageSources().drown(), 2.0F);
|
||||
+ this.hurt(this.damageSources().drown(), (float) this.level().purpurConfig.damageFromDrowning); // Purpur - Drowning Settings
|
||||
}
|
||||
} else if (this.getAirSupply() < this.getMaxAirSupply()) {
|
||||
this.setAirSupply(this.increaseAirSupply(this.getAirSupply()));
|
||||
@@ -1372,6 +_,24 @@
|
||||
this.stopSleeping();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user