use of net.glowstone.dispenser.DispenseBehavior in project Glowstone by GlowstoneMC.
the class GlowDispenser method dispense.
@Override
public boolean dispense() {
GlowBlock block = getBlock();
int dispenseSlot = getDispenseSlot();
if (dispenseSlot < 0) {
block.getWorld().playEffect(block.getLocation(), Effect.CLICK1, 0);
return false;
}
ItemStack origItems = getInventory().getItem(dispenseSlot);
DispenseBehavior behavior = getDispenseBehavior(origItems.getType());
ItemStack result = behavior.dispense(block, origItems);
getInventory().setItem(dispenseSlot, result);
return true;
}
Aggregations