Class OptionResidentMode<T>

java.lang.Object
com.palmergames.bukkit.towny.object.resident.mode.AbstractResidentMode
com.palmergames.bukkit.towny.object.resident.mode.OptionResidentMode<T>
Direct Known Subclasses:
DevmodeResidentMode

public abstract class OptionResidentMode<T> extends AbstractResidentMode
  • Constructor Details

    • OptionResidentMode

      public OptionResidentMode(String name, String permissionNode)
  • Method Details

    • getOption

      @Nullable protected T getOption(Resident resident)
      Get the resident mode option for a resident with the resident mode, or null.
      Parameters:
      resident - The resident whom to get the resident mode option for.
      Returns:
      the resident mode option for the resident, or null.
    • setOption

      protected void setOption(Resident resident, T option)
      Set the resident mode option for a resident with the resident mode, replacing any previous resident mode option for the resident.
      Parameters:
      resident - The resident whom to set the resident mode option for.
    • clearOptions

      protected void clearOptions(Resident resident)
      Clear the resident mode option for a resident with the resident mode.
      Parameters:
      resident - The resident whom to clear the resident mode option.
    • toggle

      protected void toggle(Resident resident)
      Toggle the resident mode on or off.
      Specified by:
      toggle in class AbstractResidentMode
      Parameters:
      resident - Resident to toggle mode on or off for.
    • toggle

      protected abstract void toggle(Resident resident, @NotNull @NotNull String... options)
      Toggle the resident mode on or off.
      Parameters:
      resident - Resident to toggle mode on or off.
      options - Resident mode options to set for toggling this resident mode.