9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-19 15:09:25 +00:00
Files
Leaf/patches/server/0135-DivineMC-Lithium-entity.fast_elytra_check-entity.fas.patch
Kaan D. cca144f3c7 Added some optimizations (#154)
* DivineMC - Lithium: Early checks for LivingEntity#updateSwingTime and updateFallFlying

* C2ME-Reduce-Allocations

* Lithium-fast-util

* Lithium-CompactSineLUT

* Compact-SineLUT

* some lithium patches

* Create 0141-Use-MCUtil.asyncExecutor-for-MAIN_WORKER_EXECUTOR.patch

* Fix tick function & Better inline world height

* improve the clamp logic by 1.2x

* Remove imports on IterateOutwardsCache

* Remove imports from 141

* Rename getCachedOrNewBits to CachedOrNewBitsGetter

* Remove thread instanceof checks

---------

Co-authored-by: kidofcubes <kidofcubes@gmail.com>
2024-11-09 12:51:27 -05:00

33 lines
1.5 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: kidofcubes <kidofcubes@gmail.com>
Date: Fri, 8 Nov 2024 00:22:44 +0800
Subject: [PATCH] DivineMC - Lithium: entity.fast_elytra_check +
entity.fast_hand_swing
Original license: GPL v3
Original project: https://github.com/DivineMC/DivineMC
Original license: LGPL v3
Original project: https://github.com/CaffeineMC/lithium-fabric
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 241e2598973939b7d19768cd9ca7cd8f3818c053..7ce6ce7212b942a8d6b64c98fab8fe060d813c61 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -2769,6 +2769,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
}
protected void updateSwingTime() {
+ if (!this.swinging && this.swingTime == 0) return; // DivineMC - Lithium: entity.fast_hand_swing
int i = this.getCurrentSwingDuration();
if (this.swinging) {
@@ -3747,6 +3748,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
}
private void updateFallFlying() {
+ if (!this.isFallFlying()) return; // DivineMC - Lithium: entity.fast_elytra_check
boolean flag = this.getSharedFlag(7);
if (flag && !this.onGround() && !this.isPassenger() && !this.hasEffect(MobEffects.LEVITATION)) {