mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2025-02-28 18:21:20 +01:00
Simplify and remove duplicate code.
This commit is contained in:
parent
c8bde17994
commit
03f05d3a4e
@ -246,11 +246,10 @@ protected static ProtectedRegion checkRegionStandingIn(RegionManager regionManag
|
||||
*/
|
||||
protected static Region checkSelection(Actor actor) throws CommandException {
|
||||
LocalSession localSession = WorldEdit.getInstance().getSessionManager().get(actor);
|
||||
if (localSession == null || localSession.getSelectionWorld() == null)
|
||||
throw new CommandException("Please select an area first. " +
|
||||
"Use WorldEdit to make a selection! " +
|
||||
"(see: https://worldedit.enginehub.org/en/latest/usage/regions/selections/).");
|
||||
try {
|
||||
if (localSession == null || localSession.getSelectionWorld() == null) {
|
||||
throw new IncompleteRegionException();
|
||||
}
|
||||
return localSession.getRegionSelector(localSession.getSelectionWorld()).getRegion();
|
||||
} catch (IncompleteRegionException e) {
|
||||
throw new CommandException("Please select an area first. " +
|
||||
|
Loading…
Reference in New Issue
Block a user