Commit Graph

48 Commits

Author SHA1 Message Date
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
BONNe1704
f75e4e080c Rework Challenge, ChallengeLevel and ChallengesPlayerData classes.
Challenge now will not know their world, as it is not necessary.
Remove ICON type, as it is useless.
Rename Level to Other, as under it will be not only level things.
Rename slot to order, as it was weird that users could define slot but not order. Order is easier to understand and use.

ChallengesLevel now knows all their levels.
Each challenge level only will be for single world.
Rename some variables.

ChallengesPlayerData was just adapted with changes in challenges and level classes.
2019-01-23 16:33:33 +02:00
BONNe1704
dba5a44461 Rename Challenges and ChallengeLevels classes. 2019-01-23 16:09:38 +02:00
BONNe
8711d7ad08 Rework Challenges Level Status checking.
In previous code challenges level status holds information for next level. It is fixed now, and current implementation allows to get everything that is needed.
2019-01-22 09:10:13 +02:00
BONNe
88f9d32862 Implement Reset and Complete Challenge for ListUsersGUI. 2019-01-19 18:29:08 +02:00
BONNe
c42652dde8 Implement add and remove challenge from challenge level panels in EditLevelGUI. 2019-01-19 18:02:19 +02:00
BONNe
1ecbac43bf Add last missing element in AdminGUI.
Now AdminGUI all icons are functional.
2019-01-18 19:26:03 +02:00
BONNe
870bf6d232 Implement ResetAllChallenges confirmation GUI to ListUsersGUI. 2019-01-18 19:13:39 +02:00
BONNe
13291b450c Implement ConfirmationGUIs in Delete operation for ListLevelsGUI and ListChallengesGUI. 2019-01-17 23:09:32 +02:00
BONNe1704
aaaf774952 Create ListChallengesGUI that allows to view all challenges and Edit or Remove them, depending on given mode. 2019-01-17 12:10:29 +02:00
BONNe1704
7060afd33d Create ListLevelsGUI class that allows to view all Levels.
It has 2 modes: edit mode and delete mode.
2019-01-17 12:04:16 +02:00
BONNe
818892e618 Create GUI that could edit challenges levels. 2019-01-16 22:23:12 +02:00
Florian CUNY
4c3026f3c1 Version 0.3.0 (BentoBox 1.0) 2019-01-05 11:17:03 +01:00
Florian CUNY
bf1890c392 Final harsh way to fix the ambiguity??? 2018-12-30 15:01:21 +01:00
Florian CUNY
11a86b1445 Using the hard way to fix the ambiguity 2018-12-30 14:53:58 +01:00
Florian CUNY
0041d07151 Fixed ambiguous lambda
IDEA wouldn't let me build the addon with the method reference :/
2018-12-30 14:42:54 +01:00
Florian CUNY
8f51ddb634 Moved everything to world.bentobox.challenges package 2018-12-30 14:31:26 +01:00