Moves economy related code to its own class
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package net.knarcraft.bookswithoutborders.command;
|
||||
|
||||
import net.knarcraft.bookswithoutborders.BooksWithoutBorders;
|
||||
import net.knarcraft.bookswithoutborders.utility.EconomyHelper;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
@@ -63,7 +64,7 @@ public class CommandBooksWithoutBorders implements CommandExecutor {
|
||||
if (bookPriceType != Material.AIR) {
|
||||
sendErrorMessage(sender, "[" + (int) bookPriceQuantity + " " + bookPriceType.toString() + "(s) are required to create a book]");
|
||||
} else {
|
||||
sendErrorMessage(sender, "[" + BooksWithoutBorders.eco.format(bookPriceQuantity) + " is required to create a book]");
|
||||
sendErrorMessage(sender, "[" + EconomyHelper.getEconomy().format(bookPriceQuantity) + " is required to create a book]");
|
||||
}
|
||||
}
|
||||
sender.sendMessage(getCommandColor() + "Commands:");
|
||||
|
@@ -1,6 +1,7 @@
|
||||
package net.knarcraft.bookswithoutborders.command;
|
||||
|
||||
import net.knarcraft.bookswithoutborders.BooksWithoutBorders;
|
||||
import net.knarcraft.bookswithoutborders.utility.EconomyHelper;
|
||||
import net.knarcraft.bookswithoutborders.utility.InventoryHelper;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.command.Command;
|
||||
@@ -109,7 +110,7 @@ public class CommandSetBookPrice implements CommandExecutor {
|
||||
* @return <p>True if the price was changed successfully</p>
|
||||
*/
|
||||
private boolean setEconomyPrice(CommandSender sender, double price) {
|
||||
if (booksWithoutBorders.setupEconomy()) {
|
||||
if (EconomyHelper.setupEconomy()) {
|
||||
BooksWithoutBorders.bookPriceQuantity = price;
|
||||
BooksWithoutBorders.bookPriceType = Material.AIR;
|
||||
booksWithoutBorders.getConfig().set("Options.Price_to_create_book.Item_type", "Economy");
|
||||
@@ -118,7 +119,7 @@ public class CommandSetBookPrice implements CommandExecutor {
|
||||
booksWithoutBorders.saveConfig();
|
||||
|
||||
BooksWithoutBorders.sendSuccessMessage(sender, "Book creation price set to " +
|
||||
BooksWithoutBorders.eco.format(BooksWithoutBorders.bookPriceQuantity) + "!");
|
||||
EconomyHelper.getEconomy().format(BooksWithoutBorders.bookPriceQuantity) + "!");
|
||||
return true;
|
||||
} else {
|
||||
BooksWithoutBorders.sendErrorMessage(sender, "BooksWithoutBorders failed to hook into Vault! Book price not set!");
|
||||
|
Reference in New Issue
Block a user