From 8ca4232bbcfdee949da342753c2aa6607d47bf8f Mon Sep 17 00:00:00 2001 From: 404Setup <153366651+404Setup@users.noreply.github.com> Date: Mon, 9 Sep 2024 12:35:53 +0800 Subject: [PATCH] ai.raid --- patches/server/0103-lithium-ai.raid.patch | 52 +++++++++++++++++++ ...atch => 0104-vmp-TypeFilterableList.patch} | 0 ...kip-entity-move-if-movement-is-zero.patch} | 0 ...lice-Improve-map-saving-performance.patch} | 0 ...Slice-noEntityCollisions-for-Entity.patch} | 0 ...Allow-inventory-clicks-in-Spectator.patch} | 0 ...ble-sending-Entity-Movement-Packets.patch} | 0 ...karin-Save-Json-list-asynchronously.patch} | 0 ...-Remove-stream-in-PoiCompetitorScan.patch} | 0 ...-ScalableLux-Upstream-Starlight-Fix.patch} | 0 ...=> 0113-Kiterino-New-liquid-physics.patch} | 0 11 files changed, 52 insertions(+) create mode 100644 patches/server/0103-lithium-ai.raid.patch rename patches/server/{0103-vmp-TypeFilterableList.patch => 0104-vmp-TypeFilterableList.patch} (100%) rename patches/server/{0104-vmp-skip-entity-move-if-movement-is-zero.patch => 0105-vmp-skip-entity-move-if-movement-is-zero.patch} (100%) rename patches/server/{0105-Slice-Improve-map-saving-performance.patch => 0106-Slice-Improve-map-saving-performance.patch} (100%) rename patches/server/{0106-Slice-noEntityCollisions-for-Entity.patch => 0107-Slice-noEntityCollisions-for-Entity.patch} (100%) rename patches/server/{0107-Slice-Allow-inventory-clicks-in-Spectator.patch => 0108-Slice-Allow-inventory-clicks-in-Spectator.patch} (100%) rename patches/server/{0108-Slice-Disable-sending-Entity-Movement-Packets.patch => 0109-Slice-Disable-sending-Entity-Movement-Packets.patch} (100%) rename patches/server/{0109-Akarin-Save-Json-list-asynchronously.patch => 0110-Akarin-Save-Json-list-asynchronously.patch} (100%) rename patches/server/{0110-Airplane-Remove-stream-in-PoiCompetitorScan.patch => 0111-Airplane-Remove-stream-in-PoiCompetitorScan.patch} (100%) rename patches/server/{0111-ScalableLux-Upstream-Starlight-Fix.patch => 0112-ScalableLux-Upstream-Starlight-Fix.patch} (100%) rename patches/server/{0112-Kiterino-New-liquid-physics.patch => 0113-Kiterino-New-liquid-physics.patch} (100%) diff --git a/patches/server/0103-lithium-ai.raid.patch b/patches/server/0103-lithium-ai.raid.patch new file mode 100644 index 0000000..026168c --- /dev/null +++ b/patches/server/0103-lithium-ai.raid.patch @@ -0,0 +1,52 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: 404Setup <153366651+404Setup@users.noreply.github.com> +Date: Mon, 9 Sep 2024 12:35:16 +0800 +Subject: [PATCH] lithium: ai.raid + +This patch is based on the following mixin: +"me/jellysquid/mods/lithium/mixin/ai/raid/RaidMixin.java" +By: Angeline +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/src/main/java/net/minecraft/world/entity/raid/Raid.java b/src/main/java/net/minecraft/world/entity/raid/Raid.java +index 71a442d218b7e7e7ebb57d9a1559289bda04c4d5..784143babf1569a131db0c511ec749cf22e1cafd 100644 +--- a/src/main/java/net/minecraft/world/entity/raid/Raid.java ++++ b/src/main/java/net/minecraft/world/entity/raid/Raid.java +@@ -112,6 +112,7 @@ public class Raid { + private Raid.RaidStatus status; + private int celebrationTicks; + private Optional waveSpawnPos; ++ private boolean isBarDirty; // lithium - ai.raid + // Paper start + private static final String PDC_NBT_KEY = "BukkitValues"; + private static final org.bukkit.craftbukkit.persistence.CraftPersistentDataTypeRegistry PDC_TYPE_REGISTRY = new org.bukkit.craftbukkit.persistence.CraftPersistentDataTypeRegistry(); +@@ -297,6 +298,12 @@ public class Raid { + + public void tick() { + if (!this.isStopped()) { ++ // lithium start - ai.raid ++ if (this.isBarDirty) { ++ this.updateBossbarInternal(); ++ this.isBarDirty = false; ++ } ++ // lithium end + if (this.status == Raid.RaidStatus.ONGOING) { + boolean flag = this.active; + +@@ -668,9 +675,15 @@ public class Raid { + + } + ++ // lithium start - ai.raid + public void updateBossbar() { ++ this.isBarDirty = true; ++ } ++ ++ private void updateBossbarInternal() { + this.raidEvent.setProgress(Mth.clamp(this.getHealthOfLivingRaiders() / this.totalHealth, 0.0F, 1.0F)); + } ++ // lithium end + + public float getHealthOfLivingRaiders() { + float f = 0.0F; diff --git a/patches/server/0103-vmp-TypeFilterableList.patch b/patches/server/0104-vmp-TypeFilterableList.patch similarity index 100% rename from patches/server/0103-vmp-TypeFilterableList.patch rename to patches/server/0104-vmp-TypeFilterableList.patch diff --git a/patches/server/0104-vmp-skip-entity-move-if-movement-is-zero.patch b/patches/server/0105-vmp-skip-entity-move-if-movement-is-zero.patch similarity index 100% rename from patches/server/0104-vmp-skip-entity-move-if-movement-is-zero.patch rename to patches/server/0105-vmp-skip-entity-move-if-movement-is-zero.patch diff --git a/patches/server/0105-Slice-Improve-map-saving-performance.patch b/patches/server/0106-Slice-Improve-map-saving-performance.patch similarity index 100% rename from patches/server/0105-Slice-Improve-map-saving-performance.patch rename to patches/server/0106-Slice-Improve-map-saving-performance.patch diff --git a/patches/server/0106-Slice-noEntityCollisions-for-Entity.patch b/patches/server/0107-Slice-noEntityCollisions-for-Entity.patch similarity index 100% rename from patches/server/0106-Slice-noEntityCollisions-for-Entity.patch rename to patches/server/0107-Slice-noEntityCollisions-for-Entity.patch diff --git a/patches/server/0107-Slice-Allow-inventory-clicks-in-Spectator.patch b/patches/server/0108-Slice-Allow-inventory-clicks-in-Spectator.patch similarity index 100% rename from patches/server/0107-Slice-Allow-inventory-clicks-in-Spectator.patch rename to patches/server/0108-Slice-Allow-inventory-clicks-in-Spectator.patch diff --git a/patches/server/0108-Slice-Disable-sending-Entity-Movement-Packets.patch b/patches/server/0109-Slice-Disable-sending-Entity-Movement-Packets.patch similarity index 100% rename from patches/server/0108-Slice-Disable-sending-Entity-Movement-Packets.patch rename to patches/server/0109-Slice-Disable-sending-Entity-Movement-Packets.patch diff --git a/patches/server/0109-Akarin-Save-Json-list-asynchronously.patch b/patches/server/0110-Akarin-Save-Json-list-asynchronously.patch similarity index 100% rename from patches/server/0109-Akarin-Save-Json-list-asynchronously.patch rename to patches/server/0110-Akarin-Save-Json-list-asynchronously.patch diff --git a/patches/server/0110-Airplane-Remove-stream-in-PoiCompetitorScan.patch b/patches/server/0111-Airplane-Remove-stream-in-PoiCompetitorScan.patch similarity index 100% rename from patches/server/0110-Airplane-Remove-stream-in-PoiCompetitorScan.patch rename to patches/server/0111-Airplane-Remove-stream-in-PoiCompetitorScan.patch diff --git a/patches/server/0111-ScalableLux-Upstream-Starlight-Fix.patch b/patches/server/0112-ScalableLux-Upstream-Starlight-Fix.patch similarity index 100% rename from patches/server/0111-ScalableLux-Upstream-Starlight-Fix.patch rename to patches/server/0112-ScalableLux-Upstream-Starlight-Fix.patch diff --git a/patches/server/0112-Kiterino-New-liquid-physics.patch b/patches/server/0113-Kiterino-New-liquid-physics.patch similarity index 100% rename from patches/server/0112-Kiterino-New-liquid-physics.patch rename to patches/server/0113-Kiterino-New-liquid-physics.patch