use of org.bukkit.event.entity.EntityChangeBlockEvent in project Glowstone by GlowstoneMC.
the class BlockRedstoneOre method blockInteract.
@Override
public boolean blockInteract(GlowPlayer player, GlowBlock block, BlockFace face, Vector clickedLoc) {
EntityChangeBlockEvent changeBlockEvent = new EntityChangeBlockEvent(player, block, Material.GLOWING_REDSTONE_ORE, (byte) 0);
EventFactory.callEvent(changeBlockEvent);
if (!changeBlockEvent.isCancelled()) {
GlowBlockState state = block.getState();
state.setType(Material.GLOWING_REDSTONE_ORE);
state.update(true);
}
return false;
}
Aggregations