Class Slimefun
java.lang.Object
org.bukkit.plugin.PluginBase
org.bukkit.plugin.java.JavaPlugin
io.github.thebusybiscuit.slimefun4.implementation.Slimefun
- All Implemented Interfaces:
com.xzavier0722.mc.plugin.slimefuncomplib.ICompatibleSlimefun,SlimefunAddon,io.papermc.paper.plugin.lifecycle.event.LifecycleEventOwner,org.bukkit.command.CommandExecutor,org.bukkit.command.TabCompleter,org.bukkit.command.TabExecutor,org.bukkit.plugin.Plugin
public final class Slimefun
extends org.bukkit.plugin.java.JavaPlugin
implements SlimefunAddon, com.xzavier0722.mc.plugin.slimefuncomplib.ICompatibleSlimefun
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 PlayerChatCatcherstatic SlimefunCommandTheCommandthat was added by Slimefun.static SlimefunConfigManagerstatic SlimefunDatabaseManagergetFile()static GitHubServiceThis method returns theGitHubServiceof Slimefun.static GPSNetworkThis returns ourGPSNetworkinstance.static GrapplingHookListenerstatic HologramsServiceThis returns ourHologramsServicewhich handles the creation and cleanup of any holograms.static Set<org.bukkit.plugin.Plugin> This method returns aSetof everyPluginthat lists Slimefun as a required or optional dependency.static IntegrationsManagerThis returns our instance ofIntegrationsManager.static io.github.bakedlibs.dough.config.Configstatic CustomItemDataServicestatic CustomTextureServiceorg.bukkit.plugin.java.JavaPluginThis 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 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 SQLProfilerstatic ThreadServiceThis method returns theThreadServiceof Slimefun.static TickerTaskstatic UpdaterServiceThis method returns theUpdaterServiceof Slimefun.static StringThis returns the version of Slimefun that is currently installed.获取 Wiki URL格式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()This is called when thePluginhas been loaded and enabled on aServer.static org.bukkit.scheduler.BukkitTaskThis method schedules a synchronous task for Slimefun.static org.bukkit.scheduler.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, getLifecycleManager, getLogger, getPlugin, getPluginLoader, getPluginMeta, getProvidingPlugin, getResource, getServer, getTextResource, init, init, isEnabled, isNaggable, onCommand, onLoad, onTabComplete, registerCommand, registerCommand, registerCommand, registerCommand, 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 org.bukkit.plugin.Plugin
getComponentLogger, getDataPath, getLog4JLogger, getSLF4JLoggerMethods inherited from interface io.github.thebusybiscuit.slimefun4.api.SlimefunAddon
getLogger, getName, getPluginVersion, hasDependency
-
Constructor Details
-
Slimefun
public Slimefun()Our default constructor forSlimefun. -
Slimefun
@ParametersAreNonnullByDefault public Slimefun(org.bukkit.plugin.java.JavaPluginLoader loader, org.bukkit.plugin.PluginDescriptionFile description, File dataFolder, File file) This constructor is invoked in Unit Test environments only.- Parameters:
loader- OurJavaPluginLoaderdescription- APluginDescriptionFiledataFolder- The data folderfile- AFilefor thisPlugin
-
-
Method Details
-
onEnable
public void onEnable()This is called when thePluginhas been loaded and enabled on aServer.- Specified by:
onEnablein interfaceorg.bukkit.plugin.Plugin- Overrides:
onEnablein classorg.bukkit.plugin.java.JavaPlugin
-
getJavaPlugin
public org.bukkit.plugin.java.JavaPlugin 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
-
getWikiURL
Description copied from interface:SlimefunAddon获取 Wiki URL格式- Specified by:
getWikiURLin interfaceSlimefunAddon- Returns:
- Wiki 的 URL格式,使用{0}作为替换
-
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 interfaceorg.bukkit.plugin.Plugin- Overrides:
onDisablein classorg.bukkit.plugin.java.JavaPlugin
-
logger
This returns theLoggerinstance that Slimefun uses.Any
SlimefunAddonshould use their ownLoggerinstance!- Returns:
- Our
Loggerinstance
-
getGPSNetwork
This returns ourGPSNetworkinstance. TheGPSNetworkis responsible for handling any GPS-related operations and for managing anyGEOResource.- Returns:
- Our
GPSNetworkinstance
-
instance
This returns the global instance ofSlimefun. This may return null if thePluginwas disabled.- Returns:
- The
Slimefuninstance
-
getMinecraftRecipeService
This method returns outMinecraftRecipeServicefor Slimefun. This service is responsible for finding/identifyingRecipesfrom vanilla Minecraft.- Returns:
- Slimefun's
MinecraftRecipeServiceinstance
-
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() -
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
-
getTickerTask
-
getLocalization
This returns theLocalizationServiceof Slimefun.- Returns:
- The
LocalizationServiceof Slimefun
-
getHologramsService
This returns ourHologramsServicewhich handles the creation and cleanup of any holograms.- Returns:
- Our instance of
HologramsService
-
getItemDataService
-
getItemTextureService
-
getPermissionsService
-
getBlockDataService
-
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
-
getSoundService
This returns ourSoundServicewhich handles the configuration of all sounds used in Slimefun- Returns:
- Our instance of
SoundService
-
getNetworkManager
This returns ourNetworkManagerwhich is responsible for handling the Cargo and Energy networks.- Returns:
- Our
NetworkManagerinstance
-
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
-
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
-
getConfigManager
-
getDatabaseManager
-
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
-
getSQLProfiler
-
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
This method returns aSetof everyPluginthat lists Slimefun as a required or optional dependency.We will just assume this to be a list of our addons.
- Returns:
- A
Setof everyPluginthat is dependent on Slimefun
-
runSync
@Nullable public static org.bukkit.scheduler.BukkitTask runSync(@Nonnull Runnable runnable, long delay) 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
-
getFile
- Overrides:
getFilein classorg.bukkit.plugin.java.JavaPlugin
-
getChatCatcher
-
getThreadService
This method returns theThreadServiceof Slimefun. Do not use this if you're an addon. Please make your ownThreadService.- Returns:
- The
ThreadServicefor Slimefun
-