Skip to content

Commit

Permalink
Hide generator filter button, if there are none generator with a requ…
Browse files Browse the repository at this point in the history
…ested type.
  • Loading branch information
BONNe committed Jul 15, 2020
1 parent a826a35 commit e9d5ea5
Showing 1 changed file with 20 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,26 @@ public void build()

panelBuilder.item(2, this.createButton(Action.SHOW_ACTIVE));

panelBuilder.item(4, this.createButton(Action.SHOW_COBBLESTONE));
panelBuilder.item(5, this.createButton(Action.SHOW_STONE));
panelBuilder.item(6, this.createButton(Action.SHOW_BASALT));
// Do not show cobblestone button if there are no cobblestone generators.
if (this.generatorList.stream().anyMatch(generator ->
generator.getGeneratorType().equals(GeneratorTierObject.GeneratorType.COBBLESTONE)))
{
panelBuilder.item(4, this.createButton(Action.SHOW_COBBLESTONE));
}

// Do not show stone if there are no stone generators.
if (this.generatorList.stream().anyMatch(generator ->
generator.getGeneratorType().equals(GeneratorTierObject.GeneratorType.STONE)))
{
panelBuilder.item(5, this.createButton(Action.SHOW_STONE));
}

// Do not show basalt if there are no basalt generators.
if (this.generatorList.stream().anyMatch(generator ->
generator.getGeneratorType().equals(GeneratorTierObject.GeneratorType.BASALT)))
{
panelBuilder.item(6, this.createButton(Action.SHOW_BASALT));
}

panelBuilder.item(8, this.createButton(Action.TOGGLE_VISIBILITY));

Expand Down

0 comments on commit e9d5ea5

Please sign in to comment.