aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-spigotflower-stripped/net/minecraft/server/bossevents/CustomBossEvent.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-spigotflower-stripped/net/minecraft/server/bossevents/CustomBossEvent.java.patch')
-rw-r--r--patch-remap/mache-spigotflower-stripped/net/minecraft/server/bossevents/CustomBossEvent.java.patch37
1 files changed, 37 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower-stripped/net/minecraft/server/bossevents/CustomBossEvent.java.patch b/patch-remap/mache-spigotflower-stripped/net/minecraft/server/bossevents/CustomBossEvent.java.patch
new file mode 100644
index 0000000000..ef8a8c4064
--- /dev/null
+++ b/patch-remap/mache-spigotflower-stripped/net/minecraft/server/bossevents/CustomBossEvent.java.patch
@@ -0,0 +1,37 @@
+--- a/net/minecraft/server/bossevents/CustomBossEvent.java
++++ b/net/minecraft/server/bossevents/CustomBossEvent.java
+@@ -17,6 +17,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 {
+
+@@ -24,10 +28,20 @@
+ private final Set<UUID> players = Sets.newHashSet();
+ private int value;
+ private int max = 100;
++ // CraftBukkit start
++ private KeyedBossBar bossBar;
+
+- public CustomBossEvent(ResourceLocation resourcelocation, Component component) {
+- super(component, BossEvent.BossBarColor.WHITE, BossEvent.BossBarOverlay.PROGRESS);
+- this.id = resourcelocation;
++ 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;
+ this.setProgress(0.0F);
+ }
+