BedWars icon indicating copy to clipboard operation
BedWars copied to clipboard

Configurable team color.

Open boiscljo opened this issue 2 years ago • 9 comments

Description

Make team color configurable by converting them to class instead of enum, load them from config, if present, and keep the default color if the config is missing. Here is an example of a config

image

Tested Minecraft versions: 1.19

Screenshots (if appropriate)

Types of changes

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • [x] My code follows the code style of this project.
  • [x] My change requires a change to the documentation.
  • [ ] I have updated the documentation accordingly.
  • [ ] I have added tests to cover my changes.
  • [x] All new and existing tests passed.

boiscljo avatar Jun 09 '22 14:06 boiscljo

pronze also came up with keeping it an enum and adding a constant field with the VALUES map, which has the custom colors

zlataovce avatar Jun 09 '22 16:06 zlataovce

pronze also came up with keeping it an enum and adding a constant field with the VALUES map, which has the custom colors

keeping what? api color or impl color?

Misat11 avatar Jun 09 '22 16:06 Misat11

pronze also came up with keeping it an enum and adding a constant field with the VALUES map, which has the custom colors

keeping what? api color or impl color?

API color

zlataovce avatar Jun 09 '22 16:06 zlataovce

pronze also came up with keeping it an enum and adding a constant field with the VALUES map, which has the custom colors

keeping what? api color or impl color?

API color

Yeah, that makes sense, however it would require to change some methods to support custom colors. Maybe we can do the same thing as md_5 did with his ChatColor class, so it doesn't break the API.

Misat11 avatar Jun 09 '22 16:06 Misat11

pronze also came up with keeping it an enum and adding a constant field with the VALUES map, which has the custom colors

keeping what? api color or impl color?

API color

Yeah, that makes sense, however it would require to change some methods to support custom colors. Maybe we can do the same thing as md_5 did with his ChatColor class, so it doesn't break the API.

That is actually what I attempted to do with abstract class and Enum like methods

boiscljo avatar Jun 09 '22 16:06 boiscljo

pronze also came up with keeping it an enum and adding a constant field with the VALUES map, which has the custom colors

keeping what? api color or impl color?

API color

Yeah, that makes sense, however it would require to change some methods to support custom colors. Maybe we can do the same thing as md_5 did with his ChatColor class, so it doesn't break the API.

That is actually what I attempted to do with abstract class and Enum like methods

well yes, but you removed all these values and there are no values() and ordinal() methods in the api class, so it's not compatible with the older api.

Misat11 avatar Jun 09 '22 16:06 Misat11

If I implement 100% of the enum methods, would that be good enough?

boiscljo avatar Jun 09 '22 17:06 boiscljo

Well, you should also add public static final TeamColor RED = ......; etc, then it would be 100% compatible

Misat11 avatar Jun 09 '22 17:06 Misat11

I wasn't sure if it was better to keep them separated like when they were enums but it was easier to make the public static final TeamColor NAME = ... in that way.

boiscljo avatar Jun 09 '22 17:06 boiscljo