summaryrefslogtreecommitdiffstats
path: root/nms-patches
diff options
context:
space:
mode:
authorYannick Lamprecht <yannicklamprecht@live.de>2018-11-10 20:22:39 +1100
committermd_5 <git@md-5.net>2018-11-10 20:23:17 +1100
commit3697ec7a60f718cfc05064af169a29c8594073d9 (patch)
tree66ba8045ce81e29ff6f70e8940614e9b33cac16c /nms-patches
parentca22de36ab1164f67e5b36c994c62eb0411db056 (diff)
downloadcraftbukkit-3697ec7a60f718cfc05064af169a29c8594073d9.tar
craftbukkit-3697ec7a60f718cfc05064af169a29c8594073d9.tar.gz
craftbukkit-3697ec7a60f718cfc05064af169a29c8594073d9.tar.lz
craftbukkit-3697ec7a60f718cfc05064af169a29c8594073d9.tar.xz
craftbukkit-3697ec7a60f718cfc05064af169a29c8594073d9.zip
Add API to manipulate boss bar of entities and those created by commands
Diffstat (limited to 'nms-patches')
-rw-r--r--nms-patches/BossBattleCustom.patch30
-rw-r--r--nms-patches/EnderDragonBattle.patch11
-rw-r--r--nms-patches/EntityWither.patch9
3 files changed, 50 insertions, 0 deletions
diff --git a/nms-patches/BossBattleCustom.patch b/nms-patches/BossBattleCustom.patch
new file mode 100644
index 00000000..cf8d10e9
--- /dev/null
+++ b/nms-patches/BossBattleCustom.patch
@@ -0,0 +1,30 @@
+--- a/net/minecraft/server/BossBattleCustom.java
++++ b/net/minecraft/server/BossBattleCustom.java
+@@ -8,12 +8,27 @@
+ import java.util.UUID;
+ import java.util.function.Consumer;
+
++// CraftBukkit start
++import org.bukkit.boss.KeyedBossBar;
++import org.bukkit.craftbukkit.boss.CraftKeyedBossbar;
++// CraftBukkit end
++
+ public class BossBattleCustom extends BossBattleServer {
+
+ private final MinecraftKey h;
+ private final Set<UUID> i = Sets.newHashSet();
+ private int j;
+ private int k = 100;
++ // CraftBukkit start
++ private KeyedBossBar bossBar;
++
++ public KeyedBossBar getBukkitEntity() {
++ if (bossBar == null) {
++ bossBar = new CraftKeyedBossbar(this);
++ }
++ return bossBar;
++ }
++ // CraftBukkit end
+
+ public BossBattleCustom(MinecraftKey minecraftkey, IChatBaseComponent ichatbasecomponent) {
+ super(ichatbasecomponent, BossBattle.BarColor.WHITE, BossBattle.BarStyle.PROGRESS);
diff --git a/nms-patches/EnderDragonBattle.patch b/nms-patches/EnderDragonBattle.patch
new file mode 100644
index 00000000..e5d6df48
--- /dev/null
+++ b/nms-patches/EnderDragonBattle.patch
@@ -0,0 +1,11 @@
+--- a/net/minecraft/server/EnderDragonBattle.java
++++ b/net/minecraft/server/EnderDragonBattle.java
+@@ -21,7 +21,7 @@
+
+ private static final Logger a = LogManager.getLogger();
+ private static final Predicate<Entity> b = IEntitySelector.a.and(IEntitySelector.a(0.0D, 128.0D, 0.0D, 192.0D));
+- private final BossBattleServer c;
++ public final BossBattleServer c; // PAIL private -> public, rename bossBattleServer
+ private final WorldServer d;
+ private final List<Integer> e;
+ private final ShapeDetector f;
diff --git a/nms-patches/EntityWither.patch b/nms-patches/EntityWither.patch
index 77708f47..920308ca 100644
--- a/nms-patches/EntityWither.patch
+++ b/nms-patches/EntityWither.patch
@@ -13,6 +13,15 @@
public class EntityWither extends EntityMonster implements IRangedEntity {
private static final DataWatcherObject<Integer> a = DataWatcher.a(EntityWither.class, DataWatcherRegistry.b);
+@@ -19,7 +25,7 @@
+ private final int[] bI = new int[2];
+ private final int[] bJ = new int[2];
+ private int bK;
+- private final BossBattleServer bL;
++ public final BossBattleServer bL; // PAIL private -> public, rename bossBattleServer
+ private static final Predicate<Entity> bM = (entity) -> {
+ return entity instanceof EntityLiving && ((EntityLiving) entity).getMonsterType() != EnumMonsterType.UNDEAD && ((EntityLiving) entity).df();
+ };
@@ -181,13 +187,38 @@
if (this.dz() > 0) {
i = this.dz() - 1;