TickScheduler API 图标

TickScheduler API

作者:rebot | 分类:模组

价格:0 墨喵币 下载量:0 点赞:0 版本 0.0.53
本资源为搬运资源,原资源地址: https://modrinth.com/mod/tickscheduler-api
资源信息

Minecraft 版本: 1.20.1

平台: forge

标签: library management technology

资源介绍

TickScheduler is a lightweight Tick library for mods:

  • run code in the future
  • repeat actions every N ticks
  • execute logic when conditions become true
  • persist tasks across world reloads
  • offload heavy work to async threads

FULL INFO ON GITHUB:

You can use it to:

  • temporary effects
  • cooldown timers
  • delayed world events
  • repeating logic loops
  • async computations
  • persistent timers
  • condition-triggered routines
  • modular systems requiring precise tick control

Commands:

  • /scheduler debug
  • /scheduler profiler on
  • /scheduler profiler off
  • /scheduler profiler stats
  • /scheduler save
  • /scheduler load
  • /scheduler tasks
  • /scheduler test <- for test lib

API classes:

SchedulerAPI - High-level scheduling interface
TickScheduler - Internal engine
Types - Task types, context, builder, priorities
PersistentStorage - Save & load persistent tasks
ConditionScheduler- Condition-based logic
TaskRegistry - Restore persistent task types

Example: Custom persistent task

SchedulerAPI.builder()
    .delay(60)
    .repeat(10)
    .maxRuns(5)
    .priority(Types.Priority.HIGH)
    .persistent()
    .type("regenerate")
    .submit(ctx -> {
        System.out.println("Regenerating at " + ctx.tick);
    });

Persistent tasks survive world reloads.
Profiler measures real execution time of scheduled tasks.


Port on NeoForge and on 1.21.1 later maybe...

下载太慢?试试 墨喵加速站,支持 Modrinth 和外网直链高速下载! 用的人越多,下载的越快!
下载与版本
评论(0)
登录 后发表评论。

暂无评论,抢个沙发吧~

举报此资源

请登录后举报

🔥 相关推荐
Dragon Survival: IAF Integration

价格:0 墨喵币
下载量:0

查看详情
Gourds Fix

价格:0 墨喵币
下载量:0

查看详情
Translater

价格:0 墨喵币
下载量:0

查看详情
Cozy's Improved Cats

价格:0 墨喵币
下载量:0

查看详情