Commit Graph

66 Commits

Author SHA1 Message Date
tastybento 9d45f08fb1 Test coverage (#199)
* Test coverage for Challenges Command

* Added CompleteChallengeCommand test class

* Added Utils test class

* Added ChallengesGUI test class

* Fix code smells from sonarcloud analysis

* Added .gitignore

* Added Travis CI config file

* WIP ChallengesManager Test class

* Added ChallengesManager test class

* Removed debug

* Removed code smells.

* Added ChallengesAddon test class.

* Added onDisbale test

* Added new TryToComplete test class - WIP

Covers inventory challenges.

* Added Island Challenge entity tests to TryToComplete test class
2019-10-30 08:44:26 +02:00
tastybento 2aa437f071 English update (#193)
* Organized imports

* Minor code cleanup

* Updated English locale file.
2019-10-10 08:35:25 +03:00
BONNe 4e6d37cd90 Rework Challenge Object Data storing.
Requires MIGRATION if upgrade from older version.
2019-09-08 20:03:46 +03:00
BONNe 09036a28f0 Fix typos. 2019-09-06 18:45:55 +03:00
BONNe 3501db7002 Work on fixing some crashes related to incorrect data.
Optimize some lambda functions.
Add method that validates challenge's levels. If level does not exits in database, then challenge's level is set to FREE.
Fix crash with migration: Free challenges level does not require migration.

This relates to issue #181
2019-09-06 00:14:06 +03:00
BONNe a5022bea7a Improve Wipe Button behaviour.
Add 2 new buttons:
- User wipe - deletes all challenges addon player data.
- challenges wipe - deletes only challenges and levels.

By clicking on challenges wipe with right click, it will switch to compelte wipe, and via versa.
2019-09-05 12:19:05 +03:00
BONNe 40e34e7999 Add better challenge sorting in AdminGUI's
Now challenges will be sorted by their level order number, their order number, their unique id. All free challenges will always be at the start.
2019-09-04 09:30:11 +03:00
BONNe 707625a9da Fix the issue with incorrect unlock status. (#169)
The issue was that it never decrease challengesToDo with completed challenges from previous level, so only first level was unlocked. My mistake.
2019-09-02 09:05:18 +03:00
BuildTools 235da81ba0 Move Settings class to separate package. 2019-09-01 15:10:05 +03:00
BONNe 9d7a5db290 Fix issue when multiple completions were not saved correctly. 2019-08-28 11:50:16 +03:00
BuildTools b6e2133782 Fix issue with non-migrated levels.
#168
2019-08-25 00:07:44 +03:00
BONNe1704 76fb30be36 Add ability to migrate challenges from 0.5.0 - 0.7.5 data storage mode to new 0.8.0 format.
Part of implementing #105
2019-08-02 12:22:52 +03:00
BONNe1704 e9f9b1b8d5 Rework how challenges are stored.
This is old change that was declined (#105), but unfortunately it is necessary.
If every ID is based on world names, than addon cannot process "/" in it. It mean that worlds cannot be put into different folders.
This change will fix it, but it is not completed.

In progress.
There does not exist converter, so old data is not usable with this version.
2019-08-01 13:19:15 +03:00
BONNe1704 9681494c1c Fix issue with wrongly applied world name lowercasing.
It looks like, exist plugins that keep capital letters in world names. That mean, it is not correct to lowercasing any id's.
To fix it, now, instead of lowercasing, challenges should be case insensitive.
2019-07-24 13:43:29 +03:00
BuildTools b2f2c4a0bb Fix issue with corrupted world names after upgrading from 1.13 to 1.14. 2019-06-20 08:11:38 +03:00
BONNe1704 94c3fd9fa4 Add Complete Wipe button in AdminGUI that allows to remove all Challenges Addon data from database.
This request comes from Discord.

It also mention to format DiskDrive to avoid ability to restore database, but it is not implemented yet. Will be implemented in future releases.
2019-06-05 12:30:48 +03:00
BONNe a9abe32dbe Add a lot null-pointer checks and console errors about loading null-value element from database. 2019-06-03 23:14:12 +03:00
BONNe1704 6c10fcdca9 Fix NPE when opening ChallengesGUI (#116).
Add code that removes challenges level from all its challenges, if level is deleted.
Add protection code that shows admins that something is not correct if challenge level is not in database.
2019-05-09 11:22:01 +03:00
BONNe1704 b3ce8f52f5 Rework TryToComplete.
Implement ability to complete challenge multiple times at once.
To do it, I split everything in checking/removing/rewarding steps.

In checking step, it calculates if it is possible to complete with minimal requirements and then calculates maximal repeating factor.
In removing step, it removes everything that is necessary.
In rewarding step, it give rewards by necessary factor (multilayer).

I rework item/block/entity removing as factors may be influenced at the last element, so I improve everything by memory usage. Create necessary sets/lists/queues for faster access to already collected items.
2019-05-03 18:04:50 +03:00
BONNe f0b156de31 Improve addon reload method.
Now it will call also manager.reload() that clears cache and resets database links.
Improve ReloadCommand. Now it will be able to reload both ways (soft way that clears only cache, and hard way that reassigns database connection) with reload command.
2019-05-01 17:10:05 +03:00
BONNe 0418e64125 Improve cache management.
Do not load players in memory, and unload them when they leave.
2019-04-27 00:13:02 +03:00
BONNe ae384c433d Fix crashing build. 2019-04-26 23:45:34 +03:00
BONNe f5cf5f5867 Add 2 new methods that detects if exist any challenge or level for given world. 2019-04-24 07:43:51 +03:00
BONNe f16417b630 Remove deprecated code 2019-04-23 20:47:46 +03:00
BONNe d5e75491e6 Add protective code in ChallengesManager to avoid getting challenges for non-existing world. #622 2019-04-02 09:14:23 +03:00
BONNe1704 7fb5140427 Merge remote-tracking branch 'origin/develop' into develop 2019-02-22 13:00:37 +02:00
BONNe1704 ddd43d27e6 Add event callers when completing/resetting challenges (#92) 2019-02-22 12:53:38 +02:00
BONNe 5e2d3f9cc1 Fix null-pointer issue when trying to get first element of empty list. 2019-02-20 00:33:53 +02:00
BONNe 4c762dd269 Fix mistake in assumptions.
Island#uniqueId is not a UUID object.
2019-02-20 00:30:34 +02:00
BONNe1704 f38aee6ed8 Add lifeSpan to history data (#90).
In configuration add ability to add lifespan to history data. Data that will be older then configured values, will be removed from database.
This operation will happen only on player data save operation.
2019-02-19 18:30:12 +02:00
BONNe ffaffde734 Implement history data storing in ChallengesPlayerData object (#90).
- Add new variable "history" in ChallengesPlayerData.
- Add new methods in ChallengesManager that populates LogEntry and adds it to history variable.
- Add ability to enable/disable history storing in config (default: disabled).

- Fix issue when resetAllChallenges resets only caller challenges.
2019-02-18 11:28:07 +02:00
BONNe e6f2b9e0b7 Fix issue when reset all challenges does not work. 2019-02-18 09:18:34 +02:00
BONNe 4db59d6c19 Implement completed challenge storage by island (#55).
Rework methods that access to ChallengesPlayerData object. Methods that access to this object will be private and use UUID and String where possible.
Add public methods that could use previously mentioned methods to access ChallengesPlayerData object.
Implement these methods in all places.

Add ability to enable/disable island storage in config (no-gui for now).
Disable challenge GUI opening, if user does not have island.
2019-02-18 01:29:42 +02:00
BONNe1704 8f9aa78435 Fix confusing Select Challenge GUI. #86
Left Click on challenge will immediately return to previous panel (status = true), right click will select challenge.
2019-02-14 11:46:37 +02:00
BONNe1704 78fa459aa4 Implement ability to Fix player Data from GUI.
Fix issue when accept and decline buttons were with wrong names.
2019-02-13 16:17:44 +02:00
BONNe d33a763cbe Add single method that generates level description. 2019-02-12 15:36:16 +02:00
BONNe 0317d057ab Implement Challenge Description into SelectChallengeGUI.
Fix issue, when reset and complete user challenges showed all challenges, instead of mission one.
2019-02-12 13:03:13 +02:00
BONNe ab3275cd69 Rework Challenges Addon Language structure.
Reorganize structure.
Add missing translations.
Add colors.
2019-02-12 01:38:16 +02:00
BONNe 2bbb4e5c87 Fix issue when Challenges were not sorted by order number. 2019-02-10 17:00:30 +02:00
BONNe dff3608aa3 Fix null-pointer crash in island reset event. 2019-02-08 21:54:08 +02:00
BONNe 55578ab88c Fix null-pointer crash when loading invalid challenge level. 2019-02-05 09:23:49 +02:00
BONNe 94a54c2156 Fix null-pointer issue in ChallengeLevel creation. 2019-02-05 09:13:39 +02:00
tastybento 8becd9c08b Fixed reference for levels too 2019-01-30 08:03:23 -08:00
tastybento 7e0487113d Fixes import challenge name presentation
Previously was showing [challenge] instead of the challenge name. I
could change the locale text, but this works too.
2019-01-30 07:52:00 -08:00
BONNe 4b2f974b56 Add correct language references. 2019-01-26 00:12:42 +02:00
BONNe 089f09dd45 Implement ChallengeLevel completion rewards.
Add methods isLevelDone() and addCompletedLevel() to ChallengesPlayerData object.
Add isLevelCompleted(), validateLevelCompletion() and setLevelComplete() to ChallengesManager.

Add check in TryToComplete after completing challenges first time.
2019-01-25 00:54:21 +02:00
BONNe 1375d13ae4 Remove unused import. 2019-01-24 23:28:54 +02:00
BONNe 53da2d67c7 Fix logical error that opens all levels instead of locking them.
WaiverAmount should be reducer, not from whom reduces.
2019-01-23 19:50:15 +02:00
BONNe1704 590b3f114c Rework ChallengesManager.
Implement all methods that were only placeholders.
Remove all unnecessary old methods.
Implement new methods in all classes.

User and Admin command now opens new GUI.
2019-01-23 17:30:30 +02:00
BONNe1704 1bc6bb2b76 Move LevelStatus to utils, as it is more Util then necessary class object. 2019-01-23 16:34:37 +02:00