Commit Graph

22 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
BONNe1704 fe3a18c459 Fix copy-paste issue that prevent from completing ISLAND type challenges. 2019-08-30 17:15:36 +03:00
BONNe 592a4c7310 Fix server crash when COOP player tried to complete ISLAND type challenge (#174).
The issue was that I used wrong command to check island owner. It is fixed.
Also added 2 protective code, that prevents from trying to select large areas for block searching.
2019-08-29 00:07:08 +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
BONNe ca5ff504f0 Add protection code in TryToComplete task, to avoid negative numbers in max completion times. 2019-06-16 20:46:12 +03:00
BONNe a7f9e01d61 Fix issue when unstackable items flood challenge description (#135) 2019-06-16 15:57:05 +03:00
BONNe1704 413429a091 Merge remote-tracking branch 'origin/develop' into develop 2019-05-16 10:30:46 +03:00
BONNe1704 9704ed32aa Fix issue when IslandTypeChallenges required blocks were cleared if completion was uncessesfull.
The issue was that it cleared wrong map. It must clear priority queue, but cleared required elements.
2019-05-16 10:30:01 +03:00
BONNe 3521495739 Fix issue when entities has not been removed on challenge completion (#118).
I forgot to populate entity queue :(
2019-05-14 09:55:34 +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
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 d60f20e394 Fix issue when Color codes did not work in opened Panels and Titles (#110)
These text element colors were not translated correctly.
Now it should work.
2019-05-04 11:16:41 +03:00
BONNe b24f7ebcb0 Implement title messages on first challenge/level completion (#108).
Add settings option that can enable/disable title message and its length.
Add ability to edit these settings via admin GUI.
Add ability to use some variables in title and subtitle in translation files.
2019-05-01 22:57:24 +03:00
BONNe 13faf478ee Use player BoundingBox to simplify code, instead of creating new boundingBox from player location. 2019-04-24 07:03:09 +03:00
BONNe 3b8b7129ad Fix issue when players could complete ISLAND type challenges near island border and complete, if outside border are required blocks. 2019-04-23 19:54:39 +03:00
BONNe e33db6ef29 Fix issue when users were able to complete Challenges with less items than required (#101).
This issue happens because there were an issue with detecting if enough items are in player inventory. Each new required item stack forgets abouts previous founding.
Also it marked challenge as completed after items were failed to remove.
2019-04-01 10:14:31 +03:00
BONNe ba5c972e5f Fix issue when Island and Other type challenges were not marked as completed. 2019-03-05 10:30:58 +02:00
BONNe 62189f0052 Merge flags into development build. 2019-02-22 19:47:36 +02:00
BONNe1704 7bb2ad09d3 Move TryToComplete from panel Package to tasks package. 2019-02-19 19:58:06 +02:00