mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 09:47:38 +00:00
Added OperationHelper.completeBlindly().
This commit is contained in:
parent
45c2868d4c
commit
2562a2f577
@ -61,4 +61,21 @@ public final class OperationHelper {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Complete a given operation synchronously until it completes. Re-throw all
|
||||||
|
* {@link com.sk89q.worldedit.WorldEditException} exceptions as
|
||||||
|
* {@link java.lang.RuntimeException}s.
|
||||||
|
*
|
||||||
|
* @param op operation to execute
|
||||||
|
*/
|
||||||
|
public static void completeBlindly(Operation op) {
|
||||||
|
while (op != null) {
|
||||||
|
try {
|
||||||
|
op = op.resume();
|
||||||
|
} catch (WorldEditException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user