Contents
Record Class EffectsAction
java.lang.Object
java.lang.Record
com.hypixel.hytale.builtin.adventure.worldevents.action.EffectsAction
- All Implemented Interfaces:
EventAction
public record EffectsAction(@Nonnull ContextKey locationKey, int radius, @Nonnull Shape shape, @Nullable CameraFX cfx, @Nullable SoundFX sfx, @Nullable VisualFX vfx)
extends Record
implements EventAction
-
Field Summary
FieldsFields inherited from interface EventAction
ARRAY_CODEC, EMPTY_ARRAY, TYPE_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionEffectsAction(ContextKey locationKey, int radius, Shape shape, CameraFX cfx, SoundFX sfx, VisualFX vfx) Creates an instance of aEffectsActionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanapply(Ref<EntityStore> ref, CommandBuffer<EntityStore> buffer, WorldEvent event) Executes the action.cfx()Returns the value of thecfxrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thelocationKeyrecord component.intradius()Returns the value of theradiusrecord component.sfx()Returns the value of thesfxrecord component.shape()Returns the value of theshaperecord component.final StringtoString()Returns a string representation of this record class.voidCalled at asset-load time so the action can register theContextKeyvalues it depends on, enabling the validator to catch dangling or mismatched key names.vfx()Returns the value of thevfxrecord component.
-
Field Details
-
ID
- See Also:
-
CODEC
-
-
Constructor Details
-
EffectsAction
public EffectsAction(@Nonnull ContextKey locationKey, int radius, @Nonnull Shape shape, @Nullable CameraFX cfx, @Nullable SoundFX sfx, @Nullable VisualFX vfx) Creates an instance of aEffectsActionrecord class.- Parameters:
locationKey- the value for thelocationKeyrecord componentradius- the value for theradiusrecord componentshape- the value for theshaperecord componentcfx- the value for thecfxrecord componentsfx- the value for thesfxrecord componentvfx- the value for thevfxrecord 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
-
validate
Description copied from interface:EventActionCalled at asset-load time so the action can register theContextKeyvalues it depends on, enabling the validator to catch dangling or mismatched key names.Call
Validator.addReferencedKey(String, String, ContextKey)for each key this action reads from context, andValidator.addDefinedKey(String, String, ContextKey)for each key this action writes to context.- Specified by:
validatein interfaceEventAction- Parameters:
validator- the validator to register key references with
-
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. -
locationKey
Returns the value of thelocationKeyrecord component.- Returns:
- the value of the
locationKeyrecord component
-
radius
public int radius()Returns the value of theradiusrecord component.- Returns:
- the value of the
radiusrecord component
-
shape
Returns the value of theshaperecord component.- Returns:
- the value of the
shaperecord component
-
cfx
Returns the value of thecfxrecord component.- Returns:
- the value of the
cfxrecord component
-
sfx
Returns the value of thesfxrecord component.- Returns:
- the value of the
sfxrecord component
-
vfx
Returns the value of thevfxrecord component.- Returns:
- the value of the
vfxrecord component
-