Commits
md_5 authored 3804ba654e0
1 + | --- a/net/minecraft/server/PathfinderGoalTempt.java |
2 + | +++ b/net/minecraft/server/PathfinderGoalTempt.java |
3 + | |
4 + | import com.google.common.collect.Sets; |
5 + | import java.util.Set; |
6 + | import javax.annotation.Nullable; |
7 + | +// CraftBukkit start |
8 + | +import org.bukkit.craftbukkit.entity.CraftLivingEntity; |
9 + | +import org.bukkit.craftbukkit.event.CraftEventFactory; |
10 + | +import org.bukkit.event.entity.EntityTargetEvent; |
11 + | +import org.bukkit.event.entity.EntityTargetLivingEntityEvent; |
12 + | +// CraftBukkit end |
13 + | |
14 + | public class PathfinderGoalTempt extends PathfinderGoal { |
15 + | |
16 + | |
17 + | private double e; |
18 + | private double f; |
19 + | private double g; |
20 + | - private EntityHuman h; |
21 + | + private EntityLiving h; // CraftBukkit |
22 + | private int i; |
23 + | private boolean j; |
24 + | private final Set<Item> k; |
25 + | |
26 + | return false; |
27 + | } else { |
28 + | this.h = this.a.world.findNearbyPlayer(this.a, 10.0D); |
29 + | - return this.h == null ? false : this.a(this.h.getItemInMainHand()) || this.a(this.h.getItemInOffHand()); |
30 + | + // CraftBukkit start |
31 + | + // PAIL: rename |
32 + | + boolean tempt = this.h == null ? false : this.a(this.h.getItemInMainHand()) || this.a(this.h.getItemInOffHand()); |
33 + | + if (tempt) { |
34 + | + EntityTargetLivingEntityEvent event = CraftEventFactory.callEntityTargetLivingEvent(this.a, this.h, EntityTargetEvent.TargetReason.TEMPT); |
35 + | + if (event.isCancelled()) { |
36 + | + return false; |
37 + | + } |
38 + | + this.h = ((CraftLivingEntity) event.getTarget()).getHandle(); |
39 + | + } |
40 + | + return tempt; |
41 + | + // CraftBukkit end |
42 + | } |
43 + | } |
44 + |