Search in sources :

Example 1 with EntityUnstackEvent

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;
}
Also used : EntityUnstackEvent(dev.rosewood.rosestacker.event.EntityUnstackEvent)

Aggregations

EntityUnstackEvent (dev.rosewood.rosestacker.event.EntityUnstackEvent)1