Package dev.itsharshxd.zentrix.api.end
Record Class EndToggleRequest
java.lang.Object
java.lang.Record
dev.itsharshxd.zentrix.api.end.EndToggleRequest
public record EndToggleRequest(boolean enabled, Optional<Boolean> pvp, Optional<EndBorderSettings> border)
extends Record
Immutable request to open or close a game's End access.
Access is an entry gate. Closing it stops new arrivals but never ejects the players and spectators already inside the runtime End, who can still leave through its exit portal.
-
Constructor Summary
ConstructorsConstructorDescriptionEndToggleRequest(boolean enabled) EndToggleRequest(boolean enabled, Optional<Boolean> pvp, Optional<EndBorderSettings> border) Creates an instance of aEndToggleRequestrecord class. -
Method Summary
Modifier and TypeMethodDescriptionborder()Returns the value of theborderrecord component.static EndToggleRequestclose()booleanenabled()Returns the value of theenabledrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static EndToggleRequestopen()pvp()Returns the value of thepvprecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
EndToggleRequest
Creates an instance of aEndToggleRequestrecord class.- Parameters:
enabled- the value for theenabledrecord componentpvp- the value for thepvprecord componentborder- the value for theborderrecord component
-
EndToggleRequest
public EndToggleRequest(boolean enabled)
-
-
Method Details
-
open
-
close
-
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 '=='. -
enabled
public boolean enabled()Returns the value of theenabledrecord component.- Returns:
- the value of the
enabledrecord component
-
pvp
Returns the value of thepvprecord component.- Returns:
- the value of the
pvprecord component
-
border
Returns the value of theborderrecord component.- Returns:
- the value of the
borderrecord component
-