Commit Graph

44 Commits

Author SHA1 Message Date
BONNe 8a8124f36e Fixes crash when player in CREATIVE shift+clicks on INVENTORY challenge.
Limit completion time to 2, if player is in creative instead of Integer.MAX_VALUE

Fixes #330
2024-01-11 09:40:20 +02:00
BONNe 9953459e50 Add support for gamemode-specific translations.
This was a request from Floris
2023-03-31 11:12:08 +03:00
BONNe 431aaf46fc Add requirement-not-met-material and requirement-not-met-entity to display statistic required item on error. 2023-02-02 23:29:06 +02:00
BONNe ee8eaf8e84 Fixes a crash that prevented STATISTICS entity and material/item challenges to be completed. 2023-02-02 23:24:22 +02:00
BONNe 468232cabc Fixes a regex bug that replaced every [player] char instead of whole word. 2023-01-30 23:54:29 +02:00
BONNe e55503a9cf Add extra parameters for completion commands.
The 2 new parameters are:
   - [owner] - the owner of island.
   - [name] - the name of the island.

Fixes #304
2022-11-21 08:15:38 +02:00
BONNe 0475c798e1 Fixes missing error translation for not meeting statistics challenge value. 2022-11-05 04:09:43 +02:00
tastybento 9cccfa02ba Remove various code smells. 2022-04-16 15:54:49 -07:00
tastybento 6c0915544e Require non-nulls.
getInventory never returns null.
2022-04-16 15:27:35 -07:00
tastybento 10d8352f1c Fixed test failures. 2022-04-16 15:03:11 -07:00
BONNe e96e2c7e72
Fixes a bug with `-1` repeat-times
There was a bug that prevented the challenge to be completed if negative numbers were set in the "max-repeats" value.
2022-03-22 12:41:27 +02:00
BONNe 6bffb2088b
Fix a bug with completion broadcasting
Reported via Discord.
2022-02-20 12:08:58 +02:00
BONNe 7fbffbb6d2 Address some code quality reports from SonarCloud.
Most of the errors are just sanity checks, as the most of null-pointers were already checked in other ways.
2021-12-01 11:30:02 +02:00
BONNe 08d1561138 Implement an option to set which item type will ignore metadata per challenge.
Fixes #261
Fixes #252
2021-09-24 17:16:33 +03:00
BONNe bb5e861b30 Implement timeout respecting in challenges completion.
Implement timeout in GUI's.

Relates #71
2021-09-24 16:03:02 +03:00
BONNe 2bc71b5f52 Clean up Constants a bit. 2021-09-19 21:04:09 +03:00
BONNe 6fbc9d0676 Changes User#sendMessage to Utils#sendMessage
This allows add "prefix" to all messages send from Challenges addon.
2021-09-19 15:36:52 +03:00
BONNe edc6d1a5b6 Fixes ChallengesManager and Completer. 2021-09-18 13:01:35 +03:00
BONNe 703658eccc Move managers to a separate directory. 2021-08-14 21:43:42 +03:00
BONNe c63087c5af Create Statistic Requirement for Challenges addon.
Statistic requirement is a new type of challenge that is based on Statistic page for clients.
2021-08-14 19:25:04 +03:00
tastybento 6368585a57
Fixes bug with checking entities in nether and end (#219)
https://github.com/BentoBoxWorld/Challenges/issues/218

Adds test case to check for compliance.
2020-03-09 11:39:59 +02:00
tastybento 4cb4c7e3fb Fixes tests 2019-11-03 14:12:09 -08:00
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