Fixed lore + help

This commit is contained in:
Niels Vergucht 2018-12-07 01:23:53 +01:00
parent c36ef93e95
commit ce8d0c86ef
3 changed files with 14 additions and 7 deletions

View File

@ -29,8 +29,12 @@ public class CommandGenbucket extends BaseCommand {
@Subcommand("help") @Subcommand("help")
@CatchUnknown @Default @CatchUnknown @Default
public void doHelp(CommandSender sender) { public void doHelp(CommandSender sender) {
sender.sendMessage("&3&lEpicBuckets"); sender.sendMessage(ChatUtil.colorString("&3&lEpicBuckets"));
sender.sendMessage(ChatUtil.colorString("&f/epicbuckets|eb help: &7shows this help"));
sender.sendMessage(ChatUtil.colorString("&f/epicbuckets|eb reload: &7reloads the config"));
sender.sendMessage(ChatUtil.colorString("&f/epicbuckets|eb shop: &7opens up the genbucket shop"));
sender.sendMessage(ChatUtil.colorString("&f/epicbuckets|eb admin toggle: &7toggle your status to receive genbucket placement notifications"));
sender.sendMessage(ChatUtil.colorString("&f/epicbuckets|eb admin panel: &7opens up the panel with all active genbuckets"));
} }
@Subcommand("shop") @Subcommand("shop")

View File

@ -0,0 +1,7 @@
package com.songoda.epicbuckets.command;
public class GenbucketCommands {
protected
}

View File

@ -45,11 +45,7 @@ public class InventoryHelper {
public static ItemStack setSubShopLore(ItemStack item, List<String> lore, SubShop subShop) { public static ItemStack setSubShopLore(ItemStack item, List<String> lore, SubShop subShop) {
ItemMeta im = item.getItemMeta(); ItemMeta im = item.getItemMeta();
List<String> newLore = new ArrayList<>(); List<String> newLore = new ArrayList<>();
lore.forEach(s -> newLore.add(ChatColor.translateAlternateColorCodes('&', s))); lore.forEach(s -> newLore.add(ChatColor.translateAlternateColorCodes('&', s.replace("${price}", subShop.getPrice() + "").replace("${material}", subShop.getGenItem().getType().name()))));
newLore.forEach(s -> {
if (s.contains("${price}")) s.replace("${price}", subShop.getPrice() + "");
if (s.contains("${material}")) s.replace("${material}", subShop.getGenItem().getType().name());
});
im.setLore(newLore); im.setLore(newLore);
item.setItemMeta(im); item.setItemMeta(im);
return item; return item;