1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-11-07 00:42:59 +00:00
Files
CC-Tweaked/remappedSrc/dan200/computercraft/api/lua/ILuaTask.java
2021-07-11 01:33:21 +00:00

30 lines
1.0 KiB
Java

/*
* This file is part of the public ComputerCraft API - http://www.computercraft.info
* Copyright Daniel Ratcliffe, 2011-2021. 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;
}