mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@a90092e Updated Upstream (CraftBukkit/Spigot) (#7848) PaperMC/Paper@79e07f3 Fix addPassenger for Marker (#7762) PaperMC/Paper@182a609 Fix duplicate world keys via createWorld (#7614) PaperMC/Paper@b6a6544 Provide ComponentSerializer services (#7527) PaperMC/Paper@3f7fbe3 Fix cb's janky level name in WorldCreator (#7851) PaperMC/Paper@af3b377 Update ForgeFlower (#7857) PaperMC/Paper@9667181 Fix OfflinePlayer#getBedSpawnLocation (#7861) PaperMC/Paper@c123915 Fix FurnaceInventory for smokers and blast furnaces (#7249) PaperMC/Paper@f7382f5 Remove unneeded UOE when copying biome sources (#7629) PaperMC/Paper@6b035fd Update default vanilla command perms (#7386) PaperMC/Paper@f210f67 Update the rewriteForIde for new cb package version (#7242) PaperMC/Paper@3f7111d Fix EntityEquipment and related javadocs (#7380) PaperMC/Paper@78e6431 Add default kick msg component (#6886) PaperMC/Paper@04e1b07 Check HAProxyMessage type is PROXY (#7864) PaperMC/Paper@00c6ae8 Implement Translatable on CreativeCategory (#7587) PaperMC/Paper@7602dd2 Sanitize Sent BlockEntity NBT (#7010) PaperMC/Paper@2d17a50 Add translation keys to GameMode enum (#7081) PaperMC/Paper@c5caee3 Prevent entity loading causing async lookups (#7553) PaperMC/Paper@71fe3c6 Add numeric string completion suggestions as int suggestions (#6360) PaperMC/Paper@b1ac25f Respect x-ray permission in World#refreshChunk (#7214) Pufferfish Changes: pufferfish-gg/Pufferfish@6186c1f Updated Upstream (Paper) pufferfish-gg/Pufferfish@b235d83 Fix regression with SIMD vector sizes not matching 256-bits pufferfish-gg/Pufferfish@27cb1ac Updated Upstream (Paper)
62 lines
3.4 KiB
Diff
62 lines
3.4 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Ben Kerllenevich <ben@omega24.dev>
|
|
Date: Sun, 21 Mar 2021 15:26:52 -0400
|
|
Subject: [PATCH] Drowning Settings
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
index 78889c65692ab9632e31bef986307663bdb7dc8f..0ba10e9a18b84c29d401482a77cdec6bd31b27c2 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
@@ -3010,7 +3010,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
|
}
|
|
|
|
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
|
|
}
|
|
|
|
public int getAirSupply() {
|
|
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
|
index 66cf9f16f0f983c1f19cc96958d0214dcef2c960..42935f0818bc854cd62476802c3c4c3751f7c755 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
|
@@ -421,7 +421,7 @@ public abstract class LivingEntity extends Entity {
|
|
|
|
if (flag1) {
|
|
this.setAirSupply(this.decreaseAirSupply(this.getAirSupply()));
|
|
- if (this.getAirSupply() == -20) {
|
|
+ if (this.getAirSupply() == -this.level.purpurConfig.drowningDamageInterval) { // Purpur
|
|
this.setAirSupply(0);
|
|
Vec3 vec3d = this.getDeltaMovement();
|
|
|
|
@@ -433,7 +433,7 @@ public abstract class LivingEntity extends Entity {
|
|
this.level.addParticle(ParticleTypes.BUBBLE, this.getX() + d2, this.getY() + d3, this.getZ() + d4, vec3d.x, vec3d.y, vec3d.z);
|
|
}
|
|
|
|
- this.hurt(DamageSource.DROWN, 2.0F);
|
|
+ this.hurt(DamageSource.DROWN, (float) this.level.purpurConfig.damageFromDrowning); // Purpur
|
|
}
|
|
}
|
|
|
|
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
index a1969d56e5c3088812737c591d6a59fd8875e6b9..4f913ecf1d259badb7eaf584da57ff8327e0e66b 100644
|
|
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
@@ -158,6 +158,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 boolean elytraIgnoreUnbreaking = false;
|