From 33a342561921aff17f4b56a120aee89b47cddd85 Mon Sep 17 00:00:00 2001 From: tastybento Date: Thu, 8 Apr 2021 16:49:18 -0700 Subject: [PATCH] Updated to support AdvancedChests 15.0 Fixes https://github.com/BentoBoxWorld/Level/issues/218 --- pom.xml | 2 +- .../bentobox/level/calculators/IslandLevelCalculator.java | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 037f7c5..47c1dee 100644 --- a/pom.xml +++ b/pom.xml @@ -205,7 +205,7 @@ com.github.DeadSilenceIV AdvancedChestsAPI - 1.4 + 1.6 diff --git a/src/main/java/world/bentobox/level/calculators/IslandLevelCalculator.java b/src/main/java/world/bentobox/level/calculators/IslandLevelCalculator.java index 8a5a0c9..0b40f43 100644 --- a/src/main/java/world/bentobox/level/calculators/IslandLevelCalculator.java +++ b/src/main/java/world/bentobox/level/calculators/IslandLevelCalculator.java @@ -35,7 +35,7 @@ import com.google.common.collect.Multisets; import us.lynuxcraft.deadsilenceiv.advancedchests.AdvancedChestsAPI; import us.lynuxcraft.deadsilenceiv.advancedchests.chest.AdvancedChest; -import us.lynuxcraft.deadsilenceiv.advancedchests.chest.ChestPage; +import us.lynuxcraft.deadsilenceiv.advancedchests.chest.gui.page.ChestPage; import world.bentobox.bentobox.BentoBox; import world.bentobox.bentobox.database.objects.Island; import world.bentobox.bentobox.util.Pair; @@ -430,7 +430,11 @@ public class IslandLevelCalculator { if (addon.isAdvChestEnabled()) { AdvancedChest aChest = AdvancedChestsAPI.getChestManager().getAdvancedChest(bs.getLocation()); if (aChest != null) { - aChest.getPages().stream().map(ChestPage::getItems).forEach(c -> c.forEach(this::countItemStack)); + aChest.getPages().stream().map(ChestPage::getItems).forEach(c -> { + for (ItemStack i : c) { + countItemStack(i); + } + }); continue; } }