Class AutoStoreSetting

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

public class AutoStoreSetting extends Object
A class to hold the user's auto-store settings.
  • Field Details

  • Constructor Details

    • AutoStoreSetting

      public AutoStoreSetting(@NotNull @NotNull UUID uuid)
      The constructor of the AutoStoreSetting.
      Parameters:
      uuid - the user's UUID
  • Method Details

    • getUuid

      @NotNull public @NotNull UUID getUuid()
      Gets the user's UUID.
      Returns:
      the user's UUID
    • getPerItemModeSetting

      @NotNull public @NotNull PerItemSetting getPerItemModeSetting()
      Gets the PerItemSetting.
      Returns:
      the PerItemSetting
    • isEnabled

      public boolean isEnabled()
      Whether the auto-store is enabled or not.
      Returns:
      if true, the auto-store is enabled, or if false, it is disabled
    • setEnabled

      public void setEnabled(boolean enabled)
      Enables or disables the auto-store.
      Parameters:
      enabled - true to enable, or false to disable the auto-store
    • isAllMode

      public boolean isAllMode()
      Whether the current auto-store mode is all mode.
      Returns:
      if true, the mode is all mode, or if false, it is per-item mode
    • setAllMode

      public void setAllMode(boolean allMode)
      Sets the auto-store mode to all mode or per-item mode.
      Parameters:
      allMode - true to all mode, or false to per-item mode.
    • isDirect

      public boolean isDirect()
      Whether the direct auto-store is enabled.
      Returns:
      if true, the direct auto-store is enabled, or if false, it is disabled
    • setDirect

      public void setDirect(boolean direct)
      Enables or disables the direct auto-store.
      Parameters:
      direct - true to enable, or false to disable the direct auto-store
    • shouldAutoStore

      public boolean shouldAutoStore(@NotNull @NotNull BoxItem item)
      Checks if the BoxItem should be auto-stored.

      If the auto-store mode is all mode (isAllMode() returns true), or if PerItemSetting.isEnabled(BoxItem) returns true, this method returns true. Otherwise, this returns false.

      Parameters:
      item - the BoxItem to check
      Returns:
      if true, the BoxItem should be auto-stored, or if false, it should not be autos-stored
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object