Record Class VibrationInfo
java.lang.Object
java.lang.Record
net.minecraft.world.level.gameevent.vibrations.VibrationInfo
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<VibrationInfo> private final floatThe field for thedistancerecord component.private final @Nullable EntityThe field for theentityrecord component.The field for thegameEventrecord component.private final Vec3The field for theposrecord component.private final @Nullable UUIDThe field for theprojectileOwnerUuidrecord component.private final @Nullable UUIDThe field for theuuidrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionVibrationInfo(Holder<GameEvent> gameEvent, float distance, Vec3 pos, @Nullable UUID uuid, @Nullable UUID projectileOwnerUuid) VibrationInfo(Holder<GameEvent> gameEvent, float distance, Vec3 pos, @Nullable UUID uuid, @Nullable UUID projectileOwnerUuid, @Nullable Entity entity) Creates an instance of aVibrationInforecord class.VibrationInfo(Holder<GameEvent> gameEvent, float distance, Vec3 pos, @Nullable Entity entity) -
Method Summary
Modifier and TypeMethodDescriptionfloatdistance()Returns the value of thedistancerecord component.@Nullable Entityentity()Returns the value of theentityrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of thegameEventrecord component.getEntity(ServerLevel level) getProjectileOwner(ServerLevel level) private static @Nullable UUIDgetProjectileOwner(@Nullable Entity entity) final inthashCode()Returns a hash code value for this object.pos()Returns the value of theposrecord component.@Nullable UUIDReturns the value of theprojectileOwnerUuidrecord component.final StringtoString()Returns a string representation of this record class.@Nullable UUIDuuid()Returns the value of theuuidrecord component.
-
Field Details
-
gameEvent
-
distance
private final float distanceThe field for thedistancerecord component. -
pos
The field for theposrecord component. -
uuid
The field for theuuidrecord component. -
projectileOwnerUuid
The field for theprojectileOwnerUuidrecord component. -
entity
The field for theentityrecord component. -
CODEC
-
-
Constructor Details
-
VibrationInfo
-
VibrationInfo
-
VibrationInfo
public VibrationInfo(Holder<GameEvent> gameEvent, float distance, Vec3 pos, @Nullable UUID uuid, @Nullable UUID projectileOwnerUuid, @Nullable Entity entity) Creates an instance of aVibrationInforecord class.- Parameters:
gameEvent- the value for thegameEventrecord componentdistance- the value for thedistancerecord componentpos- the value for theposrecord componentuuid- the value for theuuidrecord componentprojectileOwnerUuid- the value for theprojectileOwnerUuidrecord componententity- the value for theentityrecord component
-
-
Method Details
-
getProjectileOwner
-
getEntity
-
getProjectileOwner
-
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. -
gameEvent
-
distance
public float distance()Returns the value of thedistancerecord component.- Returns:
- the value of the
distancerecord component
-
pos
Returns the value of theposrecord component.- Returns:
- the value of the
posrecord component
-
uuid
Returns the value of theuuidrecord component.- Returns:
- the value of the
uuidrecord component
-
projectileOwnerUuid
Returns the value of theprojectileOwnerUuidrecord component.- Returns:
- the value of the
projectileOwnerUuidrecord component
-
entity
Returns the value of theentityrecord component.- Returns:
- the value of the
entityrecord component
-