Added javadoc since tags for the newly added methods in PanelItem and builder

Also improved the #isPlayerHead() methods
This commit is contained in:
Florian CUNY 2019-10-24 14:12:16 +02:00
parent 87ea48443f
commit ca6ab33898
2 changed files with 4 additions and 7 deletions

View File

@ -29,13 +29,11 @@ public class PanelItem {
private String name;
private boolean glow;
private ItemMeta meta;
private final boolean playerHead;
private String playerHeadName;
private boolean invisible;
public PanelItem(PanelItemBuilder builtItem) {
this.icon = builtItem.getIcon();
this.playerHead = builtItem.isPlayerHead();
this.playerHeadName = builtItem.getPlayerHeadName();
// Get the meta
meta = icon.getItemMeta();
@ -135,11 +133,12 @@ public class PanelItem {
* @return the playerHead
*/
public boolean isPlayerHead() {
return playerHead;
return playerHeadName != null && !playerHeadName.isEmpty();
}
/**
* @return the playerHeadName
* @since 1.9.0
*/
public String getPlayerHeadName() {
return playerHeadName;

View File

@ -19,7 +19,6 @@ public class PanelItemBuilder {
private List<String> description = new ArrayList<>();
private boolean glow = false;
private PanelItem.ClickHandler clickHandler;
private boolean playerHead;
private String playerHeadName;
private boolean invisible;
@ -47,7 +46,6 @@ public class PanelItemBuilder {
public PanelItemBuilder icon(String playerName) {
this.icon = new ItemStack(Material.PLAYER_HEAD, 1);
this.playerHeadName = playerName;
this.playerHead = true;
return this;
}
@ -148,11 +146,12 @@ public class PanelItemBuilder {
* @return the playerHead
*/
public boolean isPlayerHead() {
return playerHead;
return playerHeadName != null && !playerHeadName.isEmpty();
}
/**
* @return the playerHead
* @since 1.9.0
*/
public String getPlayerHeadName() {
return playerHeadName;
@ -164,5 +163,4 @@ public class PanelItemBuilder {
public boolean isInvisible() {
return invisible;
}
}