Debugify

Debugify

16M Downloads

[Bug] MC-26757 fix does not appear to account for if text has many lines or if there is too much text

mattp12 opened this issue ยท 3 comments

commented

Bug Description

The MC-26757 fix fixes text going off-screen. However, it does not seem to fix situations in which there are many new lines or if there is too much text.

An example of a command you can run to get many new lines:

/give @p ice{display:{Lore:['{"text":"a"}','{"text":"b"}','{"text":"c"}','{"text":"d"}','{"text":"e"}','{"text":"f"}','{"text":"g"}','{"text":"h"}','{"text":"i"}','{"text":"j"}','{"text":"k"}','{"text":"l"}','{"text":"m"}','{"text":"n"}','{"text":"o"}','{"text":"p"}','{"text":"q"}','{"text":"r"}','{"text":"s"}','{"text":"t"}','{"text":"u"}','{"text":"v"}','{"text":"w"}','{"text":"x"}','{"text":"y"}','{"text":"z"}']}} 1

Screenshot_1

Additionally, if there is too much text, the text can go off-screen if the item is placed too far to the side. I believe a solution would be to wrap the text if it goes on too long.

/give @p ice{display:{Lore:['{"text":"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"}']}} 1

Screenshot_2

How to Reproduce?

Run commands from bug description and observe results.

Expected Behavior

For the item descriptions to not go off-screen.

Version

2.0.0

Mod Loader Version

1.19 0.14.7

Mod Loader

Fabric

Logs or additional context

No response

Has not been reported.

  • I made sure this bug hasn't already been reported.

Is on most update to date version.

  • I made sure I am using the most up to date mod loader and mod version.
commented

I improved behaviour vertically to try to fit the tooltip on the screen unless it goes off the top.
image

commented

Text wrapping is something I really want to avoid because

  1. it's really hard to get right
  2. in some cases a mod or server could utilise this issue

So I think is will suffice for now.

commented

I have also now improved behaviour horizontally by doing the same thing. If the tooltip goes off the screen to the left too much it caps it so you can always read the first bit.
image