Record Class GameEventType
java.lang.Object
java.lang.Record
dev.yowsef.stealablock.api.gameevent.GameEventType
public record GameEventType(@NotNull net.kyori.adventure.key.Key key, @NotNull String displayName, @NotNull String description, @NotNull org.bukkit.Material icon, int defaultDurationSeconds, @NotNull GameEventType.LifecycleHandler lifecycleHandler)
extends Record
Definition of a built-in or addon-registered server-wide Game Event.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionGameEventType(@NotNull net.kyori.adventure.key.Key key, @NotNull String displayName, @NotNull String description, @NotNull org.bukkit.Material icon, int defaultDurationSeconds, @NotNull GameEventType.LifecycleHandler lifecycleHandler) Creates an instance of aGameEventTyperecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of thedefaultDurationSecondsrecord component.@NotNull StringReturns the value of thedescriptionrecord component.@NotNull StringReturns the value of thedisplayNamerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@NotNull org.bukkit.Materialicon()Returns the value of theiconrecord component.@NotNull net.kyori.adventure.key.Keykey()Returns the value of thekeyrecord component.@NotNull GameEventType.LifecycleHandlerReturns the value of thelifecycleHandlerrecord component.static @NotNull GameEventTypesimple(@NotNull net.kyori.adventure.key.Key key, @NotNull String displayName, @NotNull String description, @NotNull org.bukkit.Material icon, int defaultDurationSeconds) final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
GameEventType
public GameEventType(@NotNull @NotNull net.kyori.adventure.key.Key key, @NotNull @NotNull String displayName, @NotNull @NotNull String description, @NotNull @NotNull org.bukkit.Material icon, int defaultDurationSeconds, @NotNull @NotNull GameEventType.LifecycleHandler lifecycleHandler) Creates an instance of aGameEventTyperecord class.- Parameters:
key- the value for thekeyrecord componentdisplayName- the value for thedisplayNamerecord componentdescription- the value for thedescriptionrecord componenticon- the value for theiconrecord componentdefaultDurationSeconds- the value for thedefaultDurationSecondsrecord componentlifecycleHandler- the value for thelifecycleHandlerrecord component
-
-
Method Details
-
simple
@NotNull public static @NotNull GameEventType simple(@NotNull @NotNull net.kyori.adventure.key.Key key, @NotNull @NotNull String displayName, @NotNull @NotNull String description, @NotNull @NotNull org.bukkit.Material icon, int defaultDurationSeconds) -
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
key
@NotNull public @NotNull net.kyori.adventure.key.Key key()Returns the value of thekeyrecord component.- Returns:
- the value of the
keyrecord component
-
displayName
Returns the value of thedisplayNamerecord component.- Returns:
- the value of the
displayNamerecord component
-
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-
icon
@NotNull public @NotNull org.bukkit.Material icon()Returns the value of theiconrecord component.- Returns:
- the value of the
iconrecord component
-
defaultDurationSeconds
public int defaultDurationSeconds()Returns the value of thedefaultDurationSecondsrecord component.- Returns:
- the value of the
defaultDurationSecondsrecord component
-
lifecycleHandler
Returns the value of thelifecycleHandlerrecord component.- Returns:
- the value of the
lifecycleHandlerrecord component
-