Commit Graph

50 Commits

Author SHA1 Message Date
BONNe
7f615018a0 Rewrite action display logic.
There were no filters for action displaying. All actions were active from the start, even if they are not possible.
I added action filter that will remove impossible actions:
    - COMPLETE_MAX and MULTIPLE_PANEL for non-repeatable challenge,
    - already completely finished challenge.
Fixes #307
2022-11-21 07:59:53 +02:00
BONNe
71e0029d46 Fixes incorrect NEXT and PREVIOUS button descriptions.
Fixes #289
2022-01-04 21:38:52 +02: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
aa0336d62a 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.
2021-09-24 12:26:44 +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
670513e37a Update all commands.
Commands now will have an option to change their call values.
2021-09-19 15:02:15 +03:00
BONNe
3ee89af5df Update all admin panels.
Admin panels will not contain better locales codding and easier-to-improve design.

Remove old and unused GUIs.
2021-09-18 12:56:44 +03:00
BONNe
09a30f00db Implement customizable user panels.
Server owners can customize 3 panels:
- main panel
- gamemode selector
- multiple completions

Panel functions will be explained in docs later.
2021-09-18 12:54:17 +03:00
BONNe
703658eccc Move managers to a separate directory. 2021-08-14 21:43:42 +03:00
BONNe
227138a689 Fixes a mistaken permission for completing multiple challenges at once. 2021-04-16 20:38:32 +03:00
BONNe
93f07b95ed Fixes #263
Thanks to @sgdc3 who found my mistake with checking if challenges exists when opening GUI.
2020-11-29 00:25:02 +02: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
449890def5 Drop Depricated 1.13 SIGN object.
Update to 1.7 BentoBox.
2019-09-08 20:15:30 +03:00
BONNe
643c5e8f7c Add an option to hide undeployed challenges from challenge list (#175)
Added new config option "gui-settings.undeployed-view-mode" with 3 values
- 'VISIBLE' - all challenges are visible
- 'HIDDEN' - only deployed challenges are visible
- 'TOGGLEABLE' - users will be able to choose option for themself (not implemented)

Implement functionality in ChallengesGUI, where if option hidden is set, then all undeployed challenges are removed.
Implement ability to edit this option via admin Settings panel.
2019-09-05 15:52:14 +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
c516d53907 Update to v1.6.0 version.
Remove AnvilGUI, as it is broken. Replaced with Spigot Conversation API.
Remove lore-config from GUI (broken).
Remove RIGHT_CLICK to complete multiple times (broken).
2019-08-25 22:43:15 +03:00
BONNe
330034ea8e Add SIGN_MATERIAL constant in ChallengesAddon which value depends on Minecraft version.
This will allow to drop down 1.14 branch.
2019-05-20 08:28:35 +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
a2f0765de1 Add proper message when user opens challenges gui in world without a challenges. 2019-05-01 23:18:12 +03:00
BONNe
a957dc3a62 Update to BentoBox API 1.4.0 2019-03-29 00:42:51 +02:00
BONNe1704
0f32e0e3d4 Implement configurable locked level icon (#98)
- Implement LockedIcon in ChallengeLevel (can be null)
- Implement defaultLockedIcon in Settings (can be overwritten by ChallengeLevel)
- Reformat Config File. !!!
2019-02-25 12:09:26 +02:00
BONNe1704
7bb2ad09d3 Move TryToComplete from panel Package to tasks package. 2019-02-19 19:58:06 +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
BONNe
31b2fed8bc Implement remove one time challenge option in ChallengesGUI. 2019-02-12 16:24:41 +02:00
BONNe
810d57e042 Implement complete glow option. 2019-02-12 16:18:21 +02:00
BONNe
250aea2f27 Fix issue when active level was not displayed.
This was implemented as in ASkyBlock, but it is not necessary. Better to display active level.
2019-02-12 15:48:27 +02:00
BONNe
d33a763cbe Add single method that generates level description. 2019-02-12 15:36:16 +02:00
BONNe
0317d057ab Implement Challenge Description into SelectChallengeGUI.
Fix issue, when reset and complete user challenges showed all challenges, instead of mission one.
2019-02-12 13:03:13 +02:00
BONNe
7778426b1e Implement Challenge Description customization.
Admins now can define Order of elements in challenge description, and remove elements, if they are not necessary.
2019-02-12 12:24:00 +02:00
BONNe
ab3275cd69 Rework Challenges Addon Language structure.
Reorganize structure.
Add missing translations.
Add colors.
2019-02-12 01:38:16 +02:00
BONNe
b2201ec48d Add ability to specify Lore line length via Settings. 2019-02-11 15:29:19 +02:00
BONNe
fa03ea0669 Fix issue when users could open challenges gui, even if challenges in that world does not exist (#69) 2019-02-05 08:43:58 +02:00
BONNe
21cf82fe8e Fix slot-index issue.
NextSlotIndex value were not updated.
2019-02-02 22:22:04 +02:00
tastybento
c9909f4b76 Refreshes challenge icon after completion
https://github.com/BentoBoxWorld/Challenges/issues/60
2019-01-29 15:03:41 -08:00
BONNe
9918752589 Fix issue when completing challenge was not displayed in ChallengesGUI. (#60) 2019-01-28 21:01:26 +02:00
BONNe
5bea79d263 Remove Light Gray Glass Panes at the end of each row in ChallengesGUI. 2019-01-27 13:10:43 +02:00
BONNe
586b076860 Fix issues when Description were to long to fit in window. 2019-01-26 14:46:03 +02:00
BONNe
4b2f974b56 Add correct language references. 2019-01-26 00:12:42 +02:00
BONNe
087ee07f45 Add glowing effect on challenge level icons that are completed. 2019-01-25 00:59:06 +02:00
BONNe
52b02e06bf Rework TryToComplete class.
Remove unnecessary code.
2019-01-24 23:29:56 +02:00
BONNe
e68c5b2773 Fix issue, when top command was not displayed in Description. 2019-01-23 21:50:10 +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
1bc6bb2b76 Move LevelStatus to utils, as it is more Util then necessary class object. 2019-01-23 16:34:37 +02:00
BONNe1704
f75e4e080c Rework Challenge, ChallengeLevel and ChallengesPlayerData classes.
Challenge now will not know their world, as it is not necessary.
Remove ICON type, as it is useless.
Rename Level to Other, as under it will be not only level things.
Rename slot to order, as it was weird that users could define slot but not order. Order is easier to understand and use.

ChallengesLevel now knows all their levels.
Each challenge level only will be for single world.
Rename some variables.

ChallengesPlayerData was just adapted with changes in challenges and level classes.
2019-01-23 16:33:33 +02:00
BONNe1704
dba5a44461 Rename Challenges and ChallengeLevels classes. 2019-01-23 16:09:38 +02:00
BONNe
20dfc6a760 Perform LevelStatus improvements in ChallengesGUI. 2019-01-22 09:12:12 +02:00
BONNe
ce794d771c Create ChallengesGUI that will be opened for users. 2019-01-21 00:01:26 +02:00