From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Martijn Muijsers Date: Wed, 30 Nov 2022 20:17:41 +0100 Subject: [PATCH] Check frozen ticks before landing block License: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html) Gale - https://galemc.org This patch is based on the following mixin: "me/jellysquid/mods/lithium/mixin/entity/fast_powder_snow_check/LivingEntityMixin.java" By: 2No2Name <2No2Name@web.de> 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/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java index 506cbd835df841608d0d26a2a9313ee3434bf1ab..2f252bbe2946ea3228933b4b8c91a4e46fe99705 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java @@ -583,11 +583,10 @@ public abstract class LivingEntity extends Entity implements Attackable { } protected void tryAddFrost() { - if (!this.getBlockStateOnLegacy().isAir()) { int i = this.getTicksFrozen(); if (i > 0) { - AttributeInstance attributemodifiable = this.getAttribute(Attributes.MOVEMENT_SPEED); + AttributeInstance attributemodifiable = this.getBlockStateOnLegacy().isAir() ? null : this.getAttribute(Attributes.MOVEMENT_SPEED); // Gale - Lithium - check frozen ticks before landing block if (attributemodifiable == null) { return; @@ -597,7 +596,6 @@ public abstract class LivingEntity extends Entity implements Attackable { attributemodifiable.addTransientModifier(new AttributeModifier(LivingEntity.SPEED_MODIFIER_POWDER_SNOW_UUID, "Powder snow slow", (double) f, AttributeModifier.Operation.ADDITION)); } - } }