Update for 1.4_00_01 -- if you bypassed Bukkit, you will most likely break.

This commit is contained in:
Erik Broes
2011-04-20 19:05:14 +02:00
parent ac9f297445
commit 483a878b8b
116 changed files with 3155 additions and 3207 deletions

View File

@@ -19,7 +19,7 @@ public class EntityFireball extends Entity {
private int h = 0;
private boolean i = false;
public int a = 0;
private EntityLiving j;
private EntityLiving shooter;
private int k;
private int l = 0;
public double b;
@@ -35,10 +35,10 @@ public class EntityFireball extends Entity {
public EntityFireball(World world, EntityLiving entityliving, double d0, double d1, double d2) {
super(world);
this.j = entityliving;
this.shooter = entityliving;
this.b(1.0F, 1.0F);
this.c(entityliving.locX, entityliving.locY, entityliving.locZ, entityliving.yaw, entityliving.pitch);
this.a(this.locX, this.locY, this.locZ);
this.setPositionRotation(entityliving.locX, entityliving.locY, entityliving.locZ, entityliving.yaw, entityliving.pitch);
this.setPosition(this.locX, this.locY, this.locZ);
this.height = 0.0F;
this.motX = this.motY = this.motZ = 0.0D;
d0 += this.random.nextGaussian() * 0.4D;
@@ -64,7 +64,7 @@ public class EntityFireball extends Entity {
if (i == this.h) {
++this.k;
if (this.k == 1200) {
this.D();
this.die();
}
return;
@@ -80,14 +80,14 @@ public class EntityFireball extends Entity {
++this.l;
}
Vec3D vec3d = Vec3D.b(this.locX, this.locY, this.locZ);
Vec3D vec3d1 = Vec3D.b(this.locX + this.motX, this.locY + this.motY, this.locZ + this.motZ);
Vec3D vec3d = Vec3D.create(this.locX, this.locY, this.locZ);
Vec3D vec3d1 = Vec3D.create(this.locX + this.motX, this.locY + this.motY, this.locZ + this.motZ);
MovingObjectPosition movingobjectposition = this.world.a(vec3d, vec3d1);
vec3d = Vec3D.b(this.locX, this.locY, this.locZ);
vec3d1 = Vec3D.b(this.locX + this.motX, this.locY + this.motY, this.locZ + this.motZ);
vec3d = Vec3D.create(this.locX, this.locY, this.locZ);
vec3d1 = Vec3D.create(this.locX + this.motX, this.locY + this.motY, this.locZ + this.motZ);
if (movingobjectposition != null) {
vec3d1 = Vec3D.b(movingobjectposition.f.a, movingobjectposition.f.b, movingobjectposition.f.c);
vec3d1 = Vec3D.create(movingobjectposition.f.a, movingobjectposition.f.b, movingobjectposition.f.c);
}
Entity entity = null;
@@ -97,7 +97,7 @@ public class EntityFireball extends Entity {
for (int j = 0; j < list.size(); ++j) {
Entity entity1 = (Entity) list.get(j);
if (entity1.d_() && (entity1 != this.j || this.l >= 25)) {
if (entity1.d_() && (entity1 != this.shooter || this.l >= 25)) {
float f = 0.3F;
AxisAlignedBB axisalignedbb = entity1.boundingBox.b((double) f, (double) f, (double) f);
MovingObjectPosition movingobjectposition1 = axisalignedbb.a(vec3d, vec3d1);
@@ -119,12 +119,12 @@ public class EntityFireball extends Entity {
if (movingobjectposition != null) {
// CraftBukkit start
if (movingobjectposition.g != null) {
if (movingobjectposition.entity != null) {
boolean stick;
if (movingobjectposition.g instanceof EntityLiving) {
if (movingobjectposition.entity instanceof EntityLiving) {
CraftServer server = ((WorldServer) this.world).getServer();
org.bukkit.entity.Entity shooter = (this.j == null) ? null : this.j.getBukkitEntity();
org.bukkit.entity.Entity damagee = movingobjectposition.g.getBukkitEntity();
org.bukkit.entity.Entity shooter = (this.shooter == null) ? null : this.shooter.getBukkitEntity();
org.bukkit.entity.Entity damagee = movingobjectposition.entity.getBukkitEntity();
org.bukkit.entity.Entity projectile = this.getBukkitEntity();
DamageCause damageCause = EntityDamageEvent.DamageCause.ENTITY_ATTACK;
int damage = 0;
@@ -135,13 +135,13 @@ public class EntityFireball extends Entity {
if (!event.isCancelled()) {
// this function returns if the fireball should stick or not, i.e. !bounce
stick = movingobjectposition.g.a(this.j, event.getDamage());
stick = movingobjectposition.entity.damageEntity(this.shooter, event.getDamage());
} else {
// event was cancelled, get if the fireball should bounce or not
stick = !event.getBounce();
}
} else {
stick = movingobjectposition.g.a(this.j, 0);
stick = movingobjectposition.entity.damageEntity(this.shooter, 0);
}
if (stick) {
;
@@ -154,8 +154,8 @@ public class EntityFireball extends Entity {
server.getPluginManager().callEvent(event);
if (!event.isCancelled()) {
// give 'this' instead of (Entity) null so we know what causes the damage
this.world.a(this, this.locX, this.locY, this.locZ, event.getRadius(), event.getFire());
this.D();
this.world.createExplosion(this, this.locX, this.locY, this.locZ, event.getRadius(), event.getFire());
this.die();
}
// CraftBukkit end
}
@@ -204,7 +204,7 @@ public class EntityFireball extends Entity {
this.motY *= (double) f2;
this.motZ *= (double) f2;
this.world.a("smoke", this.locX, this.locY + 0.5D, this.locZ, 0.0D, 0.0D, 0.0D);
this.a(this.locX, this.locY, this.locZ);
this.setPosition(this.locX, this.locY, this.locZ);
}
public void a(NBTTagCompound nbttagcompound) {
@@ -229,7 +229,7 @@ public class EntityFireball extends Entity {
return true;
}
public boolean a(Entity entity, int i) {
public boolean damageEntity(Entity entity, int i) {
this.W();
if (entity != null) {
Vec3D vec3d = entity.S();