mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-30 12:29:13 +00:00
Originally vanilla logic is to use stream, and Mojang switched it to Guava's Collections2 since 1.21.4. It is much faster than using stream or manually adding to a new ArrayList. Manually adding to a new ArrayList requires allocating a new object array. However, the Collections2 lazy handles filter condition on iteration, so much better.
19 lines
985 B
Diff
19 lines
985 B
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: hayanesuru <hayanesuru@outlook.jp>
|
|
Date: Sun, 13 Jul 2025 19:40:10 +0900
|
|
Subject: [PATCH] fix MC-298464
|
|
|
|
|
|
diff --git a/net/minecraft/world/damagesource/CombatTracker.java b/net/minecraft/world/damagesource/CombatTracker.java
|
|
index aa6213ca382e4901363317df1e30332c5166f271..03b7397b303c883b14fbac7759ff296c4e55d778 100644
|
|
--- a/net/minecraft/world/damagesource/CombatTracker.java
|
|
+++ b/net/minecraft/world/damagesource/CombatTracker.java
|
|
@@ -47,6 +47,7 @@ public class CombatTracker {
|
|
public void recordDamageAndCheckCombatState(final CombatEntry combatEntry) {
|
|
final DamageSource source = combatEntry.source();
|
|
// Paper end - Combat tracker API
|
|
+ if (org.dreeam.leaf.config.modules.fixes.MC298464.enabled) { this.entries.clear(); } // Leaf - Fix MC-298464
|
|
this.entries.add(combatEntry);
|
|
this.lastDamageTime = this.mob.tickCount;
|
|
this.takingDamage = true;
|