Commit Graph

46 Commits

Author SHA1 Message Date
tastybento ec6b950304 Fix tests. 2024-03-10 18:44:57 -07:00
tastybento fe9e63f1c7 Fix tests for creative user inventory challenge completion 2024-01-13 08:23:41 -08:00
tastybento 56d7eb4259 Update to BentoBox 2.0.0
Had to ignore some tests because PowerMockito can't mock them for some
reason.
2023-11-12 13:23:22 -08:00
tastybento 1fdcfdd7ef Remove offending test. Was not that useful anyway. 2023-07-08 11:42:52 -07:00
tastybento 480ffd8eb4 Fixed ChallengesManagerTest 2023-06-04 10:49:16 -07:00
tastybento ddebdf0e62 Fixed ChallengesCommandTest 2023-06-04 10:41:18 -07:00
tastybento 82ba144038 Fixed CompleteChallengeCommandTest 2023-06-04 10:38:45 -07:00
tastybento 53f0a0cb37 Fixed TryToComplete test class 2023-06-04 10:31:52 -07:00
BONNe b1fa9a9da7
Release 1.2.0 (#317)
* Init 1.2.0 version

* Fixes #311 localization errors in zn-CN.

Original translation author translated `[]` placeholders which broke locale

* Init 1.2.0 version

* Edit some unfit translation (#312)

Edit some unfit translation

* Fixes a regex bug that replaced every [player] char instead of whole word.

* Fixes a crash that prevented STATISTICS entity and material/item challenges to be completed.

* Add requirement-not-met-material and requirement-not-met-entity to display statistic required item on error.

* Add locale of Chinese-Hong Kong (zh-HK) (#313)

Addition of locale updated to latest version

* Add ${argLine} to get jacoco coverage

* Updated Jacoco POM section

* Update build.yml

Java 17 for Surefire

* Updated pladdon annotations

* Add support for gamemode-specific translations.

This was a request from Floris

* Update ChallengesManagerTest methods with world parameter.

* Implement option that excludes undeployed challenges

The new option allows to toggle if undeployed challenges should be included in level completion count. Disabling option will not include these challenges for level completion.

Fixes #315

* Create plugin.yml (#316)

* Create plugin.yml

* Update pom.xml

* Update ChallengesPladdon.java

* Remove dependency to org.apache.commons

Replace org.apache.commons.lang.ArrayUtils to a default Java implementation.

---------

Co-authored-by: EpicMo <1982742309@qq.com>
Co-authored-by: JamesMCL44 <epicquarters@gmail.com>
Co-authored-by: tastybento <tastybento@users.noreply.github.com>
Co-authored-by: tastybento <tastybento@wasteofplastic.com>
2023-04-15 22:55:34 +03:00
BONNe de7172ef75 Update ChallengesManagerTest methods with world parameter. 2023-03-31 11:26:54 +03:00
BONNe 7ac1ab4a61
Prepare 1.0 Release (#287)
* Version 0.8.5

* Retranslated zh-CN.yml (#273)

* 50% completed.

* 60% completed.

* 63% completed.

* Completed.

* Change the indentation, some improvements.

Co-authored-by: zhangYi <apachezy@hotmail.com>

* Updated german language file (#278)

fixed double & and double whitespace

* Fixes a mistaken permission for completing multiple challenges at once.

* Fixes translated placeholders in PL translation.

Note: translation looks bad.

* Update CompleteChallengeCommandTest.java

* Upgrade to BentoBox 1.17 API changes.

Implement Pladdon functionality.
Compile against java 16 and Spigot 1.17

* Fix Java 16 compilation.

* Use BentoBox 1.17.0

* Update pom.xml

* Create Statistic Requirement for Challenges addon.

Statistic requirement is a new type of challenge that is based on Statistic page for clients.

* Switch to annotations instead of plugin.yml file.

* Move managers to a separate directory.

* Add mojang authLib instead of NMS.

* Rename classes to Selectors.

Split single and multiple item selectors for easier implementation.
Update proper locales.

* Implement customizable user panels.

Server owners can customize 3 panels:
- main panel
- gamemode selector
- multiple completions

Panel functions will be explained in docs later.

* Update all admin panels.

Admin panels will not contain better locales codding and easier-to-improve design.

Remove old and unused GUIs.

* Remove unused adapters.

Updates Challenges and ChallengesLevel objects.
Add TypeMigrationAdapter that will fix issue with renamed challenge type.

* Update commands.

Commands will now call correct GUI.

* Update Settings file.

Remove unused parts.

* Fixes ChallengesManager and Completer.

* Adds panel saving to the `/challenges/panels` directory.

* Updates locales file.

Complete rework of the locales file.
Very sorry translators :( no migration.

* Updates pom.xml

* Updates tests.

ChallengesGUITest is removed because GUI is removed.

* Update default.json

Split text into multiple lines.

* Create template YAML file.

This file format is for people who has an alergy with ingame GUI.

* Implements Template reading.

Add template loading via Admin Panel.
Improve LibraryPanel so it could find json and yml files.

* Improve coloring scheme a bit.

* Change settings file.

Add ability to change commands for addon.
Change default mode from player challenges to island challenges.

* Update Main addon class.

Move vault and level detection after everything is loaded.
Update command names.

* Update all commands.

Commands now will have an option to change their call values.

* Update default config value.

* Fixes #264

Challenges Menu will be opened only if player is in correct world.

* Changes User#sendMessage to Utils#sendMessage

This allows add "prefix" to all messages send from Challenges addon.

* Separate singe and multiple listings.

* Clean up Constants a bit.

* Add meta for items translations.

* Fix permission link.

* Translates color codes for database texts.

* Fixes a bug when global commands does not displays in tab-complete.

Remove DefaultsCommand.java as it is not used anymore.

* Fixes small bugs in translation.

* Remove unnecessary "admin" tag.

* Update default locale.

* Update latvian locale to the latest version.

* Implement multi-linguistic server support.

Now server owners can specify different name, description and reward text for each challenge and level via locales file.

Add showcase example.

* Comment out showcase translation.

* Update BentoBox version

* Update missing icons for blocks.

Some blocks cannot be displayed in GUI's, and were leaving empty spaces.
This replaces their icon with a close representative.

Fixes #286

* Add missing mob heads.

* Fixes illegal stack issues in default challenges.

#249

* Change from click-to-select to a proper next/previous page tooltip

* Add search field to the PagedSelectors.

Add missing tooltips.

* Change download icon from hopper to cobweb.

* Add missing tooltips to the CommonPagedPanel

* Add search button to the CommonPagedPanel.

Search button will allow to search elements if there are more than displayed elements.

* Add missing strings into locale.

* Reorder dependencies

The Mojang dependency was blocking out the needed Google common
packages.

* Prevent errors in TryToCompleteTest

Note - tests still fail.

* Fixed errors and tests for CompleteChallengeCommandTest

* Fixed ChallengesCommandTest tests

* Fixes tests

* Fix JavaDoc, Shade plugin settings

* Updated .gitignore

* Try different spigot API version

* Remove Vault repo because it is not needed.

* Excluded unnecessary files from shading.

* Fixes #253

Adds TeamKick and TeamLeave events to the reset check.
Do not reset challenges if data is stored per island. As in that case, they will already lose their data.

* Fixes #187

Add a new method that updates unlocked level list without changing active level. This method returns if last unlocked level was changed, and in that case it triggers whole gui rebuilding.

* Fixes #269

Disable waiver amount message for last challenge level.

* Add timeout for repeatable challenges.

Relates #71

* Implement timeout respecting in challenges completion.

Implement timeout in GUI's.

Relates #71

* Implement changing Timeout in the Challenge Edit GUI.

Relates #71

* Implement an option to set which item type will ignore metadata per challenge.

Fixes #261
Fixes #252

* Fixes failing unit-test

* Removed shade plugin from POM

* Replace GuiUtils and HeadLib to the PanelUtils library.

* Link templates to the docs.

* Remove unnecessary NMS dependency.

NMS code was used for Player Heads, but instead of NMS now it uses public mojang lib.

* 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.

* Fixes incorrect NEXT and PREVIOUS button descriptions.

Fixes #289

* Implement MetaData ignoring for rewards.

While required items had a metadata grouping, reward items did not have it. This will fix that.

Fixes #289

* Fix an issue when edit menu did not display item amount.

* Update lv translation.

* Fixes some small bugs with translation potion base effect.

There was an issue that it tried to translate extra effects and ignored main one.

Relates to #290

* Fix a bug with completion broadcasting

Reported via Discord.

* Update pom.xml

* 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.

* Improve equal item listing.

Change when items should be grouped.
Instead of relaying strictly from ignoreMetaData set, now try to group equal elements without durability check, and use set only if that fails.

* Update German translation (#295)

* Translate de.yml via GitLocalize

* Translate de.yml via GitLocalize

* Translate de.yml via GitLocalize

Co-authored-by: Patrick <patrick.wassmuth@gmx.de>
Co-authored-by: Michael F <unhappyangel83@googlemail.com>
Co-authored-by: DAge030 <dage030@web.de>

* Fix NPEs when running tests.

Note that there are still test failures, but these are assertions and
not errors.

* Fix error in test class.

Note this does not fix the failing assertion.

* Fix failing test. Make player default to being on island.

* Fixed test failures.

* Avoid potential call with a null parameter to User.getInstance

* Check for null world

* Null check

* Added null check

* Require non-nulls.

getInventory never returns null.

* Remove various code smells.

Co-authored-by: tastybento <tastybento@wasteofplastic.com>
Co-authored-by: apachezy <50116371+apachezy@users.noreply.github.com>
Co-authored-by: zhangYi <apachezy@hotmail.com>
Co-authored-by: Qumoo <76853697+Qumoo@users.noreply.github.com>
Co-authored-by: tastybento <tastybento@users.noreply.github.com>
Co-authored-by: gitlocalize-app[bot] <55277160+gitlocalize-app[bot]@users.noreply.github.com>
Co-authored-by: Patrick <patrick.wassmuth@gmx.de>
Co-authored-by: Michael F <unhappyangel83@googlemail.com>
Co-authored-by: DAge030 <dage030@web.de>
2022-05-06 19:51:54 +03:00
tastybento 9cccfa02ba Remove various code smells. 2022-04-16 15:54:49 -07:00
tastybento 10d8352f1c Fixed test failures. 2022-04-16 15:03:11 -07:00
tastybento aff6fcec22 Fix failing test. Make player default to being on island. 2022-04-16 14:49:17 -07:00
tastybento 80f748070e Fix error in test class.
Note this does not fix the failing assertion.
2022-04-16 14:42:52 -07:00
tastybento 2263dae70c Fix NPEs when running tests.
Note that there are still test failures, but these are assertions and
not errors.
2022-04-16 14:36:05 -07:00
BONNe 13924a3011 Fixes failing unit-test 2021-09-24 17:19:58 +03: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
tastybento 877c8d2eff Fixes tests 2021-09-23 19:38:10 -07:00
tastybento 7b8cab3689 Fixed ChallengesCommandTest tests 2021-09-23 17:35:26 -07:00
tastybento c21cae91e1 Fixed errors and tests for CompleteChallengeCommandTest 2021-09-23 17:22:16 -07:00
tastybento 018455f8f6 Prevent errors in TryToCompleteTest
Note - tests still fail.
2021-09-23 17:12:59 -07:00
BONNe 670513e37a Update all commands.
Commands now will have an option to change their call values.
2021-09-19 15:02:15 +03:00
BONNe 29565538c3 Implements Template reading.
Add template loading via Admin Panel.
Improve LibraryPanel so it could find json and yml files.
2021-09-18 21:37:30 +03:00
BONNe 3a3af0e2c8 Updates tests.
ChallengesGUITest is removed because GUI is removed.
2021-09-18 13:04:43 +03:00
BONNe 703658eccc Move managers to a separate directory. 2021-08-14 21:43:42 +03:00
tastybento 95edafd04f
Update CompleteChallengeCommandTest.java 2021-05-12 17:57:44 -07:00
tastybento c26b27afa1 Clean up databbase_backup after tests. 2021-03-07 11:00:39 -08:00
BONNe 7215e88706 Ignore testBuildNoChallenges() test as it cannot be tested with current approach. 2020-12-05 18:16:00 +02:00
BONNe 3e542036a0 Fixes failing UnitTests for Challenges Addon. 2020-11-05 09:24:06 +02:00
tastybento 7060799bcc
Rewards lore (#248)
* Ignore failing test because method now doesn't do anything.

* Add spaces after color codes to make gitLocalize more accurate.

* Added a rewards title and made the lore prettier.
2020-07-12 14:43:15 +03:00
tastybento 6203b92f2e Fixed tests. 2020-05-09 12:51:13 -07:00
tastybento bda02fe55b Fix broken tests due to placeholder additions.
b5ecffb725
2958ca8b6c
2020-04-06 17:20:53 -07: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 deab2d3530 Fix failing Tests.
These tests failed because in I added Server version check in ChallengesAddon class.
2019-05-24 09:39:40 +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 bf801a67fc Disable TryToCompleteTest as it will fail now.
Need to review and fix this test, as TryToComplete now uses Item.isSimilar() method that is not working outside bukkit environment.
2019-04-24 09:02:11 +03:00
BONNe1704 7bb2ad09d3 Move TryToComplete from panel Package to tasks package. 2019-02-19 19:58:06 +02:00
BONNe1704 f9b941059e Remove Deprecated Classes. 2019-02-18 00:32:51 +02:00
BONNe1704 dba5a44461 Rename Challenges and ChallengeLevels classes. 2019-01-23 16:09:38 +02:00
BONNe1704 59c0f6bfea Deprecate all classes that are not necessary anymore. 2019-01-23 16:08:18 +02:00
Florian CUNY 4c3026f3c1 Version 0.3.0 (BentoBox 1.0) 2019-01-05 11:17:03 +01:00
Florian CUNY 8f51ddb634 Moved everything to world.bentobox.challenges package 2018-12-30 14:31:26 +01:00