From 4377b86b29aca85a0c6f3e310613330a847a6ab3 Mon Sep 17 00:00:00 2001 From: md_5 Date: Tue, 26 Apr 2016 09:26:20 +1000 Subject: SPIGOT-2218: Drop horse chest on death --- nms-patches/EntityHorse.patch | 31 ++++++++++--------------------- 1 file changed, 10 insertions(+), 21 deletions(-) (limited to 'nms-patches/EntityHorse.patch') diff --git a/nms-patches/EntityHorse.patch b/nms-patches/EntityHorse.patch index 39e03b08..6030f31b 100644 --- a/nms-patches/EntityHorse.patch +++ b/nms-patches/EntityHorse.patch @@ -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) { -- cgit v1.2.3