Record Class DeathmatchSettingsSnapshot

java.lang.Object
java.lang.Record
dev.itsharshxd.zentrix.api.deathmatch.DeathmatchSettingsSnapshot
Record Components:
configured - whether a template world is set, which a deathmatch needs
templateWorld - the world copied for each deathmatch
spawnType - RANDOM or CUSTOM
freezeSeconds - how long players are frozen after arriving
blockDecayEnabled - whether blocks players place decay
blockDecayStartDelaySeconds - the delay before a placed block starts decaying
blockDecayDurationSeconds - how long a placed block takes to decay
protectOriginalBlocks - whether blocks of the arena itself cannot be broken
customSpawns - the configured spawns, used with CUSTOM
borderPos1 - one corner of the configured bounds, or null
borderPos2 - the other corner of the configured bounds, or null

public record DeathmatchSettingsSnapshot(boolean configured, @NotNull String templateWorld, @NotNull String spawnType, int freezeSeconds, boolean blockDecayEnabled, double blockDecayStartDelaySeconds, double blockDecayDurationSeconds, boolean protectOriginalBlocks, @NotNull List<org.bukkit.Location> customSpawns, @Nullable org.bukkit.Location borderPos1, @Nullable org.bukkit.Location borderPos2) extends Record
The deathmatch configuration of settings.yml, read at one moment. A snapshot whose locations are copies.

This is the default deathmatch. A scenario or addon answering GameplayHooks#DEATHMATCH_DESTINATION - through a scenario or GameplayHookService - can send a match elsewhere.

Since:
1.8.0
  • Constructor Details

    • DeathmatchSettingsSnapshot

      public DeathmatchSettingsSnapshot(boolean configured, @NotNull @NotNull String templateWorld, @NotNull @NotNull String spawnType, int freezeSeconds, boolean blockDecayEnabled, double blockDecayStartDelaySeconds, double blockDecayDurationSeconds, boolean protectOriginalBlocks, @NotNull @NotNull List<org.bukkit.Location> customSpawns, @Nullable @Nullable org.bukkit.Location borderPos1, @Nullable @Nullable org.bukkit.Location borderPos2)
      Creates an instance of a DeathmatchSettingsSnapshot record class.
      Parameters:
      configured - the value for the configured record component
      templateWorld - the value for the templateWorld record component
      spawnType - the value for the spawnType record component
      freezeSeconds - the value for the freezeSeconds record component
      blockDecayEnabled - the value for the blockDecayEnabled record component
      blockDecayStartDelaySeconds - the value for the blockDecayStartDelaySeconds record component
      blockDecayDurationSeconds - the value for the blockDecayDurationSeconds record component
      protectOriginalBlocks - the value for the protectOriginalBlocks record component
      customSpawns - the value for the customSpawns record component
      borderPos1 - the value for the borderPos1 record component
      borderPos2 - the value for the borderPos2 record component
  • Method Details

    • customSpawns

      @NotNull public @NotNull List<org.bukkit.Location> customSpawns()
      Copies of the configured spawns.
    • getBounds

      @NotNull public @NotNull Optional<org.bukkit.Location[]> getBounds()
      The configured bounds' corners, when both are set.
    • borderPos1

      @Nullable public @Nullable org.bukkit.Location borderPos1()
      Returns the value of the borderPos1 record component.
      Returns:
      the value of the borderPos1 record component
    • borderPos2

      @Nullable public @Nullable org.bukkit.Location borderPos2()
      Returns the value of the borderPos2 record component.
      Returns:
      the value of the borderPos2 record component
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • configured

      public boolean configured()
      Returns the value of the configured record component.
      Returns:
      the value of the configured record component
    • templateWorld

      @NotNull public @NotNull String templateWorld()
      Returns the value of the templateWorld record component.
      Returns:
      the value of the templateWorld record component
    • spawnType

      @NotNull public @NotNull String spawnType()
      Returns the value of the spawnType record component.
      Returns:
      the value of the spawnType record component
    • freezeSeconds

      public int freezeSeconds()
      Returns the value of the freezeSeconds record component.
      Returns:
      the value of the freezeSeconds record component
    • blockDecayEnabled

      public boolean blockDecayEnabled()
      Returns the value of the blockDecayEnabled record component.
      Returns:
      the value of the blockDecayEnabled record component
    • blockDecayStartDelaySeconds

      public double blockDecayStartDelaySeconds()
      Returns the value of the blockDecayStartDelaySeconds record component.
      Returns:
      the value of the blockDecayStartDelaySeconds record component
    • blockDecayDurationSeconds

      public double blockDecayDurationSeconds()
      Returns the value of the blockDecayDurationSeconds record component.
      Returns:
      the value of the blockDecayDurationSeconds record component
    • protectOriginalBlocks

      public boolean protectOriginalBlocks()
      Returns the value of the protectOriginalBlocks record component.
      Returns:
      the value of the protectOriginalBlocks record component