Skip to content

Commit

Permalink
Update button labels
Browse files Browse the repository at this point in the history
  • Loading branch information
Reldeam committed Feb 5, 2022
1 parent a5c8779 commit f8b8ed0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
public class AddCustomTradeEntryButton extends TextInputButton {

public AddCustomTradeEntryButton(PlayerPrompt prompt) {
super(Material.NETHER_STAR, "Add new custom trade", null, prompt);
super(Material.NETHER_STAR, "Add New Custom Trade", null, prompt);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import org.bukkit.NamespacedKey;
import org.bukkit.event.Event.Result;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.inventory.ItemFlag;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.persistence.PersistentDataContainer;
Expand All @@ -29,6 +30,10 @@ public Button(
itemMeta.setDisplayName(label);
itemMeta.setLore(lore);

itemMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
itemMeta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES);
itemMeta.addItemFlags(ItemFlag.HIDE_POTION_EFFECTS);

item.setItemMeta(itemMeta);

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,18 @@ public TradeConfigPage(GUI gui, String title) {
);
giveExperienceToPlayerPrompt.onResponse(response -> {
try {

if(
!response.toUpperCase().equals("TRUE") ||
!response.toUpperCase().equals("FALSE")
) {
throw new IllegalArgumentException("value must be TRUE or FALSE");
}

Boolean giveExperienceToPlayer = Boolean.parseBoolean(response);
this.tradeEntry.getUpdates().giveExperienceToPlayer(giveExperienceToPlayer);

icons.get("giveExperienceToPlayer").setCurrentValue(response.toUpperCase());
icons.get("giveExperienceToPlayer").setCurrentValue(giveExperienceToPlayer.toString().toUpperCase());
setIcon(Slot.GIVE_EXPERIENCE_TO_PLAYER_ICON.index(), icons.get("giveExperienceToPlayer"));

if(this.tradeEntry.isGiveExperienceToPlayerModified())
Expand Down

0 comments on commit f8b8ed0

Please sign in to comment.