aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-vineflower-stripped/net/minecraft/server/bossevents/CustomBossEvent.java.patch
blob: 33f0bf143aa5ad7e399258d18caf94bf2b7a04e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
--- a/net/minecraft/server/bossevents/CustomBossEvent.java
+++ b/net/minecraft/server/bossevents/CustomBossEvent.java
@@ -17,13 +17,27 @@
 import net.minecraft.server.level.ServerPlayer;
 import net.minecraft.util.Mth;
 import net.minecraft.world.BossEvent;
+// CraftBukkit start
+import org.bukkit.boss.KeyedBossBar;
+import org.bukkit.craftbukkit.boss.CraftKeyedBossbar;
+// CraftBukkit end
 
 public class CustomBossEvent extends ServerBossEvent {
     private final ResourceLocation 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 CustomBossEvent(ResourceLocation id, Component name) {
         super(name, BossEvent.BossBarColor.WHITE, BossEvent.BossBarOverlay.PROGRESS);
         this.id = id;