public class Timer<T> extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Timer.Event<T> |
Modifier and Type | Field and Description |
---|---|
private TimerCallbackSerializer<T> |
callback |
private UnsignedLong |
eventCounter |
private Queue<Timer.Event<T>> |
events |
private Table<String,Long,Timer.Event<T>> |
eventsByName |
private static Logger |
LOGGER |
Constructor and Description |
---|
Timer(TimerCallbackSerializer<T> timerCallbackSerializer) |
Timer(TimerCallbackSerializer<T> timerCallbackSerializer,
Stream<com.mojang.serialization.Dynamic<Tag>> stream) |
Modifier and Type | Method and Description |
---|---|
private void |
addEvent(CompoundTag tag) |
private static <T> Comparator<Timer.Event<T>> |
createEventComparator() |
Set<String> |
method_22592() |
int |
method_22593(String string) |
void |
processEvents(T server,
long time) |
private CompoundTag |
serialize(Timer.Event<T> event) |
void |
setEvent(String name,
long triggerTime,
TimerCallback<T> callback) |
ListTag |
toTag() |
private static final Logger LOGGER
private final TimerCallbackSerializer<T> callback
private final Queue<Timer.Event<T>> events
private UnsignedLong eventCounter
private final Table<String,Long,Timer.Event<T>> eventsByName
public Timer(TimerCallbackSerializer<T> timerCallbackSerializer, Stream<com.mojang.serialization.Dynamic<Tag>> stream)
public Timer(TimerCallbackSerializer<T> timerCallbackSerializer)
private static <T> Comparator<Timer.Event<T>> createEventComparator()
public void processEvents(T server, long time)
public void setEvent(String name, long triggerTime, TimerCallback<T> callback)
public int method_22593(String string)
private void addEvent(CompoundTag tag)
private CompoundTag serialize(Timer.Event<T> event)
public ListTag toTag()