I have multiple listeners and commands and tons of functions. Leaving it in one file is becoming very messy. I need to separate my functions, commands, and listeners into different files in different folders. Right now if I separate my listeners, it no longer works. Dir sturcture is ROOT-> base.php ---------> Listener ______|______> break.php, place.php, command.php etc... ----------> Command _______|________> action1.php, action2.php etc... 1) How do I register my listeners to work 2) How would I call my cmd functions from command.php
For commands look at CommandMap::register($fallbackPrefix, Command $command) And for the listeners, it's not necessary to use new class for one event but I do create more than one event listener sometimes, https://github.com/PrimusLV/UltraFactions/tree/master/src/ultrafactions/handler