public class TimerCallbackSerializer<C> extends Object
Modifier and Type | Field and Description |
---|---|
static TimerCallbackSerializer<MinecraftServer> |
INSTANCE |
private static Logger |
LOGGER |
private Map<Class<?>,TimerCallback.Serializer<C,?>> |
serializersByClass |
private Map<Identifier,TimerCallback.Serializer<C,?>> |
serializersByType |
Constructor and Description |
---|
TimerCallbackSerializer() |
Modifier and Type | Method and Description |
---|---|
TimerCallback<C> |
deserialize(CompoundTag tag) |
private <T extends TimerCallback<C>> |
getSerializer(Class<?> class2) |
TimerCallbackSerializer<C> |
registerSerializer(TimerCallback.Serializer<C,?> serializer) |
<T extends TimerCallback<C>> |
serialize(T callback) |
private static final Logger LOGGER
public static final TimerCallbackSerializer<MinecraftServer> INSTANCE
private final Map<Identifier,TimerCallback.Serializer<C,?>> serializersByType
private final Map<Class<?>,TimerCallback.Serializer<C,?>> serializersByClass
public TimerCallbackSerializer<C> registerSerializer(TimerCallback.Serializer<C,?> serializer)
private <T extends TimerCallback<C>> TimerCallback.Serializer<C,T> getSerializer(Class<?> class2)
public <T extends TimerCallback<C>> CompoundTag serialize(T callback)
@Nullable public TimerCallback<C> deserialize(CompoundTag tag)