use of org.bukkit.event.block.BlockGrowEvent in project Glowstone by GlowstoneMC.
the class BlockNetherWart method updateBlock.
@Override
public void updateBlock(GlowBlock block) {
int cropState = block.getData();
if (cropState < NetherWartsState.RIPE.ordinal() && random.nextInt(10) == 0) {
cropState++;
GlowBlockState state = block.getState();
state.setRawData((byte) cropState);
BlockGrowEvent growEvent = new BlockGrowEvent(block, state);
EventFactory.callEvent(growEvent);
if (!growEvent.isCancelled()) {
state.update(true);
}
}
}
Aggregations