|
| 1 | +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Ben Kerllenevich <me@notom3ga.me> |
| 3 | +Date: Sun, 21 Mar 2021 15:26:52 -0400 |
| 4 | +Subject: [PATCH] Drowning Settings |
| 5 | + |
| 6 | + |
| 7 | +diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java |
| 8 | +index d321616b7f726f4ff307b46ced9efce6cc20b82f..c20787a20cf6f273092d2b7ef0d7d90abcfdf609 100644 |
| 9 | +--- a/src/main/java/net/minecraft/world/entity/Entity.java |
| 10 | ++++ b/src/main/java/net/minecraft/world/entity/Entity.java |
| 11 | +@@ -2575,7 +2575,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne |
| 12 | + } |
| 13 | + |
| 14 | + public int getDefaultPortalCooldown() { |
| 15 | +- return 300; |
| 16 | ++ return this.world.purpurConfig.drowningAirTicks; // Purpur |
| 17 | + } |
| 18 | + |
| 19 | + public Iterable<ItemStack> bn() { |
| 20 | +diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java |
| 21 | +index 659ccc8075945531ca714c43a034f2d5baa5defb..1d319ad82179ae261738d6e70aac3bbbd3aecae7 100644 |
| 22 | +--- a/src/main/java/net/minecraft/world/entity/EntityLiving.java |
| 23 | ++++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java |
| 24 | +@@ -394,7 +394,7 @@ public abstract class EntityLiving extends Entity { |
| 25 | + if (this.a((Tag) TagsFluid.WATER) && !this.world.getType(new BlockPosition(this.locX(), this.getHeadY(), this.locZ())).a(Blocks.BUBBLE_COLUMN)) { |
| 26 | + if (!this.canBreatheUnderwater() && !MobEffectUtil.c(this) && !flag1) { // Paper - use OBFHELPER so it can be overridden |
| 27 | + this.setAirTicks(this.l(this.getAirTicks())); |
| 28 | +- if (this.getAirTicks() == -20) { |
| 29 | ++ if (this.getAirTicks() == -this.world.purpurConfig.drowningDamageInterval) { // Purpur |
| 30 | + this.setAirTicks(0); |
| 31 | + Vec3D vec3d = this.getMot(); |
| 32 | + |
| 33 | +@@ -406,7 +406,7 @@ public abstract class EntityLiving extends Entity { |
| 34 | + this.world.addParticle(Particles.BUBBLE, this.locX() + d2, this.locY() + d3, this.locZ() + d4, vec3d.x, vec3d.y, vec3d.z); |
| 35 | + } |
| 36 | + |
| 37 | +- this.damageEntity(DamageSource.DROWN, 2.0F); |
| 38 | ++ this.damageEntity(DamageSource.DROWN, (float) this.world.purpurConfig.damageFromDrowning); // Purpur |
| 39 | + } |
| 40 | + } |
| 41 | + |
| 42 | +diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java |
| 43 | +index 03f5fae19685823d0cb23bad5f6f07dbd75437f4..b0f6d5dae50f5689ef41b766a590ca5a26834fc2 100644 |
| 44 | +--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java |
| 45 | ++++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java |
| 46 | +@@ -1987,6 +1987,15 @@ public class PurpurWorldConfig { |
| 47 | + imposeTeleportRestrictionsOnGateways = getBoolean("gameplay-mechanics.impose-teleport-restrictions-on-gateways", imposeTeleportRestrictionsOnGateways); |
| 48 | + } |
| 49 | + |
| 50 | ++ public int drowningAirTicks = 300; |
| 51 | ++ public int drowningDamageInterval = 20; |
| 52 | ++ public double damageFromDrowning = 2.0F; |
| 53 | ++ private void drowningSettings() { |
| 54 | ++ drowningAirTicks = getInt("gameplay-mechanics.drowning.air-ticks", drowningAirTicks); |
| 55 | ++ drowningDamageInterval = getInt("gameplay-mechanics.drowning.ticks-per-damage", drowningDamageInterval); |
| 56 | ++ damageFromDrowning = getDouble("gameplay-mechanics.drowning.damage-from-drowning", damageFromDrowning); |
| 57 | ++ } |
| 58 | ++ |
| 59 | + public boolean baselessCrystalExplode = true; |
| 60 | + public double baselessCrystalExplosionPower = 6.0D; |
| 61 | + public boolean baselessCrystalExplosionFire = false; |
0 commit comments