SPIGOT-2218: Drop horse chest on death

This commit is contained in:
md_5 2016-04-26 09:26:20 +10:00
parent 22dcde52c9
commit 4377b86b29

View File

@ -44,32 +44,21 @@
flag = true;
}
@@ -652,11 +655,24 @@
@@ -651,11 +654,11 @@
}
public void die(DamageSource damagesource) {
super.die(damagesource);
+ /* CraftBukkit start - Handle chest dropping in dropDeathLoot below
- super.die(damagesource);
+ // super.die(damagesource); // Moved down
if (!this.world.isClientSide) {
this.dropChest();
}
+ // CraftBukkit end */
+ }
+
+ // CraftBukkit start - Add method
+ @Override
+ protected void dropDeathLoot(boolean flag, int i) {
+ super.dropDeathLoot(flag, i);
+ // Moved from die method above
+ if (!this.world.isClientSide) {
+ this.dropChest();
+ }
-
+ super.die(damagesource); // CraftBukkit
}
+ // CraftBukkit end
public void n() {
if (this.random.nextInt(200) == 0) {
@@ -666,7 +682,7 @@
@@ -666,7 +669,7 @@
super.n();
if (!this.world.isClientSide) {
if (this.random.nextInt(900) == 0 && this.deathTicks == 0) {
@ -78,7 +67,7 @@
}
if (!this.dm() && !this.isVehicle() && this.random.nextInt(300) == 0 && this.world.getType(new BlockPosition(MathHelper.floor(this.locX), MathHelper.floor(this.locY) - 1, MathHelper.floor(this.locZ))).getBlock() == Blocks.GRASS) {
@@ -919,6 +935,7 @@
@@ -919,6 +922,7 @@
if (this.getOwnerUUID() != null) {
nbttagcompound.setString("OwnerUUID", this.getOwnerUUID().toString());
}
@ -86,7 +75,7 @@
if (this.hasChest()) {
NBTTagList nbttaglist = new NBTTagList();
@@ -974,6 +991,12 @@
@@ -974,6 +978,12 @@
this.setOwnerUUID(UUID.fromString(s));
}
@ -99,7 +88,7 @@
AttributeInstance attributeinstance = this.getAttributeMap().a("Speed");
if (attributeinstance != null) {
@@ -1145,6 +1168,18 @@
@@ -1145,6 +1155,18 @@
}
public void b(int i) {