BlockSpreadEvent spreadEvent = new BlockSpreadEvent(state.getBlock(), block, state); EventFactory.getInstance().callEvent(spreadEvent); if (!spreadEvent.isCancelled()) { state.update(true);
private void putVine(GlowBlock block, Vine vine, GlowBlock fromBlock) { GlowBlockState state = block.getState(); state.setType(Material.VINE); state.setData(vine); if (fromBlock != null) { BlockSpreadEvent spreadEvent = new BlockSpreadEvent(block, fromBlock, state); EventFactory.getInstance().callEvent(spreadEvent); if (!spreadEvent.isCancelled()) { state.update(true); } } else { state.update(true); } }
BlockSpreadEvent spreadEvent = new BlockSpreadEvent(targetBlock, block, state); EventFactory.getInstance().callEvent(spreadEvent); if (!spreadEvent.isCancelled()) { state.update(true);
BlockSpreadEvent spreadEvent = new BlockSpreadEvent(targetBlock, block, state); EventFactory.getInstance().callEvent(spreadEvent); if (!spreadEvent.isCancelled()) { state.update(true);
@Override public void updateBlock(GlowBlock block) { super.updateBlock(block); if (block.getLightFromBlocks() <= 11 - block.getMaterialValues().getLightOpacity()) { if (block.getRelative(BlockFace.UP).isEmpty() && hasNearSolidBlock(block) && GlowBiomeClimate.isCold(block)) { GlowBlockState state = block.getState(); state.setType(Material.ICE); state.setData(new MaterialData(Material.ICE)); BlockSpreadEvent spreadEvent = new BlockSpreadEvent(state.getBlock(), block, state); EventFactory.getInstance().callEvent(spreadEvent); if (!spreadEvent.isCancelled()) { state.update(true); } } } }