added new config string fetches for more dynamic dialog configs
This commit is contained in:
parent
a23a00c881
commit
426fc4a977
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -213,10 +213,17 @@ public class BlockShop implements Listener {
|
||||
return sb.toString();
|
||||
}
|
||||
public String getConfigLine(String source, String dfault) {
|
||||
plugin.reloadConfig();
|
||||
return config != null ? config.getString(source, dfault) : dfault;
|
||||
reloadShopConfig();
|
||||
String value = plugin.getConfig().getString(source, dfault);
|
||||
if (!config.contains(source)) {
|
||||
config.set(source, dfault);
|
||||
plugin.saveConfig();
|
||||
}
|
||||
Bukkit.getLogger().info("Fetching config key: " + source + " | Found: " + value);
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
// Helper method to retrieve the price of an item (can be customized to use a config file for prices)
|
||||
private double getPrice(ItemStack item) {
|
||||
for (String category : config.getConfigurationSection("shop.categories").getKeys(false)) {
|
||||
|
@ -13,5 +13,6 @@ shop:
|
||||
price: 15
|
||||
display_name: "Oak Planks"
|
||||
poor: "you're poor..."
|
||||
inventory_full: "you got too much clutter, cant fit your purchase into that mess..."
|
||||
pagination:
|
||||
max_items_per_page: 45 # Max items to display per page
|
||||
|
Loading…
Reference in New Issue
Block a user