Package net.minecraft.server.world
Class ServerTickScheduler<T>
java.lang.Object
net.minecraft.server.world.ServerTickScheduler<T>
- All Implemented Interfaces:
TickScheduler<T>
public class ServerTickScheduler<T> extends Object implements TickScheduler<T>
-
Field Summary
Fields Modifier and Type Field Description private List<ScheduledTick<T>>
consumedTickActions
private Queue<ScheduledTick<T>>
currentTickActions
private Function<T,Identifier>
idToName
protected Predicate<T>
invalidObjPredicate
private Set<ScheduledTick<T>>
scheduledTickActions
private TreeSet<ScheduledTick<T>>
scheduledTickActionsInOrder
private Consumer<ScheduledTick<T>>
tickConsumer
private ServerWorld
world
-
Constructor Summary
Constructors Constructor Description ServerTickScheduler(ServerWorld world, Predicate<T> invalidObjPredicate, Function<T,Identifier> idToName, Consumer<ScheduledTick<T>> consumer)
-
Method Summary
Modifier and Type Method Description private void
addScheduledTick(ScheduledTick<T> scheduledTick)
void
copyScheduledTicks(BlockBox box, BlockPos offset)
List<ScheduledTick<T>>
getScheduledTicks(BlockBox bounds, boolean updateState, boolean getStaleTicks)
List<ScheduledTick<T>>
getScheduledTicksInChunk(ChunkPos chunkPos, boolean updateState, boolean getStaleTicks)
int
getTicks()
boolean
isScheduled(BlockPos pos, T object)
boolean
isTicking(BlockPos pos, T object)
void
schedule(BlockPos pos, T object, int delay, TickPriority priority)
private static <T> ListTag
serializeScheduledTicks(Function<T,Identifier> identifierProvider, Iterable<ScheduledTick<T>> scheduledTicks, long time)
void
tick()
ListTag
toTag(ChunkPos chunkPos)
private List<ScheduledTick<T>>
transferTicksInBounds(List<ScheduledTick<T>> dst, Collection<ScheduledTick<T>> src, BlockBox bounds, boolean move)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraft.world.TickScheduler
schedule
-
Field Details
-
invalidObjPredicate
-
idToName
-
scheduledTickActions
-
scheduledTickActionsInOrder
-
world
-
currentTickActions
-
consumedTickActions
-
tickConsumer
-
-
Constructor Details
-
ServerTickScheduler
public ServerTickScheduler(ServerWorld world, Predicate<T> invalidObjPredicate, Function<T,Identifier> idToName, Consumer<ScheduledTick<T>> consumer)
-
-
Method Details
-
tick
public void tick() -
isTicking
- Specified by:
isTicking
in interfaceTickScheduler<T>
-
getScheduledTicksInChunk
public List<ScheduledTick<T>> getScheduledTicksInChunk(ChunkPos chunkPos, boolean updateState, boolean getStaleTicks) -
getScheduledTicks
public List<ScheduledTick<T>> getScheduledTicks(BlockBox bounds, boolean updateState, boolean getStaleTicks) -
transferTicksInBounds
@Nullable private List<ScheduledTick<T>> transferTicksInBounds(@Nullable List<ScheduledTick<T>> dst, Collection<ScheduledTick<T>> src, BlockBox bounds, boolean move) -
copyScheduledTicks
-
toTag
-
serializeScheduledTicks
private static <T> ListTag serializeScheduledTicks(Function<T,Identifier> identifierProvider, Iterable<ScheduledTick<T>> scheduledTicks, long time) -
isScheduled
- Specified by:
isScheduled
in interfaceTickScheduler<T>
-
schedule
- Specified by:
schedule
in interfaceTickScheduler<T>
-
addScheduledTick
-
getTicks
public int getTicks()
-