PGM
PGM copied to clipboard
Throw a more fitting exception on unrecognized gamemodes
i think id would be good if the gamemodes module would at least ignore unknown gamemodes, if a map was a new gamemode it wouldn't be possible to assign it to a correct gamemode
The gamemodes for <gamemode> is defined by these two files. All the <gamemode> module does is change/force the title on the right scoreboard (in the future this should force map tags). <gamemode> doesn't allow for arbitrary gamemodes because it's supposed to be translatable. If there are other gamemode names you think should be added, you can add them on to these two files:
https://github.com/PGMDev/PGM/blob/dev/core/src/main/java/tc/oc/pgm/api/map/Gamemode.java https://github.com/PGMDev/PGM/blob/dev/util/src/main/i18n/templates/gamemode.properties
What you're looking for is already included in the <game> module, which lets you display anything.
<!-- displays "DTC and DTM" in the user's language -->
<gamemode>dtc</gamemode>
<gamemode>dtm</gamemode>
<!-- displays "Blast the Big Gold Core" to all users -->
<game>Blast the Big Gold Core</game>
Right now it throws an error if an unknown gamemode is used, maybe it could just ignore the unknown ones.
IMO the exception should just be a proper map loading error if you use an invalid gamemode Otherwise we're just hiding a bug in the xml