mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 17:57:38 +00:00
Handle NoMatchException in WorldEditBinding.
This commit is contained in:
parent
e261e720b6
commit
93a48bbb55
@ -23,6 +23,7 @@ import com.sk89q.worldedit.*;
|
|||||||
import com.sk89q.worldedit.blocks.BaseBlock;
|
import com.sk89q.worldedit.blocks.BaseBlock;
|
||||||
import com.sk89q.worldedit.entity.Entity;
|
import com.sk89q.worldedit.entity.Entity;
|
||||||
import com.sk89q.worldedit.entity.Player;
|
import com.sk89q.worldedit.entity.Player;
|
||||||
|
import com.sk89q.worldedit.extension.input.NoMatchException;
|
||||||
import com.sk89q.worldedit.extension.input.ParserContext;
|
import com.sk89q.worldedit.extension.input.ParserContext;
|
||||||
import com.sk89q.worldedit.extension.platform.Actor;
|
import com.sk89q.worldedit.extension.platform.Actor;
|
||||||
import com.sk89q.worldedit.function.mask.Mask;
|
import com.sk89q.worldedit.function.mask.Mask;
|
||||||
@ -160,7 +161,11 @@ public class WorldEditBinding extends BindingHelper {
|
|||||||
parserContext.setWorld(((Entity) actor).getWorld());
|
parserContext.setWorld(((Entity) actor).getWorld());
|
||||||
}
|
}
|
||||||
parserContext.setSession(worldEdit.getSessionManager().get(actor));
|
parserContext.setSession(worldEdit.getSessionManager().get(actor));
|
||||||
|
try {
|
||||||
return worldEdit.getBlockRegistry().parseFromInput(context.next(), parserContext);
|
return worldEdit.getBlockRegistry().parseFromInput(context.next(), parserContext);
|
||||||
|
} catch (NoMatchException e) {
|
||||||
|
throw new ParameterException(e.getMessage(), e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -182,7 +187,11 @@ public class WorldEditBinding extends BindingHelper {
|
|||||||
parserContext.setWorld(((Entity) actor).getWorld());
|
parserContext.setWorld(((Entity) actor).getWorld());
|
||||||
}
|
}
|
||||||
parserContext.setSession(worldEdit.getSessionManager().get(actor));
|
parserContext.setSession(worldEdit.getSessionManager().get(actor));
|
||||||
|
try {
|
||||||
return worldEdit.getPatternRegistry().parseFromInput(context.next(), parserContext);
|
return worldEdit.getPatternRegistry().parseFromInput(context.next(), parserContext);
|
||||||
|
} catch (NoMatchException e) {
|
||||||
|
throw new ParameterException(e.getMessage(), e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -204,7 +213,11 @@ public class WorldEditBinding extends BindingHelper {
|
|||||||
parserContext.setWorld(((Entity) actor).getWorld());
|
parserContext.setWorld(((Entity) actor).getWorld());
|
||||||
}
|
}
|
||||||
parserContext.setSession(worldEdit.getSessionManager().get(actor));
|
parserContext.setSession(worldEdit.getSessionManager().get(actor));
|
||||||
|
try {
|
||||||
return worldEdit.getMaskRegistry().parseFromInput(context.next(), parserContext);
|
return worldEdit.getMaskRegistry().parseFromInput(context.next(), parserContext);
|
||||||
|
} catch (NoMatchException e) {
|
||||||
|
throw new ParameterException(e.getMessage(), e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user