Update to 1.3.2
This commit is contained in:
@@ -12,6 +12,8 @@ public class EntityExperienceOrb extends Entity {
|
||||
public int c;
|
||||
private int d = 5;
|
||||
public int value; // CraftBukkit - private -> public
|
||||
private EntityHuman targetPlayer;
|
||||
private int targetTime;
|
||||
|
||||
public EntityExperienceOrb(World world, double d0, double d1, double d2, int i) {
|
||||
super(world);
|
||||
@@ -56,11 +58,18 @@ public class EntityExperienceOrb extends Entity {
|
||||
|
||||
this.i(this.locX, (this.boundingBox.b + this.boundingBox.e) / 2.0D, this.locZ);
|
||||
double d0 = 8.0D;
|
||||
EntityHuman entityhuman = this.world.findNearbyPlayer(this, d0);
|
||||
|
||||
if (entityhuman != null) {
|
||||
if (this.targetTime < this.a - 20 + this.id % 100) {
|
||||
if (this.targetPlayer == null || this.targetPlayer.e(this) > d0 * d0) {
|
||||
this.targetPlayer = this.world.findNearbyPlayer(this, d0);
|
||||
}
|
||||
|
||||
this.targetTime = this.a;
|
||||
}
|
||||
|
||||
if (this.targetPlayer != null) {
|
||||
// CraftBukkit start
|
||||
EntityTargetEvent event = CraftEventFactory.callEntityTargetEvent(this, entityhuman, EntityTargetEvent.TargetReason.CLOSEST_PLAYER);
|
||||
EntityTargetEvent event = CraftEventFactory.callEntityTargetEvent(this, targetPlayer, EntityTargetEvent.TargetReason.CLOSEST_PLAYER);
|
||||
Entity target = event.getTarget() == null ? null : ((org.bukkit.craftbukkit.entity.CraftEntity) event.getTarget()).getHandle();
|
||||
|
||||
if (!event.isCancelled() && target != null) {
|
||||
|
||||
Reference in New Issue
Block a user