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

Add of new minecraft colours #5838

Open
wants to merge 7 commits into
base: minor-next
Choose a base branch
from
Open

Add of new minecraft colours #5838

wants to merge 7 commits into from

Conversation

roimee6
Copy link

@roimee6 roimee6 commented Jun 15, 2023

Introduction

Minecraft has just added the colours that are linked to the materials

Tests

image

src/utils/Terminal.php Outdated Show resolved Hide resolved
src/utils/Terminal.php Outdated Show resolved Hide resolved
src/utils/TextFormat.php Outdated Show resolved Hide resolved
@dktapps
Copy link
Member

dktapps commented Jun 26, 2023

Related to #2988 - due to this change we'll no longer be able to use underline or strikethrough codes on the terminal

@jasonw4331 jasonw4331 added Category: API Related to the plugin API Category: Gameplay Related to Minecraft gameplay experience Type: Enhancement Contributes features or other improvements to PocketMine-MP labels Jun 29, 2023
@dktapps dktapps added the Status: Blocked Depends on other changes which are yet to be completed label Jul 3, 2023
@dktapps
Copy link
Member

dktapps commented Jul 3, 2023

Labelling this as blocked, since it causes breakages to other features. The discussion what to do about that hasn't been resolved yet.

@Yexeed
Copy link

Yexeed commented Apr 18, 2024

Is it possible to reopen this now since #2988 is closed now? Or it wasn't the reason why this got blocked?

@dktapps
Copy link
Member

dktapps commented Apr 18, 2024

No, the issue of being unable to use certain formatting codes on the server still exists, as well as changes in behaviour for any existing code

@Yexeed
Copy link

Yexeed commented Apr 18, 2024

Well, then, why don't just add new codes and do not remove deprecated ones? They are counted as deprecated in MC ecosystem for a very long time already, so as for my opinion, adding new codes will:

  • support textformat methods such as colorize(), tokenize() and clean()
  • console will also have new codes since rgb sources are now available on wiki.

Cons:

  • well, yes, the deprecated striketrough and underline still exists in textformat, but - are supported by the console.

So there is no 100% need to remove/deprecate them, and they will exist for unknown period of time, just as they are now, but the devs will get the ability to use new codes in api.

That's how I see the issue. I accept the fact that I may have missed something, that's alright, you may point me directly to the problems that I'm not aware of

@dktapps
Copy link
Member

dktapps commented Apr 19, 2024

We can't have them conflicting with strikethrough and underline because the console won't be able to use them. That's the whole problem.

Joshy3282 added a commit to Joshy3282/PocketMine-MP that referenced this pull request Oct 2, 2024
@dktapps
Copy link
Member

dktapps commented Nov 29, 2024

For completeness, a collection of proposed solutions for this problem:

1) Don't add the new constants

Doesn't seem like a good option - these new things aren't going to go away, and we still have problems without them, as people already use the new codes just by using their § codes directly

2) Add the constants, but allow them to conflict

Users of the underline & strikethrough constants will get unexpected formatting on clients, & console wouldn't know whether to use formatting or new colours

3) Custom formatting codes to support underline & strikethrough on the console

Presents the possibility for any custom codes to conflict with new Minecraft codes in the future
Raises migration questions if these were used in code for the terminal if Minecraft later decided to support them
Needing strings to be preprocessed to strip out custom codes before sending to clients (not a big deal)

4) Drop underline & strikethrough support via TextFormat & set the constants to ""

Losing support for strikethrough & underline on terminal via TextFormat, although technically they'd still be available by using Terminal properties directly - however this would be a bit crap if we wanted to use them internally

This would minimize the impact to users of the constants as some formatting would just disappear on the terminal, but this impact is probably minimal.

We could also add TextFormat::javaToBedrock() for cleaning up hardcoded formatting codes - right now this would just strip out underline & strikethrough codes (to prevent incorrect formatting), but if Bedrock gained support for the missing codes later on, it could replace them to the Bedrock ones as appropriate.

I'm currently leaning towards option number 4 as it seems like the least likely to cause problems, but it does mean that we lose some functionality.

@dktapps dktapps changed the base branch from stable to minor-next November 29, 2024 16:22
@dktapps dktapps requested a review from a team as a code owner November 29, 2024 16:22
@dktapps dktapps added the Easy task Probably really easy to do, good task for first-time contributors label Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: API Related to the plugin API Category: Gameplay Related to Minecraft gameplay experience Easy task Probably really easy to do, good task for first-time contributors Status: Blocked Depends on other changes which are yet to be completed Type: Enhancement Contributes features or other improvements to PocketMine-MP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants