PaperMC/Spigot-Server-Patches/added-Wither-API.patch
Jason Penilla 062733b903 Updated Upstream (CraftBukkit/Spigot)
Doesn't compile yet.

CraftBukkit Changes:
90d6905b Repackage NMS
69cf961d Repackage patches

Spigot Changes:
79d53c28 Repackage NMS
2021-03-16 00:19:45 -07:00

75 lines
2.9 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jake Potrebic <jake.m.potrebic@gmail.com>
Date: Sun, 5 Jul 2020 15:39:19 -0700
Subject: [PATCH] added Wither API
diff --git a/src/main/java/net/minecraft/world/entity/boss/wither/EntityWither.java b/src/main/java/net/minecraft/world/entity/boss/wither/EntityWither.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/entity/boss/wither/EntityWither.java
+++ b/src/main/java/net/minecraft/world/entity/boss/wither/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<? extends EntityWither> 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, com.destroystok
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
}