mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 08:27:43 +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();
|
||||
}
|
||||
|
||||
@@ -157,6 +157,15 @@ public class PurpurWorldConfig {
|
||||
nighttimeTicks = getInt("gameplay-mechanics.daylight-cycle-ticks.nighttime", nighttimeTicks);
|
||||
}
|
||||
|
||||
public int drowningAirTicks = 300;
|
||||
public int drowningDamageInterval = 20;
|
||||
public double damageFromDrowning = 2.0F;
|
||||
private void drowningSettings() {
|
||||
drowningAirTicks = getInt("gameplay-mechanics.drowning.air-ticks", drowningAirTicks);
|
||||
drowningDamageInterval = getInt("gameplay-mechanics.drowning.ticks-per-damage", drowningDamageInterval);
|
||||
damageFromDrowning = getDouble("gameplay-mechanics.drowning.damage-from-drowning", damageFromDrowning);
|
||||
}
|
||||
|
||||
public int elytraDamagePerSecond = 1;
|
||||
public double elytraDamageMultiplyBySpeed = 0;
|
||||
public int elytraDamagePerFireworkBoost = 0;
|
||||
|
||||
Reference in New Issue
Block a user