mirror of
https://github.com/Samsuik/Sakura.git
synced 2025-12-23 16:59:16 +00:00
Iron golems take fall damage
This commit is contained in:
@@ -621,10 +621,10 @@ index 0000000000000000000000000000000000000000..5fc23a0b579d7cbe03baf5324bef887a
|
||||
+}
|
||||
diff --git a/src/main/java/me/samsuik/sakura/configuration/WorldConfiguration.java b/src/main/java/me/samsuik/sakura/configuration/WorldConfiguration.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..123708bc292843dca90501d757346769f8b9f353
|
||||
index 0000000000000000000000000000000000000000..376322d8e47e24a76c7162d6379c7f71debd7505
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/me/samsuik/sakura/configuration/WorldConfiguration.java
|
||||
@@ -0,0 +1,169 @@
|
||||
@@ -0,0 +1,170 @@
|
||||
+package me.samsuik.sakura.configuration;
|
||||
+
|
||||
+import com.mojang.logging.LogUtils;
|
||||
@@ -775,6 +775,7 @@ index 0000000000000000000000000000000000000000..123708bc292843dca90501d757346769
|
||||
+ public boolean disableMobAi = false;
|
||||
+ public boolean waterSensitivity = true;
|
||||
+ public boolean instantDeathAnimation = false;
|
||||
+ public boolean ironGolemsTakeFalldamage = false;
|
||||
+
|
||||
+ public Items items = new Items();
|
||||
+ public class Items extends ConfigurationPart {
|
||||
|
||||
31
patches/server/0056-Iron-golems-take-fall-damage.patch
Normal file
31
patches/server/0056-Iron-golems-take-fall-damage.patch
Normal file
@@ -0,0 +1,31 @@
|
||||
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;
|
||||
}
|
||||
Reference in New Issue
Block a user