9
0
mirror of https://github.com/LeavesMC/Leaves.git synced 2026-01-04 15:41:31 +00:00
Files
LeavesMC/leaves-server/unapplied/minecraft-patches/features/0067-Check-frozen-ticks-before-landing-block.patch
2025-07-02 20:40:33 -07:00

25 lines
1.5 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: violetc <58360096+s-yh-china@users.noreply.github.com>
Date: Thu, 20 Jul 2023 20:33:52 +0800
Subject: [PATCH] Check frozen ticks before landing block
This patch is Powered by Gale(https://github.com/GaleMC/Gale)
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
index a95fec1506af042bd3d4424e93aa3f4de9627487..ce624ed17bc5c9b5e13d280f8dda736581b21821 100644
--- a/net/minecraft/world/entity/LivingEntity.java
+++ b/net/minecraft/world/entity/LivingEntity.java
@@ -523,10 +523,10 @@ public abstract class LivingEntity extends Entity implements Attackable {
}
protected void tryAddFrost() {
- if (!this.getBlockStateOnLegacy().isAir()) {
+ if (org.leavesmc.leaves.LeavesConfig.performance.checkFrozenTicksBeforeLandingBlock || !this.getBlockStateOnLegacy().isAir()) { // Leaves - check frozen ticks before landing block
int ticksFrozen = this.getTicksFrozen();
if (ticksFrozen > 0) {
- AttributeInstance attribute = this.getAttribute(Attributes.MOVEMENT_SPEED);
+ AttributeInstance attribute = !org.leavesmc.leaves.LeavesConfig.performance.checkFrozenTicksBeforeLandingBlock || !this.getBlockStateOnLegacy().isAir() ? this.getAttribute(Attributes.MOVEMENT_SPEED) : null; // Leaves - check frozen ticks before landing block
if (attribute == null) {
return;
}