[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

    Threore

    Thanks for the changes! Now I'll just have to make enough lore to fill my library.

    That'd work, thanks.
     
  3. Offline

    lonelydime

    What if I made it read in a file that can be /plugins/IOBookcase/import.txt
    Format it like:
    x:y:z:#:text that can go on line 1

    where x:y:z is the location of the case, # is the line number (1-10) and text.

    Then make it so if you hit your case with say, a stick, it will spit out it's location instead of the text.

    Would that work for you guys?
     
  4. Offline

    OrtwinS

    Sounds good to me, I will be able to ask my users to come up with stories & tutorials, give them some max. characters/line limits, and start copy-pasting.

    That will be 1.3 than :D, I have 1.1 now, I'll wait with upgrading for 1.3.

    Edit:
    you might want to come up with some more instructions, like if I paste a load of stories in import.txt, I have to put in the coordinates manually? and if I have done that, will there be somekind of /iobook import command that will attempt to put all that text into the shelfs? Thereby clearing the import.txt EXCEPT for the failures (no bookshelf found) and/or the overwrites? auto-overwrite should be a configuration option as well...
    I might be completely wrong, but we need more instructions for a more complicated system like that.
     
  5. Offline

    Deikkan

    I'm having a problem with this plugin. Whenever I try to write
    Code:
    @line 1
    test
    test2
    test3
    and press enter, it loops back to the first line and the sign does not disappear. Right clicking on the bookcases tell me that they are still empty. I have the sqlitejdbc-v056.jar file in the same folder as my craftbukkit file, and the sign is placed ontop of the bookcase so I can't tell what the problem is.
     
  6. Offline

    lonelydime

    Don't put it on top, put it so that the sign is actually on one of the bookcase's faces.
     
  7. Offline

    Deikkan

    Thanks, works perfectly now. For some reason, I misread 'place it on' as 'place it ontop'
     
  8. Offline

    Threore

    The stick is used by a few other plugins I believe, and breaking compatibility just for getting coordinates seems a bit of a waste. I'd prefer an import.txt without the coordinates, you can get them with signs like in the current method, and then have some book ID on the sign that points to the right spot in the import.txt file. The format of the sign could be:
    line1: @importbook
    line2: bookID

    So the bookID would be either a unique ID which is then searched for in the import.txt, or, possibly simpler, have bookID 'n' point to the 'n'-th book in the import.txt file.

    This would be much easier than constantly having to find the coordinates and writing them in the text file. If you can't do this please tell me why so I might be able to find another way that'd still be better than having to find coordinates.
     
  9. Offline

    lonelydime

    Having an id in the text and matching it with an id on the sign would work fine. That way you could reuse them if you wanted to. The reason I suggested x,y,z is because that's what the foreign keys are in the database and I have a one track mind =p
     
  10. Offline

    Threore

    If you could do that it'd be great! :D
     
  11. Offline

    yeahMan

    screenshot? i'm curious to see it before i try it :)
     
  12. Offline

    Lolf

    nice work dude, but as i saw Gronkhs plugin, to write in the books and to do the books into the bookshelves, i thought maybe you can do that too? would be very nice! a small menu, where you can choose a book & stuff like this... and if the bookshelves are empty, there is an empty bookshelve block and so on... :)
     
  13. Offline

    lonelydime

    It's basically just text displaying on the screen, nothing special.

    Not sure if I know the plugin, is it for bukkit or is it a client mod?
     
  14. Offline

    Ixbidie

    whats about longer texts then 5 lines? I thought on placing a sign and writing text. After that the sign disappears und u can add another sign to write more text, which is added to the already written lines.

    Anyways, thanks for your work
    Ixbidie
     
  15. Offline

    lonelydime

    Not sure what you're asking, but all bookcases can have up to 10 lines. Use @line # on the first line to determine what line to put it in.
     
  16. Offline

    Lolf

    first, hah, double qoute :)
    uhm i think its a official plugin for single player
    http://www.youtube.com/user/Gronkh ( dont know the name of the vid but its anywhere there:) (its on german) )
     
  17. Offline

    lonelydime

    Those are very long videos lol. If it's a client mod, I'd need an example or at least the name of the plugin before I could say yay or nay, but chances are if it's a client mod it can't be done server side.

    Version 1.3 is out, added importing from a text file. Please read how to before posting errors you get, parsing a file requires a specific format.
     
  18. Offline

    Lolf

    i asked gronkh, so lets wait for the answer ^^
     
  19. Offline

    davr

    Love these plugins that can all be done in game, without needing complex commands to be entered.
     
  20. Offline

    lonelydime

    So do I, I try to make them so that you don't have to remember commands. Makes life a whole lot easier.
     
  21. Offline

    OrtwinS

    Thanks! 1.3 is a nice improvement.
    We now have tutorial books and law books on the server, many more coming in.
    (The Law: article one, Admins rule with absolute power :D, period.)

    It would be really nice if someone developed a ingame text input window, to be used by other plugins.
    To replace all that sign syntax fiddeling.
    It would require changes in craftbukkit, and perhaps MC itself to make such a change in the HUD I guess..
     
  22. Offline

    lonelydime

    Yea, it would have to be a server mod so either bukkit would have to do it or someone could edit bukkit and keep up on editing it's source with every new version (which would be pretty much insane). I'm trying to work a way to pop open the sign text box without having to use a sign, but it's tricky
     
  23. Offline

    OrtwinS

    Ionelydime,
    I really like your plugin, but when Craftbook will have ICs and more mechanics I will install it... even if it means deinstalling IOBookcase.

    Since the current Craftbook release already has the book-shelf-read function, but only with random lines from file, could you dissect it and figure out a way so that your plugin ties in/overrides the craftbook shelf function?
     
  24. Offline

    lonelydime

    Craftbook wasn't built as an API, so there's no tying into it unless I edit his source and replace his bookshelf with mine, which I have no intention of doing. You'll have to choose eventually, sorry :(
     
  25. Offline

    davr

    Kinda funny how craftbook got its name from bookcases, but that is now the most minor, least used feature in that plugin. I kinda wish he'd break it up so people could use or not use different parts, I think having such a huge number of features in a single plugin is what made it take so long to port it over to bukkit.
     
  26. Offline

    lonelydime

    It can be good or bad, depending on how it's done. My DeathTpPlus plugin for example, the bulk of the code is for DeathNotify. The streaks, soon to be death logs and DeathTpPlus all work from that bulk. Having Streaks and DeathNotify separated would mean a lot of code is repeated making it heavier if you wanted both. And if you just wanted one, it's not that much more and can be disabled via the config making it more lightweight if you don't want a feature.
     
  27. Offline

    Codisimus

    isn't this why plugins like minecart mania have a core plugin that you need in order for each other component to work? seems like that is the better option.
     
  28. Offline

    lonelydime

    Yea, I really like how he decided to do his. For a plugin that scale it's the best way to go. Essentials did the same thing
     
  29. Offline

    Inacio

    Will there be support for flat or MySQL?
     
  30. Offline

    lonelydime

    For flat file, no. MySQL I'd have to look into, but I'm probably just going to stick to SQLite since that's what most plugin authors seem to use.
     
  31. Offline

    Inacio

    Aw, shame. I haven't got SQLite, at the moment. I hope you get it, it'd really come in handy.
    Stupid as hell question: can I set MySQL and SQLite up, at the same time?
     

Share This Page