Skip to content

Instantly share code, notes, and snippets.

@test414EFF
Created March 20, 2020 21:21
Show Gist options
  • Save test414EFF/2d048c2a5959605c5fcd1f4c5cc36201 to your computer and use it in GitHub Desktop.
Save test414EFF/2d048c2a5959605c5fcd1f4c5cc36201 to your computer and use it in GitHub Desktop.
This is only the relevant method for opening shops.
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