Update CraftBukkit to Minecraft 1.7.5
This commit is contained in:
@@ -19,20 +19,20 @@ public class EntityArrow extends Entity implements IProjectile {
|
||||
public int fromPlayer;
|
||||
public int shake;
|
||||
public Entity shooter;
|
||||
private int j;
|
||||
private int at;
|
||||
private int au;
|
||||
private double damage = 2.0D;
|
||||
public int aw; // CraftBukkit - private -> public
|
||||
public int knockbackStrength; // CraftBukkit - private -> public
|
||||
|
||||
public EntityArrow(World world) {
|
||||
super(world);
|
||||
this.k = 10.0D;
|
||||
this.j = 10.0D;
|
||||
this.a(0.5F, 0.5F);
|
||||
}
|
||||
|
||||
public EntityArrow(World world, double d0, double d1, double d2) {
|
||||
super(world);
|
||||
this.k = 10.0D;
|
||||
this.j = 10.0D;
|
||||
this.a(0.5F, 0.5F);
|
||||
this.setPosition(d0, d1, d2);
|
||||
this.height = 0.0F;
|
||||
@@ -40,7 +40,7 @@ public class EntityArrow extends Entity implements IProjectile {
|
||||
|
||||
public EntityArrow(World world, EntityLiving entityliving, EntityLiving entityliving1, float f, float f1) {
|
||||
super(world);
|
||||
this.k = 10.0D;
|
||||
this.j = 10.0D;
|
||||
this.shooter = entityliving;
|
||||
this.projectileSource = (LivingEntity) entityliving.getBukkitEntity(); // CraftBukkit
|
||||
if (entityliving instanceof EntityHuman) {
|
||||
@@ -69,7 +69,7 @@ public class EntityArrow extends Entity implements IProjectile {
|
||||
|
||||
public EntityArrow(World world, EntityLiving entityliving, float f) {
|
||||
super(world);
|
||||
this.k = 10.0D;
|
||||
this.j = 10.0D;
|
||||
this.shooter = entityliving;
|
||||
this.projectileSource = (LivingEntity) entityliving.getBukkitEntity(); // CraftBukkit
|
||||
if (entityliving instanceof EntityHuman) {
|
||||
@@ -112,7 +112,7 @@ public class EntityArrow extends Entity implements IProjectile {
|
||||
|
||||
this.lastYaw = this.yaw = (float) (Math.atan2(d0, d2) * 180.0D / 3.1415927410125732D);
|
||||
this.lastPitch = this.pitch = (float) (Math.atan2(d1, (double) f3) * 180.0D / 3.1415927410125732D);
|
||||
this.j = 0;
|
||||
this.at = 0;
|
||||
}
|
||||
|
||||
public void h() {
|
||||
@@ -130,7 +130,7 @@ public class EntityArrow extends Entity implements IProjectile {
|
||||
block.updateShape(this.world, this.d, this.e, this.f);
|
||||
AxisAlignedBB axisalignedbb = block.a(this.world, this.d, this.e, this.f);
|
||||
|
||||
if (axisalignedbb != null && axisalignedbb.a(this.world.getVec3DPool().create(this.locX, this.locY, this.locZ))) {
|
||||
if (axisalignedbb != null && axisalignedbb.a(Vec3D.a(this.locX, this.locY, this.locZ))) {
|
||||
this.inGround = true;
|
||||
}
|
||||
}
|
||||
@@ -143,8 +143,8 @@ public class EntityArrow extends Entity implements IProjectile {
|
||||
int i = this.world.getData(this.d, this.e, this.f);
|
||||
|
||||
if (block == this.g && i == this.h) {
|
||||
++this.j;
|
||||
if (this.j == 1200) {
|
||||
++this.at;
|
||||
if (this.at == 1200) {
|
||||
this.die();
|
||||
}
|
||||
} else {
|
||||
@@ -152,19 +152,19 @@ public class EntityArrow extends Entity implements IProjectile {
|
||||
this.motX *= (double) (this.random.nextFloat() * 0.2F);
|
||||
this.motY *= (double) (this.random.nextFloat() * 0.2F);
|
||||
this.motZ *= (double) (this.random.nextFloat() * 0.2F);
|
||||
this.j = 0;
|
||||
this.at = 0;
|
||||
this.au = 0;
|
||||
}
|
||||
} else {
|
||||
++this.au;
|
||||
Vec3D vec3d = this.world.getVec3DPool().create(this.locX, this.locY, this.locZ);
|
||||
Vec3D vec3d1 = this.world.getVec3DPool().create(this.locX + this.motX, this.locY + this.motY, this.locZ + this.motZ);
|
||||
Vec3D vec3d = Vec3D.a(this.locX, this.locY, this.locZ);
|
||||
Vec3D vec3d1 = Vec3D.a(this.locX + this.motX, this.locY + this.motY, this.locZ + this.motZ);
|
||||
MovingObjectPosition movingobjectposition = this.world.rayTrace(vec3d, vec3d1, false, true, false);
|
||||
|
||||
vec3d = this.world.getVec3DPool().create(this.locX, this.locY, this.locZ);
|
||||
vec3d1 = this.world.getVec3DPool().create(this.locX + this.motX, this.locY + this.motY, this.locZ + this.motZ);
|
||||
vec3d = Vec3D.a(this.locX, this.locY, this.locZ);
|
||||
vec3d1 = Vec3D.a(this.locX + this.motX, this.locY + this.motY, this.locZ + this.motZ);
|
||||
if (movingobjectposition != null) {
|
||||
vec3d1 = this.world.getVec3DPool().create(movingobjectposition.pos.c, movingobjectposition.pos.d, movingobjectposition.pos.e);
|
||||
vec3d1 = Vec3D.a(movingobjectposition.pos.a, movingobjectposition.pos.b, movingobjectposition.pos.c);
|
||||
}
|
||||
|
||||
Entity entity = null;
|
||||
@@ -177,7 +177,7 @@ public class EntityArrow extends Entity implements IProjectile {
|
||||
for (j = 0; j < list.size(); ++j) {
|
||||
Entity entity1 = (Entity) list.get(j);
|
||||
|
||||
if (entity1.R() && (entity1 != this.shooter || this.au >= 5)) {
|
||||
if (entity1.Q() && (entity1 != this.shooter || this.au >= 5)) {
|
||||
f1 = 0.3F;
|
||||
AxisAlignedBB axisalignedbb1 = entity1.boundingBox.grow((double) f1, (double) f1, (double) f1);
|
||||
MovingObjectPosition movingobjectposition1 = axisalignedbb1.a(vec3d, vec3d1);
|
||||
@@ -215,7 +215,7 @@ public class EntityArrow extends Entity implements IProjectile {
|
||||
f2 = MathHelper.sqrt(this.motX * this.motX + this.motY * this.motY + this.motZ * this.motZ);
|
||||
int k = MathHelper.f((double) f2 * this.damage);
|
||||
|
||||
if (this.f()) {
|
||||
if (this.isCritical()) {
|
||||
k += this.random.nextInt(k / 2 + 2);
|
||||
}
|
||||
|
||||
@@ -244,13 +244,13 @@ public class EntityArrow extends Entity implements IProjectile {
|
||||
EntityLiving entityliving = (EntityLiving) movingobjectposition.entity;
|
||||
|
||||
if (!this.world.isStatic) {
|
||||
entityliving.p(entityliving.aZ() + 1);
|
||||
entityliving.p(entityliving.aY() + 1);
|
||||
}
|
||||
|
||||
if (this.aw > 0) {
|
||||
if (this.knockbackStrength > 0) {
|
||||
f3 = MathHelper.sqrt(this.motX * this.motX + this.motZ * this.motZ);
|
||||
if (f3 > 0.0F) {
|
||||
movingobjectposition.entity.g(this.motX * (double) this.aw * 0.6000000238418579D / (double) f3, 0.1D, this.motZ * (double) this.aw * 0.6000000238418579D / (double) f3);
|
||||
movingobjectposition.entity.g(this.motX * (double) this.knockbackStrength * 0.6000000238418579D / (double) f3, 0.1D, this.motZ * (double) this.knockbackStrength * 0.6000000238418579D / (double) f3);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -282,9 +282,9 @@ public class EntityArrow extends Entity implements IProjectile {
|
||||
this.f = movingobjectposition.d;
|
||||
this.g = this.world.getType(d, e, f); // CraftBukkit - Get correct block for storage
|
||||
this.h = this.world.getData(this.d, this.e, this.f);
|
||||
this.motX = (double) ((float) (movingobjectposition.pos.c - this.locX));
|
||||
this.motY = (double) ((float) (movingobjectposition.pos.d - this.locY));
|
||||
this.motZ = (double) ((float) (movingobjectposition.pos.e - this.locZ));
|
||||
this.motX = (double) ((float) (movingobjectposition.pos.a - this.locX));
|
||||
this.motY = (double) ((float) (movingobjectposition.pos.b - this.locY));
|
||||
this.motZ = (double) ((float) (movingobjectposition.pos.c - this.locZ));
|
||||
f2 = MathHelper.sqrt(this.motX * this.motX + this.motY * this.motY + this.motZ * this.motZ);
|
||||
this.locX -= this.motX / (double) f2 * 0.05000000074505806D;
|
||||
this.locY -= this.motY / (double) f2 * 0.05000000074505806D;
|
||||
@@ -292,14 +292,14 @@ public class EntityArrow extends Entity implements IProjectile {
|
||||
this.makeSound("random.bowhit", 1.0F, 1.2F / (this.random.nextFloat() * 0.2F + 0.9F));
|
||||
this.inGround = true;
|
||||
this.shake = 7;
|
||||
this.a(false);
|
||||
this.setCritical(false);
|
||||
if (this.g.getMaterial() != Material.AIR) {
|
||||
this.g.a(this.world, this.d, this.e, this.f, (Entity) this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (this.f()) {
|
||||
if (this.isCritical()) {
|
||||
for (j = 0; j < 4; ++j) {
|
||||
this.world.addParticle("crit", this.locX + this.motX * (double) j / 4.0D, this.locY + this.motY * (double) j / 4.0D, this.locZ + this.motZ * (double) j / 4.0D, -this.motX, -this.motY + 0.2D, -this.motZ);
|
||||
}
|
||||
@@ -332,7 +332,7 @@ public class EntityArrow extends Entity implements IProjectile {
|
||||
float f4 = 0.99F;
|
||||
|
||||
f1 = 0.05F;
|
||||
if (this.M()) {
|
||||
if (this.L()) {
|
||||
for (int l = 0; l < 4; ++l) {
|
||||
f3 = 0.25F;
|
||||
this.world.addParticle("bubble", this.locX - this.motX * (double) f3, this.locY - this.motY * (double) f3, this.locZ - this.motZ * (double) f3, this.motX, this.motY, this.motZ);
|
||||
@@ -341,7 +341,7 @@ public class EntityArrow extends Entity implements IProjectile {
|
||||
f4 = 0.8F;
|
||||
}
|
||||
|
||||
if (this.L()) {
|
||||
if (this.K()) {
|
||||
this.extinguish();
|
||||
}
|
||||
|
||||
@@ -350,7 +350,7 @@ public class EntityArrow extends Entity implements IProjectile {
|
||||
this.motZ *= (double) f4;
|
||||
this.motY -= (double) f1;
|
||||
this.setPosition(this.locX, this.locY, this.locZ);
|
||||
this.I();
|
||||
this.H();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -358,7 +358,7 @@ public class EntityArrow extends Entity implements IProjectile {
|
||||
nbttagcompound.setShort("xTile", (short) this.d);
|
||||
nbttagcompound.setShort("yTile", (short) this.e);
|
||||
nbttagcompound.setShort("zTile", (short) this.f);
|
||||
nbttagcompound.setShort("life", (short) this.j);
|
||||
nbttagcompound.setShort("life", (short) this.at);
|
||||
nbttagcompound.setByte("inTile", (byte) Block.b(this.g));
|
||||
nbttagcompound.setByte("inData", (byte) this.h);
|
||||
nbttagcompound.setByte("shake", (byte) this.shake);
|
||||
@@ -371,7 +371,7 @@ public class EntityArrow extends Entity implements IProjectile {
|
||||
this.d = nbttagcompound.getShort("xTile");
|
||||
this.e = nbttagcompound.getShort("yTile");
|
||||
this.f = nbttagcompound.getShort("zTile");
|
||||
this.j = nbttagcompound.getShort("life");
|
||||
this.at = nbttagcompound.getShort("life");
|
||||
this.g = Block.e(nbttagcompound.getByte("inTile") & 255);
|
||||
this.h = nbttagcompound.getByte("inData") & 255;
|
||||
this.shake = nbttagcompound.getByte("shake") & 255;
|
||||
@@ -430,15 +430,15 @@ public class EntityArrow extends Entity implements IProjectile {
|
||||
return this.damage;
|
||||
}
|
||||
|
||||
public void a(int i) {
|
||||
this.aw = i;
|
||||
public void setKnockbackStrength(int i) {
|
||||
this.knockbackStrength = i;
|
||||
}
|
||||
|
||||
public boolean av() {
|
||||
public boolean au() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void a(boolean flag) {
|
||||
public void setCritical(boolean flag) {
|
||||
byte b0 = this.datawatcher.getByte(16);
|
||||
|
||||
if (flag) {
|
||||
@@ -448,7 +448,7 @@ public class EntityArrow extends Entity implements IProjectile {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean f() {
|
||||
public boolean isCritical() {
|
||||
byte b0 = this.datawatcher.getByte(16);
|
||||
|
||||
return (b0 & 1) != 0;
|
||||
|
||||
Reference in New Issue
Block a user