use of dev.rosewood.rosestacker.event.EntityUnstackEvent in project RoseStacker by Rosewood-Development.
the class StackingThread method splitEntityStack.
@Override
public StackedEntity splitEntityStack(StackedEntity stackedEntity) {
EntityUnstackEvent entityUnstackEvent = new EntityUnstackEvent(stackedEntity, new StackedEntity(stackedEntity.getEntity()));
Bukkit.getPluginManager().callEvent(entityUnstackEvent);
if (entityUnstackEvent.isCancelled())
return null;
StackedEntity newlySplit = stackedEntity.decreaseStackSize();
this.stackedEntities.put(newlySplit.getEntity().getUniqueId(), newlySplit);
return newlySplit;
}
Aggregations