public static boolean isRedstonePowered(World world, int x, int y, int z) {
if (world.isBlockIndirectlyGettingPowered(x, y, z)) {
return true;
}
for (BlockPosition bp : new BlockPosition(x, y, z).getAdjacent(false)) {
Block block = world.getBlock(bp.x, bp.y, bp.z);
if (block.equals(Blocks.redstone_wire) && block.isProvidingStrongPower(world, bp.x, bp.y, bp.z, 1) > 0) {
return true;
}
}