Package dev.selena.luacore
Class LuaCore
java.lang.Object
dev.selena.luacore.LuaCore
Main class for the library
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voiddisable()This needs to be called in the onDisable method of lock file managementstatic StringUsed for NBT compoundsstatic StringgetLockFileName(String name) Method to get a specific lock file namestatic voidlockCrashHandling(boolean... force) Used for crash handling of the lock files.static voidThis should only be called by one plugin on your server, Used for preventing the placement/usage of un usable itemsstatic voidsave()Used for saving all needed data call this in onDisablestatic voidsetDefaultErrorTrace(boolean enabled) Used for setting the defaultLuaMessageUtils.verboseError(String)to have the call tracestatic voidsetDefaultMessageTrace(boolean enabled) Used for setting the defaultLuaMessageUtils.verboseMessage(String)to have the call tracestatic voidsetDefaultWarnTrace(boolean enabled) Used for setting the defaultLuaMessageUtils.verboseWarn(String)to have the call tracestatic voidsetPlugin(org.bukkit.plugin.Plugin plugin) Deprecated, for removal: This API element is subject to removal in a future version.static voidsetupCore(org.bukkit.plugin.Plugin plugin) Method to set up the library with the required methods (setPlugin and setCoreLogger)static voidsetUserDataManager(UserDataManager userDataManager) Used for setting up user data management, This is in early beta currentlystatic voidsetVerbose(boolean verbose) Used for enabling extra messages
-
Constructor Details
-
LuaCore
public LuaCore()
-
-
Method Details
-
setPlugin
Deprecated, for removal: This API element is subject to removal in a future version.This needs to be called in the onEnable method of your plugin for it to work- Parameters:
plugin- Your main class that extends JavaPlugin
-
setupCore
public static void setupCore(org.bukkit.plugin.Plugin plugin) Method to set up the library with the required methods (setPlugin and setCoreLogger)- Parameters:
plugin- Your plugin instance
-
lockCrashHandling
public static void lockCrashHandling(boolean... force) Used for crash handling of the lock files. If the server is to crash and this method didn't exist, then you would have issues with lock files related to classes NOTE: If there is a start-up error causing crashes, you will likely encounter an issue with the lock files. If you need to manually delete them for any reason, they are located in the LuaCoreLocks inside your servers main folder. Not the plugin folder- Parameters:
force- set to true to force clearing the lock folder. Only one needs to go here it's just a way to avoid a second method.
-
setUserDataManager
Used for setting up user data management, This is in early beta currently- Parameters:
userDataManager- The instance of the UserDataManager class
-
registerItemEvents
public static void registerItemEvents()This should only be called by one plugin on your server, Used for preventing the placement/usage of un usable items -
setVerbose
public static void setVerbose(boolean verbose) Used for enabling extra messages- Parameters:
verbose- True if you want extra messages
-
setDefaultErrorTrace
public static void setDefaultErrorTrace(boolean enabled) Used for setting the defaultLuaMessageUtils.verboseError(String)to have the call trace- Parameters:
enabled- Set to true if you want the defaultLuaMessageUtils.verboseError(String)to have the call trace- See Also:
-
setDefaultWarnTrace
public static void setDefaultWarnTrace(boolean enabled) Used for setting the defaultLuaMessageUtils.verboseWarn(String)to have the call trace- Parameters:
enabled- Set to true if you want the defaultLuaMessageUtils.verboseWarn(String)to have the call trace- See Also:
-
setDefaultMessageTrace
public static void setDefaultMessageTrace(boolean enabled) Used for setting the defaultLuaMessageUtils.verboseMessage(String)to have the call trace- Parameters:
enabled- Set to true if you want the defaultLuaMessageUtils.verboseMessage(String)to have the call trace- See Also:
-
getCompountName
Used for NBT compounds- Returns:
- Returns the compound name for your plugin
-
save
public static void save()Used for saving all needed data call this in onDisable -
disable
public static void disable()This needs to be called in the onDisable method of lock file management- See Also:
-
getLockFileName
Method to get a specific lock file name- Parameters:
name- The name of the file (exclusive on the lock root dir)- Returns:
- The path string for the new lock file
-
setupCore(Plugin)