9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-27 02:49:19 +00:00
Files
Leaf/leaf-server/minecraft-patches/features/0062-Update-boss-bar-within-tick.patch
Dreeam fbb7d752a0 Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@51345a1c Correct nullable fall location type
PaperMC/Paper@93246a07 Fix errors when loading raid files without a PDC
PaperMC/Paper@cb3ffd0b Don't store empty PDCs on raids
PaperMC/Paper@d637ae85 Fix NoSuchElementException in EntityTransformEvent for slimes (#12510)
PaperMC/Paper@10742373 Pass correct draw strength for EntityShootBowEvent (#12308)
PaperMC/Paper@825685f8 Add PlayerPickBlockEvent and PlayerPickEntityEvent (#12425)
PaperMC/Paper@2bd84f6f Expand PotionMeta Api to allow getting effective potion colour and effects (#12390)
PaperMC/Paper@6f1f5b67 Fix ArmorStand items for canceled EntityDeathEvent (#12288)
2025-05-03 08:11:09 -04:00

53 lines
2.1 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Martijn Muijsers <martijnmuijsers@live.nl>
Date: Thu, 1 Dec 2022 00:12:14 +0100
Subject: [PATCH] Update boss bar within tick
License: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)
Gale - https://galemc.org
This patch is based on the following mixin:
"net/caffeinemc/mods/lithium/mixin/ai/raid/RaidMixin.java"
By: Angeline <jellysquid3@users.noreply.github.com>
As part of: Lithium (https://github.com/CaffeineMC/lithium-fabric)
Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)
diff --git a/net/minecraft/world/entity/raid/Raid.java b/net/minecraft/world/entity/raid/Raid.java
index 62a3a8d46e10e6f02e3f515bbce5d9ba1f6566b8..71166fbf93d62e8e1bff3db8161932ee2fc5ea86 100644
--- a/net/minecraft/world/entity/raid/Raid.java
+++ b/net/minecraft/world/entity/raid/Raid.java
@@ -126,6 +126,7 @@ public class Raid {
private Raid.RaidStatus status;
private int celebrationTicks;
private Optional<BlockPos> waveSpawnPos = Optional.empty();
+ private boolean isBarDirty; // Gale - Lithium - update boss bar within tick
public Raid(BlockPos center, Difficulty difficulty) {
this.active = true;
@@ -278,6 +279,12 @@ public class Raid {
}
public void tick(ServerLevel level) {
+ // Gale start - Lithium - update boss bar within tick
+ if (this.isBarDirty) {
+ this.updateBossbarInternal();
+ this.isBarDirty = false;
+ }
+ // Gale end - Lithium - update boss bar within tick
if (!this.isStopped()) {
if (this.status == Raid.RaidStatus.ONGOING) {
boolean flag = this.active;
@@ -588,6 +595,12 @@ public class Raid {
}
public void updateBossbar() {
+ // Gale start - Lithium - update boss bar within tick
+ this.isBarDirty = true;
+ }
+
+ private void updateBossbarInternal() {
+ // Gale end - Lithium - update boss bar within tick
this.raidEvent.setProgress(Mth.clamp(this.getHealthOfLivingRaiders() / this.totalHealth, 0.0F, 1.0F));
}