SquareMarkerZ
Squaremap 的标记插件,功能类似于 squaremarker 插件。
在 GitHub 查看项目:
命令
基础命令:/marker(别名 /squaremarker)。
标记 (Markers)
| 命令 |
描述 |
/marker add <id> [iconUrl] [label...] [--set <setId>] |
在你当前位置创建一个标记。如果目标集合已设置默认图标,则 iconUrl 为可选参数。 |
/marker addat <id> <world> <x> <z> [iconUrl] [label...] [--set <setId>] |
同上,但通过控制台(或玩家)指定坐标创建。Y 轴默认为该 X/Z 坐标处的最高方块高度。 |
/marker remove <id> |
删除一个标记。 |
/marker move <id> |
将标记移动到你当前的位置。 |
/marker moveset <id> <setId> |
将一个标记移动到另一个集合中。 |
/marker label <id> <label...> |
设置悬停提示文本。 |
/marker icon <id> <iconUrl> |
更改标记的图标。 |
/marker desc <id> <text...> |
设置点击弹窗文本(支持基本 HTML 标签)。 |
/marker list [world] [page] [--set <setId>] |
分页列表,包含可点击的 [tp] 条目。 |
/marker info <id> |
显示标记的完整详情。 |
/marker tp <id> |
传送你到某个标记处。 |
/marker reload |
重载配置、集合、标记并重新注册图标。 |
仅当参数以 http:// 或 https:// 开头时,才会被视为图标 URL;--set <setId> 可以出现在必需参数之后的任意位置,并在处理其余部分作为标签之前被移除。标记 ID 符合 [a-z0-9_-]{1,32} 格式(不区分大小写),且在所有集合中全局唯一。
标记集合 (Marker Sets)
| 命令 |
描述 |
/marker set create <setId> [label...] |
创建一个新的集合/图层。 |
/marker set delete <setId> [confirm] [--moveto <setId>] |
配合 --moveto 使用,会将该集合下的标记移至指定位置并立即删除该集合。否则,首次运行会弹出 30 秒确认倒计时,随后需执行 /marker set delete <setId> confirm 才能真正删除该集合及其标记。默认集合无法被删除。 |
/marker set label <setId> <label...> |
|
/marker set hide <setId> <true|false> |
控制该图层在 Web UI 中是否默认隐藏。 |
/marker set controls <setId> <true|false> |
控制该图层是否出现在 Web UI 的图层切换选项中。 |
/marker set priority <setId> <number> |
|
/marker set zindex <setId> <number> |
|
/marker set icon <setId> <iconUrl|none> |
添加到该集合且未明确指定图标的标记所使用的默认图标。设为 none 可清除它。 |
/marker set list |
|
/marker set info <setId> |
|
始终存在一个默认集合(ID 和标签来自 config.yml,默认为 markers / “Markers”),且不可删除;未使用 --set 参数创建的标记会自动归入此集合。
图标
- 仅接受
http:// 或 https:// 协议的 URL。
- 下载过程完全在主线程之外进行,连接超时为 5 秒,读取超时为 5 秒,最大文件大小限制为 512 KB(以上均可配置)。任何非有效 PNG、JPG 或 GIF 格式的图像都会被拒绝。
- 接受的图像会被调整大小以适应可配置的正方形区域(默认为 16×16),同时保持宽高比,并缓存至
plugins/SquareMarkerZ/icons/<sha1-of-url>.png。重启时会复用已缓存的图标而无需重新下载,即使源 URL 后续失效,缓存图标仍能正常工作。
- 多个标记/集合若共享同一 URL,则共用一个缓存文件和一个 Squaremap 图标注册项(引用计数);当没有任何对象引用时,该注册项会被移除,但磁盘缓存仍保留。
- 如果下载或验证失败,命令发送者会收到错误原因,且标记/集合状态保持不变——失败时不会创建或修改任何内容。
配置 (config.yml)
涵盖默认集合的 ID/标签、图标尺寸/下载限制/超时时间、新创建集合的默认图层属性,以及所有聊天消息(前缀支持传统 & 颜色代码或 MiniMessage —— 可通过切换 messages.minimessage 选项选择)。请参阅随附的 config.yml 获取完整的带注释列表。修改后执行 /marker reload 即可生效,无需重启服务器。
存储
plugins/SquareMarkerZ/sets.yml — 标记集合数据。
plugins/SquareMarkerZ/markers.yml — 标记数据(包含 id, set, world, x, y, z, label, description, icon-url, created-by, created-at 字段)。
- 每次更改均通过异步写入临时文件并重命名为最终文件的方式保存,因此写入过程中崩溃也不会导致文件损坏。
- 在引入标记集合概念之前保存的标记(缺少
set 字段)会在加载时自动迁移至默认集合。
SquareMarkerZ
Marker plugin for Squaremap, similar to plugin squaremarker.
View project on GitHub:
Commands
Base command: /marker (alias /squaremarker).
Markers
| Command |
Description |
/marker add <id> [iconUrl] [label...] [--set <setId>] |
Creates a marker at your location. iconUrl is optional only if the target set has a default icon. |
/marker addat <id> <world> <x> <z> [iconUrl] [label...] [--set <setId>] |
Same as above, from the console (or a player) at explicit coordinates. Y defaults to the highest block at that x/z. |
/marker remove <id> |
Deletes a marker. |
/marker move <id> |
Moves a marker to your current location. |
/marker moveset <id> <setId> |
Moves a marker into a different set. |
/marker label <id> <label...> |
Sets the hover tooltip text. |
/marker icon <id> <iconUrl> |
Changes a marker's icon. |
/marker desc <id> <text...> |
Sets the click popup text (basic HTML allowed). |
/marker list [world] [page] [--set <setId>] |
Paginated list with clickable [tp] entries. |
/marker info <id> |
Shows a marker's full details. |
/marker tp <id> |
Teleports you to a marker. |
/marker reload |
Reloads config, sets, markers and re-registers icons. |
An argument is treated as an icon URL only if it starts with http:// or https://; --set <setId> can
appear anywhere after the required arguments and is stripped out before the rest is treated as the label.
Marker ids match [a-z0-9_-]{1,32} (case-insensitive) and are globally unique across every set.
Marker sets
| Command |
Description |
/marker set create <setId> [label...] |
Creates a new set/layer. |
/marker set delete <setId> [confirm] [--moveto <setId>] |
With --moveto, moves the set's markers there and deletes it immediately. Otherwise, run it once to get a 30-second confirmation prompt, then run /marker set delete <setId> confirm to actually delete the set and its markers. The default set can't be deleted. |
/marker set label <setId> <label...> |
|
/marker set hide <setId> <true|false> |
Whether the layer starts hidden in the web UI. |
/marker set controls <setId> <true|false> |
Whether the layer shows up in the web UI's layer toggle at all. |
/marker set priority <setId> <number> |
|
/marker set zindex <setId> <number> |
|
/marker set icon <setId> <iconUrl|none> |
Default icon used by markers added to this set without an explicit icon. none clears it. |
/marker set list |
|
/marker set info <setId> |
|
A default set (id and label from config.yml, markers/"Markers" out of the box) always exists and can't
be deleted; markers created without --set go into it.
Icons
- Only
http:///https:// URLs are accepted.
- Downloads run entirely off the main thread, with a 5s connect timeout, a 5s read timeout, and a 512 KB
max size (all configurable). Anything that isn't a valid PNG, JPG or GIF is rejected.
- Accepted images are resized to fit a configurable square (16×16 by default), keeping aspect ratio, and
cached to
plugins/SquareMarkerZ/icons/<sha1-of-url>.png. Cached icons are reused on restart without
re-downloading, and keep working even if the source URL later goes offline.
- Several markers/sets sharing the same URL share one cached file and one squaremap icon registration
(reference-counted); the registration is dropped once nothing uses it anymore, but the disk cache stays.
- If a download/validation fails, the command sender gets the reason and the marker/set is left unchanged
— nothing is created or modified on failure.
Configuration (config.yml)
Covers the default set's id/label, icon size/download limits/timeouts, default layer properties for newly
created sets, and every chat message (with a prefix, either legacy & color codes or MiniMessage — toggle
messages.minimessage). See the shipped config.yml for the full, commented list. Changes take effect
after /marker reload — no restart needed.
Storage
plugins/SquareMarkerZ/sets.yml — marker sets.
plugins/SquareMarkerZ/markers.yml — markers (id, set, world, x, y, z, label, description,
icon-url, created-by, created-at).
- Every change is saved asynchronously by writing a temp file and renaming it into place, so a crash mid-write
can't corrupt either file.
- Markers saved before marker sets existed (no
set field) are migrated into the default set on load.
评论 0
登录后参与评分
还没有评论,来抢沙发吧