Skip to content

Commit

Permalink
Fixes issue where players lost a box size increment.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tastybento committed Apr 26, 2021
1 parent eb361a8 commit 92d3a57
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/world/bentobox/boxed/AdvancementsManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ public boolean hasAdvancement(Island island, String advancement) {
* @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;
Expand Down

0 comments on commit 92d3a57

Please sign in to comment.