Withers are created with 1/3 health :3

This commit is contained in:
William Blake Galbreath
2020-08-20 22:16:45 -05:00
parent ee1147250f
commit 6802a97f26
2 changed files with 7 additions and 8 deletions

View File

@@ -6,10 +6,10 @@ Subject: [PATCH] Customizable WitherBoss Health and Healing
Adds the ability to customize the health of the Wither Boss, as well as the amount that it heals, and how often in the PurpurWorldConfig.
diff --git a/src/main/java/net/minecraft/server/EntityWither.java b/src/main/java/net/minecraft/server/EntityWither.java
index 1511212cbf..bbcd509d4b 100644
index 1511212cbf..e8f81cd109 100644
--- a/src/main/java/net/minecraft/server/EntityWither.java
+++ b/src/main/java/net/minecraft/server/EntityWither.java
@@ -41,6 +41,16 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
@@ -41,6 +41,15 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
this.f = 50;
}
@@ -18,7 +18,6 @@ index 1511212cbf..bbcd509d4b 100644
+ public void initAttributes(World world) {
+ if (world != null) {
+ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(world.purpurConfig.witherMaxHealth);
+ setHealth(getMaxHealth());
+ }
+ }
+ // Purpur end
@@ -26,7 +25,7 @@ index 1511212cbf..bbcd509d4b 100644
@Override
protected void initPathfinder() {
this.goalSelector.a(0, new EntityWither.a());
@@ -230,7 +240,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
@@ -230,7 +239,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
this.setInvul(i);
if (this.ticksLived % 10 == 0) {
@@ -35,7 +34,7 @@ index 1511212cbf..bbcd509d4b 100644
}
} else {
@@ -339,9 +349,11 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
@@ -339,9 +348,11 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
}
}
@@ -49,7 +48,7 @@ index 1511212cbf..bbcd509d4b 100644
this.bossBattle.setProgress(this.getHealth() / this.getMaxHealth());
}
@@ -354,6 +366,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
@@ -354,6 +365,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
public void beginSpawnSequence() {
this.setInvul(220);
this.setHealth(this.getMaxHealth() / 3.0F);

View File

@@ -6,10 +6,10 @@ Subject: [PATCH] Fix MC-99259 - Show wither health bar even during
diff --git a/src/main/java/net/minecraft/server/EntityWither.java b/src/main/java/net/minecraft/server/EntityWither.java
index 81b3b9fbc5..48ae065700 100644
index e8f81cd109..8a0c623214 100644
--- a/src/main/java/net/minecraft/server/EntityWither.java
+++ b/src/main/java/net/minecraft/server/EntityWither.java
@@ -355,8 +355,9 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
@@ -354,8 +354,9 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
}
// Purpur end