9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-19 15:09:25 +00:00
Files
Leaf/leaf-server/minecraft-patches/features/0299-Only-update-frozen-ticks-if-changed.patch

26 lines
1.3 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: hayanesuru <hayanesuru@outlook.jp>
Date: Sat, 30 Aug 2025 20:31:35 +0900
Subject: [PATCH] Only update frozen ticks if changed
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
index dc5cbabe8909cedf79e915a6129bfe414d69d106..67c70e8d1e44c8b9ee010f89c527fff2c5cff1f6 100644
--- a/net/minecraft/world/entity/LivingEntity.java
+++ b/net/minecraft/world/entity/LivingEntity.java
@@ -3709,7 +3709,13 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
if (this.level() instanceof ServerLevel serverLevel) {
if ((!this.isInPowderSnow || !this.canFreeze()) && !this.freezeLocked) { // Paper - Freeze Tick Lock API
- this.setTicksFrozen(Math.max(0, this.getTicksFrozen() - 2));
+ // Leaf start - Only update frozen ticks if changed
+ int ticksForzen = this.getTicksFrozen();
+ int newTicksForzen = Math.max(0, ticksForzen - 2);
+ if (ticksForzen != newTicksForzen) {
+ this.setTicksFrozen(newTicksForzen);
+ }
+ // Leaf end - Only update frozen ticks if changed
}
this.removeFrost();