Added wither vanilla invulnerability API (#9124)
This commit is contained in:
parent
07674ea170
commit
8fcf7cfd2d
2 changed files with 35 additions and 0 deletions
|
@ -7,6 +7,7 @@ Co-authored-by: Nassim Jahnke <nassim@njahnke.dev>
|
||||||
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
|
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
|
||||||
Co-authored-by: William Blake Galbreath <blake.galbreath@gmail.com>
|
Co-authored-by: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||||
Co-authored-by: SoSeDiK <mrsosedik@gmail.com>
|
Co-authored-by: SoSeDiK <mrsosedik@gmail.com>
|
||||||
|
Co-authored-by: booky10 <boooky10@gmail.com>
|
||||||
|
|
||||||
diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java b/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java
|
diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java b/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
|
@ -1113,6 +1114,26 @@ diff --git a/src/main/java/org/bukkit/entity/Wither.java b/src/main/java/org/buk
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/org/bukkit/entity/Wither.java
|
--- a/src/main/java/org/bukkit/entity/Wither.java
|
||||||
+++ b/src/main/java/org/bukkit/entity/Wither.java
|
+++ b/src/main/java/org/bukkit/entity/Wither.java
|
||||||
|
@@ -0,0 +0,0 @@ public interface Wither extends Monster, Boss, com.destroystokyo.paper.entity.Ra
|
||||||
|
* Returns the wither's current invulnerability ticks.
|
||||||
|
*
|
||||||
|
* @return amount of invulnerability ticks
|
||||||
|
+ * @deprecated Duplicate api, use {@link #getInvulnerableTicks()}
|
||||||
|
*/
|
||||||
|
+ @Deprecated(forRemoval = true) // Paper
|
||||||
|
int getInvulnerabilityTicks();
|
||||||
|
|
||||||
|
/**
|
||||||
|
@@ -0,0 +0,0 @@ public interface Wither extends Monster, Boss, com.destroystokyo.paper.entity.Ra
|
||||||
|
* When invulnerability ticks reach 0, the wither will trigger an explosion.
|
||||||
|
*
|
||||||
|
* @param ticks amount of invulnerability ticks
|
||||||
|
+ * @deprecated Duplicate api, use {@link #setInvulnerableTicks(int)}
|
||||||
|
*/
|
||||||
|
+ @Deprecated(forRemoval = true) // Paper
|
||||||
|
void setInvulnerabilityTicks(int ticks);
|
||||||
|
|
||||||
|
/**
|
||||||
@@ -0,0 +0,0 @@ public interface Wither extends Monster, Boss, com.destroystokyo.paper.entity.Ra
|
@@ -0,0 +0,0 @@ public interface Wither extends Monster, Boss, com.destroystokyo.paper.entity.Ra
|
||||||
LEFT,
|
LEFT,
|
||||||
RIGHT
|
RIGHT
|
||||||
|
@ -1147,6 +1168,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
+ * @param value whether the wither can travel through portals
|
+ * @param value whether the wither can travel through portals
|
||||||
+ */
|
+ */
|
||||||
+ void setCanTravelThroughPortals(boolean value);
|
+ void setCanTravelThroughPortals(boolean value);
|
||||||
|
+
|
||||||
|
+ /**
|
||||||
|
+ * Makes the wither invulnerable for 11 seconds and
|
||||||
|
+ * sets the health to one third of the max health.
|
||||||
|
+ * <br>
|
||||||
|
+ * This is called in vanilla directly after spawning the wither.
|
||||||
|
+ */
|
||||||
|
+ void enterInvulnerabilityPhase();
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/org/bukkit/entity/ZombieVillager.java b/src/main/java/org/bukkit/entity/ZombieVillager.java
|
diff --git a/src/main/java/org/bukkit/entity/ZombieVillager.java b/src/main/java/org/bukkit/entity/ZombieVillager.java
|
||||||
|
|
|
@ -35,6 +35,7 @@ Co-authored-by: Nassim Jahnke <nassim@njahnke.dev>
|
||||||
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
|
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
|
||||||
Co-authored-by: William Blake Galbreath <blake.galbreath@gmail.com>
|
Co-authored-by: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||||
Co-authored-by: SoSeDiK <mrsosedik@gmail.com>
|
Co-authored-by: SoSeDiK <mrsosedik@gmail.com>
|
||||||
|
Co-authored-by: booky10 <boooky10@gmail.com>
|
||||||
|
|
||||||
diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java b/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java
|
diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java b/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
|
@ -1237,5 +1238,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
+ public void setCanTravelThroughPortals(boolean value) {
|
+ public void setCanTravelThroughPortals(boolean value) {
|
||||||
+ getHandle().setCanTravelThroughPortals(value);
|
+ getHandle().setCanTravelThroughPortals(value);
|
||||||
+ }
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public void enterInvulnerabilityPhase() {
|
||||||
|
+ this.getHandle().makeInvulnerable();
|
||||||
|
+ }
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue