Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion pom.xml
Original file line numberDiff line numberDiff line change
Expand Up@@ -67,7 +67,7 @@
<!-- Do not change unless you want different name for local builds. -->
<build.number>-LOCAL</build.number>
<!-- This allows to change between versions. -->
<build.version>2.19.0</build.version>
<build.version>2.19.1</build.version>
<sonar.projectKey>BentoBoxWorld_Level</sonar.projectKey>
<sonar.organization>bentobox-world</sonar.organization>
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
Expand Down
10 changes: 4 additions & 6 deletions src/main/java/world/bentobox/level/config/BlockConfig.java
Original file line numberDiff line numberDiff line change
Expand Up@@ -238,7 +238,9 @@ public Integer getValue(World world, Object obj) {
* @return true if hidden
*/
public boolean isHiddenBlock(Object obj) {
if (obj instanceof Material m) {
if (obj instanceof String s) {
return hiddenBlocks.contains(s);
} else if (obj instanceof Material m) {
return hiddenBlocks.contains(m.name());
}
return hiddenBlocks.contains(Material.SPAWNER.name());
Expand All@@ -250,11 +252,7 @@ public boolean isHiddenBlock(Object obj) {
* @return false if hidden
*/
public boolean isNotHiddenBlock(Object obj) {
if (obj instanceof Material m) {
return !hiddenBlocks.contains(m.name());
} else {
return !hiddenBlocks.contains(Material.SPAWNER.name());
}
return !isHiddenBlock(obj);
}

/**
Expand Down
1 change: 1 addition & 0 deletions src/main/java/world/bentobox/level/panels/ValuePanel.java
Original file line numberDiff line numberDiff line change
Expand Up@@ -135,6 +135,7 @@ private ValuePanel(Level addon,
this.activeFilter = Filter.NAME_ASC;

addon.getBlockConfig().getBlockValues().entrySet().stream().filter(en -> this.getIcon(en.getKey()) != null)
.filter(en -> addon.getBlockConfig().isNotHiddenBlock(en.getKey()))
.forEach(en -> blockRecordList
.add(new BlockRecord(en.getKey(), Objects.requireNonNullElse(en.getValue(), 0),
Objects.requireNonNullElse(addon.getBlockConfig().getLimit(en.getKey()), 0))));
Expand Down