[MECH] IOBookcase v1.32 - Allowing users to read/write to bookcases [766]

Discussion in 'Inactive/Unsupported Plugins' started by lonelydime, Feb 24, 2011.

  1. Offline

    lonelydime

    IOBookcase - Lets users read and write to bookcases.

    Version: v1.32

    This plugin makes normally useless bookcases somewhat useful! You can write up to 5 lines per bookcase to display to users who walk by and right click them.

    Commands:
    • No commands, it's all done in game!
    Requirements:
    • The sqlitejdbc-v056.jar file needs to go where craftbukkit is (one directory above plugins).
    • Permissions 2.0 or GroupManager are optional, but it's a good idea to have one.
    Quick Links:
    Install:
    • Upload the directory structure into your root minecraft directory (where craftbukkit is).
    Use:
    • Place a bookcase where ever you'd like to put it.
    • Grab a sign and place it on the bookcase.
    • In the top line, write @line # [color].
      • # is the line number, 1-10
      • [color] is optional, it can be black, navy, green, blue, red, purple, gold, gray, rose, yellow, white or the corresponding color number (dark and light color strings are too long).
    • Finish writing your text in the last 3 lines and hit enter.
    • Right click your bookcase and see your text!
    Importing from file:
    If you choose to import from a file, you can create or edit the file plugins/IOBookcase/import.txt (The file will be created when you restart your server). The formatting of this file is very important, it's not fully functional XML, but it mirrors it. Keep that in mind. Here is an example of this file properly formatted:
    Show Spoiler

    <case name="case1">
    <line num="1" color="red">
    this is text for line 1
    </line>
    <line num="2" color="green">
    this is text for line 2
    </line>
    <line num="3">
    this is text for line 3
    </line>
    <line num="4">
    this is text for line 4
    </line>
    </case>
    <case name="case2">
    <line num="1">
    this is text for line 5
    </line>
    <line num="2">
    this is text for line 6
    </line>
    <line num="3">
    this is text for line 7
    </line>
    <line num="4">
    this is text for line 8
    </line>
    </case>

    Please note in the example, the line breaks. In real XML you can do <line num="1">text</line> all on one line, here you can't. Keep the line breaks. The tabbing is just for readability, it's not required.

    The num parameter for <line> is required, color is optional. If your color is coming out white if you specified a color, it doesn't understand your color choice. Please use black, navy, green, blue, red, purple, gold, lightgray, gray, darkpurple, lightgreen, lightblue, rose, lightpurple, yellow or white.

    Finally, to import in game place a sign on the bookcase. Line 1 needs to be @import. Line 2 needs to be the case's name specified in the import.txt file (in the above example of import.txt, case1 and case2 are valid names). Lines 1-10 are accepted, any more then you will get an error.

    Permissions or GroupManager:

    Code:
    iobookcase.canread - for groups that can read bookcases
    iobookcase.canwrite - for groups that can write to bookcases
    
    Todo:
    • Experimenting with opening the sign dialog without having to place a sign.
    • If a bookcase is destroyed, drop a bookcase.
    • Add noteblock triggering lines.
    • Make 'bookcase is empty' message configurable.
    Changelog:
    Version 1.32
    • Fixed the player interact bug causing errors on left click.
    Version 1.31
    • Replaced depreciated methods to work with CB602.
    Version 1.3
    • Added option to import cases from a text file
    Version 1.2
    • Increased bookcase lines to 10
    • Fixed color being mandatory, it's now optional as designed.
    • Removed spaces between lines.
    Version 1.1
    • Added optional GroupManager support.
    • Added colored text.
    Version 1.0
    • Public Release
     
  2. Offline

    lonelydime

    Yes, sqlite is just a jar file that sits in your minecraft directory (where craftbukkit.jar lives). It doesn't require any set up. Just download the zip of this plugin and upload the sql jar and IOBookcase.jar.
     
  3. Offline

    Rabidwolf27752

    ok so i put the sqlite in the same folder as craftbukkit.jar. i put the permissions in. i put my sign on the side of the bookcase and typed @line 1 red (next line) rabid wuz here.
    but the sign just stayed on the bookcase and nothing happend.
     
  4. Offline

    lonelydime

    Any errors in your console? That could mean the database failed to create, it could be a permissions problem or a sign problem.
     
  5. Offline

    Rabidwolf27752

    my console doesnt even register that the plugin is there. :confused:
    [MERGETIME="1299791127"][/MERGETIME]
    nvm it works now. thanks for the help. is there a way you can fix the fact that bookshelfs dont drop when you destroy them? that would be nice.
     
  6. Offline

    lonelydime

    I can do that.
     
  7. Offline

    ppingos

    When I have 9 lines, it works fine, but if I put 10 lines in import.txt, it shows an error and the sign is placed with the @import text.
    Code:
    [SEVERE] Could not pass event SIGN_CHANGE to IOBookcase
    java.lang.ArrayIndexOutOfBoundsException: 10
        at com.lonelydime.IOBookcase.BioBListenerEvent.onSignChange(BioBListenerEvent.java:326)
        at org.bukkit.plugin.java.JavaPluginLoader$26.execute(JavaPluginLoader.java:289)
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:59)
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:255)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:823)
        at net.minecraft.server.Packet130UpdateSign.a(SourceFile:39)
        at net.minecraft.server.NetworkManager.a(SourceFile:230)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:75)
        at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:357)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:272)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    EDIT: Apparently the text is entered normally. The only "error" is that the sign remains on the bookshelf and needs to be removed manually.
     
  8. Offline

    lonelydime

    Should just be me doing some math wrong. I'll get it updated tomorrow.
     
  9. Offline

    maelwedd

    I have a similar problem.
    When I "read" a bookcase with 10 lines of text I get the error
    "read: java.lang.ArrayIndexOutOfBoundsException: 10"
    in the console.
    The text displays fine and everything, but seeing it pop up in the log spooks me.
    Can it be that when "reading" the bookcase you check to see if there is something on the next line to display, and when you have 10 lines it checks to see if there is something on line #11(or 10 when counting from 0)?

    Anyways, we love your plugin on our server, it really brings alot more roleplaying into the game!
     
  10. Offline

    EcoMaster21

    This is a really neat plugin, but I believe a small change needs to be made for CB Builds #561 and up. I'm not saying it needs to be released now or anything; I'm staying with Recommended Builds like I should :) But I'd like to know if a fix is ready for when the Recommended Build changes.

    Here's the error, by the way:
    Code:
    2011-03-29 10:06:17 [SEVERE] BLOCK_RIGHTCLICKED loading IOBookcase v1.3 (Is it up to date?)
    java.lang.NoSuchFieldError: BLOCK_RIGHTCLICKED
        at com.lonelydime.IOBookcase.IOBookcase.onEnable(IOBookcase.java:56)
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:118)
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:453)
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:217)
        at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:92)
        at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:70)
        at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:203)
        at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:190)
        at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:130)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:245)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
     
  11. Offline

    lonelydime

    Fixed for CB602.
     
  12. Offline

    Codisimus

    throws error on LEFT_CLICK_AIR
     
  13. Offline

    lonelydime

    Wonderful. I'm waiting for the bukkit team to release MC1.4 before I go making changes to what I have since I wasn't able to test it. I'm sure there's lots of differences between playerinteract and blockrightclicked to mess with. Just updated to get it compiling on server start.
     
  14. Offline

    Codisimus

    you just need to check for
    Code:
    if (event.getAction().equals(Action.RIGHT_CLICK_BLOCK))
    but ya makes sense to wait for 1.4
     
  15. Offline

    Brettflan

    Got this error in the console:
    Code:
    [SEVERE] Could not pass event PLAYER_INTERACT to IOBookcase
    java.lang.NullPointerException
            at com.lonelydime.IOBookcase.BioPListenerEvent.onPlayerInteract(BioPListenerEvent.java:28)
            at org.bukkit.plugin.java.JavaPluginLoader$9.execute(JavaPluginLoader.java:217)
    The error refers to line 28 of BioPListenerEvent.java, and looking at your source it's because the block referred to there was null. It happened as I was right-clicking in empty air.
    There are a couple of ways to fix it. Obviously the quickest fix would be a check to make sure the block isn't null before that line. However, if you're only interested in right-clicks on blocks, you could add this in towards the top of that function instead:
    Code:
    if (event.getAction() != Action.RIGHT_CLICK_BLOCK) return;
    For that you'll of course need to import org.bukkit.event.block.Action.

    You should also probably be checking at the start of that function to make sure the event hasn't been cancelled by another plugin, like so:
    Code:
    if (event.isCancelled()) return;
    EDIT: I see others have covered this as well several days ago, actually, but... I already typed it out, so I guess I might as well leave it.
     
  16. Offline

    godsyn

    Eagerly awaiting an update.
     
  17. Offline

    pizza9555

    Hey, I love this plugin and it adds a great effect for new players on my server but please update!!!!! the new beta 1.4 update is too new for your 602 bukkit build =(
     
  18. Offline

    hiro24

    I love this! Works great. I've got a suggestion for a feature for this plugin. Do you think there's any way you can make these reads work off of redstone? I'm making a dungeon and I'm trying to find ways to instance things. Things like "You hear a scratching sound on the other side of the door...." if I could link one of these bookcases to a pressure plate via redstone to display that from the bookcase when I walk over it... it'd be ace! Think it's possible?
     
  19. Offline

    lonelydime

    That's a pretty good idea. To implement it I'd use note blocks though, when they're powered I'd kill the note sound and just display the text. Set up would be similar to that of a bookshelf with lines and what not. I'll add it to the todo list.

    Version 1.32 works for 602 and 617.
     
    Codisimus likes this.
  20. Offline

    goldgamer328

    on the instalation part i dont understand what you have to do. Do both the sqlite thing and the book case jar both go into the plugins section or what?
     
  21. Offline

    Chocwise

    No.
    have a look at this directory tree:
    [​IMG]

    @ lonelydime: We love your plugin on our server. We're building a quite huge quest for the users. And your Bookcases are playing an important role in this. :D
    I'd let you have a look if you're interested. But it's all in german anyway. XD
     
  22. Offline

    lonelydime

    I'm glad you like it, hopefully my mmo plugin will fare just as well :)
     
  23. Offline

    EnigmaticMiner

    Does this work for build 670? :D
     
  24. Offline

    Codisimus

    seems to work for me on 670
     
  25. Offline

    EnigmaticMiner

    Grr. It's not working for me. Dx

    It's "@line #" right?
     
  26. Offline

    Codisimus

    for example,
    Code:
    @line 1 gold
    blah, blah,
    blah.
     
  27. Offline

    EnigmaticMiner

    Thanks! Got it to work.
    I'd give you diamond...but this is not the Minecraft Forums :p
     
  28. Offline

    Icemat99

    Hello, i dont really get what the lines are? when i write @line 1 [color] it works when i press the bookshelf but if i write @line 2 or anything other + [color] nothing happens when i press on the shelve :/ please why is this happening and btw when i try to add color by writing @line 1 [black] it says non valid colour i need help so can fix this on my server fast :D ! thanks btw for a great plugin =) /icemat99
     
  29. Offline

    LucidLethargy

    Please allow us to specify the message seen when you right click an "empty" bookcase. This makes our bookshelves meant only for show seem almost silly as people will see the message "This bookcase is empty." and naturally this contradicts the fact our texture pack shows books, and furthermore makes us look a bit silly for having tons of empty bookshelves, in say, a study.

    No message, or a configurable message would be amazing, though! Aside from that, I absolutely love this plugin, thank you so much for your time and effort!
     
  30. Offline

    lonelydime

    I'll add it to the todo, hopefully I'll have a release out for this next week.
     
  31. Offline

    LucidLethargy

    By the way, after a lot of additions to my server I must say this plugin is one of the coolest features we now have. It's making me do everything from making bars (I make the message read ""Various spirits plaster these walls") to making quests (by making them read something like "You see a note between two books on the shelf... bla bla bla quest here.)

    So thank you for your work! This is great stuff and it's allowing me to create all sorts of fun content for my players!
     

Share This Page