Class LuaManager

java.lang.Object
dev.selena.luacore.utils.lua.LuaManager

public class LuaManager extends Object
Main class for Lua management
  • 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 run
      scriptPath - The path to the folder your script is in
      scriptName - The name of the script
      args - List of arguments in the form of LuaArgValue
      Returns:
      True if the function exists in the Lua file
    • runScript

      public static boolean runScript(String function, String script, LuaArgValue... args)
      Used for running lua script functions
      Parameters:
      function - The name of the function you want to run
      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
    • runEvent

      public static boolean runEvent(String scriptPath, String scriptName, LuaArgValue... args)
      Used for running lua script event function
      Parameters:
      scriptPath - The path to the script
      scriptName - The name of the script file
      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
    • runEvent

      public static boolean runEvent(String script, LuaArgValue... args)
      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

      public static void loadResourceFolder(String folderName) throws IOException
      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