0
0
mirror of https://hub.spigotmc.org/stash/scm/spigot/craftbukkit.git synced 2024-11-24 18:06:14 +00:00
craftbukkit/nms-patches/net/minecraft/server/bossevents/BossBattleCustom.patch
2024-04-24 01:15:00 +10:00

31 lines
1015 B
Diff

--- a/net/minecraft/server/bossevents/BossBattleCustom.java
+++ b/net/minecraft/server/bossevents/BossBattleCustom.java
@@ -19,12 +19,27 @@
import net.minecraft.util.MathHelper;
import net.minecraft.world.BossBattle;
+// CraftBukkit start
+import org.bukkit.boss.KeyedBossBar;
+import org.bukkit.craftbukkit.boss.CraftKeyedBossbar;
+// CraftBukkit end
+
public class BossBattleCustom extends BossBattleServer {
private final MinecraftKey id;
private final Set<UUID> players = Sets.newHashSet();
private int value;
private int max = 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);