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
-
Method Summary
Modifier and TypeMethodDescriptionboolean
isAddonEnabled
(World world, SlimefunAddon addon) This method checks whether the givenSlimefunAddon
is enabled in thatWorld
.boolean
isEnabled
(World world, SlimefunItem item) This method checks whether the givenSlimefunItem
is enabled in the givenWorld
.boolean
isWorldEnabled
(World world) This checks whether the givenWorld
is enabled or not.void
This method will forcefully load all currently active Worlds to load up their settings.void
This method loads the givenWorld
if it was not loaded before.void
This will forcefully save the settings for thatWorld
.void
setEnabled
(World world, boolean enabled) This method enables or disables the givenWorld
.void
setEnabled
(World world, SlimefunItem item, boolean enabled) This method enables or disables the givenSlimefunItem
in 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 givenWorld
if it was not loaded before.- Parameters:
world
- TheWorld
to load
-
isEnabled
This method checks whether the givenSlimefunItem
is enabled in the givenWorld
.- Parameters:
world
- TheWorld
to checkitem
- TheSlimefunItem
that should be checked- Returns:
- Whether the given
SlimefunItem
is enabled in thatWorld
-
setEnabled
This method enables or disables the givenSlimefunItem
in the specifiedWorld
.- Parameters:
world
- TheWorld
in which to disable or enable the givenSlimefunItem
item
- TheSlimefunItem
to enable or disableenabled
- Whether the givenSlimefunItem
should be enabled in that world
-
setEnabled
This method enables or disables the givenWorld
. -
isWorldEnabled
This checks whether the givenWorld
is enabled or not. -
isAddonEnabled
This method checks whether the givenSlimefunAddon
is enabled in thatWorld
.- Parameters:
world
- TheWorld
to checkaddon
- TheSlimefunAddon
to 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 theServer
was still running. This writes to aFile
so it can be a heavy operation.- Parameters:
world
- TheWorld
to save
-