镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Add book page serialization - #4048

Merged
mdcfe merged 11 commits into
EssentialsX:2.xfrom
JRoy:feature/moar-serialization
May 28, 2021
Merged

mdcfe merged 11 commits into
EssentialsX:2.xfrom
JRoy:feature/moar-serialization

Conversation

@JRoy

@JRoy JRoy commented Mar 9, 2021

Copy link
Copy Markdown
Member

Closes #31

@JRoy JRoy added type: enhancement Features and feature requests. type: problem Problems that are not strictly bugs. labels Mar 9, 2021
@JRoy JRoy added this to the 2.19.0 milestone Mar 9, 2021
@pop4959

pop4959 commented Mar 10, 2021

Copy link
Copy Markdown
Member

Not all too familiar with this; how is it intended to be used?

@JRoy

JRoy commented Mar 10, 2021

Copy link
Copy Markdown
Member Author

Not all too familiar with this; how is it intended to be used?

createkit uses AbstractItemDb to serialize data, MetaItemStack parses that data.

@pop4959

pop4959 commented Mar 10, 2021

Copy link
Copy Markdown
Member

Not all too familiar with this; how is it intended to be used?

createkit uses AbstractItemDb to serialize data, MetaItemStack parses that data.

I understand that bit, what I meant was how this actually works. From the code it looks like it's adding a new item meta syntax for page<#>:<content> and dumps everything in there. It might be better if we used the method already used by book to save and load data.

@JRoy

JRoy commented Mar 10, 2021

Copy link
Copy Markdown
Member Author

Not all too familiar with this; how is it intended to be used?

createkit uses AbstractItemDb to serialize data, MetaItemStack parses that data.

I understand that bit, what I meant was how this actually works. From the code it looks like it's adding a new item meta syntax for page<#>:<content> and dumps everything in there. It might be better if we used the method already used by book to save and load data.

from what I understand, that was made for making the content of a book match that of a text file on disk, book.txt. If I used that, it would break backwards compatibility :/

@pop4959

pop4959 commented Mar 10, 2021

Copy link
Copy Markdown
Member

Ah yeah good point, we'd also need to write into that too and I don't think anything does that currently (also ew, txt). I feel like there's probably still a better way than to literally dump the text wholesale into YML and generate a bunch of messy keys. If we're going into that direction then #3248 is a better solution.

@pop4959
pop4959 requested a review from mdcfe March 10, 2021 02:41
mdcfe
mdcfe previously approved these changes May 28, 2021
@mdcfe

mdcfe commented May 28, 2021 •

Copy link
Copy Markdown
Member

Do we want to consider serializing book and quills? If they use BookMeta too, I see no reason why we couldn't allow for this.

It also currently preserves newlines:
image

mdcfe and others added 2 commits May 28, 2021 15:35
This also fixes a bug with lore, which didn't escape pipe characters before serializing.
@mdcfe
mdcfe merged commit 7852aed into EssentialsX:2.x May 28, 2021
@JRoy
JRoy deleted the feature/moar-serialization branch May 28, 2021 17:57
ressidell pushed a commit to ressidell/Essentials that referenced this pull request Apr 27, 2025
Co-authored-by: MD <1917406+mdcfe@users.noreply.github.com>

Allows serialization of books in `/createkit`. Closes EssentialsX#31.
rewsdjad1 pushed a commit to rewsdjad1/EssentialsXPlus that referenced this pull request Aug 13, 2026
Co-authored-by: MD <1917406+mdcfe@users.noreply.github.com>

Allows serialization of books in `/createkit`. Closes EssentialsX#31.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: enhancement Features and feature requests. type: problem Problems that are not strictly bugs.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Createkit command does not save book metadata

3 participants