--- a/net/minecraft/world/entity/raid/EntityRaider.java +++ b/net/minecraft/world/entity/raid/EntityRaider.java @@ -45,6 +45,10 @@ 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 IS_CELEBRATING = DataWatcher.defineId(EntityRaider.class, DataWatcherRegistry.BOOLEAN); @@ -166,7 +170,7 @@ MobEffect mobeffect1 = new MobEffect(MobEffects.BAD_OMEN, 120000, i, false, false, true); if (!this.level().getGameRules().getBoolean(GameRules.RULE_DISABLE_RAIDS)) { - entityhuman.addEffect(mobeffect1); + entityhuman.addEffect(mobeffect1, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.PATROL_CAPTAIN); // CraftBukkit } } } @@ -275,7 +279,7 @@ 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 { @@ -324,7 +328,7 @@ private final T mob; - public b(final EntityRaider entityraider, final EntityRaider entityraider1) { + public b(final EntityRaider entityraider, final T entityraider1) { // CraftBukkit - decompile error this.mob = entityraider1; this.setFlags(EnumSet.of(PathfinderGoal.Type.MOVE)); } @@ -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 @@ while (iterator.hasNext()) { EntityRaider entityraider = (EntityRaider) iterator.next(); - entityraider.setTarget(this.mob.getTarget()); + entityraider.setTarget(this.mob.getTarget(), org.bukkit.event.entity.EntityTargetEvent.TargetReason.FOLLOW_LEADER, true); // CraftBukkit } } @@ -557,7 +561,7 @@ while (iterator.hasNext()) { EntityRaider entityraider = (EntityRaider) iterator.next(); - entityraider.setTarget(entityliving); + entityraider.setTarget(this.mob.getTarget(), org.bukkit.event.entity.EntityTargetEvent.TargetReason.FOLLOW_LEADER, true); // CraftBukkit entityraider.setAggressive(true); }