Class Slimefun
java.lang.Object
org.bukkit.plugin.PluginBase
org.bukkit.plugin.java.JavaPlugin
io.github.thebusybiscuit.slimefun4.implementation.Slimefun
- All Implemented Interfaces:
SlimefunAddon,CommandExecutor,TabCompleter,TabExecutor,Plugin
This is the main class of Slimefun.
This is where all the magic starts, take a look around.
- Author:
- TheBusyBiscuit
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic AnalyticsServiceThis method returns theAnalyticsServiceof Slimefun.static BackpackListenerstatic BlockDataServicestatic SlimefunBowListenerThis method returns a link to the Bug Tracker of thisSlimefunAddonstatic io.github.bakedlibs.dough.config.ConfiggetCfg()static SlimefunCommandTheCommandthat was added by Slimefun.static GitHubServiceThis method returns theGitHubServiceof Slimefun.static GPSNetworkThis returns ourGPSNetworkinstance.static GrapplingHookListenerstatic HologramsServiceThis returns ourHologramsServicewhich handles the creation and cleanup of any holograms.static IntegrationsManagerThis returns our instance ofIntegrationsManager.static io.github.bakedlibs.dough.config.Configstatic CustomItemDataServicestatic CustomTextureServiceThis method returns the instance ofJavaPluginthat thisSlimefunAddonrefers to.static LocalizationServiceThis returns theLocalizationServiceof Slimefun.static MetricsServiceThis method returns theMetricsServiceof Slimefun.static MinecraftRecipeServiceThis method returns outMinecraftRecipeServicefor Slimefun.static MinecraftVersionThis returns the currently installed version of Minecraft.static NetworkManagerThis returns ourNetworkManagerwhich is responsible for handling the Cargo and Energy networks.static PermissionsServicestatic Storagestatic SlimefunProfilerThis returns our instance of theSlimefunProfiler, a tool that is used to analyse performance and lag.static io.github.bakedlibs.dough.protection.ProtectionManagerThis returns out instance of theProtectionManager.static SlimefunRegistrystatic io.github.bakedlibs.dough.config.Configstatic SoundServiceThis returns ourSoundServicewhich handles the configuration of all sounds used in Slimefunstatic ThreadServiceThis method returns theThreadServiceof Slimefun.static TickerTaskstatic UpdaterServiceThis method returns theUpdaterServiceof Slimefun.static StringThis returns the version of Slimefun that is currently installed.static PerWorldSettingsServiceThis method returns out world settings service.static Slimefuninstance()This returns the global instance ofSlimefun.static booleanThis method returns whether this version of Slimefun was newly installed.booleanThis method checks if this is currently running in a unit test environment.static Loggerlogger()This returns theLoggerinstance that Slimefun uses.voidThis method gets called when thePlugingets disabled.voidonEnable()static BukkitTaskThis method schedules a synchronous task for Slimefun.static BukkitTaskThis method schedules a delayed synchronous task for Slimefun.Methods inherited from class org.bukkit.plugin.java.JavaPlugin
getClassLoader, getCommand, getConfig, getDataFolder, getDefaultBiomeProvider, getDefaultWorldGenerator, getDescription, getFile, getLogger, getPlugin, getPluginLoader, getProvidingPlugin, getResource, getServer, getTextResource, isEnabled, isNaggable, onCommand, onLoad, onTabComplete, reloadConfig, saveConfig, saveDefaultConfig, saveResource, setEnabled, setNaggable, toStringMethods inherited from class org.bukkit.plugin.PluginBase
equals, getName, hashCodeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.github.thebusybiscuit.slimefun4.api.SlimefunAddon
getLogger, getName, getPluginVersion, hasDependency
-
Constructor Details
-
Slimefun
public Slimefun()This constructor is invoked by Bukkit and within unit tests. Therefore we need to figure out if we're within unit tests or not.
-
-
Method Details
-
onEnable
public void onEnable()- Specified by:
onEnablein interfacePlugin- Overrides:
onEnablein classJavaPlugin
-
getJavaPlugin
Description copied from interface:SlimefunAddonThis method returns the instance ofJavaPluginthat thisSlimefunAddonrefers to.- Specified by:
getJavaPluginin interfaceSlimefunAddon- Returns:
- The instance of your
JavaPlugin
-
getBugTrackerURL
Description copied from interface:SlimefunAddonThis method returns a link to the Bug Tracker of thisSlimefunAddon- Specified by:
getBugTrackerURLin interfaceSlimefunAddon- Returns:
- The URL for this Plugin's Bug Tracker, or null
-
onDisable
public void onDisable()This method gets called when thePlugingets disabled. Most often it is called when theServeris shutting down or reloading.- Specified by:
onDisablein interfacePlugin- Overrides:
onDisablein classJavaPlugin
-
isUnitTest
public boolean isUnitTest()This method checks if this is currently running in a unit test environment.- Returns:
- Whether we are inside a unit test
-
instance
- Returns:
- The
Slimefuninstance
-
logger
This returns theLoggerinstance that Slimefun uses.Any
SlimefunAddonshould use their ownLoggerinstance!- Returns:
- Our
Loggerinstance
-
getVersion
This returns the version of Slimefun that is currently installed.- Returns:
- The currently installed version of Slimefun
-
getCfg
@Nonnull public static io.github.bakedlibs.dough.config.Config getCfg() -
getResearchCfg
@Nonnull public static io.github.bakedlibs.dough.config.Config getResearchCfg() -
getItemCfg
@Nonnull public static io.github.bakedlibs.dough.config.Config getItemCfg() -
getGPSNetwork
This returns ourGPSNetworkinstance. TheGPSNetworkis responsible for handling any GPS-related operations and for managing anyGEOResource.- Returns:
- Our
GPSNetworkinstance
-
getTickerTask
-
getLocalization
This returns theLocalizationServiceof Slimefun.- Returns:
- The
LocalizationServiceof Slimefun
-
getMinecraftRecipeService
This method returns outMinecraftRecipeServicefor Slimefun. This service is responsible for finding/identifyingRecipesfrom vanilla Minecraft.- Returns:
- Slimefun's
MinecraftRecipeServiceinstance
-
getItemDataService
-
getItemTextureService
-
getPermissionsService
-
getBlockDataService
-
getWorldSettingsService
This method returns out world settings service. That service is responsible for managing item settings perWorld, such as disabling aSlimefunItemin a specificWorld.- Returns:
- Our instance of
PerWorldSettingsService
-
getHologramsService
This returns ourHologramsServicewhich handles the creation and cleanup of any holograms.- Returns:
- Our instance of
HologramsService
-
getSoundService
This returns ourSoundServicewhich handles the configuration of all sounds used in Slimefun- Returns:
- Our instance of
SoundService
-
getIntegrations
This returns our instance ofIntegrationsManager. This is responsible for managing any integrations with third partyplugins.- Returns:
- Our instance of
IntegrationsManager
-
getProtectionManager
@Nonnull public static io.github.bakedlibs.dough.protection.ProtectionManager getProtectionManager()This returns out instance of theProtectionManager. This bridge is used to hook into any third-party protectionPlugin.- Returns:
- Our instanceof of the
ProtectionManager
-
getUpdater
This method returns theUpdaterServiceof Slimefun. It is used to handle automatic updates.- Returns:
- The
UpdaterServicefor Slimefun
-
getMetricsService
This method returns theMetricsServiceof Slimefun. It is used to handle sending metric information to bStats.- Returns:
- The
MetricsServicefor Slimefun
-
getAnalyticsService
This method returns theAnalyticsServiceof Slimefun. It is used to handle sending analytic information.- Returns:
- The
AnalyticsServicefor Slimefun
-
getGitHubService
This method returns theGitHubServiceof Slimefun. It is used to retrieve data from GitHub repositories.- Returns:
- The
GitHubServicefor Slimefun
-
getNetworkManager
This returns ourNetworkManagerwhich is responsible for handling the Cargo and Energy networks.- Returns:
- Our
NetworkManagerinstance
-
getRegistry
-
getGrapplingHookListener
-
getBackpackListener
-
getBowListener
-
getCommand
TheCommandthat was added by Slimefun.- Returns:
- Slimefun's command
-
getProfiler
This returns our instance of theSlimefunProfiler, a tool that is used to analyse performance and lag.- Returns:
- The
SlimefunProfiler
-
getMinecraftVersion
This returns the currently installed version of Minecraft.- Returns:
- The current version of Minecraft
-
isNewlyInstalled
public static boolean isNewlyInstalled()This method returns whether this version of Slimefun was newly installed. It will return true if thisServeruses Slimefun for the very first time.- Returns:
- Whether this is a new installation of Slimefun
-
getInstalledAddons
-
runSync
This method schedules a delayed synchronous task for Slimefun. For Slimefun only, not for addons. This method should only be invoked by Slimefun itself. Addons must schedule their own tasks using their ownPlugininstance.- Parameters:
runnable- TheRunnableto rundelay- The delay for this task- Returns:
- The resulting
BukkitTaskor null if Slimefun was disabled
-
runSync
This method schedules a synchronous task for Slimefun. For Slimefun only, not for addons. This method should only be invoked by Slimefun itself. Addons must schedule their own tasks using their ownPlugininstance.- Parameters:
runnable- TheRunnableto run- Returns:
- The resulting
BukkitTaskor null if Slimefun was disabled
-
getPlayerStorage
-
getThreadService
This method returns theThreadServiceof Slimefun. Do not use this if you're an addon. Please make your ownThreadService.- Returns:
- The
ThreadServicefor Slimefun
-