2021-06-11 12:02:28 +00:00
|
|
|
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/WitherBoss.java b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
|
2022-03-01 05:43:03 +00:00
|
|
|
index 32b302aad0319ce3ee412912425c1c8db9979f8a..92734f767fde60351a179a88350a97b861be0e88 100644
|
2021-06-11 12:02:28 +00:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
|
2022-03-01 05:43:03 +00:00
|
|
|
@@ -84,6 +84,11 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob
|
2021-06-11 12:02:28 +00:00
|
|
|
return entityliving.getMobType() != MobType.UNDEAD && entityliving.attackable();
|
|
|
|
};
|
2021-06-14 19:58:32 +00:00
|
|
|
private static final TargetingConditions TARGETING_CONDITIONS = TargetingConditions.forCombat().range(20.0D).selector(WitherBoss.LIVING_ENTITY_SELECTOR);
|
2021-06-11 12:02:28 +00:00
|
|
|
+ // Paper start
|
|
|
|
+ private boolean canPortal = false;
|
|
|
|
+
|
|
|
|
+ public void setCanTravelThroughPortals(boolean canPortal) { this.canPortal = canPortal; }
|
|
|
|
+ // Paper end
|
|
|
|
|
|
|
|
public WitherBoss(EntityType<? extends WitherBoss> type, Level world) {
|
|
|
|
super(type, world);
|
2022-03-01 05:43:03 +00:00
|
|
|
@@ -602,7 +607,7 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob
|
2021-06-11 12:02:28 +00:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean canChangeDimensions() {
|
|
|
|
- return false;
|
|
|
|
+ return super.canChangeDimensions() && 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
|
2021-06-14 19:58:32 +00:00
|
|
|
index 640b0860fbe3412da32d03187e6f355ba8f099ea..299d5e47489cfe489ac130a33a08cdb29ba76d72 100644
|
2021-06-11 12:02:28 +00:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftWither.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftWither.java
|
|
|
|
@@ -38,4 +38,31 @@ public class CraftWither extends CraftMonster implements Wither, com.destroystok
|
|
|
|
public BossBar getBossBar() {
|
2021-06-14 19:58:32 +00:00
|
|
|
return this.bossBar;
|
2021-06-11 12:02:28 +00:00
|
|
|
}
|
|
|
|
+
|
|
|
|
+ // Paper start
|
|
|
|
+ @Override
|
|
|
|
+ public boolean isCharged() {
|
|
|
|
+ return getHandle().isPowered();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public int getInvulnerableTicks() {
|
|
|
|
+ return getHandle().getInvulnerableTicks();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void setInvulnerableTicks(int ticks) {
|
|
|
|
+ getHandle().setInvulnerableTicks(ticks);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public boolean canTravelThroughPortals() {
|
|
|
|
+ return getHandle().canChangeDimensions();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void setCanTravelThroughPortals(boolean value) {
|
|
|
|
+ getHandle().setCanTravelThroughPortals(value);
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
}
|