PaperMC/paper-server/patches/sources/net/minecraft/server/bossevents/CustomBossEvent.java.patch
CraftBukkit/Spigot 30e4583dbe Remap CraftBukkit to Mojang+Yarn Mappings
By: Initial Source <noreply+automated@papermc.io>
2024-12-11 22:26:55 +01:00

31 lines
1 KiB
Diff

--- a/net/minecraft/server/bossevents/CustomBossEvent.java
+++ b/net/minecraft/server/bossevents/CustomBossEvent.java
@@ -18,6 +18,10 @@
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 {
@@ -25,7 +29,17 @@
private final Set<UUID> players = Sets.newHashSet();
private int value;
private int max = 100;
+ // CraftBukkit start
+ private KeyedBossBar bossBar;
+ public KeyedBossBar getBukkitEntity() {
+ if (this.bossBar == null) {
+ this.bossBar = new CraftKeyedBossbar(this);
+ }
+ return this.bossBar;
+ }
+ // CraftBukkit end
+
public CustomBossEvent(ResourceLocation id, Component displayName) {
super(displayName, BossEvent.BossBarColor.WHITE, BossEvent.BossBarOverlay.PROGRESS);
this.id = id;