Commit Graph

30 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 0026cb7404 Separate all enums from Settings class into SettingsUtils. 2019-09-01 15:17:34 +03:00
BuildTools 235da81ba0 Move Settings class to separate package. 2019-09-01 15:10:05 +03:00
BONNe1704 8e0448eac7 Reintroduce Multiple Completions
Add [gamemode].complete.multiple permission that will allow/prevent to complete challenge multiple times at once.
Introduce new MultipleGUI that opens GUI with 5 buttons that allows to choose how many times challenge should be completed.
2019-08-28 16:55:18 +03:00
BuildTools 12dd740959 Merge remote-tracking branch 'origin/develop' into develop 2019-08-26 09:09:10 +03:00
BuildTools ac79fa5d56 Completely drop ability to import ASkyBlock challenges.
This option was not working properly and were used wrongly. To avoid that, importing challenges and player data will be handled by converter.
2019-08-26 09:08:56 +03:00
NotMyFault 36255d07a2 Fixing various typos (#172) 2019-08-26 07:55:22 +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
tastybento 9800da5973 Fixed permissions check to remove dot 2019-07-31 23:21:52 -07:00
BONNe1704 4f35f69960 Fix tabComplete method. 2019-07-24 14:34:33 +03:00
BONNe 5e0f0510d9 Add admin reset command, that allows to reset player challenges (#141)
Fix some bugs in complete command that did not display challenge list.
Add new lang parameters in en-US and lv-LV.
2019-06-23 16:51:49 +03:00
BONNe d4bcc1ee19 Fix admin message about setting up database objects. 2019-06-23 12:42:01 +03:00
BONNe 4527216dc2 Add ability for admins to complete challenge without gui. (#136) 2019-06-16 21:21:25 +03:00
BONNe 4e2181f524 Add ability to complete challenge multiple times at once via command. 2019-06-16 20:43:07 +03:00
BONNe 7e04f592ad Add custom admin message that informs about non-existing challenges in current world. 2019-05-19 13:29:02 +03:00
BONNe c8088f275d
Rework TryToComplete. (#109)
* 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.

* Add method that returns removed items, if somehow algorithm did not manage to remove all items.
Fix issue when removeItems method did not merge ItemStacks as they had different item amount.

Return and fix TryToCompleteTest.

* Implement Multiple Challenge Completion command and GUI. (#73)

/[gamemode] challenges complete [number] allows to complete challenges [number] amount (or less if not enough items)
Via GUI users can right click on challenge and if it is repeatable, then it will open AnvilGUI that accepts only numbers as input.
2019-05-06 12:10:02 +03:00
BONNe c702dd492b Implement Challenge Complete method. (#15)
Method currently will be available only via /[gamemode] challenges complete <challenge_id>.
2019-05-02 00:31:36 +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 93da0c714c Implement ability to import/generate default.json file.
Remove old unnecessary methods.

Improve default.json challenges.
2019-05-01 12:46:54 +03:00
BONNe1704 8649409cbb Add Single Challenges GUI. (#89)
Add ability to enable Single GUI in config.
Add configurable admin and player method (in config) that will open GUI with GameModes.
Add ability to define default player GameMode GUI.

Add new commands that will process config options.
2019-02-18 15:25:45 +02:00
BONNe1704 a91ec9805f Fix parameters help string. 2019-02-18 13:43:17 +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 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 f9b941059e Remove Deprecated Classes. 2019-02-18 00:32:51 +02:00
BONNe ab3275cd69 Rework Challenges Addon Language structure.
Reorganize structure.
Add missing translations.
Add colors.
2019-02-12 01:38:16 +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 59c0f6bfea Deprecate all classes that are not necessary anymore. 2019-01-23 16:08:18 +02:00
Florian CUNY 8f51ddb634 Moved everything to world.bentobox.challenges package 2018-12-30 14:31:26 +01:00