summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server/EntityInsentient.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/net/minecraft/server/EntityInsentient.java')
-rw-r--r--src/main/java/net/minecraft/server/EntityInsentient.java21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
index 7079ed7d..11450ac5 100644
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
@@ -6,6 +6,7 @@ import java.util.UUID;
// CraftBukkit start
import org.bukkit.craftbukkit.event.CraftEventFactory;
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
import org.bukkit.event.entity.EntityUnleashEvent;
import org.bukkit.event.entity.EntityUnleashEvent.UnleashReason;
// CraftBukkit end
@@ -194,11 +195,18 @@ public abstract class EntityInsentient extends EntityLiving {
if (k < 5) {
ItemStack itemstack = this.getRareDrop(k <= 0 ? 1 : 0);
if (itemstack != null) {
- loot.add(org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(itemstack));
+ loot.add(CraftItemStack.asCraftMirror(itemstack));
}
}
}
+ // Include equipment
+ for (ItemStack stack : this.dropEquipment(this.lastDamageByPlayerTime > 0, i)) {
+ if (stack != null) {
+ loot.add(CraftItemStack.asCraftMirror(stack));
+ }
+ }
+
CraftEventFactory.callEntityDeathEvent(this, loot); // raise event even for those times when the entity does not drop loot
// CraftBukkit end
}
@@ -565,7 +573,10 @@ public abstract class EntityInsentient extends EntityLiving {
return this.equipment;
}
- protected void dropEquipment(boolean flag, int i) {
+ // CraftBukkit start - return array of dropped items
+ protected ItemStack[] dropEquipment(boolean flag, int i) {
+ ItemStack[] dropped = new ItemStack[this.equipment.length];
+ // CraftBukkit end
for (int j = 0; j < this.getEquipment().length; ++j) {
ItemStack itemstack = this.getEquipment(j);
boolean flag1 = this.dropChances[j] > 1.0F;
@@ -586,9 +597,13 @@ public abstract class EntityInsentient extends EntityLiving {
itemstack.setData(l);
}
- this.a(itemstack, 0.0F);
+ // CraftBukkit start
+ // this.a(itemstack, 0.0F);
+ dropped[j] = itemstack;
+ // CraftBukkit end
}
}
+ return dropped; // CraftBukkit
}
protected void bC() {