Class PerItemSetting

java.lang.Object
net.okocraft.box.feature.autostore.setting.PerItemSetting

public class PerItemSetting extends Object
A class to hold the user's per-item settings.
  • Constructor Details

    • PerItemSetting

      public PerItemSetting()
  • Method Details

    • isEnabled

      public boolean isEnabled(@NotNull @NotNull BoxItem item)
      Checks if the BoxItem is enabled.
      Parameters:
      item - the BoxItem to check
      Returns:
      if true, the BoxItem is enabled in this setting, or if false, it is disabled
    • setEnabled

      public void setEnabled(@NotNull @NotNull BoxItem item, boolean enabled)
      Enables or disables the auto-store of the specified BoxItem.
      Parameters:
      item - the BoxItem to change the setting
      enabled - true to enable, or false to disable
    • toggleEnabled

      public boolean toggleEnabled(@NotNull @NotNull BoxItem item)
      Toggles the auto-store of the specified BoxItem.
      Parameters:
      item - the BoxItem to toggle
      Returns:
      the current setting of the BoxItem
    • getEnabledItems

      @NotNull public @NotNull it.unimi.dsi.fastutil.ints.IntSet getEnabledItems()
      Gets all enabled item ids.
      Returns:
      all enabled item ids
    • clearAndEnableItems

      public void clearAndEnableItems(@NotNull @NotNull it.unimi.dsi.fastutil.ints.IntCollection itemIds)
      Clears and enables specified items.
    • toString

      public String toString()
      Overrides:
      toString in class Object