适用于 Paper 服务器的游戏内日志插件。
玩家运行 /journal 命令,以箱子菜单的形式浏览章节、分类和条目。
一个条目可以打开一本书、一块告示牌或另一个菜单,也可以仅仅是一个拥有名称和描述文本作为内容的物品。
每个菜单都是一个 YAML 文件,没有任何硬编码逻辑。
通过编辑文件来构建日志,或者在服务器内使用命令构建,并直接编写书籍内容和告示牌文字,无需离开服务器。
可用于展示背景故事、规则、指南、服务器维基、更新日志,或任何希望玩家能够查阅的内容。
功能特性
- 三层结构,均为文件夹。 章节包含分类,分类包含条目。添加一个分类或条目文件夹,重载后即可在菜单中列出。
- 自动填充的列表。 在布局中留空槽位,插件会将分类或条目按名称或你设置的优先级排序后填入这些位置,跨越所需的多页显示。
- 四种类型的条目。 书籍、告示牌、完整背包内容,或仅带有名称和描述的普通物品。
- 文本绘制菜单。 布局由每行 9 个字符组成,每个字符代表你定义过一次的物品。
- 在游戏中构建。 使用命令创建、重命名和删除页面。页面的物品取自你的手持物品,包括自定义头颅。
- 在游戏中编写。 在书与笔中编辑书籍,在告示牌界面编辑告示牌,或在聊天栏中输入两者内容。
- 处处支持 MiniMessage。 标题、物品名称、描述、书页和告示牌行均支持
<green> 和 <bold> 等标签。
- 重命名不会破坏链接。 当页面被重命名时,所有指向该页面的按钮都会自动更新。
- 玩家保持上次位置。
/journal 会重新打开玩家上次所在的菜单,且布局中可以设置返回、主页、下一页和上一页按钮。
- 安全重载。
/journal reload 和服务器的 /reload 命令会重新读取文件。如果某个页面出错,会被跳过并在控制台显示原因,其余部分继续正常工作。
- 无需其他依赖。 无外部依赖,无需数据库。告示牌无需放置方块即可显示。
组织结构
plugins/Journalism/
├── inventory.yml 主菜单
└── data/
└── lore/ 章节
├── item.yml
├── layout.yml
└── dragons/ 分类
├── item.yml
├── layout.yml
└── ender_dragon/ 条目
├── item.yml
└── book.yml
layout.yml 是玩家在菜单中看到的布局。item.yml 是在上一级菜单中表示该页面的物品。
条目文件夹内的文件决定了点击该条目时的行为:
| 文件名 |
点击条目的效果 |
book.yml |
打开一本书 |
sign.yml |
打开一块告示牌 |
inventory.yml |
打开另一个菜单 |
| 无 |
无操作,物品本身即为玩家阅读的内容 |
文件示例
一个分类菜单。14 个空槽位由其条目填充,标题显示当前页码:
title: "Dragons (%page%/%pages%)"
layout:
- "b#######h"
- "# #"
- "# #"
- "###p#n###"
items:
"#":
material: gray_stained_glass_pane
name: " "
b:
material: arrow
name: "<yellow>Back"
function: back
h:
material: nether_star
name: "<green>Home"
function: home
p:
material: arrow
name: "<yellow>Previous page"
function: prev
n:
material: arrow
name: "<yellow>Next page"
function: next
一个书籍条目:
pages:
- "<bold>The Ender Dragon</bold>\n\nIt lives in <dark_purple>the End</dark_purple>."
- "Each item in the list is one page. Text that does not fit moves on to the next page."
命令
/journal 打开日志
/journal help 列出可用命令
/journal reload 重新读取文件
/journal section <create|open|rename|delete> ... 管理章节
/journal category <create|open|rename|delete> ... 管理分类
/journal entry <create|open|edit|delete> ... 管理条目
/journal <section|category|entry> item set <material|name> ...
/journal edit <save|cancel|restart> 在聊天中完成编辑
从零开始创建一个页面:
/journal section create lore
/journal category create lore dragons
/journal entry create lore dragons ender_dragon book
/journal entry item set name lore dragons ender_dragon <dark_purple>The Ender Dragon
/journal entry edit lore dragons ender_dragon
权限
| 权限 |
默认值 |
允许操作 |
journalism.use |
所有人 |
使用 /journal 和 /journal help |
journalism.reload |
管理员 |
使用 /journal reload |
journalism.manage |
管理员 |
创建、重命名、删除和编辑页面 |
入门指南
- 将 jar 文件放入
plugins 文件夹并启动服务器。
- 运行
/journal。首次启动时,插件会在 plugins/Journalism/ 目录下写入一个主菜单和一个包含每种类型条目的示例章节。
- 修改示例或自行创建页面,可以手动编辑文件或配合命令使用。
- 新建的章节需要一个按钮。在
inventory.yml 中添加一个带有 goto: page/<section> 的物品,然后运行 /journal reload。
已知限制
- 所有玩家看到的日志内容相同。目前尚不支持按玩家解锁,也没有针对每一页的权限控制。
- 在告示牌编辑界面可以打开一条告示牌条目。读者可以在那里输入文字,但他们的输入会被丢弃。
该界面仅显示 16 种基本颜色、加粗、斜体、下划线和删除线。
- 物品栏条目直接在文件中修改,而非在游戏中修改。
依赖项
该插件使用 Paper 自身的 API,因此无法在 Spigot 或 CraftBukkit 上运行。不支持 Folia。
链接
本插件根据 MIT 许可证 发布。
An in-game journal for Paper servers.
Players run /journal and browse sections, categories and entries in a chest menus format.
An entry can open a book, a sign or another menu, or simply be an item that have the name and lore are the content.
Every menu is a YAML file and nothing is hard-coded.
Build the journal by editing files, or build it in game with commands and write the books and signs without leaving the server.
Use it for lore, rules, guides, a server wiki, changelogs, or anything else players should be able to look up.
Features
- Three levels, all folders. Sections hold categories, and categories hold entries. Add a category or
entry folder, reload, and it is listed in the menu.
- Lists that fill themselves in. Leave empty slots in a layout and the plugin puts the categories or
entries there, sorted by name or by a priority you set, over as many pages as it takes.
- Four kinds of entry. A book, a sign, a whole inventory, or a plain item with a name and lore.
- Menus drawn in text. A layout is rows of 9 characters, and each character is an item you define once.
- Build it in game. Create, rename and delete pages with commands. The item for a page is taken from
your hand, custom heads included.
- Write it in game. Edit a book in a book and quill, edit a sign on the sign screen, or type either one
into chat.
- MiniMessage everywhere. Titles, item names, lore, book pages and sign lines all take tags like
<green> and <bold>.
- Renaming does not break links. When a page is renamed, every button that pointed at it is updated.
- Players keep their place.
/journal reopens the menu they were last on, and layouts can have back,
home, next and previous buttons.
- Safe reloads.
/journal reload and the server's own /reload read the files again. A broken page is
skipped with the reason in the console, and the rest keeps working.
- Nothing else needed. No dependencies and no database. Signs are shown without placing a block.
How it is organized
plugins/Journalism/
├── inventory.yml the main menu
└── data/
└── lore/ section
├── item.yml
├── layout.yml
└── dragons/ category
├── item.yml
├── layout.yml
└── ender_dragon/ entry
├── item.yml
└── book.yml
layout.yml is the menu players see. item.yml is the item that stands for that page in the menu above it.
The file inside an entry folder decides what clicking the entry does:
| File |
Clicking the entry |
book.yml |
Opens a book |
sign.yml |
Opens a sign |
inventory.yml |
Opens another menu |
| none of them |
Nothing, the item itself is what players read |
What the files look like
A category menu. The 14 empty slots are filled with its entries, and the title shows the page number:
title: "Dragons (%page%/%pages%)"
layout:
- "b#######h"
- "# #"
- "# #"
- "###p#n###"
items:
"#":
material: gray_stained_glass_pane
name: " "
b:
material: arrow
name: "<yellow>Back"
function: back
h:
material: nether_star
name: "<green>Home"
function: home
p:
material: arrow
name: "<yellow>Previous page"
function: prev
n:
material: arrow
name: "<yellow>Next page"
function: next
A book entry:
pages:
- "<bold>The Ender Dragon</bold>\n\nIt lives in <dark_purple>the End</dark_purple>."
- "Each item in the list is one page. Text that does not fit moves on to the next page."
Commands
/journal open the journal
/journal help list the commands you can use
/journal reload read the files again
/journal section <create|open|rename|delete> ... manage sections
/journal category <create|open|rename|delete> ... manage categories
/journal entry <create|open|edit|delete> ... manage entries
/journal <section|category|entry> item set <material|name> ...
/journal edit <save|cancel|restart> finish editing in chat
Making a page from nothing:
/journal section create lore
/journal category create lore dragons
/journal entry create lore dragons ender_dragon book
/journal entry item set name lore dragons ender_dragon <dark_purple>The Ender Dragon
/journal entry edit lore dragons ender_dragon
Permissions
| Permission |
Default |
Allows |
journalism.use |
everyone |
/journal and /journal help |
journalism.reload |
operators |
/journal reload |
journalism.manage |
operators |
Creating, renaming, deleting and editing pages |
Getting started
- Put the jar in your
plugins folder and start the server.
- Run
/journal. On first start the plugin writes a main menu and an example section with one entry of
every type into plugins/Journalism/.
- Change the example or make your own pages, by hand or with the commands.
- A new section needs a button. Add an item with
goto: page/<section> to inventory.yml, then run
/journal reload.
Known limitations
- Everyone sees the same journal. There is no per-player unlocking and no permission per page yet.
- A sign entry opens on the sign editing screen. Readers can type there, but what they type is thrown away.
That screen only shows the 16 basic colors, bold, italic, underlined and strikethrough.
- Inventory entries are changed in their file, not in game.
Requirements
The plugin uses Paper's own API, so it does not run on Spigot or CraftBukkit. Folia is not supported.
Links
Released under the MIT license.
评论 0
登录后参与评分
还没有评论,来抢沙发吧