Skip to content

Commit

Permalink
Update BiomeSelector with proper biome groups.
Browse files Browse the repository at this point in the history
  • Loading branch information
BONNe committed Jan 8, 2022
1 parent 5f42f11 commit f78f11a
Showing 1 changed file with 47 additions and 20 deletions.
67 changes: 47 additions & 20 deletions src/main/java/world/bentobox/biomes/panels/util/BiomeSelector.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,15 @@ protected void build()

PanelUtils.fillBorder(panelBuilder, Material.BLUE_STAINED_GLASS_PANE);

panelBuilder.item(0, this.buildButton(Mode.LUSH));
panelBuilder.item(1, this.buildButton(Mode.DRY));
panelBuilder.item(0, this.buildButton(Mode.TEMPERATE));
panelBuilder.item(1, this.buildButton(Mode.WARM));
panelBuilder.item(2, this.buildButton(Mode.COLD));
panelBuilder.item(3, this.buildButton(Mode.SNOWY));
panelBuilder.item(4, this.buildButton(Mode.OCEAN));
panelBuilder.item(4, this.buildButton(Mode.AQUATIC));
panelBuilder.item(5, this.buildButton(Mode.NETHER));
panelBuilder.item(6, this.buildButton(Mode.THE_END));
panelBuilder.item(7, this.buildButton(Mode.NEUTRAL));
panelBuilder.item(8, this.buildButton(Mode.UNUSED));
panelBuilder.item(8, this.buildButton(Mode.CAVE));

this.populateElements(panelBuilder, this.filterElements);

Expand Down Expand Up @@ -138,20 +138,20 @@ protected void updateFilters()
this.filterElements.removeIf(biome -> {
switch (this.mode)
{
case LUSH -> {
return !Utils.isLushBiome(biome);
case TEMPERATE -> {
return !Utils.isTemperateBiome(biome);
}
case DRY -> {
return !Utils.isDryBiome(biome);
case WARM -> {
return !Utils.isWarmBiome(biome);
}
case COLD -> {
return !Utils.isColdBiome(biome);
}
case SNOWY -> {
return !Utils.isSnowyBiome(biome);
}
case OCEAN -> {
return !Utils.isOceanBiome(biome);
case AQUATIC -> {
return !Utils.isAquaticBiome(biome);
}
case NETHER -> {
return !Utils.isNetherBiome(biome);
Expand All @@ -162,8 +162,8 @@ protected void updateFilters()
case NEUTRAL -> {
return !Utils.isNeutralBiome(biome);
}
case UNUSED -> {
return !Utils.isUnusedBiome(biome);
case CAVE -> {
return !Utils.isCaveBiome(biome);
}
default -> {
return false;
Expand Down Expand Up @@ -248,15 +248,15 @@ private PanelItem buildButton(Mode filterMode)
description.add(this.user.getTranslation(Constants.TIPS + "click-to-filter"));

ItemStack icon = switch (filterMode) {
case LUSH -> new ItemStack(Material.SUNFLOWER);
case DRY -> new ItemStack(Material.SAND);
case TEMPERATE -> new ItemStack(Material.SUNFLOWER);
case WARM -> new ItemStack(Material.SAND);
case COLD -> new ItemStack(Material.GRAVEL);
case SNOWY -> new ItemStack(Material.SNOW_BLOCK);
case OCEAN -> new ItemStack(Material.TROPICAL_FISH);
case AQUATIC -> new ItemStack(Material.TROPICAL_FISH);
case NETHER -> new ItemStack(Material.NETHERRACK);
case THE_END -> new ItemStack(Material.END_STONE);
case NEUTRAL -> new ItemStack(Material.STRUCTURE_VOID);
case UNUSED -> new ItemStack(Material.BARRIER);
case CAVE -> new ItemStack(Material.BARRIER);
};

return new PanelItemBuilder().
Expand Down Expand Up @@ -285,15 +285,42 @@ private PanelItem buildButton(Mode filterMode)
*/
private enum Mode
{
LUSH,
DRY,
/**
* Temperate mode.
*/
TEMPERATE,
/**
* Warm mode.
*/
WARM,
/**
* Cold mode.
*/
COLD,
/**
* Snowy mode.
*/
SNOWY,
OCEAN,
/**
* Aquatic mode.
*/
AQUATIC,
/**
* Nether mode.
*/
NETHER,
/**
* The end mode.
*/
THE_END,
/**
* Neutral mode.
*/
NEUTRAL,
UNUSED
/**
* Cave mode.
*/
CAVE
}


Expand Down

0 comments on commit f78f11a

Please sign in to comment.