Commit Graph

37 Commits

Author SHA1 Message Date
tastybento
9cccfa02ba Remove various code smells. 2022-04-16 15:54:49 -07:00
BONNe
88215b6f0c Implement MetaData ignoring for rewards.
While required items had a metadata grouping, reward items did not have it. This will fix that.

Fixes #289
2022-01-04 21:45:34 +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
e9f37e8dee Replace GuiUtils and HeadLib to the PanelUtils library. 2021-10-02 14:04:30 +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
BONNe
bb5e861b30 Implement timeout respecting in challenges completion.
Implement timeout in GUI's.

Relates #71
2021-09-24 16:03:02 +03:00
BONNe
1b01995546 Add timeout for repeatable challenges.
Relates #71
2021-09-24 13:08:33 +03:00
BONNe
d1f15aed8b Remove unused adapters.
Updates Challenges and ChallengesLevel objects.
Add TypeMigrationAdapter that will fix issue with renamed challenge type.
2021-09-18 12:58:52 +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
BONNe
504c0b410e Add validation methods to challenge and challengeLevel.
Do not load into local cache invalid data. Add error warnings about it.
2020-07-26 12:10:35 +03:00
BONNe
ce14c20126 Update to BentoBox 1.14-SNAPSHOT API.
Implement new API features.
Replace deprecated methods.

Add compatibility layer with Minecraft 1.16 version.
2020-07-07 11:58:09 +03: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
BONNe
c7fe138d78 Add GUI for editing Challenge and Challenge Level lore messages.
Rework Lore message construction.
2019-09-03 09:03:21 +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
tastybento
a25796613f Changes to fit new API for database transition. (#114)
Config files must implement the ConfigObject interface now instead of
DataObject. They no longer need to specify uniqueId.
2019-05-09 16:24:01 +03:00
BONNe1704
b3ce8f52f5 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.
2019-05-03 18:04:50 +03:00
BONNe
0e89f1216d Make clone to public method. 2019-04-25 00:39:21 +03:00
BONNe
e6f151ef89 Implement clone methods for Challenge and ChallengeLevel objects. 2019-04-25 00:08:13 +03:00
BONNe1704
8d238a5789 Remove all deprecated code.
Remove Challenges.yml from resources, as old standard is outdated and there is no point to support it.
2019-04-11 12:49:43 +03: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
BONNe
ca2b7e2ec6 Add history log to ChallengesPlayerData object.
Add @NonNull annotation to all population methods.
2019-02-18 09:24:28 +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
tastybento
8becd9c08b Fixed reference for levels too 2019-01-30 08:03:23 -08:00
BONNe1704
48eb14b377 Restore original Challenges and ChallengeLevels objects.
(For backward compatibility)
2019-01-28 16:28:25 +02:00
BONNe
089f09dd45 Implement ChallengeLevel completion rewards.
Add methods isLevelDone() and addCompletedLevel() to ChallengesPlayerData object.
Add isLevelCompleted(), validateLevelCompletion() and setLevelComplete() to ChallengesManager.

Add check in TryToComplete after completing challenges first time.
2019-01-25 00:54:21 +02:00
BONNe
38fce9a4b0 Fix issue when Challenge and ChallengeLevel icons were stored with glowing effect and lore from admin panel.
This issue happened because PanelItem overwrites ItemStack metaData.
It is fixed by returning clone of icon element instead of returning actual icon.
2019-01-23 19:49:13 +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
9415452e33 Implement AnvilGUIs into EditLevelGUI for editing Text fields. 2019-01-19 17:41:27 +02:00
BONNe
1d0f090948 Implement existing GUIs in EditChallengeGUI.
Change Challenges.environment from list to set.
2019-01-19 17:27:41 +02:00
BONNe
818892e618 Create GUI that could edit challenges levels. 2019-01-16 22:23:12 +02:00
BONNe1704
016deec34c Create ChallengesEditGUI class that will allow to edit challenges via ingame GUI.
This GUI currently does not have ability to change values. It only contains skeleton for each option, that user should be able to change.
Add new parameters to Challenges class.
2019-01-16 19:25:01 +02:00
Florian CUNY
4c3026f3c1 Version 0.3.0 (BentoBox 1.0) 2019-01-05 11:17:03 +01:00