diff --git a/Spigot-API-Patches/added-Wither-API.patch b/Spigot-API-Patches/added-Wither-API.patch new file mode 100644 index 0000000000..a41993f185 --- /dev/null +++ b/Spigot-API-Patches/added-Wither-API.patch @@ -0,0 +1,45 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jake Potrebic +Date: Sun, 5 Jul 2020 15:39:40 -0700 +Subject: [PATCH] added Wither API + + +diff --git a/src/main/java/org/bukkit/entity/Wither.java b/src/main/java/org/bukkit/entity/Wither.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/entity/Wither.java ++++ b/src/main/java/org/bukkit/entity/Wither.java +@@ -0,0 +0,0 @@ import com.destroystokyo.paper.entity.RangedEntity; + * Represents a Wither boss + */ + public interface Wither extends Monster, Boss, RangedEntity { // Paper ++ // Paper start ++ /** ++ * @return whether the wither is charged ++ */ ++ boolean isCharged(); ++ ++ /** ++ * @return ticks the wither is invulnerable for ++ */ ++ int getInvulnerableTicks(); ++ ++ /** ++ * Sets for how long in the future, the wither should be invulnerable. ++ * ++ * @param ticks ticks the wither is invulnerable for ++ */ ++ void setInvulnerableTicks(int ticks); ++ ++ /** ++ * @return whether the wither can travel through portals ++ */ ++ boolean canTravelThroughPortals(); ++ ++ /** ++ * Sets whether the wither can travel through portals. ++ * ++ * @param value whether the wither can travel through portals ++ */ ++ void setCanTravelThroughPortals(boolean value); ++ // Paper end + } diff --git a/Spigot-Server-Patches/added-Wither-API.patch b/Spigot-Server-Patches/added-Wither-API.patch new file mode 100644 index 0000000000..1b1fb5dcbf --- /dev/null +++ b/Spigot-Server-Patches/added-Wither-API.patch @@ -0,0 +1,75 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jake Potrebic +Date: Sun, 5 Jul 2020 15:39:19 -0700 +Subject: [PATCH] added Wither API + + +diff --git a/src/main/java/net/minecraft/server/EntityWither.java b/src/main/java/net/minecraft/server/EntityWither.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/server/EntityWither.java ++++ b/src/main/java/net/minecraft/server/EntityWither.java +@@ -0,0 +0,0 @@ public class EntityWither extends EntityMonster implements IRangedEntity { + return entityliving.getMonsterType() != EnumMonsterType.UNDEAD && entityliving.ei(); + }; + private static final PathfinderTargetCondition bz = (new PathfinderTargetCondition()).a(20.0D).a(EntityWither.by); ++ // Paper start ++ private boolean canPortal = false; ++ ++ public void setCanTravelThroughPortals(boolean canPortal) { this.canPortal = canPortal; } ++ // Paper end + + public EntityWither(EntityTypes entitytypes, World world) { + super(entitytypes, world); +@@ -0,0 +0,0 @@ public class EntityWither extends EntityMonster implements IRangedEntity { + this.datawatcher.set((DataWatcherObject) EntityWither.bo.get(i), j); + } + ++ public final boolean isPowered() { return this.S_(); } // Paper - OBFHELPER + public boolean S_() { + return this.getHealth() <= this.getMaxHealth() / 2.0F; + } +@@ -0,0 +0,0 @@ public class EntityWither extends EntityMonster implements IRangedEntity { + + @Override + public boolean canPortal() { +- return false; ++ return canPortal; // Paper + } + + @Override +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftWither.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftWither.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftWither.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftWither.java +@@ -0,0 +0,0 @@ public class CraftWither extends CraftMonster implements Wither, CraftRangedEnti + public BossBar getBossBar() { + return bossBar; + } ++ ++ // Paper start ++ @Override ++ public boolean isCharged() { ++ return getHandle().isPowered(); ++ } ++ ++ @Override ++ public int getInvulnerableTicks() { ++ return getHandle().getInvul(); ++ } ++ ++ @Override ++ public void setInvulnerableTicks(int ticks) { ++ getHandle().setInvul(ticks); ++ } ++ ++ @Override ++ public boolean canTravelThroughPortals() { ++ return getHandle().canPortal(); ++ } ++ ++ @Override ++ public void setCanTravelThroughPortals(boolean value) { ++ getHandle().setCanTravelThroughPortals(value); ++ } ++ // Paper end + }