prolong-1.1.0-r4.jar
Curse Maven Snippet
What's new
版本 / Version:1.1.0 日期 / Date:2026-09-08
新增 / New Features 批量延长指令:新增 /buff extend_all <目标> <时间> <等级> [ex ...] 和 /buff extend_random <目标> <时间> <等级> [ex ...]。前者延长目标玩家所有生效的药水效果,后者随机延长其中一个效果。两者均支持正负数值(缩短/降低)和可选上限参数。
单效果指令增强:原有 /buff extend <目标> <效果ID> add <时间> <等级> 现在可追加 ex <时间上限> <最终等级上限> 以设置本轮累计时间上限和最终等级上限。
Batch extension commands:Added /buff extend_all <target> <time> <level> [ex ...] and /buff extend_random <target> <time> <level> [ex ...]. The former extends all active effects on the target player; the latter randomly picks one effect. Both support positive/negative values (shortening/lowering) and optional upper-limit arguments.
Enhanced single-effect command:The existing /buff extend <target> <effectID> add <time> <level> can now append ex <timeLimit> <finalLevelLimit> to set a cumulative time cap and a final level cap for the current session.
改进 / Improvements 独立效果记录:每个玩家×每个效果现在独立维护 BuffRecord,包含累计延长秒数(所有指令共享)、时间上限、最终等级上限(仅 extend)、累计增加等级(仅 all/random)和累计增加上限。效果过期、被移除、玩家死亡或退出时,该记录自动清零,避免旧数据干扰。
上限“只升不降”:当使用 ex 设置上限时,新值大于当前记录值才会更新,且扩充发生在所有效果处理之前,与截断逻辑完全分离。
时间处理更严谨:负数时间直接缩短,归零则移除效果;正数时间受累计秒数上限约束,而非绝对剩余时间。所有计算使用 long 防止溢出。
等级处理区分指令:/buff extend 使用“最终等级上限”夹取;/buff extend_all/random 使用“累计增加等级上限”,仅记录正向增长,负值降低不影响累计值。等级降至负或时间归零时移除效果并清空记录。
属性完整保留:重新施加效果时,原效果的 ambient、粒子显示、图标等属性被完整复制。
无限时长效果不受影响:时长为负(无限)的效果不会被时间增减误伤。
硬性等级上限:所有效果增加后的等级封顶 255,避免异常值。
Per-effect tracking:Each player×effect now maintains a BuffRecord with fields for cumulative extended seconds (shared across all commands), time limit, final level limit (for extend only), cumulative added level (for all/random only), and cumulative addition limit. Records are automatically cleared when the effect expires, is removed, or when the player dies/logs out.
Cap escalation only:When ex sets a cap, the stored cap is updated only if the new value is larger; this expansion happens before any effect processing, independent of truncation logic.
Strict time handling:Negative time shortens the effect; when it reaches zero, the effect is removed. Positive time is capped by the cumulative total seconds, not by the absolute remaining duration. All calculations use long to prevent overflow.
Differentiated level capping:/buff extend uses a “final level cap”; /buff extend_all/random use a “cumulative addition cap” that only tracks positive increments (negative level changes do not reduce the accumulator). Effects with new level < 0 or new time ≤ 0 are removed and their records cleared.
Attribute preservation:When reapplying an effect, ambient, particle visibility, and icon settings are copied from the original effect.
Infinite-duration effects unaffected:Effects with negative duration (infinite) are not harmed by time modifications.
Hard level ceiling:All effects are capped at level 255 to avoid overflow.
反馈 / Feedback 丰富的彩色提示:成功操作用绿色,错误/失败用红色。extend_all 报告“已延长 X 个效果”(跳过无变化的效果不计入);extend_random 报告随机选中的效果名称;另有“已达时间/等级上限”和“因时间/等级归零已移除”的逐效果点名提示。所有消息均支持中英文本地化。
Rich colored messages:Success in green, errors in red. extend_all reports “X effect(s) extended” (skipping unchanged ones); extend_random reports which effect was chosen; specific alerts for “cap reached” and “removed due to zero time/level” are provided per effect. All messages are fully localized in both Chinese and English.
其他 / Other 权限:所有指令默认需要 OP 等级 2,可通过 Forge 权限系统调整。
Tab 补全:补全支持效果 ID(含模组效果)以及子命令 add、ex、extend_all、extend_random。
Permission:All commands require OP level 2 by default (configurable via Forge permission system).
Tab completion:Supports effect IDs (including modded effects) and sub‑commands add, ex, extend_all, extend_random.
This mod has no additional files