addon-challenges/src/main/java/world/bentobox/challenges/commands
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
..
admin Improve addon reload method. 2019-05-01 17:10:05 +03:00
ChallengesCommand.java Implement Challenge Complete method. (#15) 2019-05-02 00:31:36 +03:00
ChallengesUserCommand.java Implement Challenge Complete method. (#15) 2019-05-02 00:31:36 +03:00
CompleteChallengeCommand.java Rework TryToComplete. (#109) 2019-05-06 12:10:02 +03:00