Record Class TransientBlock
java.lang.Object
java.lang.Record
net.minecraft.client.renderer.extract.TransientBlock
public record TransientBlock(BlockPos pos, BlockState state, double timeToLive, long createTimeNs)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final longThe field for thecreateTimeNsrecord component.static doubleprivate final BlockPosThe field for theposrecord component.private final BlockStateThe field for thestaterecord component.private final doubleThe field for thetimeToLiverecord component. -
Constructor Summary
ConstructorsConstructorDescriptionTransientBlock(BlockPos pos, BlockState state, double timeToLive, long createTimeNs) Creates an instance of aTransientBlockrecord class. -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the value of thecreateTimeNsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.pos()Returns the value of theposrecord component.state()Returns the value of thestaterecord component.doubleReturns the value of thetimeToLiverecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
pos
The field for theposrecord component. -
state
The field for thestaterecord component. -
timeToLive
private final double timeToLiveThe field for thetimeToLiverecord component. -
createTimeNs
private final long createTimeNsThe field for thecreateTimeNsrecord component. -
DEFAULT_TIME_TO_LIVE
public static double DEFAULT_TIME_TO_LIVE
-
-
Constructor Details
-
TransientBlock
Creates an instance of aTransientBlockrecord class.- Parameters:
pos- the value for theposrecord componentstate- the value for thestaterecord componenttimeToLive- the value for thetimeToLiverecord componentcreateTimeNs- the value for thecreateTimeNsrecord component
-
-
Method Details
-
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. -
pos
Returns the value of theposrecord component.- Returns:
- the value of the
posrecord component
-
state
Returns the value of thestaterecord component.- Returns:
- the value of the
staterecord component
-
timeToLive
public double timeToLive()Returns the value of thetimeToLiverecord component.- Returns:
- the value of the
timeToLiverecord component
-
createTimeNs
public long createTimeNs()Returns the value of thecreateTimeNsrecord component.- Returns:
- the value of the
createTimeNsrecord component
-