Class PerWorldSettingsService
java.lang.Object
io.github.thebusybiscuit.slimefun4.core.services.PerWorldSettingsService
This Service is responsible for disabling a
SlimefunItem in a certain World.- Author:
- TheBusyBiscuit
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanisAddonEnabled(World world, SlimefunAddon addon) This method checks whether the givenSlimefunAddonis enabled in thatWorld.booleanisEnabled(World world, SlimefunItem item) This method checks whether the givenSlimefunItemis enabled in the givenWorld.booleanisWorldEnabled(World world) This checks whether the givenWorldis enabled or not.voidThis method will forcefully load all currently active Worlds to load up their settings.voidThis method loads the givenWorldif it was not loaded before.voidThis will forcefully save the settings for thatWorld.voidsetEnabled(World world, boolean enabled) This method enables or disables the givenWorld.voidsetEnabled(World world, SlimefunItem item, boolean enabled) This method enables or disables the givenSlimefunItemin the specifiedWorld.
-
Constructor Details
-
PerWorldSettingsService
-
-
Method Details
-
load
This method will forcefully load all currently active Worlds to load up their settings. -
load
This method loads the givenWorldif it was not loaded before.- Parameters:
world- TheWorldto load
-
isEnabled
This method checks whether the givenSlimefunItemis enabled in the givenWorld.- Parameters:
world- TheWorldto checkitem- TheSlimefunItemthat should be checked- Returns:
- Whether the given
SlimefunItemis enabled in thatWorld
-
setEnabled
This method enables or disables the givenSlimefunItemin the specifiedWorld.- Parameters:
world- TheWorldin which to disable or enable the givenSlimefunItemitem- TheSlimefunItemto enable or disableenabled- Whether the givenSlimefunItemshould be enabled in that world
-
setEnabled
This method enables or disables the givenWorld. -
isWorldEnabled
This checks whether the givenWorldis enabled or not. -
isAddonEnabled
This method checks whether the givenSlimefunAddonis enabled in thatWorld.- Parameters:
world- TheWorldto checkaddon- TheSlimefunAddonto check- Returns:
- Whether this addon is enabled in that
World
-
save
This will forcefully save the settings for thatWorld. This should only be called if you altered the settings while theServerwas still running. This writes to aFileso it can be a heavy operation.- Parameters:
world- TheWorldto save
-