Never decrease island under the starting size

This commit is contained in:
evlad 2022-04-28 18:11:07 +02:00
parent 8b8dcfa236
commit 4b0c698eac

View File

@ -151,7 +151,8 @@ public class AdvancementsManager {
*/
public int checkIslandSize(Island island) {
// Island is always a minimum of 1 for free.
int shouldSize = getIsland(island).getAdvancements().stream().mapToInt(this::getScore).sum() + 1;
int defaultSize = addon.getSettings().getIslandProtectionRange();
int shouldSize = getIsland(island).getAdvancements().stream().mapToInt(this::getScore).sum() + defaultSize;
if (shouldSize < 1) {
// Boxes can never be less than 1 in protection size
return 0;