mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-14 11:45:52 -07:00
Updated to Minecraft version 1.4
This commit is contained in:
@@ -9,22 +9,27 @@ import org.bukkit.event.entity.EntityTargetEvent.TargetReason;
|
||||
// CraftBukkit end
|
||||
|
||||
public class EntityCreature extends EntityLiving {
|
||||
|
||||
public PathEntity a; // CraftBukkit - public
|
||||
public Entity d; // CraftBukkit - public
|
||||
// CraftBukkit start - both public
|
||||
public PathEntity a;
|
||||
public Entity d;
|
||||
// CraftBukkit end
|
||||
protected boolean e = false;
|
||||
|
||||
public EntityCreature(World world) {
|
||||
super(world);
|
||||
}
|
||||
|
||||
protected boolean u() {
|
||||
return false;
|
||||
}
|
||||
|
||||
protected void c_() {
|
||||
this.e = false;
|
||||
this.e = this.u();
|
||||
float f = 16.0F;
|
||||
|
||||
if (this.d == null) {
|
||||
// CraftBukkit start
|
||||
Entity target = this.l();
|
||||
Entity target = this.m();
|
||||
if (target != null) {
|
||||
EntityTargetEvent event = new EntityTargetEvent(this.getBukkitEntity(), target.getBukkitEntity(), TargetReason.CLOSEST_PLAYER);
|
||||
CraftServer server = ((WorldServer) this.world).getServer();
|
||||
@@ -42,7 +47,7 @@ public class EntityCreature extends EntityLiving {
|
||||
if (this.d != null) {
|
||||
this.a = this.world.a(this, this.d, f);
|
||||
}
|
||||
} else if (!this.d.J()) {
|
||||
} else if (!this.d.N()) {
|
||||
// CraftBukkit start
|
||||
EntityTargetEvent event = new EntityTargetEvent(this.getBukkitEntity(), null, TargetReason.TARGET_DIED);
|
||||
CraftServer server = ((WorldServer) this.world).getServer();
|
||||
@@ -66,7 +71,7 @@ public class EntityCreature extends EntityLiving {
|
||||
|
||||
if (!this.e && this.d != null && (this.a == null || this.random.nextInt(20) == 0)) {
|
||||
this.a = this.world.a(this, this.d, f);
|
||||
} else if (this.a == null && this.random.nextInt(80) == 0 || this.random.nextInt(80) == 0) {
|
||||
} else if (!this.e && (this.a == null && this.random.nextInt(80) == 0 || this.random.nextInt(80) == 0)) {
|
||||
boolean flag = false;
|
||||
int i = -1;
|
||||
int j = -1;
|
||||
@@ -95,7 +100,7 @@ public class EntityCreature extends EntityLiving {
|
||||
|
||||
int l1 = MathHelper.b(this.boundingBox.b);
|
||||
boolean flag1 = this.g_();
|
||||
boolean flag2 = this.Q();
|
||||
boolean flag2 = this.V();
|
||||
|
||||
this.pitch = 0.0F;
|
||||
if (this.a != null && this.random.nextInt(100) != 0) {
|
||||
@@ -155,10 +160,10 @@ public class EntityCreature extends EntityLiving {
|
||||
}
|
||||
|
||||
if (this.d != null) {
|
||||
this.b(this.d, 30.0F);
|
||||
this.a(this.d, 30.0F, 30.0F);
|
||||
}
|
||||
|
||||
if (this.aV) {
|
||||
if (this.aW) {
|
||||
this.ax = true;
|
||||
}
|
||||
|
||||
@@ -177,7 +182,7 @@ public class EntityCreature extends EntityLiving {
|
||||
return 0.0F;
|
||||
}
|
||||
|
||||
protected Entity l() {
|
||||
protected Entity m() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -188,4 +193,20 @@ public class EntityCreature extends EntityLiving {
|
||||
|
||||
return super.b() && this.a(i, j, k) >= 0.0F;
|
||||
}
|
||||
|
||||
public boolean z() {
|
||||
return this.a != null;
|
||||
}
|
||||
|
||||
public void a(PathEntity pathentity) {
|
||||
this.a = pathentity;
|
||||
}
|
||||
|
||||
public Entity A() {
|
||||
return this.d;
|
||||
}
|
||||
|
||||
public void c(Entity entity) {
|
||||
this.d = entity;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user