static void showChestInfo(ProbeMode mode, IProbeInfo probeInfo, World world, BlockPos pos, IProbeConfig config) {
List<ItemStack> stacks = null;
IProbeConfig.ConfigMode chestMode = config.getShowChestContents();
if (chestMode == IProbeConfig.ConfigMode.EXTENDED && (Config.showSmallChestContentsWithoutSneaking > 0 || !Config.getInventoriesToShow().isEmpty())) {
if (Config.getInventoriesToShow().contains(world.getBlockState(pos).getBlock().getRegistryName())) {
chestMode = IProbeConfig.ConfigMode.NORMAL;
} else if (Config.showSmallChestContentsWithoutSneaking > 0) {
stacks = new ArrayList<>();
int slots = getChestContents(world, pos, stacks);
if (slots <= Config.showSmallChestContentsWithoutSneaking) {
chestMode = IProbeConfig.ConfigMode.NORMAL;
}
}
} else if (chestMode == IProbeConfig.ConfigMode.NORMAL && !Config.getInventoriesToNotShow().isEmpty()) {
if (Config.getInventoriesToNotShow().contains(world.getBlockState(pos).getBlock().getRegistryName())) {
chestMode = IProbeConfig.ConfigMode.EXTENDED;
}
}
if (Tools.show(mode, chestMode)) {
if (stacks == null) {
stacks = new ArrayList<>();
getChestContents(world, pos, stacks);
}
if (!stacks.isEmpty()) {
boolean showDetailed = Tools.show(mode, config.getShowChestContentsDetailed()) && stacks.size() <= Config.showItemDetailThresshold;
showChestContents(probeInfo, world, pos, stacks, showDetailed);
}
}
}