Package net.minecraft.world.ticks
Record Class SavedTick<T>
java.lang.Object
java.lang.Record
net.minecraft.world.ticks.SavedTick<T>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int
The field for thedelay
record component.private final BlockPos
The field for thepos
record component.private final TickPriority
The field for thepriority
record component.private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private final T
The field for thetype
record component.static final it.unimi.dsi.fastutil.Hash.Strategy
<SavedTick<?>> -
Constructor Summary
ConstructorsConstructorDescriptionSavedTick
(T type, BlockPos pos, int delay, TickPriority priority) Creates an instance of aSavedTick
record class. -
Method Summary
Modifier and TypeMethodDescriptionint
delay()
Returns the value of thedelay
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.loadTick
(CompoundTag pTag, Function<String, Optional<T>> pIdParser) static <T> void
loadTickList
(ListTag pTag, Function<String, Optional<T>> pIdParser, ChunkPos pChunkPos, Consumer<SavedTick<T>> pOutput) pos()
Returns the value of thepos
record component.priority()
Returns the value of thepriority
record component.static <T> SavedTick
<T> private static CompoundTag
saveTick
(String pId, BlockPos pPos, int pDelay, TickPriority pPriority) static <T> CompoundTag
saveTick
(ScheduledTick<T> pTick, Function<T, String> pIdGetter, long pGameTime) final String
toString()
Returns a string representation of this record class.type()
Returns the value of thetype
record component.unpack
(long pGameTime, long pSubTickOrder)
-
Field Details
-
type
The field for thetype
record component. -
pos
The field for thepos
record component. -
delay
private final int delayThe field for thedelay
record component. -
priority
The field for thepriority
record component. -
TAG_ID
- See Also:
-
TAG_X
- See Also:
-
TAG_Y
- See Also:
-
TAG_Z
- See Also:
-
TAG_DELAY
- See Also:
-
TAG_PRIORITY
- See Also:
-
UNIQUE_TICK_HASH
-
-
Constructor Details
-
SavedTick
Creates an instance of aSavedTick
record class.- Parameters:
type
- the value for thetype
record componentpos
- the value for thepos
record componentdelay
- the value for thedelay
record componentpriority
- the value for thepriority
record component
-
-
Method Details
-
loadTickList
-
loadTick
-
saveTick
-
saveTick
public static <T> CompoundTag saveTick(ScheduledTick<T> pTick, Function<T, String> pIdGetter, long pGameTime) -
save
-
unpack
-
probe
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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 '=='. -
type
Returns the value of thetype
record component.- Returns:
- the value of the
type
record component
-
pos
Returns the value of thepos
record component.- Returns:
- the value of the
pos
record component
-
delay
public int delay()Returns the value of thedelay
record component.- Returns:
- the value of the
delay
record component
-
priority
Returns the value of thepriority
record component.- Returns:
- the value of the
priority
record component
-