Skip to content

Commit e7563b2

Browse files
authored
Merge pull request #333 from BentoBoxWorld/332_non-items_in_the_level_value_menu
Fixes an issue where items can be a block but not an item #332
2 parents 58bcf9e + db2ebac commit e7563b2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/main/java/world/bentobox/level/panels/ValuePanel.java

+2
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ private ValuePanel(Level addon,
5858
this.activeFilter = Filter.NAME_ASC;
5959
this.materialRecordList = Arrays.stream(Material.values()).
6060
filter(Material::isBlock).
61+
filter(Material::isItem). // Remove things like PITCHER_CROP
6162
filter(m -> !m.name().startsWith("LEGACY_")).
6263
filter(this.addon.getBlockConfig()::isNotHiddenBlock).
6364
map(material ->
@@ -584,6 +585,7 @@ private PanelItem createMaterialButton(ItemTemplateRecord template, TemplatedPan
584585
return null;
585586
}
586587

588+
@SuppressWarnings("deprecation")
587589
int index = this.pageIndex * slot.amountMap().getOrDefault(BLOCK, 1) + slot.slot();
588590

589591
if (index >= this.elementList.size())

0 commit comments

Comments
 (0)