Skip to content

Commit

Permalink
Fix armor stand cant kill by mob projectile
Browse files Browse the repository at this point in the history
Make it like before 1.20.2
  • Loading branch information
s-yh-china committed Dec 8, 2023
1 parent ab0b1ab commit 10acfe9
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions patches/server/0126-Armor-stand-cant-kill-by-mob-projectile.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,21 @@ Subject: [PATCH] Armor stand cant kill by mob projectile


diff --git a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
index 6609f4309c2d6fac14b56dd75963d868a464c44c..60859ca12d6df9770b3c0cb7feffbbb471b8b233 100644
index 3d982458fa0e5c5af27368e8750d7d24392386d2..d6cbd2cdaf10a5ba76c6052255b5ae2e119e2db6 100644
--- a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
+++ b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
@@ -552,7 +552,7 @@ public class ArmorStand extends LivingEntity {
} else {
long i = this.level().getGameTime();
@@ -518,6 +518,14 @@ public class ArmorStand extends LivingEntity {
boolean flag = "player".equals(source.getMsgId());
boolean flag1 = source.is(DamageTypeTags.ALWAYS_KILLS_ARMOR_STANDS);

- if (i - this.lastHit > 5L && !flag1) {
+ if (i - this.lastHit > 5L && (!flag1 || (top.leavesmc.leaves.LeavesConfig.armorStandCantKillByMobProjectile && source.is(net.minecraft.world.damagesource.DamageTypes.MOB_PROJECTILE)))) { // Leaves - Armor stand cant kill by mob projectile
this.level().broadcastEntityEvent(this, (byte) 32);
this.gameEvent(GameEvent.ENTITY_DAMAGE, source.getEntity());
this.lastHit = i;
+ // Leaves start - Armor stand cant kill by mob projectile
+ if (top.leavesmc.leaves.LeavesConfig.armorStandCantKillByMobProjectile) {
+ if (!flag && !(source.getDirectEntity() instanceof AbstractArrow)) {
+ return false;
+ }
+ }
+ // Leaves end - Armor stand cant kill by mob projectile
+
if (!flag && !flag1) {
return false;
} else {

0 comments on commit 10acfe9

Please sign in to comment.