public class AutoUpdate
extends java.lang.Object
implements java.lang.Runnable, org.bukkit.event.Listener
Constructor and Description |
---|
AutoUpdate(org.bukkit.plugin.Plugin plugin)
This will use your main configuration (config.yml).
|
AutoUpdate(org.bukkit.plugin.Plugin plugin,
org.bukkit.configuration.Configuration config)
This will use a custom configuration.
|
Modifier and Type | Method and Description |
---|---|
void |
adminJoin(org.bukkit.event.player.PlayerJoinEvent event)
This is internal stuff.
|
boolean |
isDebug() |
void |
resetConfig()
This will overwrite the pre-saved configuration.
|
boolean |
restartMainTask()
Use this to restart the main task.
|
void |
run()
This is internal stuff.
|
void |
setConfig(org.bukkit.configuration.Configuration config)
This will overwrite the pre-saved configuration.
|
void |
setDebug(boolean debug)
Use this to enable/disable debugging mode at runtime.
|
void |
updateCmd(org.bukkit.event.player.PlayerCommandPreprocessEvent event)
This is internal stuff.
|
boolean |
updatePlugin(org.bukkit.command.CommandSender sender)
Called by a player or the console to initiate updates.
|
public AutoUpdate(org.bukkit.plugin.Plugin plugin) throws java.io.FileNotFoundException
plugin
- The instance of your plugins main class.java.io.FileNotFoundException
- - configuration file could not be found.public AutoUpdate(org.bukkit.plugin.Plugin plugin, org.bukkit.configuration.Configuration config) throws java.io.FileNotFoundException
plugin
- The instance of your plugins main class.config
- The configuration to use.java.io.FileNotFoundException
- - configuration file could not be found.public boolean isDebug()
public void setDebug(boolean debug)
debug
- True if you want to enable it, false otherwise.public boolean restartMainTask()
public void resetConfig() throws java.io.FileNotFoundException
restartMainTask()
internally.java.io.FileNotFoundException
public void setConfig(org.bukkit.configuration.Configuration config) throws java.io.FileNotFoundException
restartMainTask()
internally.config
- The new configuration to use.java.io.FileNotFoundException
public void run()
run
in interface java.lang.Runnable
public void adminJoin(org.bukkit.event.player.PlayerJoinEvent event)
public void updateCmd(org.bukkit.event.player.PlayerCommandPreprocessEvent event)
public boolean updatePlugin(org.bukkit.command.CommandSender sender)
Note that the return value only indicates that the update request was accepted and the download process is scheduled to be executed. The update itself may still fail.
sender
- - the player or console that is attempting to initiate an update.