9
0
mirror of https://github.com/LeavesMC/Leaves.git synced 2026-01-03 14:22:09 +00:00
Files
LeavesMC/patches/server/0122-Armor-stand-cant-kill-by-mob-projectile.patch
2024-01-10 13:32:42 +08:00

26 lines
1.4 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: violetc <58360096+s-yh-china@users.noreply.github.com>
Date: Fri, 29 Sep 2023 10:39:36 +0800
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 18e9ee9e0c986b1174ff9529b198a839df12825f..a6d486c867f86d5eec9423e53f37b7df6e93e7e2 100644
--- a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
+++ b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
@@ -518,6 +518,14 @@ public class ArmorStand extends LivingEntity {
boolean flag = source.is(DamageTypeTags.CAN_BREAK_ARMOR_STAND);
boolean flag1 = source.is(DamageTypeTags.ALWAYS_KILLS_ARMOR_STANDS);
+ // Leaves start - Armor stand cant kill by mob projectile
+ if (top.leavesmc.leaves.LeavesConfig.armorStandCantKillByMobProjectile) {
+ if (!flag && !(source.getDirectEntity() instanceof net.minecraft.world.entity.projectile.AbstractArrow)) {
+ return false;
+ }
+ }
+ // Leaves end - Armor stand cant kill by mob projectile
+
if (!flag && !flag1) {
return false;
} else {