Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minimessage 支持 #7

Open
1 of 3 tasks
XiYang6666 opened this issue Oct 19, 2024 · 13 comments
Open
1 of 3 tasks

Minimessage 支持 #7

XiYang6666 opened this issue Oct 19, 2024 · 13 comments
Assignees
Labels
enhancement New feature or request

Comments

@XiYang6666
Copy link
Owner

什么是Minimessage? : https://docs.advntr.dev/minimessage/format.html

实现进度:

  • 解析 Minimessage 到 TextComponent
  • 正确处理 TextComponent
  • 渲染 TextComponent
@XiYang6666 XiYang6666 pinned this issue Oct 19, 2024
@XiYang6666
Copy link
Owner Author

目前问题:

TextComponent 的 翻译文本、计分板分数、实体名称、按键绑定、NBT标签值等部分因实际渲染内容不确定,所以无法获取准确的字符宽度。

解决方法:

  1. 支持上述文本组件类型,但不渲染或使用占位符渲染.
  2. 过滤上述文本组件类型

@BarbTurnip437
Copy link

注意到Minimessage有原版无法直接实现或无法实现的功能如
彩虹
insertion
你会怎么做

@XiYang6666
Copy link
Owner Author

注意到Minimessage有原版无法直接实现或无法实现的功能如 彩虹 insertion 你会怎么做

可以替换为多个 TextComponent 实现

@BarbTurnip437
Copy link

书可能无法显示一些文本

@BarbTurnip437
Copy link

BarbTurnip437 commented Oct 19, 2024

/give @p written_book[written_book_content={title:"",author:"",pages:['{"selector":"@e"}']}] 1
image
/tellraw @p {"selector":"@e"}
image

@XiYang6666
Copy link
Owner Author

那么可以考虑放弃支持部分minimessage标签和TextComponent类型

@BarbTurnip437
Copy link

测试ing

@XiYang6666
Copy link
Owner Author

XiYang6666 commented Oct 19, 2024

经测试 selector 类型在只有 @a @s 等选择器时正常显示,出现任意一个 @e 时所有 selector 类型的 TextComponent 均显示异常

@BarbTurnip437
Copy link

yes

@XiYang6666
Copy link
Owner Author

过于玄学( , 将放弃支持所有 selector 类型

@BarbTurnip437
Copy link

BarbTurnip437 commented Oct 19, 2024

clickEvent":{"action":"suggest_command","value":"some_random_text"}
也无法使用

@XiYang6666
Copy link
Owner Author

XiYang6666 commented Oct 27, 2024

目前进度:
0e4b780d2028b7b2d87758569c195a05

<b>Bold text</b>and<i>italic text</i><red>awa<rainbow>12345678901234567890aaaaaa114514114514</red>abcdefg<br>
<rainbow>1234567890aaaaaa114514114514</rainbow><br>
<rainbow>1234567890<black>aaaaaa</black>114514114514</rainbow><br>
<rainbow>1234567890aaaaaa114514114514</rainbow><br>
<rainbow:!>1234567890aaaaaa114514114514</rainbow><br>
<rainbow:2>1234567890aaaaaa114514114514</rainbow><br>
<rainbow:!2>1234567890aaaaaa114514114514</rainbow><br>
<yellow>Woo: <rainbow>||||||||||||||||||||||||</rainbow>!\n
<yellow>Woo: <rainbow:!>||||||||||||||||||||||||</rainbow>!\n
<yellow>Woo: <rainbow:2>||||||||||||||||||||||||</rainbow>!\n
<yellow>Woo: <rainbow:!2>||||||||||||||||||||||||</rainbow>!\n

@BarbTurnip437
Copy link

!

@XiYang6666 XiYang6666 self-assigned this Nov 13, 2024
@XiYang6666 XiYang6666 added the enhancement New feature or request label Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants