SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, #1008: Add EntityRemoveEvent
By: DerFrZocker <derrieple@gmail.com>
This commit is contained in:
@@ -1,6 +1,17 @@
|
||||
--- a/net/minecraft/world/entity/animal/EntityFox.java
|
||||
+++ b/net/minecraft/world/entity/animal/EntityFox.java
|
||||
@@ -523,7 +523,8 @@
|
||||
@@ -94,6 +94,10 @@
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
import org.joml.Vector3f;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.event.entity.EntityRemoveEvent;
|
||||
+// CraftBukkit end
|
||||
+
|
||||
public class EntityFox extends EntityAnimal implements VariantHolder<EntityFox.Type> {
|
||||
|
||||
private static final DataWatcherObject<Integer> DATA_TYPE_ID = DataWatcher.defineId(EntityFox.class, DataWatcherRegistry.INT);
|
||||
@@ -523,7 +527,8 @@
|
||||
protected void pickUpItem(EntityItem entityitem) {
|
||||
ItemStack itemstack = entityitem.getItem();
|
||||
|
||||
@@ -10,7 +21,16 @@
|
||||
int i = itemstack.getCount();
|
||||
|
||||
if (i > 1) {
|
||||
@@ -883,6 +884,16 @@
|
||||
@@ -535,7 +540,7 @@
|
||||
this.setItemSlot(EnumItemSlot.MAINHAND, itemstack.split(1));
|
||||
this.setGuaranteedDrop(EnumItemSlot.MAINHAND);
|
||||
this.take(entityitem, itemstack.getCount());
|
||||
- entityitem.discard();
|
||||
+ entityitem.discard(EntityRemoveEvent.Cause.PICKUP); // CraftBukkit - add Bukkit remove cause
|
||||
this.ticksSinceEaten = 0;
|
||||
}
|
||||
|
||||
@@ -883,6 +888,16 @@
|
||||
if (entityplayer1 != null && entityplayer != entityplayer1) {
|
||||
entityfox.addTrustedUUID(entityplayer1.getUUID());
|
||||
}
|
||||
@@ -27,7 +47,7 @@
|
||||
|
||||
if (entityplayer2 != null) {
|
||||
entityplayer2.awardStat(StatisticList.ANIMALS_BRED);
|
||||
@@ -893,12 +904,14 @@
|
||||
@@ -893,12 +908,14 @@
|
||||
this.partner.setAge(6000);
|
||||
this.animal.resetLove();
|
||||
this.partner.resetLove();
|
||||
@@ -46,7 +66,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1294,6 +1307,11 @@
|
||||
@@ -1294,6 +1311,11 @@
|
||||
int i = (Integer) iblockdata.getValue(BlockSweetBerryBush.AGE);
|
||||
|
||||
iblockdata.setValue(BlockSweetBerryBush.AGE, 1);
|
||||
@@ -58,7 +78,7 @@
|
||||
int j = 1 + EntityFox.this.level().random.nextInt(2) + (i == 3 ? 1 : 0);
|
||||
ItemStack itemstack = EntityFox.this.getItemBySlot(EnumItemSlot.MAINHAND);
|
||||
|
||||
@@ -1451,7 +1469,7 @@
|
||||
@@ -1451,7 +1473,7 @@
|
||||
private EntityLiving trustedLastHurt;
|
||||
private int timestamp;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user