Updated to support AdvancedChests 15.0

Fixes https://github.com/BentoBoxWorld/Level/issues/218
This commit is contained in:
tastybento 2021-04-08 16:49:18 -07:00
parent 9bff48b7b0
commit 33a3425619
2 changed files with 7 additions and 3 deletions

View File

@ -205,7 +205,7 @@
<dependency> <dependency>
<groupId>com.github.DeadSilenceIV</groupId> <groupId>com.github.DeadSilenceIV</groupId>
<artifactId>AdvancedChestsAPI</artifactId> <artifactId>AdvancedChestsAPI</artifactId>
<version>1.4</version> <version>1.6</version>
</dependency> </dependency>
</dependencies> </dependencies>

View File

@ -35,7 +35,7 @@ import com.google.common.collect.Multisets;
import us.lynuxcraft.deadsilenceiv.advancedchests.AdvancedChestsAPI; import us.lynuxcraft.deadsilenceiv.advancedchests.AdvancedChestsAPI;
import us.lynuxcraft.deadsilenceiv.advancedchests.chest.AdvancedChest; 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.BentoBox;
import world.bentobox.bentobox.database.objects.Island; import world.bentobox.bentobox.database.objects.Island;
import world.bentobox.bentobox.util.Pair; import world.bentobox.bentobox.util.Pair;
@ -430,7 +430,11 @@ public class IslandLevelCalculator {
if (addon.isAdvChestEnabled()) { if (addon.isAdvChestEnabled()) {
AdvancedChest aChest = AdvancedChestsAPI.getChestManager().getAdvancedChest(bs.getLocation()); AdvancedChest aChest = AdvancedChestsAPI.getChestManager().getAdvancedChest(bs.getLocation());
if (aChest != null) { 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; continue;
} }
} }