2021-03-15 23:00:00 +01:00
--- a/net/minecraft/world/entity/raid/EntityRaider.java
+++ b/net/minecraft/world/entity/raid/EntityRaider.java
2024-04-23 17:15:00 +02:00
@@ -45,6 +45,10 @@
2024-02-21 10:55:34 +01:00
import net.minecraft.world.level.WorldAccess;
import net.minecraft.world.phys.Vec3D;
+// CraftBukkit start
+import org.bukkit.event.entity.EntityRemoveEvent;
+// CraftBukkit end
+
public abstract class EntityRaider extends EntityMonsterPatrolling {
protected static final DataWatcherObject<Boolean> IS_CELEBRATING = DataWatcher.defineId(EntityRaider.class, DataWatcherRegistry.BOOLEAN);
2024-04-23 17:15:00 +02:00
@@ -166,7 +170,7 @@
2020-02-02 01:16:01 +01:00
MobEffect mobeffect1 = new MobEffect(MobEffects.BAD_OMEN, 120000, i, false, false, true);
2023-06-07 17:30:00 +02:00
if (!this.level().getGameRules().getBoolean(GameRules.RULE_DISABLE_RAIDS)) {
2020-02-02 01:16:01 +01:00
- entityhuman.addEffect(mobeffect1);
+ entityhuman.addEffect(mobeffect1, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.PATROL_CAPTAIN); // CraftBukkit
}
}
}
2024-04-23 17:15:00 +02:00
@@ -275,7 +279,7 @@
2024-02-21 10:55:34 +01:00
this.onItemPickup(entityitem);
this.setItemSlot(enumitemslot, itemstack);
this.take(entityitem, itemstack.getCount());
- entityitem.discard();
+ entityitem.discard(EntityRemoveEvent.Cause.PICKUP); // CraftBukkit - add Bukkit remove cause
this.getCurrentRaid().setLeader(this.getWave(), this);
this.setPatrolLeader(true);
} else {
2024-04-23 17:15:00 +02:00
@@ -324,7 +328,7 @@
2021-06-11 07:00:00 +02:00
private final T mob;
2024-04-23 17:15:00 +02:00
- public b(final EntityRaider entityraider, final EntityRaider entityraider1) {
+ public b(final EntityRaider entityraider, final T entityraider1) { // CraftBukkit - decompile error
this.mob = entityraider1;
2021-11-21 23:00:00 +01:00
this.setFlags(EnumSet.of(PathfinderGoal.Type.MOVE));
2021-06-11 07:00:00 +02:00
}
2024-04-23 17:15:00 +02:00
@@ -517,7 +521,7 @@
private final float hostileRadiusSqr;
public final PathfinderTargetCondition shoutTargeting = PathfinderTargetCondition.forNonCombat().range(8.0D).ignoreLineOfSight().ignoreInvisibilityTesting();
- public a(final EntityRaider entityraider, final EntityIllagerAbstract entityillagerabstract, final float f) {
+ public a(final EntityIllagerAbstract entityillagerabstract, final float f) { // CraftBukkit - decompile error
this.mob = entityillagerabstract;
this.hostileRadiusSqr = f * f;
this.setFlags(EnumSet.of(PathfinderGoal.Type.MOVE, PathfinderGoal.Type.LOOK));
@@ -540,7 +544,7 @@
2019-04-23 04:00:00 +02:00
while (iterator.hasNext()) {
EntityRaider entityraider = (EntityRaider) iterator.next();
2021-11-21 23:00:00 +01:00
- entityraider.setTarget(this.mob.getTarget());
+ entityraider.setTarget(this.mob.getTarget(), org.bukkit.event.entity.EntityTargetEvent.TargetReason.FOLLOW_LEADER, true); // CraftBukkit
2019-04-23 04:00:00 +02:00
}
}
2024-04-23 17:15:00 +02:00
@@ -557,7 +561,7 @@
2019-04-23 04:00:00 +02:00
while (iterator.hasNext()) {
EntityRaider entityraider = (EntityRaider) iterator.next();
2021-11-21 23:00:00 +01:00
- entityraider.setTarget(entityliving);
+ entityraider.setTarget(this.mob.getTarget(), org.bukkit.event.entity.EntityTargetEvent.TargetReason.FOLLOW_LEADER, true); // CraftBukkit
2020-06-25 02:00:00 +02:00
entityraider.setAggressive(true);
2019-04-23 04:00:00 +02:00
}