Update to 1.3.2

This commit is contained in:
Travis Watkins
2012-08-24 19:51:51 -05:00
committed by EvilSeph
parent 35cff16da5
commit b8cc862083
18 changed files with 103 additions and 79 deletions

View File

@@ -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) {