3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-15 04:20:04 +01:00
Paper/patches/server/0441-Ensure-EntityRaider-respects-game-and-entity-rules-f.patch

29 Zeilen
1.6 KiB
Diff

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
2021-06-17 21:52:26 +02:00
index 37f4becb39d6d4c13aa0c3901ed123083518cdbf..19d1070afc7f6af92beb1fe7e90b67358596eca3 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
2021-06-14 07:32:56 +02:00
@@ -305,7 +305,7 @@ public abstract class Raider extends PatrollingMonster {
2021-06-11 14:02:28 +02:00
public class ObtainRaidLeaderBannerGoal<T extends Raider> extends Goal {
- private final T mob;
2021-06-17 21:52:26 +02:00
+ private final T mob; @Deprecated private T getRaider() { return mob; } // Paper - obfhelper
2021-06-11 14:02:28 +02:00
public ObtainRaidLeaderBannerGoal(T entityraider) { // CraftBukkit - decompile error
this.mob = entityraider;
2021-06-14 07:32:56 +02:00
@@ -314,6 +314,7 @@ public abstract class Raider extends PatrollingMonster {
2021-06-11 14:02:28 +02:00
@Override
public boolean canUse() {
+ if (!getRaider().level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING) || !getRaider().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())) {