Package dev.selena.luacore.utils.lua
Class LuaManager
java.lang.Object
dev.selena.luacore.utils.lua.LuaManager
Main class for Lua management
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
loadResourceFolder
(String folderName) Used for loading a folder from the Resources folder Note its best to add all the resource files into sub foldersstatic boolean
runEvent
(String script, LuaArgValue... args) Used for running lua script functionsstatic boolean
runEvent
(String scriptPath, String scriptName, LuaArgValue... args) Used for running lua script event functionstatic boolean
runScript
(String function, String script, LuaArgValue... args) Used for running lua script functionsstatic boolean
runScript
(String function, String scriptPath, String scriptName, LuaArgValue... args) Used to run a lua script
-
Constructor Details
-
LuaManager
public LuaManager()
-
-
Method Details
-
runScript
public static boolean runScript(String function, String scriptPath, String scriptName, LuaArgValue... args) Used to run a lua script- Parameters:
function
- The name of the function you want to runscriptPath
- The path to the folder your script is inscriptName
- The name of the scriptargs
- List of arguments in the form ofLuaArgValue
- Returns:
- True if the function exists in the Lua file
-
runScript
Used for running lua script functions- Parameters:
function
- The name of the function you want to runscript
- The path to the script inclusive (test/test.lua)args
- The list of argument variables you want to pass in- Returns:
- True when all checks are parsed
-
runEvent
Used for running lua script event function- Parameters:
scriptPath
- The path to the scriptscriptName
- The name of the script fileargs
- The list of argument variables you want to pass in- Returns:
- True when all checks are parsed NOTE: Be sure to add the Event instance into the LuaArgValue list
-
runEvent
Used for running lua script functions- Parameters:
script
- The path to the script inclusive (test/test.lua)args
- The list of argument variables you want to pass in- Returns:
- True when all checks are parsed NOTE: Be sure to add the Event instance into the LuaArgValue list
-
loadResourceFolder
Used for loading a folder from the Resources folder Note its best to add all the resource files into sub folders- Parameters:
folderName
- The start path for loading the files- Throws:
IOException
- thrown when the files fail to copy from the plugin into the allocated folder This is partly based off kamontat jar extraction
-