Set default pickup delay for dropped item

This commit is contained in:
IzzelAliz 2021-05-07 21:14:13 +08:00
parent 9073fb86bf
commit cef6d7e3fc

View File

@ -35,7 +35,11 @@ public class EntityEventDispatcher {
}
List<ItemStack> itemStackList = XmapList.create((List<ItemEntity>) drops, ItemStack.class,
(ItemEntity entity) -> CraftItemStack.asCraftMirror(entity.getItem()),
itemStack -> new ItemEntity(livingEntity.world, livingEntity.getPosX(), livingEntity.getPosY(), livingEntity.getPosZ(), CraftItemStack.asNMSCopy(itemStack)));
itemStack -> {
ItemEntity itemEntity = new ItemEntity(livingEntity.world, livingEntity.getPosX(), livingEntity.getPosY(), livingEntity.getPosZ(), CraftItemStack.asNMSCopy(itemStack));
itemEntity.setDefaultPickupDelay();
return itemEntity;
});
ArclightEventFactory.callEntityDeathEvent(livingEntity, itemStackList);
if (drops.isEmpty()) {
event.setCanceled(true);