Fixes issue where players lost a box size increment.

All boxes start with a minimum size of 1. This was not being included in
the box size calculation, so players were erroneously losing one box
size when they logged in or teleported.
This commit is contained in:
tastybento 2021-04-25 18:08:36 -07:00
parent eb361a8579
commit 92d3a57362

View File

@ -150,7 +150,8 @@ public class AdvancementsManager {
* @return value of island size change. Negative values means the island range shrank.
*/
public int checkIslandSize(Island island) {
int shouldSize = getIsland(island).getAdvancements().stream().mapToInt(this::getScore).sum();
// Island is always a minimum of 1 for free.
int shouldSize = getIsland(island).getAdvancements().stream().mapToInt(this::getScore).sum() + 1;
if (shouldSize < 1) {
// Boxes can never be less than 1 in protection size
return 0;