mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-23 17:09:29 +00:00
* [Reimplement] Hide specified item components * try to fix drag problem in creative mode * correct my name * cleanup * Update 0103-Hide-specified-item-components.patch * Move to gameplay
34 lines
1.8 KiB
Diff
34 lines
1.8 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] Lithium: Skip unnecessary calculations if player is not
|
|
flying or swing
|
|
|
|
This patch is based on the following mixins:
|
|
* "net/caffeinemc/mods/lithium/mixin/entity/fast_elytra_check/LivingEntityMixin.java"
|
|
* "net/caffeinemc/mods/lithium/mixin/entity/fast_hand_swing/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 b816d4509f5d1154fdbe462a0534a17c0d238281..5588202b7bdf77e8cdc7fcdfccd68afebb13ab15 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
|
@@ -2866,6 +2866,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
}
|
|
|
|
protected void updateSwingTime() {
|
|
+ if (!this.swinging && this.swingTime == 0) return; // Leaf - Lithium - entity.fast_hand_swing
|
|
int i = this.getCurrentSwingDuration();
|
|
|
|
if (this.swinging) {
|
|
@@ -3889,6 +3890,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
protected void updateFallFlying() {
|
|
this.checkSlowFallDistance();
|
|
if (!this.level().isClientSide) {
|
|
+ if (!this.isFallFlying() && this.fallFlyTicks == 0) return; // Leaf - Lithium - entity.fast_elytra_check
|
|
if (!this.canGlide()) {
|
|
if (this.getSharedFlag(7) != false && !CraftEventFactory.callToggleGlideEvent(this, false).isCancelled()) // CraftBukkit
|
|
this.setSharedFlag(7, false);
|