Class PluginReloader
java.lang.Object
valorless.valorlessutils.reloader.PluginReloader
Utility class for safely reloading plugins at runtime.
This reloader works by disabling a plugin immediately and then scheduling its re-enablement after a configurable delay. Useful for development or for plugins that support hot-reloading.
Note: Reloading plugins at runtime may cause side effects if the plugin is not designed to handle being disabled and re-enabled properly.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidreloadPlugin(org.bukkit.plugin.Plugin target, long delay, boolean silent) Handles the actual plugin reload logic.static voidreloadPlugin(org.bukkit.plugin.Plugin target, long delay, boolean silent, org.bukkit.command.CommandSender sender) Handles the actual plugin reload logic.
-
Constructor Details
-
PluginReloader
public PluginReloader()
-
-
Method Details
-
reloadPlugin
public static void reloadPlugin(org.bukkit.plugin.Plugin target, long delay, boolean silent) Handles the actual plugin reload logic.Disables the target plugin immediately, then schedules a re-enable after the given delay. If the plugin is not found, an error is logged.
- Parameters:
target- The plugin to reloaddelay- The delay in ticks before re-enablingsilent- Whether to suppress log messages during reload
-
reloadPlugin
public static void reloadPlugin(org.bukkit.plugin.Plugin target, long delay, boolean silent, org.bukkit.command.CommandSender sender) Handles the actual plugin reload logic.Disables the target plugin immediately, then schedules a re-enable after the given delay. If the plugin is not found, an error is logged.
- Parameters:
target- The plugin to reloaddelay- The delay in ticks before re-enablingsilent- Whether to suppress log messages during reloadsender- CommandSender to send status messages to during the reload process
-