mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-25 20:16:19 +01:00
SPIGOT-5948: EntityDropItemEvent does not fire when piglins drop an item
This commit is contained in:
parent
38a66b6560
commit
0fa2eecffb
@ -33,7 +33,19 @@
|
|||||||
double d0 = entityliving.getHeadY() - 0.30000001192092896D;
|
double d0 = entityliving.getHeadY() - 0.30000001192092896D;
|
||||||
EntityItem entityitem = new EntityItem(entityliving.world, entityliving.locX(), d0, entityliving.locZ(), itemstack);
|
EntityItem entityitem = new EntityItem(entityliving.world, entityliving.locX(), d0, entityliving.locZ(), itemstack);
|
||||||
float f = 0.3F;
|
float f = 0.3F;
|
||||||
@@ -76,7 +77,7 @@
|
@@ -71,12 +72,19 @@
|
||||||
|
vec3d1 = vec3d1.d().a(0.30000001192092896D);
|
||||||
|
entityitem.setMot(vec3d1);
|
||||||
|
entityitem.defaultPickupDelay();
|
||||||
|
+ // CraftBukkit start
|
||||||
|
+ org.bukkit.event.entity.EntityDropItemEvent event = new org.bukkit.event.entity.EntityDropItemEvent(entityliving.getBukkitEntity(), (org.bukkit.entity.Item) entityitem.getBukkitEntity());
|
||||||
|
+ entityitem.world.getServer().getPluginManager().callEvent(event);
|
||||||
|
+ if (event.isCancelled()) {
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
+ // CraftBukkit end
|
||||||
|
entityliving.world.addEntity(entityitem);
|
||||||
|
}
|
||||||
|
|
||||||
public static SectionPosition a(WorldServer worldserver, SectionPosition sectionposition, int i) {
|
public static SectionPosition a(WorldServer worldserver, SectionPosition sectionposition, int i) {
|
||||||
int j = worldserver.b(sectionposition);
|
int j = worldserver.b(sectionposition);
|
||||||
|
Loading…
Reference in New Issue
Block a user