mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2026-01-06 15:51:31 +00:00
Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@b0da38c2 Repository details in RuntimeException for MavenLibraryResolver#addRepository (#12939) PaperMC/Paper@1922be90 Update custom tags (#12183) PaperMC/Paper@79cf1353 Ignore HopperInventorySearchEvent when it has no listeners (#13009) PaperMC/Paper@ea014f7a feat: add stuckEntityPoiRetryDelay config (#12949) PaperMC/Paper@a9e76749 Support for showNotification in PlayerRecipeDiscoverEvent (#12992) PaperMC/Paper@5622c9dd Expose attribute sentiment (#12974) PaperMC/Paper@42b653b1 Expose more argument types (#12665) PaperMC/Paper@52d9a221 [ci/skip] Fix typo in Display javadoc (#13010) PaperMC/Paper@614e9acf Improve APIs around riptide tridents (#12996) PaperMC/Paper@51706e5a Fixed DyeItem sheep dye hunk
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Taiyou06 <kaandindar21@gmail.com>
|
||||
Date: Mon, 14 Apr 2025 18:07:21 +0200
|
||||
Subject: [PATCH] Optimise MobEffectUtil#getDigSpeedAmplification
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/effect/MobEffectUtil.java b/net/minecraft/world/effect/MobEffectUtil.java
|
||||
index 93a07a96f74e3ba73986324b39923c6a2802f8ee..e900c91c8eb36029726f7833df1d9be4030b3ad8 100644
|
||||
--- a/net/minecraft/world/effect/MobEffectUtil.java
|
||||
+++ b/net/minecraft/world/effect/MobEffectUtil.java
|
||||
@@ -27,17 +27,21 @@ public final class MobEffectUtil {
|
||||
}
|
||||
|
||||
public static int getDigSpeedAmplification(LivingEntity entity) {
|
||||
- int i = 0;
|
||||
- int i1 = 0;
|
||||
- if (entity.hasEffect(MobEffects.HASTE)) {
|
||||
- i = entity.getEffect(MobEffects.HASTE).getAmplifier();
|
||||
+ // Leaf start - Optimise MobEffectUtil#getDigSpeedAmplification
|
||||
+ int digAmplifier = 0;
|
||||
+ int conduitAmplifier = 0;
|
||||
+ MobEffectInstance digEffect = entity.getEffect(MobEffects.HASTE);
|
||||
+ if (digEffect != null) {
|
||||
+ digAmplifier = digEffect.getAmplifier();
|
||||
}
|
||||
|
||||
- if (entity.hasEffect(MobEffects.CONDUIT_POWER)) {
|
||||
- i1 = entity.getEffect(MobEffects.CONDUIT_POWER).getAmplifier();
|
||||
+ MobEffectInstance conduitEffect = entity.getEffect(MobEffects.CONDUIT_POWER);
|
||||
+ if (conduitEffect != null) {
|
||||
+ conduitAmplifier = conduitEffect.getAmplifier();
|
||||
}
|
||||
|
||||
- return Math.max(i, i1);
|
||||
+ return Math.max(digAmplifier, conduitAmplifier);
|
||||
+ // Leaf end - Optimise MobEffectUtil#getDigSpeedAmplification
|
||||
}
|
||||
|
||||
public static boolean hasWaterBreathing(LivingEntity entity) {
|
||||
Reference in New Issue
Block a user