1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-10-20 00:17:38 +00:00
Files
CC-Tweaked/src/main/java/dan200/computercraft/api/lua/ILuaTask.java
Devan-Kerman c5eb7a9501 reformat
2020-09-04 18:07:48 -05:00

29 lines
1.0 KiB
Java

/*
* This file is part of the public ComputerCraft API - http://www.computercraft.info
* Copyright Daniel Ratcliffe, 2011-2020. This API may be redistributed unmodified and in full only.
* For help using the API, and posting your mods, visit the forums at computercraft.info.
*/
package dan200.computercraft.api.lua;
import javax.annotation.Nullable;
/**
* A task which can be executed via {@link ILuaContext#issueMainThreadTask(ILuaTask)} This will be run on the main thread, at the beginning of the next
* tick.
*
* @see ILuaContext#issueMainThreadTask(ILuaTask)
*/
@FunctionalInterface
public interface ILuaTask {
/**
* Execute this task.
*
* @return The arguments to add to the {@code task_completed} event.
* @throws LuaException If you throw any exception from this function, a lua error will be raised with the same message as your exception. Use this
* to throw appropriate errors if the wrong arguments are supplied to your method.
*/
@Nullable
Object[] execute() throws LuaException;
}