Contents
Record Class GlobalEventStopAction
java.lang.Object
java.lang.Record
com.hypixel.hytale.builtin.adventure.worldevents.action.GlobalEventStopAction
- All Implemented Interfaces:
EventAction
public record GlobalEventStopAction(@Nonnull UUID id, boolean fail)
extends Record
implements EventAction
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final RecordCodec<GlobalEventStopAction> static final StringFields inherited from interface EventAction
ARRAY_CODEC, EMPTY_ARRAY, TYPE_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionGlobalEventStopAction(UUID id, boolean fail) Creates an instance of aGlobalEventStopActionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanapply(Ref<EntityStore> ref, CommandBuffer<EntityStore> buffer, WorldEvent event) Executes the action.final booleanIndicates whether some other object is "equal to" this one.booleanfail()Returns the value of thefailrecord component.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.Methods inherited from interface EventAction
validate
-
Field Details
-
ID
- See Also:
-
CODEC
-
-
Constructor Details
-
GlobalEventStopAction
Creates an instance of aGlobalEventStopActionrecord class.- Parameters:
id- the value for theidrecord componentfail- the value for thefailrecord component
-
-
Method Details
-
apply
public boolean apply(@Nonnull Ref<EntityStore> ref, @Nonnull CommandBuffer<EntityStore> buffer, @Nonnull WorldEvent event) Description copied from interface:EventActionExecutes the action.Actions that read from the event context should check for
nullvalues and returnfalsewith a warning log if a required entry is missing, as the context may not have been populated if an earlier condition or action failed.ECS mutations (spawning entities, setting blocks, etc.) should be submitted through
bufferrather than applied directly, to maintain world-thread consistency.- Specified by:
applyin interfaceEventAction- Parameters:
ref- the entity reference for the world event entitybuffer- the command buffer used to submit ECS mutationsevent- the running world event, including its context- Returns:
trueif the action succeeded;falseto abort the current stage
-
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
-
fail
public boolean fail()Returns the value of thefailrecord component.- Returns:
- the value of the
failrecord component
-