diff options
author | feildmaster <admin@feildmaster.com> | 2012-03-25 20:58:12 -0500 |
---|---|---|
committer | Warren Loo <evilseph@gmail.com> | 2012-03-26 16:36:31 -0400 |
commit | c16bf07e85feb5e7bcb3e4a98048de36fe7859f2 (patch) | |
tree | 7a3c9943a2f2c07a37faed7ec73428608a6b5722 /src/main/java/net/minecraft/server/EntityArrow.java | |
parent | bdccfd29ec0c6e59e321e474c0b46c790669d343 (diff) | |
download | craftbukkit-c16bf07e85feb5e7bcb3e4a98048de36fe7859f2.tar craftbukkit-c16bf07e85feb5e7bcb3e4a98048de36fe7859f2.tar.gz craftbukkit-c16bf07e85feb5e7bcb3e4a98048de36fe7859f2.tar.lz craftbukkit-c16bf07e85feb5e7bcb3e4a98048de36fe7859f2.tar.xz craftbukkit-c16bf07e85feb5e7bcb3e4a98048de36fe7859f2.zip |
[Bleeding] Allow CraftItem to be backed by non-EntityItems. Fixes BUKKIT-1351
Diffstat (limited to 'src/main/java/net/minecraft/server/EntityArrow.java')
-rw-r--r-- | src/main/java/net/minecraft/server/EntityArrow.java | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/main/java/net/minecraft/server/EntityArrow.java b/src/main/java/net/minecraft/server/EntityArrow.java index a8759c39..2ae8a007 100644 --- a/src/main/java/net/minecraft/server/EntityArrow.java +++ b/src/main/java/net/minecraft/server/EntityArrow.java @@ -3,7 +3,6 @@ package net.minecraft.server; import java.util.List; // CraftBukkit start -import org.bukkit.Bukkit; import org.bukkit.entity.Projectile; import org.bukkit.event.entity.EntityCombustByEntityEvent; import org.bukkit.event.entity.ProjectileHitEvent; @@ -215,7 +214,7 @@ public class EntityArrow extends Entity { if (movingobjectposition.entity.damageEntity(damagesource, l)) { if (this.isBurning() && (!(movingobjectposition.entity instanceof EntityPlayer) || this.world.pvpMode)) { // CraftBukkit - abide by pvp setting if destination is a player. EntityCombustByEntityEvent combustEvent = new EntityCombustByEntityEvent(this.getBukkitEntity(), entity.getBukkitEntity(), 5); - Bukkit.getPluginManager().callEvent(combustEvent); + org.bukkit.Bukkit.getPluginManager().callEvent(combustEvent); if (!combustEvent.isCancelled()) { movingobjectposition.entity.setOnFire(combustEvent.getDuration()); @@ -345,11 +344,11 @@ public class EntityArrow extends Entity { public void a_(EntityHuman entityhuman) { if (!this.world.isStatic) { // CraftBukkit start - ItemStack itemstack = new ItemStack(Item.ARROW, 1); + ItemStack itemstack = new ItemStack(Item.ARROW); if (this.inGround && this.fromPlayer && this.shake <= 0 && entityhuman.inventory.canHold(itemstack) > 0) { - net.minecraft.server.EntityItem item = new net.minecraft.server.EntityItem(this.world, this.locX, this.locY, this.locZ, itemstack); + EntityItem item = new EntityItem(this.world, this.locX, this.locY, this.locZ, itemstack); - PlayerPickupItemEvent event = new PlayerPickupItemEvent((org.bukkit.entity.Player) entityhuman.getBukkitEntity(), new org.bukkit.craftbukkit.entity.CraftItem(this.world.getServer(), item), 0); + PlayerPickupItemEvent event = new PlayerPickupItemEvent((org.bukkit.entity.Player) entityhuman.getBukkitEntity(), new org.bukkit.craftbukkit.entity.CraftItem(this.world.getServer(), this, item), 0); this.world.getServer().getPluginManager().callEvent(event); if (event.isCancelled()) { |