}, 2L);
}
public boolean flipState(Block trigger, LocalPlayer player) throws InvalidMechanismException {
if (!SignUtil.isCardinal(trigger)) throw new InvalidMechanismException();
ChangedSign sign = BukkitUtil.toChangedSign(trigger);
// Attempt to detect whether the bridge is above or below the sign,
// first assuming that the bridge is above
Block proximalBaseCenter = getBlockBase(trigger);
// Find the other side
Block farSide = getFarSign(trigger);
if (farSide.getType() != trigger.getType()) throw new InvalidMechanismException("mech.door.other-sign");
// Check the other side's base blocks for matching type
Block distalBaseCenter = null;
if (sign.getLine(1).equalsIgnoreCase("[Door Up]")) {
distalBaseCenter = farSide.getRelative(BlockFace.DOWN);
} else if (sign.getLine(1).equalsIgnoreCase("[Door Down]")) {
distalBaseCenter = farSide.getRelative(BlockFace.UP);
}
if (!BlockUtil.areBlocksIdentical(distalBaseCenter, proximalBaseCenter))
throw new InvalidMechanismException("mech.door.material");
// Select the togglable region
CuboidRegion toggle = getCuboidArea(trigger, proximalBaseCenter, distalBaseCenter);
// this is kinda funky, but we only check one position