Created my bot. I learnt how to use Sqlite, Typescript, and Discord.js today.
I added a Roles system (PARTICIPANT, SPECTATOR, STAFF, ADMIN) as well as setRole(Player player, Role role), getPlayers(Role role) and updateState(Player player) You now automatically get assigned spectator on death and participant on event start. This system is still very primative and I will adjust how roles are managed in the future as required.
I spent 10 minutes debugging because of a typo in my messages.yml causing the showTitle() to fail because of an invalid message. I’m going to add null saftey to my MessageManager to return some error if a configuration value is null, to help me catch these earlier in the future.
I’ve added a lot of stuff in one hour!
You can now use predefined placeholders in the messages.yml in the format of {index}. These are replaced by predetermined variables.
Chat formatting has been added! I plan to implement a placeholder for the users role soon, right now it’s just hard-coded in the messages file as PARTICIPANT <username> ▶ <message>
Added tab completion to the subcommand’s subcommands! More specifically the kit actions are auto completed now.
Began preparation for event roles (Participant, Spectator, Staff, Admin). All this means so far is adding an enum
Fixed some bugs, most notably where my messages file would take two restarts to overwrite the updated version due to me initializing my file too soon.
I’ve added a functioning kits system to the plugin! You can now save your inventory including armor and offhand slot as a kit by using /event kit save <name>, and load a kit by using /event kit get <name>. Kits are saved to /kits/<kit>.yml in my plugins data folder. It has support for enchants, custom display names, and persistent data container data.
Implemented a messages.yml for storing the messages used in the plugin, as well as a /event reload subcommand to reload the configuration. I will eventually move MessagesManager.java to a dedicated ConfigurationManager when I require more files, but for now it works fine. I also tidied up the formatting and pushed my changes to the github.