Contents
Record Class EventContext
java.lang.Object
java.lang.Record
com.hypixel.hytale.builtin.adventure.worldevents.context.EventContext
- All Implemented Interfaces:
Context
-
Field Summary
FieldsFields inherited from interface Context
TYPE_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionEventContext(UUID id, boolean detached) Creates an instance of aEventContextrecord class. -
Method Summary
Modifier and TypeMethodDescriptionvoidcleanup(CommandBuffer<EntityStore> buffer, WorldEvent event) Called when the owning event ends, whether by success or failure.booleandetached()Returns the value of thedetachedrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
ID
- See Also:
-
CODEC
-
-
Constructor Details
-
EventContext
Creates an instance of aEventContextrecord class.- Parameters:
id- the value for theidrecord componentdetached- the value for thedetachedrecord component
-
-
Method Details
-
cleanup
Description copied from interface:ContextCalled when the owning event ends, whether by success or failure.Override to release resources or trigger compensating actions. Enqueue any ECS mutations through
bufferrather than applying them directly. This method is only called for context entries that are still present in the map when the event ends; entries that were removed viaconsumeearlier in the event's lifetime will not havecleanupinvoked. -
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. -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
detached
public boolean detached()Returns the value of thedetachedrecord component.- Returns:
- the value of the
detachedrecord component
-