mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-23 02:55:47 +01:00
SPIGOT-4964: EntityPickupItemEvent for pandas
This commit is contained in:
parent
de9b85b8a1
commit
49e15b4d9a
@ -9,6 +9,15 @@
|
|||||||
public class EntityPanda extends EntityAnimal {
|
public class EntityPanda extends EntityAnimal {
|
||||||
|
|
||||||
private static final DataWatcherObject<Integer> bA = DataWatcher.a(EntityPanda.class, DataWatcherRegistry.b);
|
private static final DataWatcherObject<Integer> bA = DataWatcher.a(EntityPanda.class, DataWatcherRegistry.b);
|
||||||
|
@@ -445,7 +447,7 @@
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void a(EntityItem entityitem) {
|
||||||
|
- if (this.getEquipment(EnumItemSlot.MAINHAND).isEmpty() && EntityPanda.bQ.test(entityitem)) {
|
||||||
|
+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityPickupItemEvent(this, entityitem, 0, !(this.getEquipment(EnumItemSlot.MAINHAND).isEmpty() && EntityPanda.bQ.test(entityitem))).isCancelled()) { // CraftBukkit
|
||||||
|
ItemStack itemstack = entityitem.getItemStack();
|
||||||
|
|
||||||
|
this.setSlot(EnumItemSlot.MAINHAND, itemstack);
|
||||||
@@ -673,7 +675,7 @@
|
@@ -673,7 +675,7 @@
|
||||||
@Override
|
@Override
|
||||||
protected void a(EntityInsentient entityinsentient, EntityLiving entityliving) {
|
protected void a(EntityInsentient entityinsentient, EntityLiving entityliving) {
|
||||||
|
Loading…
Reference in New Issue
Block a user