PurpurExtras icon indicating copy to clipboard operation
PurpurExtras copied to clipboard

Overhaul Modules - implement nicer command

Open TheRealRyGuy opened this issue 1 year ago • 8 comments

Changes so Far

  • Implement an @ModuleInfo annotation onto each Module, supplying description for eventual tooltips / nice tab competition of commands
  • All module implementations were refactored to org.purpurmc.purpurextras.modules.impl
  • ModuleManager now stores and handles all live Module manipulation and storage
  • AnvilSplitsMinecartsAndBoatsModule was split into a Minecarts and a Boats module
  • ShieldSettingsModule module was split into ShieldDamageReductionModule and ShieldCooldownModule
  • OpenIronDoorsModule was split into OpenIronDoorsWithHand and OpenIronTrapdoorsWithHand
  • Fixes smithing modules in the interim before they become data packs by just not requiring a template
  • PurpurExtrasModule is now abstract class with the following changes
    • inherits Listener
    • Now the only required method is String getConfigPath(), which will handle all registration logic
    • Given default logic, essentially allowing the only required things to implement being event handlers and #getConfigPath
    • Given config getters to reduce boilerplate, with the end goal of not needing PurpurExtras#getPurpurConfig calls outside of PurpurExtrasModule or even just not needing it and passing it as an instance
  • Implements a test to ensure all Modules are valid (they have a proper annotation)
    • This opens up the potential for module unit tests using MockBukkit
      • Needs to wait for this pr, probably will just put this into another PR
  • All Modules had the word Module removed from the class name
  • CommandAPI now handles all command work
  • Moved entire gameplay-settings config section to just settings.[module] - this should naturally port by itself

Module Port Progress

  • [x] AnvilChangesBlocksModule
  • [x] AnvilSplitsBoatsModule
  • [x] AnvilSplitsMinecartsModule
  • [x] BeeHiveLoreModule
  • [x] CancelPetDamageFromOwnerModule
  • [x] ChorusFlowerAlwaysDropsModule
  • [x] ColoredBossBarModule
  • [x] CreateSusBlocksModule
  • [x] DispenserBlocksModule
  • [x] EscapeCommandSlashModule
  • [x] ForceNametaggedForRidingModule
  • [x] FurnaceBurnTimeModule
  • [x] GrindstoneEnchantsBooksModule
  • [x] InvisibleItemFrameModule
  • [x] LightningTransformsMobsModule
  • [x] LootBlocksProtectionModule
  • [x] MobNoTargetModule
  • [x] NetherBuildHeightModule
  • [x] NoFallDamageWhil,eHavingJumpBoostModule
  • [x] OpenIronDoorsWithHandModule
  • [x] OpenIronTrapdoorsWithHandModule
  • [x] RespawnAnchorNeedsChargeModule
  • [x] RunFasterOnPathsModule
  • [x] ShieldCooldownModule
  • [x] ShieldDamageReductionModule
  • [x] SleepPercentageMessageModule
  • [x] SpawnerPlacementPermissionsModule
  • [x] StonecutterDamageModule
  • [x] UnlockAllRecipesModule
  • [x] UpgradeIronToDiamondsToolsModule
  • [x] UpgradeStoneToIronToolsModule
  • [x] UpgradeWoodToStoneToolsModule
  • [x] VoidTotemModule

TheRealRyGuy avatar Jun 20 '23 16:06 TheRealRyGuy