Skip to content

Fixes #373 chest contents not being counted #374

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ private void processBlock(ChunkPair cp, int x, int y, int z, int globalX, int gl
processSlabs(blockData, m, belowSeaLevel);
processStackers(loc, m);
processUltimateStacker(m, loc, belowSeaLevel);
processChests(cp, blockData);
processChests(cp, cp.chunkSnapshot.getBlockType(x, y, z));
processSpawnerOrBlock(m, loc, belowSeaLevel);
}

Expand All @@ -524,9 +524,48 @@ private void processUltimateStacker(Material m, Location loc, boolean belowSeaLe
}
}

private void processChests(ChunkPair cp, BlockData blockData) {
if (addon.getSettings().isIncludeChests() && blockData instanceof Container) {
chestBlocks.add(cp.chunk);
private void processChests(ChunkPair cp, Material material) {
if (addon.getSettings().isIncludeChests()) {
switch (material) {
case CHEST:
case TRAPPED_CHEST:
case BARREL:
case HOPPER:
case DISPENSER:
case DROPPER:
case SHULKER_BOX:
case WHITE_SHULKER_BOX:
case ORANGE_SHULKER_BOX:
case MAGENTA_SHULKER_BOX:
case LIGHT_BLUE_SHULKER_BOX:
case YELLOW_SHULKER_BOX:
case LIME_SHULKER_BOX:
case PINK_SHULKER_BOX:
case GRAY_SHULKER_BOX:
case LIGHT_GRAY_SHULKER_BOX:
case CYAN_SHULKER_BOX:
case PURPLE_SHULKER_BOX:
case BLUE_SHULKER_BOX:
case BROWN_SHULKER_BOX:
case GREEN_SHULKER_BOX:
case RED_SHULKER_BOX:
case BLACK_SHULKER_BOX:
case BREWING_STAND:
case FURNACE:
case BLAST_FURNACE:
case SMOKER:
case BEACON: // has an inventory slot
case ENCHANTING_TABLE: // technically has an item slot
case LECTERN: // stores a book
case JUKEBOX: // stores a record
// ✅ It's a container
chestBlocks.add(cp.chunk);
break;
default:
// ❌ Not a container
break;
}

}
}

Expand Down
Loading