Record Class TeleportRandomlyConsumeEffect
java.lang.Object
java.lang.Record
net.minecraft.world.item.consume_effects.TeleportRandomlyConsumeEffect
- All Implemented Interfaces:
ConsumeEffect
public record TeleportRandomlyConsumeEffect(float diameter, boolean directionalParticles)
extends Record
implements ConsumeEffect
-
Nested Class Summary
Nested classes/interfaces inherited from interface ConsumeEffect
ConsumeEffect.Type<T> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<TeleportRandomlyConsumeEffect> private static final floatprivate final floatThe field for thediameterrecord component.private final booleanThe field for thedirectionalParticlesrecord component.static final StreamCodec<RegistryFriendlyByteBuf, TeleportRandomlyConsumeEffect> -
Constructor Summary
ConstructorsConstructorDescriptionTeleportRandomlyConsumeEffect(float diameter, boolean directionalParticles) Creates an instance of aTeleportRandomlyConsumeEffectrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanapply(Level level, ItemStack stack, LivingEntity user) floatdiameter()Returns the value of thediameterrecord component.booleanReturns the value of thedirectionalParticlesrecord component.final booleanIndicates whether some other object is "equal to" this one.getType()final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
diameter
private final float diameterThe field for thediameterrecord component. -
directionalParticles
private final boolean directionalParticlesThe field for thedirectionalParticlesrecord component. -
DEFAULT_DIAMETER
private static final float DEFAULT_DIAMETER- See Also:
-
CODEC
-
STREAM_CODEC
public static final StreamCodec<RegistryFriendlyByteBuf, TeleportRandomlyConsumeEffect> STREAM_CODEC
-
-
Constructor Details
-
TeleportRandomlyConsumeEffect
public TeleportRandomlyConsumeEffect() -
TeleportRandomlyConsumeEffect
public TeleportRandomlyConsumeEffect(float diameter, boolean directionalParticles) Creates an instance of aTeleportRandomlyConsumeEffectrecord class.- Parameters:
diameter- the value for thediameterrecord componentdirectionalParticles- the value for thedirectionalParticlesrecord component
-
-
Method Details
-
getType
- Specified by:
getTypein interfaceConsumeEffect
-
apply
- Specified by:
applyin interfaceConsumeEffect
-
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. All components in this record class are compared with thecomparemethod from their corresponding wrapper classes. -
diameter
public float diameter()Returns the value of thediameterrecord component.- Returns:
- the value of the
diameterrecord component
-
directionalParticles
public boolean directionalParticles()Returns the value of thedirectionalParticlesrecord component.- Returns:
- the value of the
directionalParticlesrecord component
-