ammaraskar / pyCraft

Minecraft-client networking library in Python
Other
814 stars 184 forks source link

Color coded Chat (instead of JSON) with ANSI Color? #73

Open TheSnoozer opened 7 years ago

TheSnoozer commented 7 years ago

Hi, I just wanted to check-in if a color coded chat would be something that would fit this scope of this project? Technically its pretty much at the border of being a python library to provide access to minecraft servers but on the other side there are python classes available that also be used as real client and thus I think it might be worth double checking. Maybe it would be something a user enables/disables with a switch (so just a side library that would allow to convert the JSON-Text to something colorfull.

Just a side-note: This might only work on windows 10 most likely out of the box, since it got added to windows 10

Let me know...

ammaraskar commented 7 years ago

In a much older version of this project, when it aimed to be a client instead of a client-library, this was actually a thing that existed: https://github.com/ammaraskar/pyCraft/commit/9a715a72b868edf5ad4785f1965b4fee9e155ada https://github.com/ammaraskar/pyCraft/issues/10

As for its viability now, I think its definitely a useful feature to have but as part of a utility package instead of in auth/networking since it doesn't really fit there.

Side note, you can use colorama like I did to make it work on windows, but I wanna make sure these dependencies are optional since not all people using the project need this feature.

joodicator commented 6 years ago

This might be a good thing to add, along with general parsing of Minecraft's JSON chat (and legacy chat formatting) structures. Doing the latter requires language files to be present, and, since those are protected by Mojang's copyright, there are some legal subtleties involved in using them. Nonetheless, I think it is possible, for example by providing the ability to automatically download them if needed, or use a langauge file provided by the user.

I don't know when or if I'll have a chance to implement this myself, but I will gladly review a pull request.

TheSnoozer commented 6 years ago

Mhh interesting....i personally looked into making the chat somewhat color full and readable but haven't considered the translation from general chat messages....might take a look into it and create a PR ;)