Files
Purpur/patches/server/0103-Customizable-wither-health-and-healing.patch
William Blake Galbreath aa4b436198 Purpur client stuffs
2021-07-30 15:35:19 -05:00

47 lines
2.7 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jason Penilla <11360596+jpenilla@users.noreply.github.com>
Date: Thu, 20 Aug 2020 17:38:12 -0700
Subject: [PATCH] Customizable wither health and healing
Adds the ability to customize the health of the wither, as well as the amount that it heals, and how often.
diff --git a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
index 12cd1b453150e098975c34e00ec9277ff9730c75..ee13bdfb5cfc9992d26126804c0a0bb512c2eb1e 100644
--- a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
+++ b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
@@ -504,8 +504,10 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob
}
}
- if (this.tickCount % 20 == 0) {
- this.heal(1.0F, EntityRegainHealthEvent.RegainReason.REGEN); // CraftBukkit
+ // Purpur start - customizable heal rate and amount
+ if (this.tickCount % level.purpurConfig.witherHealthRegenDelay == 0) {
+ this.heal(level.purpurConfig.witherHealthRegenAmount, EntityRegainHealthEvent.RegainReason.REGEN); // CraftBukkit
+ // Purpur end
}
this.bossEvent.setProgress(this.getHealth() / this.getMaxHealth());
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
index ce3e424ef0933d80b23eb5a1762d55a9e69280f1..a2612c026ae87995881cb339f4d3481a3274c509 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -1523,6 +1523,8 @@ public class PurpurWorldConfig {
public boolean witherRidableInWater = false;
public double witherMaxY = 256D;
public double witherMaxHealth = 300.0D;
+ public float witherHealthRegenAmount = 1.0f;
+ public int witherHealthRegenDelay = 20;
private void witherSettings() {
witherRidable = getBoolean("mobs.wither.ridable", witherRidable);
witherRidableInWater = getBoolean("mobs.wither.ridable-in-water", witherRidableInWater);
@@ -1537,6 +1539,8 @@ public class PurpurWorldConfig {
set("mobs.wither.attributes.max_health", oldValue);
}
witherMaxHealth = getDouble("mobs.wither.attributes.max_health", witherMaxHealth);
+ witherHealthRegenAmount = (float) getDouble("mobs.wither.health-regen-amount", witherHealthRegenAmount);
+ witherHealthRegenDelay = getInt("mobs.wither.health-regen-delay", witherHealthRegenDelay);
}
public boolean witherSkeletonRidable = false;