Update to Minecraft 1.3 beta

This commit is contained in:
Dinnerbone
2011-02-23 02:37:56 +00:00
parent a124bfdab5
commit f759e0b60d
83 changed files with 3182 additions and 3292 deletions

View File

@@ -22,9 +22,9 @@ public class EntityEgg extends Entity {
private int e = 0;
private boolean f = false;
public int a = 0;
private EntityLiving ak;
private int al;
private int am = 0;
private EntityLiving g;
private int h;
private int i = 0;
public EntityEgg(World world) {
super(world);
@@ -35,9 +35,9 @@ public class EntityEgg extends Entity {
public EntityEgg(World world, EntityLiving entityliving) {
super(world);
this.ak = entityliving;
this.g = entityliving;
this.a(0.25F, 0.25F);
this.c(entityliving.locX, entityliving.locY + (double) entityliving.w(), entityliving.locZ, entityliving.yaw, entityliving.pitch);
this.c(entityliving.locX, entityliving.locY + (double) entityliving.p(), entityliving.locZ, entityliving.yaw, entityliving.pitch);
this.locX -= (double) (MathHelper.b(this.yaw / 180.0F * 3.1415927F) * 0.16F);
this.locY -= 0.10000000149011612D;
this.locZ -= (double) (MathHelper.a(this.yaw / 180.0F * 3.1415927F) * 0.16F);
@@ -53,7 +53,7 @@ public class EntityEgg extends Entity {
public EntityEgg(World world, double d0, double d1, double d2) {
super(world);
this.al = 0;
this.h = 0;
this.a(0.25F, 0.25F);
this.a(d0, d1, d2);
this.height = 0.0F;
@@ -78,14 +78,14 @@ public class EntityEgg extends Entity {
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.al = 0;
this.h = 0;
}
public void b_() {
this.O = this.locX;
this.P = this.locY;
this.Q = this.locZ;
super.b_();
public void f_() {
this.bi = this.locX;
this.bj = this.locY;
this.bk = this.locZ;
super.f_();
if (this.a > 0) {
--this.a;
}
@@ -94,9 +94,9 @@ public class EntityEgg extends Entity {
int i = this.world.getTypeId(this.b, this.c, this.d);
if (i == this.e) {
++this.al;
if (this.al == 1200) {
this.q();
++this.h;
if (this.h == 1200) {
this.C();
}
return;
@@ -106,10 +106,10 @@ public class EntityEgg extends Entity {
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.al = 0;
this.am = 0;
this.h = 0;
this.i = 0;
} else {
++this.am;
++this.i;
}
Vec3D vec3d = Vec3D.b(this.locX, this.locY, this.locZ);
@@ -130,7 +130,7 @@ public class EntityEgg extends Entity {
for (int j = 0; j < list.size(); ++j) {
Entity entity1 = (Entity) list.get(j);
if (entity1.c_() && (entity1 != this.ak || this.am >= 5)) {
if (entity1.d_() && (entity1 != this.g || this.i >= 5)) {
float f = 0.3F;
AxisAlignedBB axisalignedbb = entity1.boundingBox.b((double) f, (double) f, (double) f);
MovingObjectPosition movingobjectposition1 = axisalignedbb.a(vec3d, vec3d1);
@@ -157,7 +157,7 @@ public class EntityEgg extends Entity {
boolean stick;
if (movingobjectposition.g instanceof EntityLiving) {
CraftServer server = ((WorldServer) this.world).getServer();
org.bukkit.entity.Entity shooter = (this.ak == null) ? null : this.ak.getBukkitEntity();
org.bukkit.entity.Entity shooter = (this.g == null) ? null : this.g.getBukkitEntity();
org.bukkit.entity.Entity damagee = movingobjectposition.g.getBukkitEntity();
org.bukkit.entity.Entity projectile = this.getBukkitEntity();
DamageCause damageCause = EntityDamageEvent.DamageCause.ENTITY_ATTACK;
@@ -169,13 +169,13 @@ public class EntityEgg extends Entity {
if(!event.isCancelled()) {
// this function returns if the egg should stick or not, i.e. !bounce
stick = movingobjectposition.g.a(this.ak, event.getDamage());
stick = movingobjectposition.g.a(this.g, event.getDamage());
} else {
// event was cancelled, get if the egg should bounce or not
stick = !event.getBounce();
}
} else {
stick = movingobjectposition.g.a(this.ak, 0);
stick = movingobjectposition.g.a(this.g, 0);
}
if (stick) {
@@ -190,10 +190,10 @@ public class EntityEgg extends Entity {
}
MobType hatchingType = MobType.CHICKEN;
if (this.ak instanceof EntityPlayer) {
if (this.g instanceof EntityPlayer) {
CraftServer server = ((WorldServer) this.world).getServer();
Type eventType = Type.PLAYER_EGG_THROW;
Player player = (this.ak == null) ? null : (Player) this.ak.getBukkitEntity();
Player player = (this.g == null) ? null : (Player) this.g.getBukkitEntity();
PlayerEggThrowEvent event = new PlayerEggThrowEvent(eventType, player, (Egg)this.getBukkitEntity(), hatching, numHatching, hatchingType);
server.getPluginManager().callEvent(event);
@@ -246,7 +246,7 @@ public class EntityEgg extends Entity {
// The world we're spawning in accepts this creature
boolean isAnimal = entity instanceof EntityAnimal || entity instanceof EntityWaterAnimal;
if ((isAnimal && this.world.L) || (!isAnimal && this.world.K)) {
if ((isAnimal && this.world.E) || (!isAnimal && this.world.D)) {
entity.c(this.locX, this.locY, this.locZ, this.yaw, 0.0F);
this.world.a(entity);
}
@@ -258,7 +258,7 @@ public class EntityEgg extends Entity {
this.world.a("snowballpoof", this.locX, this.locY, this.locZ, 0.0D, 0.0D, 0.0D);
}
this.q();
this.C();
}
this.locX += this.motX;
@@ -289,7 +289,7 @@ public class EntityEgg extends Entity {
float f2 = 0.99F;
float f3 = 0.03F;
if (this.v()) {
if (this.g_()) {
for (int i1 = 0; i1 < 4; ++i1) {
float f4 = 0.25F;
@@ -316,19 +316,19 @@ public class EntityEgg extends Entity {
}
public void b(NBTTagCompound nbttagcompound) {
this.b = nbttagcompound.c("xTile");
this.c = nbttagcompound.c("yTile");
this.d = nbttagcompound.c("zTile");
this.e = nbttagcompound.b("inTile") & 255;
this.a = nbttagcompound.b("shake") & 255;
this.f = nbttagcompound.b("inGround") == 1;
this.b = nbttagcompound.d("xTile");
this.c = nbttagcompound.d("yTile");
this.d = nbttagcompound.d("zTile");
this.e = nbttagcompound.c("inTile") & 255;
this.a = nbttagcompound.c("shake") & 255;
this.f = nbttagcompound.c("inGround") == 1;
}
public void b(EntityHuman entityhuman) {
if (this.f && this.ak == entityhuman && this.a <= 0 && entityhuman.inventory.a(new ItemStack(Item.ARROW, 1))) {
if (this.f && this.g == entityhuman && this.a <= 0 && entityhuman.inventory.a(new ItemStack(Item.ARROW, 1))) {
this.world.a(this, "random.pop", 0.2F, ((this.random.nextFloat() - this.random.nextFloat()) * 0.7F + 1.0F) * 2.0F);
entityhuman.c(this, 1);
this.q();
entityhuman.b(this, 1);
this.C();
}
}
}