Skip to content

Commit

Permalink
Fix some warnings in EditBiomePanel
Browse files Browse the repository at this point in the history
  • Loading branch information
BONNe committed Nov 1, 2021
1 parent 72f64aa commit 34b921c
Showing 1 changed file with 38 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@
public class EditBiomePanel extends CommonPanel
{
/**
* {@inheritDoc}
* @param biome Object that must be edited.
* Instantiates a new Edit biome panel.
*
* @param parentPanel the parent panel
* @param biome the biome
*/
private EditBiomePanel(CommonPanel parentPanel, BiomesObject biome)
{
Expand Down Expand Up @@ -62,7 +64,7 @@ public static void open(CommonPanel parentPanel, BiomesObject biome)
@Override
protected void build()
{
// PanelBuilder is a BentoBox API that provides ability to easy create Panels.
// PanelBuilder is a BentoBox API that provides ability to easily create Panels.
PanelBuilder panelBuilder = new PanelBuilder().
user(this.user).
name(this.user.getTranslation(Constants.TITLE + "edit-biome",
Expand Down Expand Up @@ -187,8 +189,6 @@ private PanelItem createButton(Action button)
return true;
};

glow = false;

description.add("");
description.add(this.user.getTranslation(Constants.TIPS + "click-to-change"));

Expand All @@ -197,12 +197,7 @@ private PanelItem createButton(Action button)
description.add(this.user.getTranslation(Constants.TIPS + "shift-click-to-reset"));
}

return new PanelItemBuilder().
icon(icon).
name(name).
description(description).
clickHandler(clickHandler).
build();
glow = false;
}
case COST -> {
description.add(this.user.getTranslation(reference + "value",
Expand Down Expand Up @@ -446,17 +441,17 @@ private PanelItem createButton(Action button)
if (this.biome.isValid())
{
this.biome.setDeployed(!this.biome.isDeployed());
this.manager.saveBiome(this.biome);
}
else
{
Utils.sendMessage(this.user,
this.user.getTranslation(Constants.CONVERSATIONS + "invalid-biome",
"[biome]", this.biome.getFriendlyName()));
this.biome.setDeployed(false);
this.manager.saveBiome(this.biome);
}

this.manager.saveBiome(this.biome);

this.build();
return true;
};
Expand Down Expand Up @@ -555,15 +550,45 @@ public void setup()
*/
private enum Action
{
/**
* Biome action.
*/
BIOME,
/**
* Permission action.
*/
PERMISSION,
/**
* Cost action.
*/
COST,
/**
* Level action.
*/
LEVEL,
/**
* Order action.
*/
ORDER,
/**
* Environment action.
*/
ENVIRONMENT,
/**
* Description action.
*/
DESCRIPTION,
/**
* Icon action.
*/
ICON,
/**
* Name action.
*/
NAME,
/**
* Deployed action.
*/
DEPLOYED
}

Expand Down

0 comments on commit 34b921c

Please sign in to comment.