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 needstemplateWorld- the world copied for each deathmatchspawnType-RANDOMorCUSTOMfreezeSeconds- how long players are frozen after arrivingblockDecayEnabled- whether blocks players place decayblockDecayStartDelaySeconds- the delay before a placed block starts decayingblockDecayDurationSeconds- how long a placed block takes to decayprotectOriginalBlocks- whether blocks of the arena itself cannot be brokencustomSpawns- the configured spawns, used withCUSTOMborderPos1- one corner of the configured bounds, or nullborderPos2- 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 Summary
ConstructorsConstructorDescriptionDeathmatchSettingsSnapshot(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) Creates an instance of aDeathmatchSettingsSnapshotrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns the value of theblockDecayDurationSecondsrecord component.booleanReturns the value of theblockDecayEnabledrecord component.doubleReturns the value of theblockDecayStartDelaySecondsrecord component.@Nullable org.bukkit.LocationReturns the value of theborderPos1record component.@Nullable org.bukkit.LocationReturns the value of theborderPos2record component.booleanReturns the value of theconfiguredrecord component.@NotNull List<org.bukkit.Location> Copies of the configured spawns.final booleanIndicates whether some other object is "equal to" this one.intReturns the value of thefreezeSecondsrecord component.@NotNull Optional<org.bukkit.Location[]> The configured bounds' corners, when both are set.final inthashCode()Returns a hash code value for this object.booleanReturns the value of theprotectOriginalBlocksrecord component.@NotNull StringReturns the value of thespawnTyperecord component.@NotNull StringReturns the value of thetemplateWorldrecord component.final StringtoString()Returns a string representation of this record class.
-
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 aDeathmatchSettingsSnapshotrecord class.- Parameters:
configured- the value for theconfiguredrecord componenttemplateWorld- the value for thetemplateWorldrecord componentspawnType- the value for thespawnTyperecord componentfreezeSeconds- the value for thefreezeSecondsrecord componentblockDecayEnabled- the value for theblockDecayEnabledrecord componentblockDecayStartDelaySeconds- the value for theblockDecayStartDelaySecondsrecord componentblockDecayDurationSeconds- the value for theblockDecayDurationSecondsrecord componentprotectOriginalBlocks- the value for theprotectOriginalBlocksrecord componentcustomSpawns- the value for thecustomSpawnsrecord componentborderPos1- the value for theborderPos1record componentborderPos2- the value for theborderPos2record component
-
-
Method Details
-
customSpawns
Copies of the configured spawns. -
getBounds
The configured bounds' corners, when both are set. -
borderPos1
@Nullable public @Nullable org.bukkit.Location borderPos1()Returns the value of theborderPos1record component.- Returns:
- the value of the
borderPos1record component
-
borderPos2
@Nullable public @Nullable org.bukkit.Location borderPos2()Returns the value of theborderPos2record component.- Returns:
- the value of the
borderPos2record component
-
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
configured
public boolean configured()Returns the value of theconfiguredrecord component.- Returns:
- the value of the
configuredrecord component
-
templateWorld
Returns the value of thetemplateWorldrecord component.- Returns:
- the value of the
templateWorldrecord component
-
spawnType
Returns the value of thespawnTyperecord component.- Returns:
- the value of the
spawnTyperecord component
-
freezeSeconds
public int freezeSeconds()Returns the value of thefreezeSecondsrecord component.- Returns:
- the value of the
freezeSecondsrecord component
-
blockDecayEnabled
public boolean blockDecayEnabled()Returns the value of theblockDecayEnabledrecord component.- Returns:
- the value of the
blockDecayEnabledrecord component
-
blockDecayStartDelaySeconds
public double blockDecayStartDelaySeconds()Returns the value of theblockDecayStartDelaySecondsrecord component.- Returns:
- the value of the
blockDecayStartDelaySecondsrecord component
-
blockDecayDurationSeconds
public double blockDecayDurationSeconds()Returns the value of theblockDecayDurationSecondsrecord component.- Returns:
- the value of the
blockDecayDurationSecondsrecord component
-
protectOriginalBlocks
public boolean protectOriginalBlocks()Returns the value of theprotectOriginalBlocksrecord component.- Returns:
- the value of the
protectOriginalBlocksrecord component
-