Skip to content

Commit

Permalink
Merge pull request #333 from BentoBoxWorld/332_non-items_in_the_level…
Browse files Browse the repository at this point in the history
…_value_menu

Fixes an issue where items can be a block but not an item #332
  • Loading branch information
tastybento authored Sep 18, 2024
2 parents 58bcf9e + db2ebac commit e7563b2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/java/world/bentobox/level/panels/ValuePanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ private ValuePanel(Level addon,
this.activeFilter = Filter.NAME_ASC;
this.materialRecordList = Arrays.stream(Material.values()).
filter(Material::isBlock).
filter(Material::isItem). // Remove things like PITCHER_CROP
filter(m -> !m.name().startsWith("LEGACY_")).
filter(this.addon.getBlockConfig()::isNotHiddenBlock).
map(material ->
Expand Down Expand Up @@ -584,6 +585,7 @@ private PanelItem createMaterialButton(ItemTemplateRecord template, TemplatedPan
return null;
}

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

if (index >= this.elementList.size())
Expand Down

0 comments on commit e7563b2

Please sign in to comment.