Skip to content

Commit 1b5933f

Browse files
authored
Merge pull request #375 from BentoBoxWorld/develop
Version 2.21.1
2 parents ae7969d + 04cdbe6 commit 1b5933f

File tree

2 files changed

+44
-5
lines changed

2 files changed

+44
-5
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
<!-- Do not change unless you want different name for local builds. -->
6868
<build.number>-LOCAL</build.number>
6969
<!-- This allows to change between versions. -->
70-
<build.version>2.21.0</build.version>
70+
<build.version>2.21.1</build.version>
7171
<sonar.projectKey>BentoBoxWorld_Level</sonar.projectKey>
7272
<sonar.organization>bentobox-world</sonar.organization>
7373
<sonar.host.url>https://sonarcloud.io</sonar.host.url>

src/main/java/world/bentobox/level/calculators/IslandLevelCalculator.java

Lines changed: 43 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ private void processBlock(ChunkPair cp, int x, int y, int z, int globalX, int gl
499499
processSlabs(blockData, m, belowSeaLevel);
500500
processStackers(loc, m);
501501
processUltimateStacker(m, loc, belowSeaLevel);
502-
processChests(cp, blockData);
502+
processChests(cp, cp.chunkSnapshot.getBlockType(x, y, z));
503503
processSpawnerOrBlock(m, loc, belowSeaLevel);
504504
}
505505

@@ -524,9 +524,48 @@ private void processUltimateStacker(Material m, Location loc, boolean belowSeaLe
524524
}
525525
}
526526

527-
private void processChests(ChunkPair cp, BlockData blockData) {
528-
if (addon.getSettings().isIncludeChests() && blockData instanceof Container) {
529-
chestBlocks.add(cp.chunk);
527+
private void processChests(ChunkPair cp, Material material) {
528+
if (addon.getSettings().isIncludeChests()) {
529+
switch (material) {
530+
case CHEST:
531+
case TRAPPED_CHEST:
532+
case BARREL:
533+
case HOPPER:
534+
case DISPENSER:
535+
case DROPPER:
536+
case SHULKER_BOX:
537+
case WHITE_SHULKER_BOX:
538+
case ORANGE_SHULKER_BOX:
539+
case MAGENTA_SHULKER_BOX:
540+
case LIGHT_BLUE_SHULKER_BOX:
541+
case YELLOW_SHULKER_BOX:
542+
case LIME_SHULKER_BOX:
543+
case PINK_SHULKER_BOX:
544+
case GRAY_SHULKER_BOX:
545+
case LIGHT_GRAY_SHULKER_BOX:
546+
case CYAN_SHULKER_BOX:
547+
case PURPLE_SHULKER_BOX:
548+
case BLUE_SHULKER_BOX:
549+
case BROWN_SHULKER_BOX:
550+
case GREEN_SHULKER_BOX:
551+
case RED_SHULKER_BOX:
552+
case BLACK_SHULKER_BOX:
553+
case BREWING_STAND:
554+
case FURNACE:
555+
case BLAST_FURNACE:
556+
case SMOKER:
557+
case BEACON: // has an inventory slot
558+
case ENCHANTING_TABLE: // technically has an item slot
559+
case LECTERN: // stores a book
560+
case JUKEBOX: // stores a record
561+
// ✅ It's a container
562+
chestBlocks.add(cp.chunk);
563+
break;
564+
default:
565+
// ❌ Not a container
566+
break;
567+
}
568+
530569
}
531570
}
532571

0 commit comments

Comments
 (0)