9
0
mirror of https://github.com/LeavesMC/Leaves.git synced 2025-12-22 16:39:30 +00:00
Files
LeavesMC/patches/server/0096-Check-frozen-ticks-before-landing-block.patch
2024-01-10 13:32:42 +08:00

26 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/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 7e6f28c0d10e70acdaedb06314f1f5fc67e86de4..55d43a0cca18ec1274e417bdf199c048a0c5138c 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -581,11 +581,11 @@ public abstract class LivingEntity extends Entity implements Attackable {
}
protected void tryAddFrost() {
- if (!this.getBlockStateOnLegacy().isAir()) {
+ if (top.leavesmc.leaves.LeavesConfig.checkFrozenTicksBeforeLandingBlock || !this.getBlockStateOnLegacy().isAir()) { // Leaves - check frozen ticks before landing block
int i = this.getTicksFrozen();
if (i > 0) {
- AttributeInstance attributemodifiable = this.getAttribute(Attributes.MOVEMENT_SPEED);
+ AttributeInstance attributemodifiable = !top.leavesmc.leaves.LeavesConfig.checkFrozenTicksBeforeLandingBlock || !this.getBlockStateOnLegacy().isAir() ? this.getAttribute(Attributes.MOVEMENT_SPEED) : null; // Leaves - check frozen ticks before landing block
if (attributemodifiable == null) {
return;