Class DifficultyDependentNode<T>

java.lang.Object
dev.satyrn.papermc.api.configuration.v1.ConfigurationNode<T>
dev.satyrn.papermc.api.configuration.v1.DifficultyDependentNode<T>
Type Parameters:
T - The value type, shared between each sub-node.

@Deprecated(since="1.9.1") public abstract class DifficultyDependentNode<T> extends ConfigurationNode<T>
Deprecated.
Since 1.9.1. Use DifficultyDependentNode instead. Default value is removed.
Represents a node which has a value dependent on difficulty.
Since:
1.9.0
Author:
Isabel Maskrey
  • Constructor Details

    • DifficultyDependentNode

      protected DifficultyDependentNode(@NotNull @NotNull ConfigurationNode<?> parent, @NotNull @NotNull String name)
      Deprecated.
      Initializes a new difficulty-dependent configuration node.
      Parameters:
      parent - The parent node.
      name - The node name.
      Since:
      1.9.0
  • Method Details

    • getPeacefulNode

      @Nullable protected @Nullable ConfigurationNode<T> getPeacefulNode()
      Deprecated.
      Gets the node instance for the peaceful difficulty value.
      Returns:
      The peaceful node.
      Since:
      1.9.0
    • getEasyNode

      @Nullable protected @Nullable ConfigurationNode<T> getEasyNode()
      Deprecated.
      Gets the node instance for the easy difficulty value.
      Returns:
      The easy node.
      Since:
      1.9.0
    • getNormalNode

      @Nullable protected @Nullable ConfigurationNode<T> getNormalNode()
      Deprecated.
      Gets the node instance for the normal difficulty value.
      Returns:
      The normal node.
      Since:
      1.9.0
    • getHardNode

      @Nullable protected @Nullable ConfigurationNode<T> getHardNode()
      Deprecated.
      Gets the node instance for the hard difficulty value.
      Returns:
      The hard node.
      Since:
      1.9.0
    • getValueNodeName

      @NotNull public final @NotNull String getValueNodeName()
      Deprecated.
      Gets the name of the value node, which will be used if this node contains children and a value.

      Defaults to "value" for most node types.

      Overrides:
      getValueNodeName in class ConfigurationNode<T>
      Returns:
      The name of the value node.
      Since:
      1.9.0
    • value

      @Nullable public T value()
      Deprecated.
      Gets the value of the node.
      Specified by:
      value in class ConfigurationNode<T>
      Returns:
      The value.
      Since:
      1.9.0
    • defaultValue

      @Nullable public T defaultValue()
      Deprecated.
      Gets the default value of the node.
      Specified by:
      defaultValue in class ConfigurationNode<T>
      Returns:
      The value.
      Since:
      1.9.0
    • value

      @Nullable public T value(@NotNull @NotNull org.bukkit.Difficulty difficulty)
      Deprecated.
      Gets a value specific to the given difficulty value.
      Parameters:
      difficulty - The difficulty of the current world.
      Returns:
      The value of the node for that difficulty.
      Since:
      1.9.0
    • setValue

      public final void setValue(@NotNull @NotNull org.bukkit.Difficulty difficulty, @Nullable T value)
      Deprecated.
      Sets the value of the node for a specific difficulty.
      Parameters:
      difficulty - The difficulty level.
      value - The value of the node at the difficulty level.
      Since:
      1.9.0
    • save

      public void save()
      Deprecated.
      Writes the value of the node and its children to the config file.
      Overrides:
      save in class ConfigurationNode<T>
      Since:
      1.9.1
    • getChildren

      @NotNull public @NotNull @Unmodifiable List<ConfigurationNode<?>> getChildren()
      Deprecated.
      Gets an unmodifiable list of children for this node.
      Overrides:
      getChildren in class ConfigurationNode<T>
      Returns:
      An unmodifiable list of the item's children.
      Since:
      1.9.1