Class PerWorldSettingsService

java.lang.Object
io.github.thebusybiscuit.slimefun4.core.services.PerWorldSettingsService

public class PerWorldSettingsService extends Object
This Service is responsible for disabling a SlimefunItem in a certain World.
Author:
TheBusyBiscuit
  • Constructor Details

    • PerWorldSettingsService

      public PerWorldSettingsService(@Nonnull Slimefun plugin)
  • Method Details

    • load

      public void load(@Nonnull Iterable<World> worlds)
      This method will forcefully load all currently active Worlds to load up their settings.
      Parameters:
      worlds - An Iterable of Worlds to load
    • load

      public void load(@Nonnull World world)
      This method loads the given World if it was not loaded before.
      Parameters:
      world - The World to load
    • isEnabled

      public boolean isEnabled(@Nonnull World world, @Nonnull SlimefunItem item)
      This method checks whether the given SlimefunItem is enabled in the given World.
      Parameters:
      world - The World to check
      item - The SlimefunItem that should be checked
      Returns:
      Whether the given SlimefunItem is enabled in that World
    • setEnabled

      public void setEnabled(@Nonnull World world, @Nonnull SlimefunItem item, boolean enabled)
      This method enables or disables the given SlimefunItem in the specified World.
      Parameters:
      world - The World in which to disable or enable the given SlimefunItem
      item - The SlimefunItem to enable or disable
      enabled - Whether the given SlimefunItem should be enabled in that world
    • setEnabled

      public void setEnabled(@Nonnull World world, boolean enabled)
      This method enables or disables the given World.
      Parameters:
      world - The World to enable or disable
      enabled - Whether this World should be enabled or not
    • isWorldEnabled

      public boolean isWorldEnabled(@Nonnull World world)
      This checks whether the given World is enabled or not.
      Parameters:
      world - The World to check
      Returns:
      Whether this World is enabled
    • isAddonEnabled

      public boolean isAddonEnabled(@Nonnull World world, @Nonnull SlimefunAddon addon)
      This method checks whether the given SlimefunAddon is enabled in that World.
      Parameters:
      world - The World to check
      addon - The SlimefunAddon to check
      Returns:
      Whether this addon is enabled in that World
    • save

      public void save(@Nonnull World world)
      This will forcefully save the settings for that World. This should only be called if you altered the settings while the Server was still running. This writes to a File so it can be a heavy operation.
      Parameters:
      world - The World to save