Skip to content
This repository was archived by the owner on Apr 30, 2026. It is now read-only.

Add category groups with independent renewal schedules - #111

Open
AerWyn81 wants to merge 2 commits into
Ordwen:masterfrom
AerWyn81:master
Open

Add category groups with independent renewal schedules#111
AerWyn81 wants to merge 2 commits into
Ordwen:masterfrom
AerWyn81:master

Conversation

@AerWyn81

@AerWyn81 AerWyn81 commented Feb 28, 2026

Copy link
Copy Markdown

Hi, I added a group system for a friend who uses this plugin to define several categories with different time frames. He has configured it but has not yet used it in production. If you like the idea, feel free to grab the code :)

Thanks!

AI generated:

Summary

  • Introduce Category Groups, allowing server administrators to assign quest categories to groups with independent
    renewal timers (e.g., easy/medium quests renew daily while hard quests renew weekly)
  • Add new PlaceholderAPI placeholders for per-group time remaining (%odailyquests_drawin_%) and per-group
    achieved count (%odailyquests_achieved_group_%)
  • Fix PersistentDataContainer.has() calls to use explicit PersistentDataType.STRING for broader Bukkit API
    compatibility

Changes

New files

  • CategoryGroupsLoader — Reads category_groups from config.yml; falls back to legacy mode (single global timer) when
    not defined
  • CategoryGroup — Data model representing a group of categories sharing a renewal schedule
  • GroupTimerTask — Per-group scheduled task that renews only the quests belonging to its group
  • TimerManager — Replaces the old TimerTask, manages multiple GroupTimerTask instances
  • QuestLoaderUtils — Utility for group-specific quest renewal while preserving other groups' quests
  • TimeRemain — Calculates remaining time until next renewal for a specific group

Modified files

  • PlayerQuests — Refactored to store timestamps and reroll counts per group instead of globally (backward-compatible)
  • ProgressionLoader — Extended to handle per-group timestamps and rerolls with legacy migration support
  • QuestsManager — Added selectRandomQuestsForGroup() for group-specific quest selection
  • PAPIExpansion — Registered new group-aware placeholders
  • config.yml — Added documented example configuration for category groups

Bugfix

  • BlockBreakListener, CustomBlockBreakListener, StructureGrowListener — Added explicit PersistentDataType.STRING
    parameter to PersistentDataContainer.has() calls

Backward Compatibility

Full backward compatibility is maintained. When no category_groups section is defined in config.yml, the plugin
operates in legacy mode with a single global renewal timer, identical to previous behavior. Deprecated methods in
PlayerQuests continue to work by operating across all groups.

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot

See analysis details on SonarQube Cloud

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant