Class SettingChangeEvent

java.lang.Object
org.bukkit.event.Event
dev.itsharshxd.zentrix.api.events.ZentrixEvent
dev.itsharshxd.zentrix.api.events.settings.SettingChangeEvent

public final class SettingChangeEvent extends ZentrixEvent
Called after an editable settings.yml value was changed - in the settings menu or through SettingsService#set - saved and applied to the running server.

A notification. Values are as stored; Locations are the stored objects, so copy them before changing them.

Main thread; only fired while a listener is registered.

Since:
1.8.0
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.bukkit.event.Event

    org.bukkit.event.Event.Result
  • Constructor Summary

    Constructors
    Constructor
    Description
    SettingChangeEvent(@NotNull String path, @Nullable Object previousValue, @Nullable Object newValue, boolean applied)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static @NotNull org.bukkit.event.HandlerList
     
    @NotNull org.bukkit.event.HandlerList
    Gets the handler list for this event.
    @NotNull Optional<Object>
    The value now stored; empty when the setting was cleared.
    @NotNull String
    The setting's settings.yml path.
    @NotNull Optional<Object>
    The value before, when there was one.
    boolean
    Whether the running server was refreshed; false when that failed and a restart applies it.

    Methods inherited from class org.bukkit.event.Event

    callEvent, getEventName, isAsynchronous

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SettingChangeEvent

      public SettingChangeEvent(@NotNull @NotNull String path, @Nullable @Nullable Object previousValue, @Nullable @Nullable Object newValue, boolean applied)
  • Method Details

    • getPath

      @NotNull public @NotNull String getPath()
      The setting's settings.yml path.
    • getPreviousValue

      @NotNull public @NotNull Optional<Object> getPreviousValue()
      The value before, when there was one.
    • getNewValue

      @NotNull public @NotNull Optional<Object> getNewValue()
      The value now stored; empty when the setting was cleared.
    • isApplied

      public boolean isApplied()
      Whether the running server was refreshed; false when that failed and a restart applies it.
    • getHandlers

      @NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()
      Description copied from class: ZentrixEvent
      Gets the handler list for this event.
      Overrides:
      getHandlers in class ZentrixEvent
      Returns:
      The handler list
    • getHandlerList

      @NotNull public static @NotNull org.bukkit.event.HandlerList getHandlerList()