Shopkeepers

Shopkeepers

2M Downloads

Command to reload only the config, not the shopkeeper data

blablubbabc opened this issue ยท 0 comments

commented

Reloading the shopkeepers plugin comes with a certain overhead due to having to reload all the shop data (TODO do some testing; a user reported that reloading ~550 shops takes "a few seconds"). But in many cases, the shopkeepers plugin is only reloaded with the goal to apply config changes.

Idea: Add a /shopkeeper reload config command that only reloads the config.
Priority: Low, because reloading is not expected to occur often. Even with several hundred shopkeepers, a brief impact of a few seconds is tolerable (as long as we stay below the 10 seconds crash detection limit).

Problem: There are currently a lot of components that only read the settings once, during initialization. I.e. they would need to be adapted to react to dynamic config changes.

  • Container protection and item movements
  • deleteShopkeeperOnBreakContainer
  • EventDebugger
  • Messages
  • Plugin metrics
  • playerShopkeeperInactiveDays
  • State captured by active tasks (TODO check) or open UIs (editor, trading, etc.)
  • Citizen shops and related startup tasks and shopkeeper data migration (snapshotsSaveCitizenNpcData)
  • Shopkeeper spawning: bypassSpawnBlocking, enabled shop object types
  • Shopkeeper behavior: Gravity, tick perdiod, activation range, silenceLivingShopEntities, villager trading and ambient sounds
  • Shopkeeper names: Nameplate related settings
  • saveInstantly : Periodic save task
  • Trade logging and related settings
  • Trade notifications
  • Settings related to normal villagers: blockVillagerSpawns, blockWanderingTraderSpawns, disableZombieVillagerCuring

Another idea could be to distribute some work across several ticks. E.g. load the shop data delayed.
However, we still need to at least load the save file in one go. And we usually want to avoid that players need to wait for shopkeepers to show up after reloads.
And the server treats the plugin loading phase specifically, applying exceptions to the 10 seconds server crash rule.