use of net.glowstone.block.GlowBlock 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 = getDispenseBehaviorRegistry().getBehavior(origItems.getType());
ItemStack result = behavior.dispense(block, origItems);
getInventory().setItem(dispenseSlot, result);
return true;
}
use of net.glowstone.block.GlowBlock in project Glowstone by GlowstoneMC.
the class BlockStateDelegate method backupBlockState.
/**
* Backups a block state.
*
* @param block the block which state should be backup
*/
public void backupBlockState(Block block) {
blockStateMap.remove(block.getLocation());
blockStateBackupMap.put(block.getLocation(), new GlowBlockState((GlowBlock) block));
}
Aggregations