-
-
Save test414EFF/2d048c2a5959605c5fcd1f4c5cc36201 to your computer and use it in GitHub Desktop.
This is only the relevant method for opening shops.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void openShop(Player p, String shopName) { | |
System.out.println("Opened shop!"); | |
Merchant merchant = Bukkit.createMerchant(ChatColor.RED + shopStorage.getShopOwner(shopName) + ChatColor.RED + "'s §a§b§c§d§e§f§cShop"); | |
List<MerchantRecipe> recipes = new ArrayList<>(); | |
shopStorage.getShopItems(shopName).forEach((item, price) -> recipes.add(utility.createShopItem(serializer.stringToItem(item.toString()), ((String) price)))); | |
merchant.setRecipes(recipes); | |
p.openMerchant(merchant, true); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment