private void flow(GlowBlock source, BlockFace direction) { // if we're not going down BlockFromToEvent fromToEvent = new BlockFromToEvent(source, direction); if (fromToEvent.isCancelled()) { return; } byte strength = fromToEvent.getBlock().getState().getRawData(); if (DOWN != fromToEvent.getFace()) { if (strength < (isWater(fromToEvent.getBlock().getType()) || fromToEvent.getBlock().getBiome() == Biome.HELL ? STRENGTH_MIN_WATER : STRENGTH_MIN_LAVA)) { // decrease the strength strength += 1; } else { // no strength, can't flow return; } } else { // reset the strength if we're going down strength = STRENGTH_MAX; } // flow to the target GlowBlock toBlock = (GlowBlock) fromToEvent.getToBlock(); toBlock.setType(fromToEvent.getBlock().getType(), strength, false); toBlock.getWorld().requestPulse(toBlock); }
@Override public MCBlockFace getBlockFace() { return BukkitMCBlockFace.getConvertor().getAbstractedEnum(event.getFace()); }
if(spreadEvent.getFace() == BlockFace.DOWN) return;