Commit Graph

222 Commits

Author SHA1 Message Date
BONNe
4e2181f524 Add ability to complete challenge multiple times at once via command. 2019-06-16 20:43:07 +03:00
BONNe
526fe9ce81 Update flag Registering to newest addon API. 2019-06-16 20:25:02 +03:00
BONNe
071c6ca83a Improve item description management. 2019-06-16 20:22:42 +03:00
BONNe
68a26e4d28 Fix unstackable reward item displaying (#135) 2019-06-16 15:59:41 +03:00
BONNe
a7f9e01d61 Fix issue when unstackable items flood challenge description (#135) 2019-06-16 15:57:05 +03:00
BONNe
1a70ee3ad8 Fix issue with Entity and Block selecting GUIs.
Items were not selected unless player use right click. Not it will work correctly.
2019-06-16 11:43:05 +03:00
BONNe
fc4f3ca0b6 Add AutoSaver task for Challenges Addon.
Remove WorldSave event listener.
2019-06-12 22:56:52 +03:00
BONNe1704
94c3fd9fa4 Add Complete Wipe button in AdminGUI that allows to remove all Challenges Addon data from database.
This request comes from Discord.

It also mention to format DiskDrive to avoid ability to restore database, but it is not implemented yet. Will be implemented in future releases.
2019-06-05 12:30:48 +03:00
BONNe
a9abe32dbe Add a lot null-pointer checks and console errors about loading null-value element from database. 2019-06-03 23:14:12 +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
7e04f592ad Add custom admin message that informs about non-existing challenges in current world. 2019-05-19 13:29:02 +03:00
BONNe
c3f93fd797 Implement ability to select multiple Entities and Blocks in SelectBlockGUI and SelectEntityGUI. (#121)
Fix issue with unsplitted text in ManageBlocksGUI and ManageEntitiesGUI. (#121)
2019-05-18 00:01:03 +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
BONNe
9f8bf03708 Fix wrongly display message for required money in edit challenge gui (#119)
It showed required level instead of required money in element description.
2019-05-14 09:20:17 +03:00
BONNe1704
34ed09e768 Change json adapter factory to BentoBoxTypeAdapterFactory class. 2019-05-09 16:45:53 +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
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
d9486bbbdb Fix issue when Import Default Challenges Button did not work 2019-05-05 23:54:35 +03:00
BONNe
f18c8d0dff Remove NBT editing via NMS.
Use Dummy Mojang profiles with custom skulls, instead of editing NBT with NMS.
This will work on all versions instead of just with correct NMS hacks.
2019-05-05 17:10:10 +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
c702dd492b Implement Challenge Complete method. (#15)
Method currently will be available only via /[gamemode] challenges complete <challenge_id>.
2019-05-02 00:31:36 +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
ca5cfcc841 Add button in Challenges admin GUI that allows to import default challenges. 2019-05-01 23:14: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
f0b156de31 Improve addon reload method.
Now it will call also manager.reload() that clears cache and resets database links.
Improve ReloadCommand. Now it will be able to reload both ways (soft way that clears only cache, and hard way that reassigns database connection) with reload command.
2019-05-01 17:10:05 +03:00
BONNe
93da0c714c Implement ability to import/generate default.json file.
Remove old unnecessary methods.

Improve default.json challenges.
2019-05-01 12:46:54 +03:00
BONNe
0418e64125 Improve cache management.
Do not load players in memory, and unload them when they leave.
2019-04-27 00:13:02 +03:00
BONNe
ae384c433d Fix crashing build. 2019-04-26 23:45:34 +03:00
BONNe
c05015716f Enable Level and Money editing, even when required addons or plugins are not provided. 2019-04-26 21:27:52 +03:00
BONNe
a41859459f Implement ability to change text via Chat instead of AnvilGUI (#97).
It was necessary as Anvil has limited char input, while chat is almost unlimited.
2019-04-26 21:20:36 +03:00
BONNe
507c68d683 Add ability to edit string messages from StringListGUI via Chat. 2019-04-26 20:59:52 +03:00
BONNe
ec099cee9c Improve default challenge loading and creating.
Remove world name from challenge and challenge level ids when default file is created.
Reassign correct world name to unique id when challenges and levels are loaded.
2019-04-26 11:18:57 +03:00
BONNe1704
017147ff3f Improve and simplify default challenge data storing. 2019-04-25 18:21:10 +03:00
BONNe1704
188e86d546 Small code cleanup. 2019-04-25 11:42:04 +03:00
BONNe
5a5d2d7782 Create method that will generate default.json file from existing challenges in memory and from given world. 2019-04-25 00:48:29 +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
BONNe
4b233e2246 Start to implement default challenge loading.
Work in progress.
2019-04-24 07:45:05 +03:00
BONNe
f5cf5f5867 Add 2 new methods that detects if exist any challenge or level for given world. 2019-04-24 07:43:51 +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
f16417b630 Remove deprecated code 2019-04-23 20:47:46 +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
337defb452 Add protective code that prevents for setting search radius too large.
Now it will be caped at island radius.
2019-04-21 10:13:41 +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
BONNe
d5e75491e6 Add protective code in ChallengesManager to avoid getting challenges for non-existing world. #622 2019-04-02 09:14:23 +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
a957dc3a62 Update to BentoBox API 1.4.0 2019-03-29 00:42:51 +02:00