SaberLLC / Saber-Factions

The Ultimate Factions Plugin
GNU General Public License v3.0
124 stars 101 forks source link

Updates to mission code #224

Closed Gabo6480 closed 1 year ago

Gabo6480 commented 2 years ago

New: Implemented a MissionType Enum, for clarity and consistency between mission type comparisons. Refactored the MissionHandler code to make it easier to understand/maintain. Added BREED missions. Added TRIBUTE missions. Also added the /f missions tribute command where players can tribute items towards active TRIBUTE missions. Allowed more specificity in FISH and ENCHANT missions, allowing to select for a specific item to complete said missions. Replaced "Material" in MINE and PLACE missions with "Item" for consistency with other missions. Changed "EntityType" with "Entity" on entity related missions, such as KILL, BREED, TAME. Missing config value paths are now automatically added, based on the related resource in the plugin's files. Added an option to add deadlines to missions. Added a string that is added to cancellable missions' lore for clarity. Added a string that is added to "denied" missions' lore for clarity. Added an option to set an item material that "denied" missions will be replaced by. Added the possibility to charge currency/points for cancelling a mission. Added an option to allow "missions prestige", where after completing all missions in "DenyMoreThenOnce" mode, all missions will be "undenied" and a reward can be given. Faction Bank can now pay for upgrades.

Fixes: I don't know why, but Vault wasn't listed as a full depend. It is now. Creature types for 1.18+ weren't being properly registered on StartupParameter. Allowed for the declaration and use of "inifinte" chest upgrade levels. (The code was capping it at 3) Random mission assignation mode used to randomly check for available missions on a loop until it found an assignable one. Now is a straightforward random selection based on the assignable missions.