Corex
一款面向 Paper / Folia / Velocity 的高性能编译脚本引擎。简单、自动化、便捷——认识 Corex。
⚡ 启动时编译
脚本仅解析一次。每次调用都运行预构建的字节码——性能不依赖于脚本数量。
|
?️ 使用标签而非变量
<player.name>、<player.health>、<player.location.x> ——数据直接嵌入字符串中,无需中间赋值。
|
? 持久化标记(Flags)
通过单条命令即可写入标记——针对玩家、方块或全局生效。重启后依然保留。支持 TTL:数据在设定时间后自动删除。
|
? 支持 Folia
Corex 会追踪线程并在区域间自动切换。脚本编写方式与普通情况一致——无需特殊处理。
|
? Velocity - 相同语法
代理脚本使用相同的语言。跨服逻辑、全局数据、高性能。
|
? 热重载
/run reload ——脚本即时重新编译。服务器保持在线运行。
|
脚本队列

每个脚本都在其独立的队列中运行。当一个队列等待(例如 delay、command execution 或 region switch)时,其他队列继续执行。每个队列拥有自己的变量和代码执行位置。
.jar 生命周期

一个 .jar 文件可在 Paper、Folia 和 Velocity 上运行。加载时,服务器会检测平台并读取相应的配置文件。
命令语法

每条命令以 - 开头,后跟命令名称和参数。参数分为两种类型:线性参数——作为普通值传递(如 "Some text"),前缀参数——以 key:value 形式传递(如 targets:<player[_TIZIS_]>)。任何参数中均可使用标签——它们会在命令执行时求值。
标签语法

标签是 < > 内部的一个链式结构。从左到右读取:player ——主体是谁,.name ——其名称(字符串),.length ——该字符串的长度(数字),.isMoreThan[10] ——是否大于 10(布尔值)。每一部分接收上一部分的结果并返回新值。最终结果将替换标签被写入的位置。

Corex
A high-performance, compiled scripting engine for Paper / Folia / Velocity. Simple, automated, convenient - meet Corex.
⚡ Compiled at startup
Scripts are parsed once. Every call runs prebuilt bytecode - performance does not depend on the number of scripts.
|
?️ Tags instead of variables
<player.name>, <player.health>, <player.location.x> - data is embedded directly into the string, no intermediate assignments needed.
|
? Persistent flags
A flag is written with a single command - on a player, a block, or globally. Survives restarts. Supports TTL: data deletes itself after a set time.
|
? Folia support
Corex tracks threads and switches between regions automatically. Scripts are written as usual - no special handling required.
|
? Velocity - same syntax
Proxy scripts use the same language. Cross-server logic, global data, high performance.
|
? Hot reload
/run reload - scripts are recompiled on the fly. The server keeps running.
|
Script Queue

Every script runs in its own isolated queue. While one queue is waiting (for a delay, a command execution, or a region switch) - the others keep going. Each queue has its own variables and its own position in the code.
.jar lifecycle

One .jar file runs on Paper, Folia and Velocity. On load, the server detects the platform and reads the right config.
Command syntax

Every command starts with -, followed by the command name and arguments. Arguments come in two types: linear - passed as a plain value ("Some text"), and prefix - passed as key:value (targets:<player[_TIZIS_]>). Tags can be used in any argument - they are evaluated at the moment the command runs.
Tag syntax

A tag is a chain inside < >. Read left to right: player - who, .name - their name (string), .length - the length of that string (number), .isMoreThan[10] - whether it is greater than 10 (boolean). Each part receives the result of the previous one and returns a new value. The final result is substituted wherever the tag is written.

评论 0
登录后参与评分
还没有评论,来抢沙发吧