PaperMC/patches/unapplied/server/0359-Ensure-EntityRaider-respects-game-and-entity-rules-f.patch

20 lines
1.2 KiB
Diff
Raw Normal View History

2021-06-11 14:02:28 +02:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: kickash32 <kickash32@gmail.com>
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
2024-06-14 14:11:52 +02:00
index 6fb56c826f0eaf76ab7896f784084b4fb1b3d105..f9bd6f5e54bdb4e2fe4cc73e54961721f440ef07 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/net/minecraft/world/entity/raid/Raider.java
+++ b/src/main/java/net/minecraft/world/entity/raid/Raider.java
2024-06-13 22:14:13 +02:00
@@ -292,6 +292,7 @@ public abstract class Raider extends PatrollingMonster {
2021-06-11 14:02:28 +02:00
@Override
public boolean canUse() {
2024-06-14 14:11:52 +02:00
+ if (!this.mob.level().getGameRules().getBoolean(net.minecraft.world.level.GameRules.RULE_MOBGRIEFING) || !this.mob.canPickUpLoot()) return false; // Paper - respect game and entity rules for picking up items
2021-06-11 14:02:28 +02:00
Raid raid = this.mob.getCurrentRaid();
2024-04-24 08:44:48 +02:00
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)))) {