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
-
Method Summary
Modifier and TypeMethodDescriptionstatic AnalyticsService
This method returns theAnalyticsService
of Slimefun.static BackpackListener
static BlockDataService
static SlimefunBowListener
This method returns a link to the Bug Tracker of thisSlimefunAddon
static io.github.bakedlibs.dough.config.Config
getCfg()
static SlimefunCommand
TheCommand
that was added by Slimefun.static GitHubService
This method returns theGitHubService
of Slimefun.static GPSNetwork
This returns ourGPSNetwork
instance.static GrapplingHookListener
static HologramsService
This returns ourHologramsService
which handles the creation and cleanup of any holograms.static IntegrationsManager
This returns our instance ofIntegrationsManager
.static io.github.bakedlibs.dough.config.Config
static CustomItemDataService
static CustomTextureService
This method returns the instance ofJavaPlugin
that thisSlimefunAddon
refers to.static LocalizationService
This returns theLocalizationService
of Slimefun.static MetricsService
This method returns theMetricsService
of Slimefun.static MinecraftRecipeService
This method returns outMinecraftRecipeService
for Slimefun.static MinecraftVersion
This returns the currently installed version of Minecraft.static NetworkManager
This returns ourNetworkManager
which is responsible for handling the Cargo and Energy networks.static PermissionsService
static Storage
static SlimefunProfiler
This returns our instance of theSlimefunProfiler
, a tool that is used to analyse performance and lag.static io.github.bakedlibs.dough.protection.ProtectionManager
This returns out instance of theProtectionManager
.static SlimefunRegistry
static io.github.bakedlibs.dough.config.Config
static SoundService
This returns ourSoundService
which handles the configuration of all sounds used in Slimefunstatic ThreadService
This method returns theThreadService
of Slimefun.static TickerTask
static UpdaterService
This method returns theUpdaterService
of Slimefun.static String
This returns the version of Slimefun that is currently installed.static PerWorldSettingsService
This method returns out world settings service.static Slimefun
instance()
This returns the global instance ofSlimefun
.static boolean
This method returns whether this version of Slimefun was newly installed.boolean
This method checks if this is currently running in a unit test environment.static Logger
logger()
This returns theLogger
instance that Slimefun uses.void
This method gets called when thePlugin
gets disabled.void
onEnable()
static BukkitTask
This method schedules a synchronous task for Slimefun.static BukkitTask
This 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, toString
Methods inherited from class org.bukkit.plugin.PluginBase
equals, getName, hashCode
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods 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:
onEnable
in interfacePlugin
- Overrides:
onEnable
in classJavaPlugin
-
getJavaPlugin
Description copied from interface:SlimefunAddon
This method returns the instance ofJavaPlugin
that thisSlimefunAddon
refers to.- Specified by:
getJavaPlugin
in interfaceSlimefunAddon
- Returns:
- The instance of your
JavaPlugin
-
getBugTrackerURL
Description copied from interface:SlimefunAddon
This method returns a link to the Bug Tracker of thisSlimefunAddon
- Specified by:
getBugTrackerURL
in interfaceSlimefunAddon
- Returns:
- The URL for this Plugin's Bug Tracker, or null
-
onDisable
public void onDisable()This method gets called when thePlugin
gets disabled. Most often it is called when theServer
is shutting down or reloading.- Specified by:
onDisable
in interfacePlugin
- Overrides:
onDisable
in 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
Slimefun
instance
-
logger
This returns theLogger
instance that Slimefun uses.Any
SlimefunAddon
should use their ownLogger
instance!- Returns:
- Our
Logger
instance
-
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 ourGPSNetwork
instance. TheGPSNetwork
is responsible for handling any GPS-related operations and for managing anyGEOResource
.- Returns:
- Our
GPSNetwork
instance
-
getTickerTask
-
getLocalization
This returns theLocalizationService
of Slimefun.- Returns:
- The
LocalizationService
of Slimefun
-
getMinecraftRecipeService
This method returns outMinecraftRecipeService
for Slimefun. This service is responsible for finding/identifyingRecipes
from vanilla Minecraft.- Returns:
- Slimefun's
MinecraftRecipeService
instance
-
getItemDataService
-
getItemTextureService
-
getPermissionsService
-
getBlockDataService
-
getWorldSettingsService
This method returns out world settings service. That service is responsible for managing item settings perWorld
, such as disabling aSlimefunItem
in a specificWorld
.- Returns:
- Our instance of
PerWorldSettingsService
-
getHologramsService
This returns ourHologramsService
which handles the creation and cleanup of any holograms.- Returns:
- Our instance of
HologramsService
-
getSoundService
This returns ourSoundService
which 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 theUpdaterService
of Slimefun. It is used to handle automatic updates.- Returns:
- The
UpdaterService
for Slimefun
-
getMetricsService
This method returns theMetricsService
of Slimefun. It is used to handle sending metric information to bStats.- Returns:
- The
MetricsService
for Slimefun
-
getAnalyticsService
This method returns theAnalyticsService
of Slimefun. It is used to handle sending analytic information.- Returns:
- The
AnalyticsService
for Slimefun
-
getGitHubService
This method returns theGitHubService
of Slimefun. It is used to retrieve data from GitHub repositories.- Returns:
- The
GitHubService
for Slimefun
-
getNetworkManager
This returns ourNetworkManager
which is responsible for handling the Cargo and Energy networks.- Returns:
- Our
NetworkManager
instance
-
getRegistry
-
getGrapplingHookListener
-
getBackpackListener
-
getBowListener
-
getCommand
TheCommand
that 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 thisServer
uses 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 ownPlugin
instance.- Parameters:
runnable
- TheRunnable
to rundelay
- The delay for this task- Returns:
- The resulting
BukkitTask
or 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 ownPlugin
instance.- Parameters:
runnable
- TheRunnable
to run- Returns:
- The resulting
BukkitTask
or null if Slimefun was disabled
-
getPlayerStorage
-
getThreadService
This method returns theThreadService
of Slimefun. Do not use this if you're an addon. Please make your ownThreadService
.- Returns:
- The
ThreadService
for Slimefun
-