Fix foxes not dropping items

This commit is contained in:
Spottedleaf 2019-05-07 08:20:32 -07:00
parent cf17353783
commit 9db83af2ab

View file

@ -1,4 +1,4 @@
From 91e26b7d4f46295ba6b5efd3577a49eeed07b55c Mon Sep 17 00:00:00 2001
From 87f19f8f0e3245d63d69328ac2941f934d31a857 Mon Sep 17 00:00:00 2001
From: Phoenix616 <mail@moep.tv>
Date: Tue, 21 Aug 2018 01:39:35 +0100
Subject: [PATCH] Improve death events
@ -61,7 +61,7 @@ index 7031dd0e4c..f6dc96434b 100644
}
diff --git a/src/main/java/net/minecraft/server/EntityFox.java b/src/main/java/net/minecraft/server/EntityFox.java
index 917d603507..c099e2fbb6 100644
index 917d603507..95d6b3f369 100644
--- a/src/main/java/net/minecraft/server/EntityFox.java
+++ b/src/main/java/net/minecraft/server/EntityFox.java
@@ -597,15 +597,25 @@ public class EntityFox extends EntityAnimal {
@ -69,9 +69,10 @@ index 917d603507..c099e2fbb6 100644
@Override
- protected void d(DamageSource damagesource) {
- ItemStack itemstack = this.getEquipment(EnumItemSlot.MAINHAND);
+ protected org.bukkit.event.entity.EntityDeathEvent d(DamageSource damagesource) { // Paper
ItemStack itemstack = this.getEquipment(EnumItemSlot.MAINHAND);
+ ItemStack itemstack = this.getEquipment(EnumItemSlot.MAINHAND).cloneItemStack(); // Paper
+
+ // Paper start - Cancellable death event
+ org.bukkit.event.entity.EntityDeathEvent deathEvent = super.d(damagesource);
+
@ -81,7 +82,7 @@ index 917d603507..c099e2fbb6 100644
+ return deathEvent;
+ }
+ // Paper end
+
if (!itemstack.isEmpty()) {
this.a(itemstack);
this.setSlot(EnumItemSlot.MAINHAND, ItemStack.a);