use of org.bukkit.event.entity.EntityDropItemEvent in project Arclight by IzzelAliz.
the class EntityMixin method arclight$entityDropItem.
@Inject(method = "entityDropItem(Lnet/minecraft/item/ItemStack;F)Lnet/minecraft/entity/item/ItemEntity;", cancellable = true, locals = LocalCapture.CAPTURE_FAILHARD, at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;addEntity(Lnet/minecraft/entity/Entity;)Z"))
public void arclight$entityDropItem(ItemStack stack, float offsetY, CallbackInfoReturnable<ItemEntity> cir, ItemEntity itementity) {
EntityDropItemEvent event = new EntityDropItemEvent(this.getBukkitEntity(), (org.bukkit.entity.Item) ((EntityBridge) itementity).bridge$getBukkitEntity());
Bukkit.getPluginManager().callEvent(event);
if (event.isCancelled()) {
cir.setReturnValue(null);
}
}
use of org.bukkit.event.entity.EntityDropItemEvent in project Arclight by IzzelAliz.
the class ArclightEventFactory method callEntityDropItemEvent.
public static EntityDropItemEvent callEntityDropItemEvent(org.bukkit.entity.Entity entity, org.bukkit.entity.Item drop) {
EntityDropItemEvent bukkitEvent = new EntityDropItemEvent(entity, drop);
callEvent(bukkitEvent);
return bukkitEvent;
}
Aggregations