服务器程序于main.cpp开始运行。
编译服务器请在Server目录下带着all参数运行build.py(比如我这里是python3 build.py all)。CMake太高深不想用,不如直接用G++。
本程序使用Utf8Wrapper以此将UTF-8字符串转换成Unicode处理(实际上包装为个迭代器)。只读。见utf8.hpp和utf8.cpp了解更多。
对于所有 JSON 中涉及到“名称”“提示”之类的,一律允许以下格式:
"你好世界!"
{"translation":"hello.world"}
[{"translation":"hello"},{"translation":"world"}]
{
"translation": "greeting_someone",
"args": {
"someone": {"translation": "world"}
}
}注:(此处仅举例,非真实)"greeting_someone"对应的本地化字符串是"你好{someone}!"
{"text":"你好世界!","color":"#114514"}
如果要显示为{user}:
{
"text": "This would be okay to show {uuuser} and also the user {user}. Just need to make sure the order of {uuuser} and {uuuuuser}. ",
"args": {
"user": "114514",
"uuuser": "{user}",
"uuuuuser": "{uuuser}"
}
}注:color不支持为整数。
{
"translation": "greeting_someone", "color": "#114514",
"args": {
"someone": [
{"icon": "creaft.gui.icon.earth"},
{"translation": "world", "color": "#309eff", "bold": true, "underlined": true, "italic": true, "strikethrough": false}
]
}
}有个人建议我叫美西螈语言,于是我就起了一个别名“螈代码”,也可以叫AxolotL。
脚本用于书写模组的逻辑,如实体的tick()等。
需要注意的是,区块等的加载为硬编码,若要优化请直接修改源代码或者帮我改。
内置类型有:
为避免距离现象,游戏会将全局坐标转换为区块坐标。添加该类型是为了自动处理转换,
该类型使用一个指针记录对应区块,三个FixedShort192类型记录相对位置,仅显示时转换为全局的样子。
而且你改的时候直接改实现(比如删去转换)就能在16777216.0走不动路了。
添加理由同上。
该类型使用一个指针记录对应区块,三个short类型记录相对位置。
Bool布尔值:除0以外的值均变为1。Byte有符号8位整数:对应int8_t。请自行处理溢出。UByte无符号8位整数:对应uint8_t。Short有符号16位整数:对应int16_t。同上,请自行处理溢出。UShort无符号16位整数:对应uint16_t。Int有符号32位整数:对应int32_t。同上。UInt无符号32位整数:对应uint32_t。Long有符号64位整数:对应int64_t。同上。ULong无符号64位整数:对应uint64_t。Fixed6定点数,比例为10的6次方。:对应Fixed6。同上。Float32位浮点数:对应float。请自行处理精度丢失。Double64位浮点数:对应double。同上String字符串:对应std::string。Identifier标识符:对应Identifier。