Package net.minecraft.client
Class PeriodicNotificationManager
java.lang.Object
net.neoforged.neoforge.resource.ContextAwareReloadListener
net.minecraft.server.packs.resources.SimplePreparableReloadListener<Map<String,List<PeriodicNotificationManager.Notification>>>
net.minecraft.client.PeriodicNotificationManager
- All Implemented Interfaces:
AutoCloseable,PreparableReloadListener
public class PeriodicNotificationManager
extends SimplePreparableReloadListener<Map<String,List<PeriodicNotificationManager.Notification>>>
implements AutoCloseable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final record(package private) static classNested classes/interfaces inherited from interface net.minecraft.server.packs.resources.PreparableReloadListener
PreparableReloadListener.PreparationBarrier, PreparableReloadListener.SharedState, PreparableReloadListener.StateKey<T> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final com.mojang.serialization.Codec<Map<String, List<PeriodicNotificationManager.Notification>>> private static final org.slf4j.Loggerprivate final ResourceLocationprivate final it.unimi.dsi.fastutil.objects.Object2BooleanFunction<String> private Timer -
Constructor Summary
ConstructorsConstructorDescriptionPeriodicNotificationManager(ResourceLocation pNotifications, it.unimi.dsi.fastutil.objects.Object2BooleanFunction<String> pSelector) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidapply(Map<String, List<PeriodicNotificationManager.Notification>> p_205318_, ResourceManager p_205319_, ProfilerFiller p_205320_) private longcalculateInitialDelay(List<PeriodicNotificationManager.Notification> pNotifications) private longcalculateOptimalPeriod(List<PeriodicNotificationManager.Notification> pNotifications, long pDelay) voidclose()protected Map<String, List<PeriodicNotificationManager.Notification>> prepare(ResourceManager p_205300_, ProfilerFiller p_205301_) Performs any reloading that can be done off-thread, such as file IOprivate voidMethods inherited from class net.minecraft.server.packs.resources.SimplePreparableReloadListener
reloadMethods inherited from class net.neoforged.neoforge.resource.ContextAwareReloadListener
getContext, getRegistryLookup, injectContext, makeConditionalOps, makeConditionalOpsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.server.packs.resources.PreparableReloadListener
getName, prepareSharedState
-
Field Details
-
CODEC
private static final com.mojang.serialization.Codec<Map<String,List<PeriodicNotificationManager.Notification>>> CODEC -
LOGGER
private static final org.slf4j.Logger LOGGER -
notifications
-
selector
-
timer
-
notificationTask
-
-
Constructor Details
-
PeriodicNotificationManager
public PeriodicNotificationManager(ResourceLocation pNotifications, it.unimi.dsi.fastutil.objects.Object2BooleanFunction<String> pSelector)
-
-
Method Details
-
prepare
protected Map<String,List<PeriodicNotificationManager.Notification>> prepare(ResourceManager p_205300_, ProfilerFiller p_205301_) Description copied from class:SimplePreparableReloadListenerPerforms any reloading that can be done off-thread, such as file IO- Specified by:
preparein classSimplePreparableReloadListener<Map<String,List<PeriodicNotificationManager.Notification>>>
-
apply
protected void apply(Map<String, List<PeriodicNotificationManager.Notification>> p_205318_, ResourceManager p_205319_, ProfilerFiller p_205320_) - Specified by:
applyin classSimplePreparableReloadListener<Map<String,List<PeriodicNotificationManager.Notification>>>
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
stopTimer
private void stopTimer() -
calculateOptimalPeriod
private long calculateOptimalPeriod(List<PeriodicNotificationManager.Notification> pNotifications, long pDelay) -
calculateInitialDelay
-