BookShop
Players can publish their written books in a shop, so other players can buy the written books. There are two ways of creating a BookShop:
- When the player holds a book and quill item while hitting the sign, the text in the book is copied.
- When the player places some books in the chest beneath the sign, the plugin will duplicate the item in the chest every time it is sold. Thus nobody has to write books more than once.
Please note:
- AdminShops always duplicate the book!
It works the same way than a publisher: It copies the book in the chest and sells it to the player.
Features
- Publication of written books
- backup of books into a file
- Restoring books
- Give a default book to every new player
- Give a book to every player who joined the server before.
- Give a book to a player
- Statistics for every book (how often it was sold)
- Admins can impose taxes.
- Player can only publish written books.
- Admins can create AdminShops that always duplicate the book regardless of the settings in the config file.
Dependencies
- iConomy 5 or iConomy6 or Vault or Register
- PermissionsEX or bPermissions or GroupManager or BukkitPermissions
The shop
To create a shop, you have to place an empty chest first. Then you can create a sign with following content
Please note: Only ONE book per shop is allowed!
Line | Text |
---|---|
1 | [BookShop] |
2 | |
3 | The books name (automatically added after closing the chest with the book), but you can let it empty ;) |
4 | price of the book |
OR:
Line | Text |
---|---|
1 | [BookShop] |
2 | |
3 | The books name (automatically added after closing the chest with the book), but you can let it empty ;) |
4 | price of the book:price of the book if the player has a book and quill in the hand |
To create an AdminShop:
Line | Text |
---|---|
1 | [BookShop] |
2 | AdminShop |
3 | The books name (automatically added after closing the chest with the book), but you can let it empty ;) |
4 | price of the book |
To create a Newspaper shop:
Line | Text |
---|---|
1 | [BookShop] |
2 | Newspapers |
3 | The books name (automatically added after closing the chest with the book), but you can let it empty ;) |
4 | price of the newspapers |
With the newspaper shop you are able to sell several books at a time. E.g. a book with rules and a book with a plugin info. If the player hits the sign he receives the two books.
If you don't like the keywords on the sign, you can edit them in the Shopconfig.yml´file!
At the end it should look like this:
Permission nodes
Action | Permission node |
---|---|
Create a shop | BookShop.create |
Create a shop of an other player | BookShop.create.other |
Sell books of other players | BookShop.sell.other |
Create a Adminshop | BookShop.create.admin |
Use the shop | BookShop.use |
Destroy own shop | BookShop.create |
Destroy shop of someone else or AdminShop | BookShop.create.admin |
Message to admins that someone created a shop | BookShop.admin |
Command | Permission node | Explanation |
---|---|---|
/BookShop setwelcomebook | BookShop.setwelcomebook | Sets a book which has every new player in the inventory |
/BookShop removewelcomebook | BookShop.removewelcomebook | Unsets a book which has every new player in the inventory |
/BookShop giveall | BookShop.giveall | Gives a book to every player who joined the server before |
/BookShop give | BookShop.give | Gives a book to a player |
/BookShop backupbook | BookShop.backupbook | Backups a book |
/BookShop loadbook | BookShop.loadbook | Loads a book |
/BookShop reload | BookShop.reload | Reloads the plugin |
/BookShop debugfile | BookShop.debugfile | Turn the debugfile on and off |
/BookShop internet | BookShop.internet | Turns the internet access on and off |
/BookShop version | BookShop.version | Shows the current version of BookShop |
/BookShop update | BookShop.admin | Updates the plugin to the latest vesrsion on dev.bukkit.org |
/BookShop deletedebug | BookShop.admin | Deletes the debugfile to give you free space on the hdd |
/BookShop log | BookShop.admin | Returns the current size of the debugfile |
/BookShop toggle | BookShop.admin | Turns BookShop immediately off |
/BookShop language <language> | BookShop.admin | Select the ingame language (by default english) |
/BookShop help | BookShop.help | Returns all command which the player can execute |
/BookShop showdebug | BookShop.showdebug | Shows you console messages ingame |
@ibhh: Well...it's for convenience consideration-.- so we don't need to type that command everyday
hi. thanks for your work. but i have some question.
it dosen't work on my server. backupbook, loadbook, nothing seems work.
when i use /backupbook it shows to me "unknown error: null"
there is some problem with using other languages like korean? sometimes, written books are even disapear.
i really want to use this plugin. and there are about 50 people who want to use this plugin on my server. i hope you can fix this bugs.
@CubieX
it works with every 1.3.* bukkit build.
@jessefjxm
Why should I add a extra feature for this? Is it to much work to run the command '/bookshop giveall' ? With this command every player gets the book you hold in your hand :)
by the way,another suggestion:the function to give away newspapers to all players(whether online or not,like a mail)at a specific interval,or when the newspaper.txt file is changed.
i changed the book.txt from ansi to utf-8
Is there a version for 1.3.1-R2.0, or does it probably work with it also?
@jessefjxm
Ok, I will add this messages to the config.yml
@jessefjxm
So if you've fixed it, what was the problem?
Another thing:This error occured when a new player come to my server: [Well,i've fixed this problem after i recoded the file- -] 2012-09-24 15:32:46 [INFO] jessefjxm123123[/127.0.0.1:1045] logged in with entity id 521 at ([world] 333.5, 47.62000000476837, 3654.5) 2012-09-24 15:32:46 [SEVERE] java.lang.NullPointerException 2012-09-24 15:32:46 [SEVERE] at me.ibhh.BookShop.BookShopListener.join(BookShopListener.java:305) 2012-09-24 15:32:46 [SEVERE] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2012-09-24 15:32:46 [SEVERE] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 2012-09-24 15:32:46 [SEVERE] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 2012-09-24 15:32:46 [SEVERE] at java.lang.reflect.Method.invoke(Unknown Source) 2012-09-24 15:32:46 [SEVERE] at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:330) 2012-09-24 15:32:46 [SEVERE] at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) 2012-09-24 15:32:46 [SEVERE] at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:477) 2012-09-24 15:32:46 [SEVERE] at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:462) 2012-09-24 15:32:46 [SEVERE] at net.minecraft.server.ServerConfigurationManagerAbstract.c(ServerConfigurationManagerAbstract.java:161) 2012-09-24 15:32:46 [SEVERE] at net.minecraft.server.ServerConfigurationManagerAbstract.a(ServerConfigurationManagerAbstract.java:92) 2012-09-24 15:32:46 [SEVERE] at net.minecraft.server.NetLoginHandler.d(NetLoginHandler.java:121) 2012-09-24 15:32:46 [SEVERE] at net.minecraft.server.NetLoginHandler.c(NetLoginHandler.java:41) 2012-09-24 15:32:46 [SEVERE] at net.minecraft.server.DedicatedServerConnectionThread.a(DedicatedServerConnectionThread.java:44) 2012-09-24 15:32:46 [SEVERE] at net.minecraft.server.DedicatedServerConnection.b(SourceFile:29) 2012-09-24 15:32:46 [SEVERE] at net.minecraft.server.MinecraftServer.q(MinecraftServer.java:581) 2012-09-24 15:32:46 [SEVERE] at net.minecraft.server.DedicatedServer.q(DedicatedServer.java:212) 2012-09-24 15:32:46 [SEVERE] at net.minecraft.server.MinecraftServer.p(MinecraftServer.java:474) 2012-09-24 15:32:46 [SEVERE] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:406) 2012-09-24 15:32:46 [SEVERE] at net.minecraft.server.ThreadServerApplication.run(SourceFile:539) 2012-09-24 15:32:46 [INFO] [BookShop] Error: Uncatch Exeption! 2012-09-24 15:32:46 [SEVERE] Could not pass event PlayerJoinEvent to BookShop org.bukkit.event.EventException at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:332) at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:477) at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:462) at net.minecraft.server.ServerConfigurationManagerAbstract.c(ServerConfigurationManagerAbstract.java:161) at net.minecraft.server.ServerConfigurationManagerAbstract.a(ServerConfigurationManagerAbstract.java:92) at net.minecraft.server.NetLoginHandler.d(NetLoginHandler.java:121) at net.minecraft.server.NetLoginHandler.c(NetLoginHandler.java:41) at net.minecraft.server.DedicatedServerConnectionThread.a(DedicatedServerConnectionThread.java:44) at net.minecraft.server.DedicatedServerConnection.b(SourceFile:29) at net.minecraft.server.MinecraftServer.q(MinecraftServer.java:581) at net.minecraft.server.DedicatedServer.q(DedicatedServer.java:212) at net.minecraft.server.MinecraftServer.p(MinecraftServer.java:474) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:406) at net.minecraft.server.ThreadServerApplication.run(SourceFile:539) Caused by: java.lang.NullPointerException at java.net.URLEncoder.encode(Unknown Source) at me.ibhh.BookShop.ReportToHost.send(ReportToHost.java:100) at me.ibhh.BookShop.ReportToHost.report(ReportToHost.java:42) at me.ibhh.BookShop.BookShopListener.join(BookShopListener.java:313) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:330) ... 14 more
I found some contents that should be but didn't included in .yml files:
Warnings like "[BookShop]:XXX" and "[BookShop]Warning:XXXX " "The lenght of a page is too long!"...in BookHandler.class "Please take the book in the hand which you want to give to every player!"...in BookShop$4.class "The player XXX created a BookShop:"... "Destroy booksop..." "That is your shop","Something is wrong with this book!" "BookShop creation failed!" "You purchased the collection for..." "Successfully set a welcome book!"
@Hvarr
I believe we mean different things. The shop tells you how owns the shop and the owner of the book is only visible if you it the sign while you are sneaking.
If you want to create a shop for someone else you need the permission node BookShop.create.other
@ibhh,
d'oh, I am sorry, I meant comment #77, not #79. I'm sorry, ibhh. I will type it here again to avoid confusion:
For example, my name is "Player_1" and I want to create a shop, that will sell a Book, written by "Player_2". But, no matter, how I try, shop always changes the name of the seller to "Player_1" (which is my name) right, after shop is created. Even, after I manually enter the name of the seller - "Player_2".
I, as Player_1, want to be able to create book shop for Player_2.
@Slaand
Without chest not yet :(
Hello ibhh! Can i make with AdminShop withn't chests? Thanks
@LHammonds
You can export books with /bookshop backup and you're able to import them with /bookshop load authorname book title.
Using collection with a shop is very difficult.
What do you mean to this idea: You have one Shop named with [BookShop] and in the next line you write "Newspapers". Now every player is able to open the chest and take a book, but the book gets duplicated.
A good solution?
@jessefjxm
Nice idea, thanks. Will be implemented in the next update.
@Hvarr
@Hvarr
@Daelmaron
BookShop works already with FE Economy because if you have Vault BookShop works with Vault. I check wheather I can implement a direct support of Fe Economy.
Hope you can add a more detailed language file!:) So we can change the words [Bookshop] and AdminShop on the sign
ibhh,
Do you understand my comment? (Comment #79)