BedWars
BedWars copied to clipboard
Configurable team color.
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
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.
pronze also came up with keeping it an enum and adding a constant field with the VALUES map, which has the custom colors
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?
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
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.
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
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.
If I implement 100% of the enum methods, would that be good enough?
Well, you should also add public static final TeamColor RED = ......;
etc, then it would be 100% compatible
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.