diff options
author | Nathan Adams <dinnerbone@dinnerbone.com> | 2012-03-01 10:49:23 +0000 |
---|---|---|
committer | Nathan Adams <dinnerbone@dinnerbone.com> | 2012-03-01 14:38:31 +0000 |
commit | 543c4879fee3b7165764c5371d226c93fe3a657b (patch) | |
tree | 4fe9116464e1fe42a40dc3ba19b58234bd26f821 /src/main/java/net/minecraft/server/EntityItem.java | |
parent | e9ca87000c1794715bc3fe0a7d1caaf809057635 (diff) | |
download | craftbukkit-543c4879fee3b7165764c5371d226c93fe3a657b.tar craftbukkit-543c4879fee3b7165764c5371d226c93fe3a657b.tar.gz craftbukkit-543c4879fee3b7165764c5371d226c93fe3a657b.tar.lz craftbukkit-543c4879fee3b7165764c5371d226c93fe3a657b.tar.xz craftbukkit-543c4879fee3b7165764c5371d226c93fe3a657b.zip |
Updated CraftBukkit to 1.2
Diffstat (limited to 'src/main/java/net/minecraft/server/EntityItem.java')
-rw-r--r-- | src/main/java/net/minecraft/server/EntityItem.java | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java index 11549ad8..a7750ac0 100644 --- a/src/main/java/net/minecraft/server/EntityItem.java +++ b/src/main/java/net/minecraft/server/EntityItem.java @@ -8,10 +8,9 @@ import org.bukkit.event.player.PlayerPickupItemEvent; public class EntityItem extends Entity { public ItemStack itemStack; - private int e; public int age = 0; public int pickupDelay; - private int f = 5; + private int e = 5; public float d = (float) (Math.random() * 3.141592653589793D * 2.0D); private int lastTick = (int) (System.currentTimeMillis() / 50); // CraftBukkit @@ -47,8 +46,8 @@ public class EntityItem extends Entity { protected void b() {} - public void y_() { - super.y_(); + public void G_() { + super.G_(); // CraftBukkit start int currentTick = (int) (System.currentTimeMillis() / 50); this.pickupDelay -= (currentTick - this.lastTick); @@ -86,7 +85,6 @@ public class EntityItem extends Entity { this.motY *= -0.5D; } - ++this.e; ++this.age; if (this.age >= 6000) { // CraftBukkit start @@ -99,7 +97,11 @@ public class EntityItem extends Entity { } } - public boolean i_() { + public void k() { + this.age = 4800; + } + + public boolean h_() { return this.world.a(this.boundingBox, Material.WATER, this); } @@ -108,9 +110,9 @@ public class EntityItem extends Entity { } public boolean damageEntity(DamageSource damagesource, int i) { - this.aM(); - this.f -= i; - if (this.f <= 0) { + this.aV(); + this.e -= i; + if (this.e <= 0) { this.die(); } @@ -118,14 +120,14 @@ public class EntityItem extends Entity { } public void b(NBTTagCompound nbttagcompound) { - nbttagcompound.setShort("Health", (short) ((byte) this.f)); + nbttagcompound.setShort("Health", (short) ((byte) this.e)); nbttagcompound.setShort("Age", (short) this.age); if (this.itemStack != null) // CraftBukkit - Nullchex! nbttagcompound.setCompound("Item", this.itemStack.save(new NBTTagCompound())); } public void a(NBTTagCompound nbttagcompound) { - this.f = nbttagcompound.getShort("Health") & 255; + this.e = nbttagcompound.getShort("Health") & 255; this.age = nbttagcompound.getShort("Age"); NBTTagCompound nbttagcompound1 = nbttagcompound.getCompound("Item"); @@ -187,4 +189,8 @@ public class EntityItem extends Entity { if (this.itemStack == null) return LocaleI18n.get("item.unknown"); // CraftBukkit - nullcheck return LocaleI18n.get("item." + this.itemStack.k()); } + + public boolean k_() { + return false; + } } |