SPIGOT-1816: Rework drop capture.

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2016-03-07 19:51:42 +11:00
parent 406b2d6204
commit ced78d5d27
6 changed files with 30 additions and 113 deletions

View File

@@ -64,28 +64,7 @@
}
public boolean d(Class<? extends EntityLiving> oclass) {
@@ -225,6 +267,7 @@
return null;
}
+ protected ItemStack headDrop = null; // CraftBukkit
protected void dropDeathLoot(boolean flag, int i) {
Item item = this.getLoot();
@@ -240,6 +283,12 @@
}
}
+ // CraftBukkit start
+ if (headDrop != null) {
+ this.a(headDrop, 0.0F);
+ headDrop = null;
+ }
+ // CraftBukkit end
}
public void b(NBTTagCompound nbttagcompound) {
@@ -321,11 +370,20 @@
@@ -321,11 +363,20 @@
public void a(NBTTagCompound nbttagcompound) {
super.a(nbttagcompound);
@@ -108,16 +87,7 @@
NBTTagList nbttaglist;
int i;
@@ -406,7 +464,7 @@
}
this.dropEquipment(flag, i);
- } else {
+ } { // CraftBukkit - remove else
super.a(flag, i, damagesource);
}
@@ -549,11 +607,11 @@
@@ -549,11 +600,11 @@
double d2 = entityhuman.locZ - this.locZ;
double d3 = d0 * d0 + d1 * d1 + d2 * d2;
@@ -131,7 +101,7 @@
this.die();
} else if (d3 < 1024.0D) {
this.ticksFarFromPlayer = 0;
@@ -931,9 +989,21 @@
@@ -931,9 +982,21 @@
public final boolean a(EntityHuman entityhuman, ItemStack itemstack, EnumHand enumhand) {
if (this.isLeashed() && this.getLeashHolder() == entityhuman) {
@@ -153,7 +123,7 @@
this.setLeashHolder(entityhuman, true);
--itemstack.count;
return true;
@@ -953,10 +1023,12 @@
@@ -953,10 +1016,12 @@
if (this.bC) {
if (!this.isAlive()) {
@@ -166,7 +136,7 @@
this.unleash(true, true);
}
}
@@ -1037,6 +1109,7 @@
@@ -1037,6 +1102,7 @@
this.leashHolder = entityleash;
} else {