9
0
mirror of https://github.com/Samsuik/Sakura.git synced 2025-12-22 08:19:26 +00:00
Files
SakuraMC/patches/server/0072-Change-shields-to-reduce-damage.patch
Samsuik 13f012eb71 Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@84f6e6e Fix max temper API for llama (#10823)
PaperMC/Paper@672c077 handle BODY slot for non-mobs (#10822)
PaperMC/Paper@716b868 Use RegistryOps for loadAdvancement (#10799)
PaperMC/Paper@d9e659a Allow firework effects with no colors (#10814)
PaperMC/Paper@7e2b682 Fix skipping custom block entity tag (#10812)
PaperMC/Paper@ed85aac Flatten namespaced vanilla command alias redirects (#10821)
PaperMC/Paper@a31dc90 Several fixes and new api for experience merging/stacking (#9242)
PaperMC/Paper@efd91e5 Add registry-related argument types (#10770)
PaperMC/Paper@27d2ed8 Extend fishing API (#10634)
PaperMC/Paper@0fcf3e3 Deprecate InvAction#HOTBAR_MOVE_AND_READD (#10784)
PaperMC/Paper@8e6554a Fix sending disconnect packet in phases where it doesn't exist
PaperMC/Paper@06e69c8 Use CommandSourceStack in AsyncPlayerSendCommandsEvent (#10826)
PaperMC/Paper@a47e11d fix knockback events (#10831)
PaperMC/Paper@3181470 Add entity heal API (#10267)
PaperMC/Paper@0513374 Fire TabCompleteEvent for legacy commands (#10834)
PaperMC/Paper@5d8e53d Fix CommandSourceStack#bypassSelectorPermissions (#10837)
PaperMC/Paper@ac64751 Use RegistryOps in the correct places (#10843)
PaperMC/Paper@54fbd0c clarify what getEntityId actually returns (#10839)
PaperMC/Paper@b8f2101 Only assign blockstate data if super ctor did not (#10841)
PaperMC/Paper@4f13be9 Do not perform chunk existance check for I/O scheduling
PaperMC/Paper@79c1ce1 Add since to deprecated for removals (#10848)
PaperMC/Paper@88d76d9 Make Bogged implement Shearable (#10844)
PaperMC/Paper@bd5867a Handle alpha channel from potion_contents component (#10808)
2024-06-08 20:58:06 +01:00

25 lines
1.4 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Samsuik <kfian294ma4@gmail.com>
Date: Fri, 23 Feb 2024 02:07:03 +0000
Subject: [PATCH] Change shields to reduce damage
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index ed1cd8624df04419031bb55c03d31d8c002dfbc7..c9f23149df9bb0a2a73abb6e16ff9673562d60eb 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -2329,7 +2329,13 @@ public abstract class LivingEntity extends Entity implements Attackable {
Function<Double, Double> blocking = new Function<Double, Double>() {
@Override
public Double apply(Double f) {
+ // Sakura start - shield damage reduction
+ if (!level().sakuraConfig().players.combat.shieldDamageReduction || damagesource.getDirectEntity() instanceof AbstractArrow) {
return -((LivingEntity.this.isDamageSourceBlocked(damagesource)) ? f : 0.0);
+ } else {
+ return -(LivingEntity.this.isBlocking() ? f * 0.5 : 0.0);
+ }
+ // Sakura end - shield damage reduction
}
};
float blockingModifier = blocking.apply((double) f).floatValue();