9
0
mirror of https://github.com/Samsuik/Sakura.git synced 2025-12-28 03:09:07 +00:00
Files
SakuraMC/patches/server/0055-Iron-golems-take-fall-damage.patch
Samsuik 7fafdbf3cb Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@dc3ef2a Fix vanilla components not being translated (#9893)
PaperMC/Paper@7e15d97 Remove no longer needed diff from adventure patch
PaperMC/Paper@f1820dc Fix incorrect border collision detection
PaperMC/Paper@de04cbc Updated Upstream (Bukkit/CraftBukkit) (#10034)
PaperMC/Paper@ff26d54 send sound and particle packets immediately even if off main (#10033)
PaperMC/Paper@e3140fb hotfix spawning item/xp in wrong spot
PaperMC/Paper@0b95298 Make worldborder collisions consistent with Vanilla
PaperMC/Paper@47b2c18 Don't fire the drop event on player deaths (#10046)
PaperMC/Paper@8c007d9 properly read and store sus effect duration (#10050)
PaperMC/Paper@5385b21 [ci skip] Make test results viewable in-browser and downloadable (#10055)
PaperMC/Paper@086ca61 Fix world border edge collision (#10053)
PaperMC/Paper@45e01a2 Use correct max stack size in crafter (#10057)
PaperMC/Paper@d11a588 Remove duplicate code in chunk tick iteration (#10056)
PaperMC/Paper@b4c9e7e add missing Experimental annotations (#10012)
2023-12-22 11:11:22 +00:00

32 lines
1.4 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Samsuik <kfian294ma4@gmail.com>
Date: Sat, 9 Dec 2023 16:10:29 +0000
Subject: [PATCH] Iron golems take fall damage
diff --git a/src/main/java/net/minecraft/world/entity/animal/IronGolem.java b/src/main/java/net/minecraft/world/entity/animal/IronGolem.java
index f383928fc5b331ddf128bdcb6a23010d8fe088d3..4dd778901f0327d30b993dffd73f75f631bb3a9b 100644
--- a/src/main/java/net/minecraft/world/entity/animal/IronGolem.java
+++ b/src/main/java/net/minecraft/world/entity/animal/IronGolem.java
@@ -240,6 +240,20 @@ public class IronGolem extends AbstractGolem implements NeutralMob {
}
+ // Sakura start
+ @Override
+ protected int calculateFallDamage(float fallDistance, float damageMultiplier) {
+ if (!this.level().sakuraConfig().entity.ironGolemsTakeFalldamage) {
+ return super.calculateFallDamage(fallDistance, damageMultiplier);
+ } else {
+ net.minecraft.world.effect.MobEffectInstance mobeffect = this.getEffect(net.minecraft.world.effect.MobEffects.JUMP);
+ float f2 = mobeffect == null ? 0.0F : (float) (mobeffect.getAmplifier() + 1);
+
+ return net.minecraft.util.Mth.ceil((fallDistance - 3.0F - f2) * damageMultiplier);
+ }
+ }
+ // Sakura end
+
public int getAttackAnimationTick() {
return this.attackAnimationTick;
}