diff options
Diffstat (limited to 'patches/server/0365-Ensure-EntityRaider-respects-game-and-entity-rules-f.patch')
-rw-r--r-- | patches/server/0365-Ensure-EntityRaider-respects-game-and-entity-rules-f.patch | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/patches/server/0365-Ensure-EntityRaider-respects-game-and-entity-rules-f.patch b/patches/server/0365-Ensure-EntityRaider-respects-game-and-entity-rules-f.patch new file mode 100644 index 0000000000..a65b9bbbbc --- /dev/null +++ b/patches/server/0365-Ensure-EntityRaider-respects-game-and-entity-rules-f.patch @@ -0,0 +1,19 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: kickash32 <[email protected]> +Date: Sat, 9 May 2020 02:01:48 -0400 +Subject: [PATCH] Ensure EntityRaider respects game and entity rules for + picking up items + + +diff --git a/src/main/java/net/minecraft/world/entity/raid/Raider.java b/src/main/java/net/minecraft/world/entity/raid/Raider.java +index f81d5abedec0f2fa7ae81421edda8b3dfcb7690b..9f54e46b870e78d1d360ea79604708db08276ae3 100644 +--- a/src/main/java/net/minecraft/world/entity/raid/Raider.java ++++ b/src/main/java/net/minecraft/world/entity/raid/Raider.java +@@ -334,6 +334,7 @@ public abstract class Raider extends PatrollingMonster { + + @Override + public boolean canUse() { ++ if (!this.mob.level().getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING) || !this.mob.canPickUpLoot()) return false; // Paper - respect game and entity rules for picking up items + Raid raid = this.mob.getCurrentRaid(); + + if (this.mob.hasActiveRaid() && !this.mob.getCurrentRaid().isOver() && this.mob.canBeLeader() && !ItemStack.matches(this.mob.getItemBySlot(EquipmentSlot.HEAD), Raid.getLeaderBannerInstance(this.mob.registryAccess().lookupOrThrow(Registries.BANNER_PATTERN)))) { |