mirror of
https://github.com/BX-Team/DivineMC.git
synced 2025-12-19 14:59:25 +00:00
I'll make some changes now, so skipping build Changelog: * add CarpetFixes optimizations * fix optimizations config * lithium optimizations * add Carpet Fixes Sheep Optimization * add Async Pathfinding; add C2ME opts math * add 2 vmp patches * New performance patches; update README and wiki README * update configuration on wiki * update wiki main page * Updated Upstream (Purpur) * fix conflicts * make "Don't save Fireworks" patch configurable * Disable memory reserve allocating * Fix MC-172801 * resolve conflicts * add bstats to readme * dd custom list of forks * update logo link
53 lines
2.1 KiB
Diff
53 lines
2.1 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
|
|
Date: Sat, 8 Apr 2023 23:45:11 +0300
|
|
Subject: [PATCH] lithium: ai.raid
|
|
|
|
This patch is based on the following mixin:
|
|
"me/jellysquid/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/src/main/java/net/minecraft/world/entity/raid/Raid.java b/src/main/java/net/minecraft/world/entity/raid/Raid.java
|
|
index eaa2943b667967f93f28d9d794d702fdaeb670ec..0e780da8dc230b27eddb01d1fa8bf2d8b5994158 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/raid/Raid.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/raid/Raid.java
|
|
@@ -106,6 +106,7 @@ public class Raid {
|
|
private Raid.RaidStatus status;
|
|
private int celebrationTicks;
|
|
private Optional<BlockPos> waveSpawnPos;
|
|
+ private boolean isBarDirty; // DivineMC - lithium: ai.raid
|
|
|
|
public Raid(int id, ServerLevel world, BlockPos pos) {
|
|
this.raidEvent = new ServerBossEvent(Raid.RAID_NAME_COMPONENT, BossEvent.BossBarColor.RED, BossEvent.BossBarOverlay.NOTCHED_10);
|
|
@@ -273,6 +274,12 @@ public class Raid {
|
|
|
|
public void tick() {
|
|
if (!this.isStopped()) {
|
|
+ // DivineMC start - lithium: ai.raid
|
|
+ if (this.isBarDirty) {
|
|
+ this.updateBossbarInternal();
|
|
+ this.isBarDirty = false;
|
|
+ }
|
|
+ // DivineMC end
|
|
if (this.status == Raid.RaidStatus.ONGOING) {
|
|
boolean flag = this.active;
|
|
|
|
@@ -641,9 +648,15 @@ public class Raid {
|
|
|
|
}
|
|
|
|
+ // DivineMC start - lithium: ai.raid
|
|
public void updateBossbar() {
|
|
+ this.isBarDirty = true;
|
|
+ }
|
|
+
|
|
+ private void updateBossbarInternal() {
|
|
this.raidEvent.setProgress(Mth.clamp(this.getHealthOfLivingRaiders() / this.totalHealth, 0.0F, 1.0F));
|
|
}
|
|
+ // DivineMC end
|
|
|
|
public float getHealthOfLivingRaiders() {
|
|
float f = 0.0F;
|