Increases book generation for all loaded books #4
This commit is contained in:
parent
7c229fb459
commit
ce249a93b3
@ -64,7 +64,8 @@ public final class BookLoader {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Make sure the player can pay for the book
|
//Make sure the player can pay for the book
|
||||||
if (BooksWithoutBordersConfig.booksHavePrice() && !sender.hasPermission("bookswithoutborders.bypassBookPrice") &&
|
if (BooksWithoutBordersConfig.booksHavePrice() &&
|
||||||
|
!sender.hasPermission("bookswithoutborders.bypassBookPrice") &&
|
||||||
(bookDirectory == BookDirectory.PUBLIC || bookDirectory == BookDirectory.PLAYER) &&
|
(bookDirectory == BookDirectory.PUBLIC || bookDirectory == BookDirectory.PLAYER) &&
|
||||||
EconomyHelper.cannotPayForBookPrinting((Player) sender, numCopies)) {
|
EconomyHelper.cannotPayForBookPrinting((Player) sender, numCopies)) {
|
||||||
return null;
|
return null;
|
||||||
@ -98,6 +99,8 @@ public final class BookLoader {
|
|||||||
|
|
||||||
//Set the metadata and amount to the new book
|
//Set the metadata and amount to the new book
|
||||||
book.setItemMeta(bookMetadata);
|
book.setItemMeta(bookMetadata);
|
||||||
|
//Increase book generation if enabled
|
||||||
|
BookHelper.increaseGeneration(book);
|
||||||
book.setAmount(numCopies);
|
book.setAmount(numCopies);
|
||||||
|
|
||||||
return book;
|
return book;
|
||||||
|
Loading…
Reference in New Issue
Block a user