MobEnhancer class is growing in size. There is no need to place all of our code within a single class. Our one class is extending the
JavaPlugin class as well as implementing both the
CommandExecutor interfaces. Our program may be easier to understand if we split these into three unique classes.
Create two new classes named
MobEnhancer will still be your main class, so it will still extend
JavaPlugin. However, the two new classes will implement
CommandExecutor, respectively. Move the appropriate methods to their new classes. That is,
onMobSpawn is an event handler, so it belongs within the
Listener class and
onCommand belongs within ...