diff options
Diffstat (limited to 'src/main')
28 files changed, 125 insertions, 125 deletions
diff --git a/src/main/java/net/minecraft/server/BlockCactus.java b/src/main/java/net/minecraft/server/BlockCactus.java index 3ba77d17..792c51b2 100644 --- a/src/main/java/net/minecraft/server/BlockCactus.java +++ b/src/main/java/net/minecraft/server/BlockCactus.java @@ -90,12 +90,12 @@ public class BlockCactus extends Block { world.getServer().getPluginManager().callEvent(event); if (!event.isCancelled()) { - entity.damageEntity(DamageSource.g, event.getDamage()); + entity.damageEntity(DamageSource.CACTUS, event.getDamage()); } return; } // CraftBukkit end - entity.damageEntity(DamageSource.g, 1); + entity.damageEntity(DamageSource.CACTUS, 1); } } diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java index 3939f993..0333078c 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -268,10 +268,10 @@ public abstract class Entity { this.world.getServer().getPluginManager().callEvent(event); if (!event.isCancelled()) { - this.damageEntity(DamageSource.b, event.getDamage()); + this.damageEntity(DamageSource.BURN, event.getDamage()); } } else { - this.damageEntity(DamageSource.b, 1); + this.damageEntity(DamageSource.BURN, 1); } // CraftBukkit end } @@ -310,7 +310,7 @@ public abstract class Entity { server.getPluginManager().callEvent(event); if (!event.isCancelled()) { - this.damageEntity(DamageSource.c, event.getDamage()); + this.damageEntity(DamageSource.LAVA, event.getDamage()); } if (this.fireTicks <= 0) { @@ -329,7 +329,7 @@ public abstract class Entity { } // CraftBukkit end - this.damageEntity(DamageSource.c, 4); + this.damageEntity(DamageSource.LAVA, 4); this.fireTicks = 600; } } @@ -668,7 +668,7 @@ public abstract class Entity { i = event.getDamage(); } // CraftBukkit end - this.damageEntity(DamageSource.a, i); + this.damageEntity(DamageSource.FIRE, i); } } diff --git a/src/main/java/net/minecraft/server/EntityArrow.java b/src/main/java/net/minecraft/server/EntityArrow.java index 09a4b181..0eaafc1e 100644 --- a/src/main/java/net/minecraft/server/EntityArrow.java +++ b/src/main/java/net/minecraft/server/EntityArrow.java @@ -196,10 +196,10 @@ public class EntityArrow extends Entity { stick = !projectile.doesBounce(); } else { // this function returns if the arrow should stick in or not, i.e. !bounce - stick = movingobjectposition.entity.damageEntity(DamageSource.a(this, this), event.getDamage()); + stick = movingobjectposition.entity.damageEntity(DamageSource.arrow(this, this.shooter), event.getDamage()); } } else { - stick = movingobjectposition.entity.damageEntity(DamageSource.a(this, this.shooter), 4); + stick = movingobjectposition.entity.damageEntity(DamageSource.arrow(this, this.shooter), 4); } if (stick) { // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/EntityBoat.java b/src/main/java/net/minecraft/server/EntityBoat.java index 7773ad7e..3ffb55a5 100644 --- a/src/main/java/net/minecraft/server/EntityBoat.java +++ b/src/main/java/net/minecraft/server/EntityBoat.java @@ -93,7 +93,7 @@ public class EntityBoat extends Entity { if (!this.world.isStatic && !this.dead) { // CraftBukkit start Vehicle vehicle = (Vehicle) this.getBukkitEntity(); - org.bukkit.entity.Entity attacker = (damagesource.a() == null) ? null : damagesource.a().getBukkitEntity(); + org.bukkit.entity.Entity attacker = (damagesource.getEntity() == null) ? null : damagesource.getEntity().getBukkitEntity(); VehicleDamageEvent event = new VehicleDamageEvent(vehicle, attacker, i); this.world.getServer().getPluginManager().callEvent(event); diff --git a/src/main/java/net/minecraft/server/EntityCreeper.java b/src/main/java/net/minecraft/server/EntityCreeper.java index b31231a0..4729167d 100644 --- a/src/main/java/net/minecraft/server/EntityCreeper.java +++ b/src/main/java/net/minecraft/server/EntityCreeper.java @@ -85,7 +85,7 @@ public class EntityCreeper extends EntityMonster { public void die(DamageSource damagesource) { super.die(damagesource); - if (damagesource.a() instanceof EntitySkeleton) { + if (damagesource.getEntity() instanceof EntitySkeleton) { this.b(Item.GOLD_RECORD.id + this.random.nextInt(2), 1); } } diff --git a/src/main/java/net/minecraft/server/EntityEgg.java b/src/main/java/net/minecraft/server/EntityEgg.java index 4a0dbf1b..3cf3c43e 100644 --- a/src/main/java/net/minecraft/server/EntityEgg.java +++ b/src/main/java/net/minecraft/server/EntityEgg.java @@ -168,10 +168,10 @@ public class EntityEgg extends Entity { stick = !projectile.doesBounce(); } else { // this function returns if the egg should stick in or not, i.e. !bounce - stick = movingobjectposition.entity.damageEntity(DamageSource.a(this, this), event.getDamage()); + stick = movingobjectposition.entity.damageEntity(DamageSource.projectile(this, this.thrower), event.getDamage()); } } else { - stick = movingobjectposition.entity.damageEntity(DamageSource.a(this, this.thrower), 0); + stick = movingobjectposition.entity.damageEntity(DamageSource.projectile(this, this.thrower), 0); } if (stick) { diff --git a/src/main/java/net/minecraft/server/EntityExperienceOrb.java b/src/main/java/net/minecraft/server/EntityExperienceOrb.java index f0246b11..b11c8754 100644 --- a/src/main/java/net/minecraft/server/EntityExperienceOrb.java +++ b/src/main/java/net/minecraft/server/EntityExperienceOrb.java @@ -100,7 +100,7 @@ public class EntityExperienceOrb extends Entity { } protected void burn(int i) { - this.damageEntity(DamageSource.a, i); + this.damageEntity(DamageSource.FIRE, i); } public boolean damageEntity(DamageSource damagesource, int i) { diff --git a/src/main/java/net/minecraft/server/EntityFireball.java b/src/main/java/net/minecraft/server/EntityFireball.java index e65d2c33..1383b30d 100644 --- a/src/main/java/net/minecraft/server/EntityFireball.java +++ b/src/main/java/net/minecraft/server/EntityFireball.java @@ -150,10 +150,10 @@ public class EntityFireball extends Entity { stick = !projectile.doesBounce(); } else { // this function returns if the fireball should stick in or not, i.e. !bounce - stick = movingobjectposition.entity.damageEntity(DamageSource.a(this, this), event.getDamage()); + stick = movingobjectposition.entity.damageEntity(DamageSource.fireball(this, this.shooter), event.getDamage()); } } else { - stick = movingobjectposition.entity.damageEntity(DamageSource.a(this, this.shooter), 0); + stick = movingobjectposition.entity.damageEntity(DamageSource.fireball(this, this.shooter), 0); } if (stick) { ; @@ -244,8 +244,8 @@ public class EntityFireball extends Entity { public boolean damageEntity(DamageSource damagesource, int i) { this.aq(); - if (damagesource.a() != null) { - Vec3D vec3d = damagesource.a().ai(); + if (damagesource.getEntity() != null) { + Vec3D vec3d = damagesource.getEntity().ai(); if (vec3d != null) { this.motX = vec3d.a; diff --git a/src/main/java/net/minecraft/server/EntityFish.java b/src/main/java/net/minecraft/server/EntityFish.java index 65b7d2be..c3af567c 100644 --- a/src/main/java/net/minecraft/server/EntityFish.java +++ b/src/main/java/net/minecraft/server/EntityFish.java @@ -204,10 +204,10 @@ public class EntityFish extends Entity { stick = !projectile.doesBounce(); } else { // this function returns if the fish should stick in or not, i.e. !bounce - stick = movingobjectposition.entity.damageEntity(DamageSource.a((Entity) this, this), event.getDamage()); + stick = movingobjectposition.entity.damageEntity(DamageSource.projectile((Entity) this, this.owner), event.getDamage()); } } else { - stick = movingobjectposition.entity.damageEntity(DamageSource.a((Entity) this, this.owner), 0); + stick = movingobjectposition.entity.damageEntity(DamageSource.projectile((Entity) this, this.owner), 0); } if (!stick) { // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java index a5a7fec3..dd6f612f 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java @@ -22,7 +22,7 @@ public abstract class EntityHuman extends EntityLiving { public InventoryPlayer inventory = new InventoryPlayer(this); public Container defaultContainer; public Container activeContainer; - protected FoodMetaData m = new FoodMetaData(); + protected FoodMetaData foodData = new FoodMetaData(); protected int n = 0; public byte o = 0; public int p = 0; @@ -53,7 +53,7 @@ public abstract class EntityHuman extends EntityLiving { public int H = 20; protected boolean I = false; public float J; - public PlayerAbilities K = new PlayerAbilities(); + public PlayerAbilities abilities = new PlayerAbilities(); public int exp; public int expLevel; public int expTotal; @@ -156,13 +156,13 @@ public abstract class EntityHuman extends EntityLiving { this.activeContainer = this.defaultContainer; } - if (this.K.b) { + if (this.abilities.isFlying) { for (int i = 0; i < 8; ++i) { ; } } - if (this.fireTicks > 0 && this.K.a) { + if (this.fireTicks > 0 && this.abilities.isInvulnerable) { this.fireTicks = 0; } @@ -207,7 +207,7 @@ public abstract class EntityHuman extends EntityLiving { } if (!this.world.isStatic) { - this.m.a(this); + this.foodData.a(this); } } @@ -484,7 +484,7 @@ public abstract class EntityHuman extends EntityLiving { this.b = new ChunkCoordinates(nbttagcompound.e("SpawnX"), nbttagcompound.e("SpawnY"), nbttagcompound.e("SpawnZ")); } - this.m.a(nbttagcompound); + this.foodData.a(nbttagcompound); } public void b(NBTTagCompound nbttagcompound) { @@ -502,7 +502,7 @@ public abstract class EntityHuman extends EntityLiving { nbttagcompound.a("SpawnZ", this.b.z); } - this.m.b(nbttagcompound); + this.foodData.b(nbttagcompound); } public void a(IInventory iinventory) {} @@ -520,7 +520,7 @@ public abstract class EntityHuman extends EntityLiving { } public boolean damageEntity(DamageSource damagesource, int i) { - if (this.K.a && !damagesource.d()) { + if (this.abilities.isInvulnerable && !damagesource.ignoresInvulnerability()) { return false; } else { this.aO = 0; @@ -531,7 +531,7 @@ public abstract class EntityHuman extends EntityLiving { this.a(true, true, false); } - Entity entity = damagesource.a(); + Entity entity = damagesource.getEntity(); if (entity instanceof EntityMonster || entity instanceof EntityArrow) { if (this.world.spawnMonsters == 0) { @@ -634,11 +634,11 @@ public abstract class EntityHuman extends EntityLiving { } protected void b(DamageSource damagesource, int i) { - if (!damagesource.b() && this.G()) { + if (!damagesource.ignoresArmor() && this.G()) { i = 1 + i >> 1; } - if (!damagesource.b()) { + if (!damagesource.ignoresArmor()) { int j = 25 - this.inventory.i(); int k = i * j + this.f; @@ -717,7 +717,7 @@ public abstract class EntityHuman extends EntityLiving { } // CraftBukkit end - boolean flag1 = entity.damageEntity(DamageSource.b(this), i); + boolean flag1 = entity.damageEntity(DamageSource.playerAttack(this), i); // CraftBukkit start - Return when the damage fails so that the item will not lose durability if (!flag1) { @@ -985,7 +985,7 @@ public abstract class EntityHuman extends EntityLiving { double d1 = this.locY; double d2 = this.locZ; - if (this.K.b) { + if (this.abilities.isFlying) { double d3 = this.motY; float f2 = this.ak; @@ -1061,7 +1061,7 @@ public abstract class EntityHuman extends EntityLiving { } protected void a(float f) { - if (!this.K.c) { + if (!this.abilities.canFly) { if (f >= 2.0F) { this.a(StatisticList.n, (int) Math.round((double) f * 100.0D)); } @@ -1103,19 +1103,19 @@ public abstract class EntityHuman extends EntityLiving { } public void b(float f) { - if (!this.K.a) { + if (!this.abilities.isInvulnerable) { if (!this.world.isStatic) { - this.m.a(f); + this.foodData.a(f); } } } - public FoodMetaData V() { - return this.m; + public FoodMetaData getFoodData() { + return this.foodData; } public boolean c(boolean flag) { - return (flag || this.m.b()) && !this.K.a; + return (flag || this.foodData.b()) && !this.abilities.isInvulnerable; } public boolean W() { diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java index 1d99c44d..695e42e0 100644 --- a/src/main/java/net/minecraft/server/EntityItem.java +++ b/src/main/java/net/minecraft/server/EntityItem.java @@ -92,7 +92,7 @@ public class EntityItem extends Entity { } protected void burn(int i) { - this.damageEntity(DamageSource.a, i); + this.damageEntity(DamageSource.FIRE, i); } public boolean damageEntity(DamageSource damagesource, int i) { diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java index 9d839020..23d81935 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -133,7 +133,7 @@ public abstract class EntityLiving extends Entity { this.world.getServer().getPluginManager().callEvent(event); if (!event.isCancelled()) { - this.damageEntity(DamageSource.d, event.getDamage()); + this.damageEntity(DamageSource.STUCK, event.getDamage()); } // CraftBukkit end } @@ -162,7 +162,7 @@ public abstract class EntityLiving extends Entity { this.world.getServer().getPluginManager().callEvent(event); if (!event.isCancelled() && event.getDamage() != 0) { - this.damageEntity(DamageSource.e, event.getDamage()); + this.damageEntity(DamageSource.DROWN, event.getDamage()); } // CraftBukkit end } @@ -412,7 +412,7 @@ public abstract class EntityLiving extends Entity { } this.ar = 0.0F; - Entity entity = damagesource.a(); + Entity entity = damagesource.getEntity(); if (entity != null) { if (entity instanceof EntityHuman) { @@ -499,7 +499,7 @@ public abstract class EntityLiving extends Entity { } public void die(DamageSource damagesource) { - Entity entity = damagesource.a(); + Entity entity = damagesource.getEntity(); if (this.ag >= 0 && entity != null) { entity.b(this, this.ag); @@ -553,7 +553,7 @@ public abstract class EntityLiving extends Entity { this.world.getServer().getPluginManager().callEvent(event); if (!event.isCancelled() && event.getDamage() != 0) { - this.damageEntity(DamageSource.h, event.getDamage()); + this.damageEntity(DamageSource.FALL, event.getDamage()); } // CraftBukkit end @@ -973,7 +973,7 @@ public abstract class EntityLiving extends Entity { return; } - this.damageEntity(DamageSource.i, event.getDamage()); + this.damageEntity(DamageSource.OUT_OF_WORLD, event.getDamage()); // CraftBukkit end } diff --git a/src/main/java/net/minecraft/server/EntityMinecart.java b/src/main/java/net/minecraft/server/EntityMinecart.java index 2ee158c9..5cce3667 100644 --- a/src/main/java/net/minecraft/server/EntityMinecart.java +++ b/src/main/java/net/minecraft/server/EntityMinecart.java @@ -100,7 +100,7 @@ public class EntityMinecart extends Entity implements IInventory { if (!this.world.isStatic && !this.dead) { // CraftBukkit start Vehicle vehicle = (Vehicle) this.getBukkitEntity(); - org.bukkit.entity.Entity passenger = (damagesource.a() == null) ? null : damagesource.a().getBukkitEntity(); + org.bukkit.entity.Entity passenger = (damagesource.getEntity() == null) ? null : damagesource.getEntity().getBukkitEntity(); VehicleDamageEvent event = new VehicleDamageEvent(vehicle, passenger, i); this.world.getServer().getPluginManager().callEvent(event); diff --git a/src/main/java/net/minecraft/server/EntityMonster.java b/src/main/java/net/minecraft/server/EntityMonster.java index c805fd7a..6e68d17d 100644 --- a/src/main/java/net/minecraft/server/EntityMonster.java +++ b/src/main/java/net/minecraft/server/EntityMonster.java @@ -42,7 +42,7 @@ public abstract class EntityMonster extends EntityCreature implements IMonster { public boolean damageEntity(DamageSource damagesource, int i) { if (super.damageEntity(damagesource, i)) { - Entity entity = damagesource.a(); + Entity entity = damagesource.getEntity(); if (this.passenger != entity && this.vehicle != entity) { if (entity != this) { @@ -82,14 +82,14 @@ public abstract class EntityMonster extends EntityCreature implements IMonster { this.world.getServer().getPluginManager().callEvent(event); if (!event.isCancelled()) { - return entity.damageEntity(DamageSource.a(this), event.getDamage()); + return entity.damageEntity(DamageSource.mobAttack(this), event.getDamage()); } return false; } // CraftBukkit end - return entity.damageEntity(DamageSource.a((EntityLiving) this), this.damage); + return entity.damageEntity(DamageSource.mobAttack((EntityLiving) this), this.damage); } protected void a(Entity entity, float f) { diff --git a/src/main/java/net/minecraft/server/EntityPainting.java b/src/main/java/net/minecraft/server/EntityPainting.java index 0e7d92a7..03eb9b3e 100644 --- a/src/main/java/net/minecraft/server/EntityPainting.java +++ b/src/main/java/net/minecraft/server/EntityPainting.java @@ -201,7 +201,7 @@ public class EntityPainting extends Entity { public boolean damageEntity(DamageSource damagesource, int i) { if (!this.dead && !this.world.isStatic) { // CraftBukkit start - PaintingBreakByEntityEvent event = new PaintingBreakByEntityEvent((org.bukkit.entity.Painting) this.getBukkitEntity(), damagesource.a() == null ? null : damagesource.a().getBukkitEntity()); + PaintingBreakByEntityEvent event = new PaintingBreakByEntityEvent((org.bukkit.entity.Painting) this.getBukkitEntity(), damagesource.getEntity() == null ? null : damagesource.getEntity().getBukkitEntity()); this.world.getServer().getPluginManager().callEvent(event); if (event.isCancelled()) { diff --git a/src/main/java/net/minecraft/server/EntityPigZombie.java b/src/main/java/net/minecraft/server/EntityPigZombie.java index d5ebce05..6113c510 100644 --- a/src/main/java/net/minecraft/server/EntityPigZombie.java +++ b/src/main/java/net/minecraft/server/EntityPigZombie.java @@ -53,7 +53,7 @@ public class EntityPigZombie extends EntityZombie { } public boolean damageEntity(DamageSource damagesource, int i) { - Entity entity = damagesource.a(); + Entity entity = damagesource.getEntity(); if (entity instanceof EntityHuman) { List list = this.world.b((Entity) this, this.boundingBox.b(32.0D, 32.0D, 32.0D)); diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java index b49ed108..74476d7d 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -99,7 +99,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { this.itemInWorldManager = new ItemInWorldManager((WorldServer) world); this.itemInWorldManager.player = this; this.itemInWorldManager.a(oldMode); - this.m = new FoodMetaData(); + this.foodData = new FoodMetaData(); // CraftBukkit end } @@ -139,7 +139,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { } public void die(DamageSource damagesource) { - this.b.serverConfigurationManager.sendAll(new Packet3Chat(damagesource.a((EntityHuman) this))); + this.b.serverConfigurationManager.sendAll(new Packet3Chat(damagesource.a(this))); // CraftBukkit start java.util.List<org.bukkit.inventory.ItemStack> loot = new java.util.ArrayList<org.bukkit.inventory.ItemStack>(); @@ -184,7 +184,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { } else { // CraftBukkit - this.b.pvpMode -> this.world.pvpMode if (!this.world.pvpMode && damagesource instanceof EntityDamageSource) { - Entity entity = damagesource.a(); + Entity entity = damagesource.getEntity(); if (entity instanceof EntityHuman) { return false; @@ -300,11 +300,11 @@ public class EntityPlayer extends EntityHuman implements ICrafting { --this.H; } - if (this.health != this.cb || this.cc != this.m.a() || this.m.c() == 0.0F != this.cd) { - this.netServerHandler.sendPacket(new Packet8UpdateHealth(this.health, this.m.a(), this.m.c())); + if (this.health != this.cb || this.cc != this.foodData.a() || this.foodData.c() == 0.0F != this.cd) { + this.netServerHandler.sendPacket(new Packet8UpdateHealth(this.health, this.foodData.a(), this.foodData.c())); this.cb = this.health; - this.cc = this.m.a(); - this.cd = this.m.c() == 0.0F; + this.cc = this.foodData.a(); + this.cd = this.foodData.c() == 0.0F; } if (this.expTotal != this.ce) { diff --git a/src/main/java/net/minecraft/server/EntitySkeleton.java b/src/main/java/net/minecraft/server/EntitySkeleton.java index 0ffc6ce4..e29d53ca 100644 --- a/src/main/java/net/minecraft/server/EntitySkeleton.java +++ b/src/main/java/net/minecraft/server/EntitySkeleton.java @@ -32,8 +32,8 @@ public class EntitySkeleton extends EntityMonster { public void die(DamageSource damagesource) { super.die(damagesource); - if (damagesource.e() instanceof EntityArrow && damagesource.a() instanceof EntityHuman) { - EntityHuman entityhuman = (EntityHuman) damagesource.a(); + if (damagesource.e() instanceof EntityArrow && damagesource.getEntity() instanceof EntityHuman) { + EntityHuman entityhuman = (EntityHuman) damagesource.getEntity(); double d0 = entityhuman.locX - this.locX; double d1 = entityhuman.locZ - this.locZ; diff --git a/src/main/java/net/minecraft/server/EntitySnowball.java b/src/main/java/net/minecraft/server/EntitySnowball.java index ffec1f3a..90c3f47a 100644 --- a/src/main/java/net/minecraft/server/EntitySnowball.java +++ b/src/main/java/net/minecraft/server/EntitySnowball.java @@ -167,10 +167,10 @@ public class EntitySnowball extends Entity { stick = !projectile.doesBounce(); } else { // this function returns if the snowball should stick in or not, i.e. !bounce - stick = movingobjectposition.entity.damageEntity(DamageSource.a(this, this), event.getDamage()); + stick = movingobjectposition.entity.damageEntity(DamageSource.projectile(this, this.shooter), event.getDamage()); } } else { - stick = movingobjectposition.entity.damageEntity(DamageSource.a(this, this.shooter), 0); + stick = movingobjectposition.entity.damageEntity(DamageSource.projectile(this, this.shooter), 0); } if (stick) { ; diff --git a/src/main/java/net/minecraft/server/EntityWolf.java b/src/main/java/net/minecraft/server/EntityWolf.java index 1c4d6c7b..a7ff3d04 100644 --- a/src/main/java/net/minecraft/server/EntityWolf.java +++ b/src/main/java/net/minecraft/server/EntityWolf.java @@ -237,7 +237,7 @@ public class EntityWolf extends EntityAnimal { } public boolean damageEntity(DamageSource damagesource, int i) { - Entity entity = damagesource.a(); + Entity entity = damagesource.getEntity(); this.setSitting(false); if (entity != null && !(entity instanceof EntityHuman) && !(entity instanceof EntityArrow)) { @@ -345,7 +345,7 @@ public class EntityWolf extends EntityAnimal { } // CraftBukkit end - entity.damageEntity(DamageSource.a((EntityLiving) this), b0); + entity.damageEntity(DamageSource.mobAttack(this), b0); } } diff --git a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java index fe61a028..4db1a31a 100644 --- a/src/main/java/net/minecraft/server/Explosion.java +++ b/src/main/java/net/minecraft/server/Explosion.java @@ -130,7 +130,7 @@ public class Explosion { server.getPluginManager().callEvent(event); if (!event.isCancelled()) { - entity.damageEntity(DamageSource.k, event.getDamage()); + entity.damageEntity(DamageSource.EXPLOSION, event.getDamage()); entity.motX += d0 * d10; entity.motY += d1 * d10; entity.motZ += d2 * d10; @@ -140,7 +140,7 @@ public class Explosion { server.getPluginManager().callEvent(event); if (!event.isCancelled()) { - entity.damageEntity(DamageSource.k, event.getDamage()); + entity.damageEntity(DamageSource.EXPLOSION, event.getDamage()); entity.motX += d0 * d10; entity.motY += d1 * d10; diff --git a/src/main/java/net/minecraft/server/FoodMetaData.java b/src/main/java/net/minecraft/server/FoodMetaData.java index 29ea6efc..eb4213c5 100644 --- a/src/main/java/net/minecraft/server/FoodMetaData.java +++ b/src/main/java/net/minecraft/server/FoodMetaData.java @@ -3,18 +3,18 @@ package net.minecraft.server; public class FoodMetaData { // CraftBukkit start - all made public - public int a = 20; - public float b = 5.0F; - public float c; - public int d = 0; + public int foodLevel = 20; + public float saturationLevel = 5.0F; + public float exhaustionLevel; + public int foodTickTimer = 0; // CraftBukkit end private int e = 20; public FoodMetaData() {} public void a(int i, float f) { - this.a = Math.min(i + this.a, 20); - this.b = Math.min(this.b + (float) i * f * 2.0F, (float) this.a); + this.foodLevel = Math.min(i + this.foodLevel, 20); + this.saturationLevel = Math.min(this.saturationLevel + (float) i * f * 2.0F, (float) this.foodLevel); } public void a(ItemFood itemfood) { @@ -24,65 +24,65 @@ public class FoodMetaData { public void a(EntityHuman entityhuman) { int i = entityhuman.world.spawnMonsters; - this.e = this.a; - if (this.c > 4.0F) { - this.c -= 4.0F; - if (this.b > 0.0F) { - this.b = Math.max(this.b - 1.0F, 0.0F); + this.e = this.foodLevel; + if (this.exhaustionLevel > 4.0F) { + this.exhaustionLevel -= 4.0F; + if (this.saturationLevel > 0.0F) { + this.saturationLevel = Math.max(this.saturationLevel - 1.0F, 0.0F); } else if (i > 0) { - this.a = Math.max(this.a - 1, 0); + this.foodLevel = Math.max(this.foodLevel - 1, 0); } } - if (this.a >= 18 && entityhuman.W()) { - ++this.d; - if (this.d >= 80) { + if (this.foodLevel >= 18 && entityhuman.W()) { + ++this.foodTickTimer; + if (this.foodTickTimer >= 80) { entityhuman.c(1); - this.d = 0; + this.foodTickTimer = 0; } - } else if (this.a <= 0) { - ++this.d; - if (this.d >= 80) { + } else if (this.foodLevel <= 0) { + ++this.foodTickTimer; + if (this.foodTickTimer >= 80) { if (entityhuman.health > 10 || i >= 3 || entityhuman.health > 1 && i >= 2) { - entityhuman.damageEntity(DamageSource.f, 1); + entityhuman.damageEntity(DamageSource.STARVE, 1); } - this.d = 0; + this.foodTickTimer = 0; } } else { - this.d = 0; + this.foodTickTimer = 0; } } public void a(NBTTagCompound nbttagcompound) { if (nbttagcompound.hasKey("foodLevel")) { - this.a = nbttagcompound.e("foodLevel"); - this.d = nbttagcompound.e("foodTickTimer"); - this.b = nbttagcompound.g("foodSaturationLevel"); - this.c = nbttagcompound.g("foodExhaustionLevel"); + this.foodLevel = nbttagcompound.e("foodLevel"); + this.foodTickTimer = nbttagcompound.e("foodTickTimer"); + this.saturationLevel = nbttagcompound.g("foodSaturationLevel"); + this.exhaustionLevel = nbttagcompound.g("foodExhaustionLevel"); } } public void b(NBTTagCompound nbttagcompound) { - nbttagcompound.a("foodLevel", this.a); - nbttagcompound.a("foodTickTimer", this.d); - nbttagcompound.a("foodSaturationLevel", this.b); - nbttagcompound.a("foodExhaustionLevel", this.c); + nbttagcompound.a("foodLevel", this.foodLevel); + nbttagcompound.a("foodTickTimer", this.foodTickTimer); + nbttagcompound.a("foodSaturationLevel", this.saturationLevel); + nbttagcompound.a("foodExhaustionLevel", this.exhaustionLevel); } public int a() { - return this.a; + return this.foodLevel; } public boolean b() { - return this.a < 20; + return this.foodLevel < 20; } public void a(float f) { - this.c = Math.min(this.c + f, 40.0F); + this.exhaustionLevel = Math.min(this.exhaustionLevel + f, 40.0F); } public float c() { - return this.b; + return this.saturationLevel; } -}
\ No newline at end of file +} diff --git a/src/main/java/net/minecraft/server/ItemBucket.java b/src/main/java/net/minecraft/server/ItemBucket.java index 6cb74b92..ee348ac9 100644 --- a/src/main/java/net/minecraft/server/ItemBucket.java +++ b/src/main/java/net/minecraft/server/ItemBucket.java @@ -148,7 +148,7 @@ public class ItemBucket extends Item { world.setTypeIdAndData(i, j, k, this.a, 0); } - if (entityhuman.K.d) { + if (entityhuman.abilities.canInstantlyBuild) { return itemstack; } diff --git a/src/main/java/net/minecraft/server/ItemInWorldManager.java b/src/main/java/net/minecraft/server/ItemInWorldManager.java index 23828a48..dc575f44 100644 --- a/src/main/java/net/minecraft/server/ItemInWorldManager.java +++ b/src/main/java/net/minecraft/server/ItemInWorldManager.java @@ -33,14 +33,14 @@ public class ItemInWorldManager { public void a(int i) { this.c = i; if (i == 0) { - this.player.K.c = false; - this.player.K.b = false; - this.player.K.d = false; - this.player.K.a = false; + this.player.abilities.canFly = false; + this.player.abilities.isFlying = false; + this.player.abilities.canInstantlyBuild = false; + this.player.abilities.isInvulnerable = false; } else { - this.player.K.c = true; - this.player.K.d = true; - this.player.K.a = true; + this.player.abilities.canFly = true; + this.player.abilities.canInstantlyBuild = true; + this.player.abilities.isInvulnerable = true; } } @@ -229,7 +229,7 @@ public class ItemInWorldManager { int j = itemstack.getData(); ItemStack itemstack1 = itemstack.a(world, entityhuman); - if (itemstack1 == itemstack && (itemstack1 == null || itemstack1.count == i)) { + if (itemstack1 == itemstack && (itemstack1 == null || itemstack1.count == i) && (itemstack1 == null || itemstack1.l() <= 0)) { return false; } else { entityhuman.inventory.items[entityhuman.inventory.itemInHandIndex] = itemstack1; diff --git a/src/main/java/net/minecraft/server/PlayerInstance.java b/src/main/java/net/minecraft/server/PlayerInstance.java index 7bc26990..04dad1c0 100644 --- a/src/main/java/net/minecraft/server/PlayerInstance.java +++ b/src/main/java/net/minecraft/server/PlayerInstance.java @@ -52,7 +52,7 @@ class PlayerInstance { if (this.b.size() == 0) { long i = (long) this.chunkX + 2147483647L | (long) this.chunkZ + 2147483647L << 32; - PlayerManager.a(this.playerManager).d(i); + PlayerManager.a(this.playerManager).remove(i); if (this.dirtyCount > 0) { PlayerManager.b(this.playerManager).remove(this); } diff --git a/src/main/java/net/minecraft/server/PlayerManager.java b/src/main/java/net/minecraft/server/PlayerManager.java index 3dbb30d3..958ed1f3 100644 --- a/src/main/java/net/minecraft/server/PlayerManager.java +++ b/src/main/java/net/minecraft/server/PlayerManager.java @@ -39,11 +39,11 @@ public class PlayerManager { private PlayerInstance a(int i, int j, boolean flag) { long k = (long) i + 2147483647L | (long) j + 2147483647L << 32; - PlayerInstance playerinstance = (PlayerInstance) this.b.a(k); + PlayerInstance playerinstance = (PlayerInstance) this.b.getEntry(k); if (playerinstance == null && flag) { playerinstance = new PlayerInstance(this, i, j); - this.b.a(k, playerinstance); + this.b.put(k, playerinstance); } return playerinstance; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java index 9c1cc854..63e1d1b9 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java @@ -41,7 +41,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { } if (entity instanceof EntityPlayer && health == 0) { - ((EntityPlayer) entity).die(DamageSource.j); + ((EntityPlayer) entity).die(DamageSource.GENERIC); } getHandle().health = health; @@ -176,16 +176,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { } public void damage(int amount) { - entity.damageEntity(DamageSource.j, amount); + entity.damageEntity(DamageSource.GENERIC, amount); } public void damage(int amount, org.bukkit.entity.Entity source) { - DamageSource reason = DamageSource.a.j; + DamageSource reason = DamageSource.GENERIC; if (source instanceof HumanEntity) { - reason = DamageSource.b(((CraftHumanEntity)source).getHandle()); + reason = DamageSource.playerAttack(((CraftHumanEntity)source).getHandle()); } else if (source instanceof LivingEntity) { - reason = DamageSource.a(((CraftLivingEntity)source).getHandle()); + reason = DamageSource.mobAttack(((CraftLivingEntity)source).getHandle()); } entity.damageEntity(reason, amount); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java index 0be60026..5fe614fc 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -426,26 +426,26 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } public float getExhaustion() { - return getHandle().V().c; + return getHandle().getFoodData().exhaustionLevel; } public void setExhaustion(float value) { - getHandle().V().c = value; + getHandle().getFoodData().exhaustionLevel = value; } public float getSaturation() { - return getHandle().V().b; + return getHandle().getFoodData().saturationLevel; } public void setSaturation(float value) { - getHandle().V().b = value; + getHandle().getFoodData().saturationLevel = value; } public int getFoodLevel() { - return getHandle().V().a; + return getHandle().getFoodData().foodLevel; } public void setFoodLevel(int value) { - getHandle().V().a = value; + getHandle().getFoodData().foodLevel = value; } } |