mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-05 12:36:40 +00:00
Add better control over expression timeouts. (#451)
Add better control over expression timeouts. * //timeout command can be used to change player's current timeout. * Config now also has a max timeout, can be bypassed with permission * Timeout of < 0 will let expressions run indefinitely. * Said expressions won't run on a separate thread, slightly reducing the overhead from context switching. For large //gen commands, for example, this can actually increase speed.
This commit is contained in:
@ -79,6 +79,7 @@ public class SelectionCommand extends SimpleCommand<Operation> {
|
||||
EditContext editContext = new EditContext();
|
||||
editContext.setDestination(locals.get(EditSession.class));
|
||||
editContext.setRegion(selection);
|
||||
editContext.setSession(session);
|
||||
|
||||
Operation operation = operationFactory.createFromContext(editContext);
|
||||
Operations.completeBlindly(operation);
|
||||
|
@ -75,7 +75,7 @@ public class ShapedBrushCommand extends SimpleCommand<Object> {
|
||||
BrushTool tool = session.getBrushTool(player.getItemInHand(HandSide.MAIN_HAND).getType());
|
||||
tool.setSize(radius);
|
||||
tool.setFill(null);
|
||||
tool.setBrush(new OperationFactoryBrush(factory, regionFactory), permission);
|
||||
tool.setBrush(new OperationFactoryBrush(factory, regionFactory, session), permission);
|
||||
} catch (MaxBrushRadiusException | InvalidToolBindException e) {
|
||||
WorldEdit.getInstance().getPlatformManager().getCommandManager().getExceptionConverter().convert(e);
|
||||
}
|
||||
|
Reference in New Issue
Block a user