This commit is contained in:
BillyGalbreath
2021-06-17 15:30:00 -05:00
parent 02377a8ecd
commit 321c252f05
20 changed files with 2166 additions and 193 deletions

View File

@@ -6,24 +6,22 @@ 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 1c8f6863b976cfcb559de9b3e3cf9292831166ee..7858e97db83085721310f7c9e35abe0b944b3b1f 100644
index 0b1f6fad51a985ebe4ccebde12a1db9e12a57bc0..a91480bfecd17ef45e3380c726a42cd7534f07ae 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
@@ -97,6 +97,13 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob
this.xpReward = 50;
@@ -196,6 +196,11 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob
skull.setPosRaw(headX, headY, headZ);
level.addFreshEntity(skull);
}
+ // Purpur start
+
+ @Override
+ public void initAttributes() {
+ this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(level.purpurConfig.witherMaxHealth);
+ }
+ // Purpur end
+
// Purpur end
@Override
protected void registerGoals() {
this.goalSelector.addGoal(0, new WitherBoss.WitherDoNothingGoal());
@@ -288,7 +295,7 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob
@@ -401,7 +406,7 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob
this.setInvulnerableTicks(i);
if (this.tickCount % 10 == 0) {
@@ -32,7 +30,7 @@ index 1c8f6863b976cfcb559de9b3e3cf9292831166ee..7858e97db83085721310f7c9e35abe0b
}
} else {
@@ -381,8 +388,10 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob
@@ -494,8 +499,10 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob
}
}
@@ -46,19 +44,20 @@ index 1c8f6863b976cfcb559de9b3e3cf9292831166ee..7858e97db83085721310f7c9e35abe0b
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 a6a6b766b5dc5b3743aecd0a2c8021d04df1d8d2..2681463ae89ea4e0746425114feb24aed0f34cb3 100644
index ae46aafd1a19e183e9a77fec8c0556a35c70c521..be3b2cc6fb2f8f01e38fb4a47324c825fee2aee7 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -992,9 +992,20 @@ public class PurpurWorldConfig {
@@ -993,10 +993,21 @@ public class PurpurWorldConfig {
public boolean witherRidable = false;
public boolean witherRidableInWater = false;
public double witherMaxY = 256D;
+ public float witherHealthRegenAmount = 1.0f;
+ public int witherHealthRegenDelay = 20;
+ public double witherMaxHealth = 300.0D;
private void witherSettings() {
witherRidable = getBoolean("mobs.wither.ridable", witherRidable);
witherRidableInWater = getBoolean("mobs.wither.ridable-in-water", witherRidableInWater);
witherMaxY = getDouble("mobs.wither.ridable-max-y", witherMaxY);
+ witherHealthRegenAmount = (float) getDouble("mobs.wither.health-regen-amount", witherHealthRegenAmount);
+ witherHealthRegenDelay = getInt("mobs.wither.health-regen-delay", witherHealthRegenDelay);
+ if (PurpurConfig.version < 8) {