Commit Graph

9 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
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
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 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 4e2181f524 Add ability to complete challenge multiple times at once via command. 2019-06-16 20:43:07 +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