NightbreakPluginHotSwap

public final class NightbreakPluginHotSwap

Applies a plugin update staged in Bukkit's update folder without a server restart.

The swap disables the plugin and every MagmaGuy plugin that depends on it, removes them from the server's plugin registry, replaces the jar, then loads and enables them again. If the new jar does not enable, the previous jar is loaded again and the update stays staged for the next restart.

The swap itself runs in PluginHotSwapRoutine, loaded by a separate class loader. See that class for why.

Properties

Link copied to clipboard
public final static String APPLY_MODE_CONFIG_PATH
Link copied to clipboard
public final static String MODE_IMMEDIATELY
Link copied to clipboard
public final static String MODE_NEVER
Link copied to clipboard
public final static String MODE_WHEN_EMPTY

Functions

Link copied to clipboard
public static boolean applyStagedUpdate(JavaPlugin plugin, CommandSender sender)
Schedules a swap to the staged update on the next tick.
Link copied to clipboard
public static boolean hasStagedUpdate(JavaPlugin plugin)
Link copied to clipboard
public static void requireRestartForUpdates(JavaPlugin plugin, String reason)
Keeps this plugin's updates waiting for a restart, for example because part of it runs outside Bukkit and cannot reload.