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(org.bukkit.World world, SlimefunAddon addon) This method checks whether the givenSlimefunAddonis enabled in thatWorld.booleanisEnabled(org.bukkit.World world, SlimefunItem item) This method checks whether the givenSlimefunItemis enabled in the givenWorld.booleanisWorldEnabled(org.bukkit.World world) This checks whether the givenWorldis enabled or not.voidThis method will forcefully load all currently active Worlds to load up their settings.voidload(org.bukkit.World world) This method loads the givenWorldif it was not loaded before.voidsave(org.bukkit.World world) This will forcefully save the settings for thatWorld.voidsetEnabled(org.bukkit.World world, boolean enabled) This method enables or disables the givenWorld.voidsetEnabled(org.bukkit.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.- Parameters:
worlds- AnIterableofWorldsto load
-
load
public void load(@Nonnull org.bukkit.World world) 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
public void setEnabled(@Nonnull org.bukkit.World world, @Nonnull SlimefunItem item, boolean enabled) 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
public void setEnabled(@Nonnull org.bukkit.World world, boolean enabled) This method enables or disables the givenWorld.- Parameters:
world- TheWorldto enable or disableenabled- Whether thisWorldshould be enabled or not
-
isWorldEnabled
public boolean isWorldEnabled(@Nonnull org.bukkit.World world) This checks whether the givenWorldis enabled or not.- Parameters:
world- TheWorldto check- Returns:
- Whether this
Worldis enabled
-
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
public void save(@Nonnull org.bukkit.World world) 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
-