Inactive [MECH] Backpack v2.2.0 (The Ultimate Inventory Expander!) [953]

Discussion in 'Inactive/Unsupported Plugins' started by Afforess, Feb 25, 2011.

  1. Offline

    Afforess

    Backpack
    Because One is never enough!
    Preface:
    Backpack is the ultimate salvation in inventory management. Your standard minecraft inventory has 36 slots in it, just enough to be handy, but terrible for long journeys or mining expeditions to the other side of the map. Backpack nonatuples your existing inventory space. (For those of you not familiar with latin, that's 9x the space).
    How is this massive inventory boost possible? The mouse wheel. (Thanks to Edward Hand for the idea!) Sneaking while Scrolling through each of the quickslots switches you to a new inventory page. This gives you freedom to scroll through NINE different pages. Scrolling without sneaking allows you to scroll through your inventory like normal.

    If you don't quite get it, I've made a short video demonstrating:
    FAQ:​
    Is there a way to change the number of pages? I only want certain users to have x amount of pages.
    Yes, see the next question down!
    Is there permission or group manager support!
    Nope! There is however a configuration file (aptly named "config.xml") that is created on the first run and allows you to customize the amount of extra inventory pages, and who gets to use them.
    Are your inventories saved between logins and server restarts?
    Yes. Backpack saves the inventories in the same file notch does, in the "player".dat file.
    Updating all those files must be slow/I heard that I/O operations are slow.
    They are. Backpack is multithreaded, so if you have more than 1 core, you won't notice any lag.
    This mod doesn't have anything to do with Minecarts, why the Minecart Mania dependency?
    Minecart Mania offers a useful interface for a lot of things I needed in writing Backpack, and 70% of the code is actually in MM. If you really hate Minecart Mania, you can just install core, and disable all of the features from it's configuration file.
    Dependencies:
    Commands:
    • /open <page number>
      • Opens a dialog with your current inventory, and the inventory from that page so you can easily swap items between pages. Quick slots are numbered 1-10, with 1 on the leftmost side.
    • /backpack
      • Toggles your backpack on or off.
    Permissions:
    (Permissions is optional, but will be used if installed)​
    • backpack.toggle
      • Allows the use of the /backpack command
    • backpack.open
      • Allows the use of the /open command
    • backpack.saveactionbar
      • Saves the action bar in-between pages
    • backpack.maxpages.# (where # is a number 1-9 [e.g backpack.maxpages.6])
      • The maximum pages allowed for the players
    Changelog:
    • Version 0.10
      • Initial Release!
    • Version 0.11
      • Swapped the role of sneaking around
    • Version 0.12
      • Player death is handled correctly
      • When your current inventory page is full, nearby items on the ground will be added to empty slots in other inventory pages.
    • Version 0.13
      • Added a first time login message. Only is triggered once for each player.
    • Version 0.14
      • Added customizable amount of inventory players, through XML.
    • Version 0.15-0.20
      • Bug Fixes
    • Version 0.21
      • Added /open command
    • Version 0.23
      • Reduced I/O operations from being continuous to once per minute
      • Fixed a bug which could cause player inventory pages to be lost if the server shut down in such a way that MM unloaded before the I/O operations finished.
    • Version 1.0
      • Fixed lag caused by I/O operations
      • Player Data now saves correctly, and will not become corrupt during server shutdowns
      • Improved Error Handling
      • Improved Console Log of Information for admins
    • Version 1.0a-1.0g
      • Bug fixes
    • Version 1.1
      • More robust inventory backups
      • /backpack command
    • Version 2.0
      • Supports MC 1.4
      • Action bar no longer switches with new inventory pages
      • Backpack saves with rest of inventory in player.dat file
      • Other plugins can access and correctly see a player's larger inventory w/o being Backpack Aware
    • Version 2.0.1
      • Backpack's work correctly after death
    • Version 2.0.2
      • Small Backpacks work correctly
    • Version 2.0.3
      • Players can choose to save the action bar or have separate action bars via the config
      • Bug fixes
    • Version 2.0.4
      • Improved Error Handling
    • Version 2.0.5
      • Fixed /open command crashing clients
    • Version 2.0.6
      • Fixed item duping on death
    • Version 2.0.7
      • Bug Fixes
    • Version 2.0.8
      • Permissions Support
      • Efficiency Changes
      • Bug Fixes
    • Version 2.0.9
      • Updated to MC 1.5
    • Version 2.1.0
      • Minor fixes/Cleanup
    • Version 2.2.0
      • New saving system
      • Lots of cleanup
      • Lots of bug fixes
     
  2. Offline

    Afforess

    Updated to 1.0f, now supports the latest recommended build.
    [MERGETIME="1299784368"][/MERGETIME]
    QuickStash should work with it.
     
  3. Offline

    Taeir

    if someone kicks people i still get the "Could not pass event PLAYER_MOVE to Backpack" error.
     
  4. Offline

    woodzy

    getting this error at server start up
    00:11:41 [SEVERE] [BACKPACK] Failed to read contents of backpack!
    >
     
  5. Offline

    Afforess

    Please post the error log.
    [MERGETIME="1299966080"][/MERGETIME]
    Happens when Backpack can't read the data from one of the data files.
     
  6. Offline

    woodzy

    is there a way to fix it? its at all most every startup and look at the conve i started with you
     
  7. Offline

    Taeir

    When a player is kicked, i sometimes get this error. Using kick and ban system of essentials.
    Code:
    2011-03-12 19:20:41 [SEVERE] Could not pass event PLAYER_MOVE to Backpack
    java.lang.NullPointerException
     at com.afforess.backpack.PlayerInventorySorter.<init>(PlayerInventorySorter.java:21)
     at com.afforess.backpack.BackpackPlayerListener.onPlayerMove(BackpackPlayerListener.java:52)
     at org.bukkit.plugin.java.JavaPluginLoader$7.execute(JavaPluginLoader.java:192)
     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:123)
     at net.minecraft.server.Packet10Flying.a(SourceFile:126)
     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)
    
     
  8. Offline

    Afforess

    Fixed for next release.
    [MERGETIME="1300056258"][/MERGETIME]
    I've included a much more descriptive error message in 1.0g. Once you see the error again in the latest version, please give me a copy of the console logs.

    Thanks.

    Backpack Updated to 1.0g
    -Fixed exception when players are kicked
    -More descriptive log when failed to read item
     
  9. Offline

    woodzy

    i will do that for you, it would seem that im a "tester" for you
    XD
     
  10. Offline

    gazius

    Would it be possible to add a configuration to disable the crouch + scroll switch and only use a command like /i1-9? I really like this mod but when working around lava it gets kind of inconvenient to have.
     
  11. Offline

    iarspider

    It would be nice (and quite logical, in fact) if backpack data is stored in the "world" folder(s), instead of a plugin folder.
     
  12. Offline

    Linaks

    Nice plugin :)
    One question..
    Is this plugin dynamic? I mean, i dont want to restart my server every minute if I want to add an user into the config list where i add him pages. Maybe you can add a command where we can add players with optional pages into the config list, like /bpadd Linaks [pageamount]

    /bpadd Linaks 9
    /bpadd mikel21 3
    etc..

    bp = backpack
    Linaks = Playername
    [pageamount] no description necessary :)


    Thanks <3

    //Edit:

    Bugreport: If I restart the server, all items in the backpack are lost..
    PLEASE FIX THAT.
     
  13. Offline

    Afforess

    "/i" (as are many of the single letter command names) are already commonly used. I also want to keep this plugin as simple as possible, since I find that commands often take away from the minecraft experience, and fragment gameplay. So no. ;)

    I'm pretty sure most people would cringe and run in panic at any plugin that touched the world folder. I know I wouldn't want any plugin that modifies that directory.

    There's a "default" setting, but having a command to add players is a pretty decent idea. I'll add something like that next release.

    Backpack saves items on server restarts, but remember to use the "stop" command, and not just kill the process. Backpack also auto-saves every 5 minutes, but if you added items recently, and killed the server, they will be lost.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 10, 2016
  14. Offline

    Stephen92

    can someone please post ur users config i cant seem to be able to configure it.
     
  15. Offline

    DJHenjin

    hello I am having a problem with starting up my server where it hangs on backpack version 1.0g usign CB build 556 no error messages just takes forever to start.
     
  16. Offline

    Jessicadawn

    Quick question. Anyway you can make it /backpack off /backpack on

    and maybe use arrow keys not the scroll thing because it goes 2 fast
     
  17. Offline

    wierd

    Love this plugin, been using it for a while.
    I've got a couple issues I'd like to call attention to:
    1) There is a duplication/lost item bug having to do with /open
    if you /open a page, and put items into it, or take items out of it, then close the page with 'i', then without moving, use /open to open the same page again, the page will be what it was before you added or removed items from it. allowing you to duplicate items or accidetnally lose items (man, that sucks)
    you have to move after using /open or the changes wont save (can anyone else confirm this, or is it just my server?)
    I guess this means you save changes to backpack on a players move event.
    2) if a server is being unstable, it can cause the entire backpack file for a single user to be wiped, erasing all items except the ones on the page that already had open (im assuming its cause the active page is also stored in the player dat file)
    I really do not know the best way to handle either problem, but I figured I needed to say something to be sure you were aware of these problems.

    Thanks for the wonderful plugin.

    Just found another bug...
    3) If a player logs in then logs out without moving, if the server then shuts down, you get this error message.
    Code:
    09:27:03 [INFO] [BACKPACK] Saving Player Data!
    09:27:03 [SEVERE] java.lang.NullPointerException
    09:27:03 [SEVERE] at com.afforess.backpack.BackpackPlayer.getInventoryPage(BackpackPlayer.java:23)
    09:27:03 [SEVERE] at com.afforess.backpack.PlayerInventoryUpdater.<init>(PlayerInventoryUpdater.java:16)
    09:27:03 [SEVERE] at com.afforess.backpack.Backpack.onDisable(Backpack.java:45)
    09:27:03 [SEVERE] at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:120)
    09:27:03 [SEVERE] at org.bukkit.plugin.java.JavaPluginLoader.disablePlugin(JavaPluginLoader.java:465)
    09:27:03 [SEVERE] at org.bukkit.plugin.SimplePluginManager.disablePlugin(SimplePluginManager.java:229)
    09:27:03 [SEVERE] at org.bukkit.plugin.SimplePluginManager.disablePlugins(SimplePluginManager.java:223)
    09:27:03 [SEVERE] at org.bukkit.craftbukkit.CraftServer.disablePlugins(CraftServer.java:81)
    09:27:03 [SEVERE] at net.minecraft.server.MinecraftServer.g(MinecraftServer.java:227)
    09:27:03 [SEVERE] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:302)
    09:27:03 [SEVERE] at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    09:27:03 [SEVERE] [BACKPACK] Failed to save --nameremoved--'s inventory data!
    as you can see, thats bad =) the backpack data for that player is wiped.
    if a player makes sure to move before logging back out, no problems when the server shuts down
     
  18. Offline

    Badzilla

    Well, this is certainly not funny at all. I just lost all of my inventory from every one of the slots but the first slot. Why would it do this? Is there any way to get it back?
     
  19. Offline

    Afforess

    Please upload your entire backpack data folder.

    Yeah, I'll add that next release.

    Wow, thanks for the detailed report.

    1.) Yes, you have the problem dead on. I check for moving or scrolling to detect when the player has exited the window, but it seems you found a way around that. I've changed the plugin so the /open command will also update the inventory correctly too.

    2.) I've done almost everything I can to minimize data loss, since I realize it's a critical issue. For the next release, I'm going to have Backpack back up the data file when it writes a new one, and restore it if something goes wrong. Hopefully that will help mitigate issues.

    3.) Ouch! And such an easy bug to fix too.

    By lost - you mean your items are gone?

    First - are you sure you didn't just scroll to a new page by mistake?
    Second - If you're items really ARE gone, what were you doing around the time they disappeared? Item loss should only occur at server restarts, if at all. Does your console report anything unusual?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 10, 2016
  20. Offline

    Badzilla

    Gone means gone. The first time it was all slots except the main one. When I got up this morning, there was more messages in the console about the issue with MM vehicle or something like that. It has been reported in the MM thread many times. This caused the client to disconnect. I closed the client and did a stop on the server. Started both back up and I had absolutely no items in any slot.

    I say slot meaning page. So all pages all slots gone.
     
  21. Offline

    Afforess

    Okay, while the more robust system in 1.1 that includes backing up the entire data file, and other measures *should* eliminate that. Please give it another try again with 1.1

    Backpack updated to 1.1
    -Added /backpack command to toggle backpack on or off
    -More robust backup and inventory system to protect the integrity of your inventory.
     
  22. Offline

    Badzilla

    This thing is still loosing items left and right. This time there were no client or server messages to indicate a problem. I spent an hour replacing all of my and now they are gone again!
     
  23. Offline

    Afforess

    ?

    That's impossible. I'd wager that you're using it wrong, not that it's losing items. I've hardly ever had a problem, and not lost anything for weeks at a time.
     
  24. Offline

    Badzilla

    How could I be using it wrong? You scroll to a page and place items in that page. I did restart the client and server several times because of the MM core update issue. That F version made my minecarts go nuts so I rebooted several times until I saw the G version. Now I just went to my page where I had all of my construction items and it is empty.

    Edit: I am going to empty out any remaining items and delete the directory and restart the server so it can recreate the files.

    On that note, what is the format of that save file. Would it be possible to modify it directly and have it reload items instead of me spending so much time doing /give over and over?
     
  25. Offline

    Afforess

    FYI, you need to "stop" the server to save the items correctly. Killing the process is bad. The data file is in plain text. Double check it's being creating, should be in plugins/backpack/data
     
  26. Offline

    Badzilla

    The file is there. I opened the file with a text editor and see several sections. Current Page: and a number. Not sure what this means but then the other sections are page: and a number from 0-8. At one point that I looked at the file most entries said null. now most have 0:0:-1

    I always escape out of minecraft and quit from there and do a stop on the server.
    I think this app should do some kind of save as it runs just in case a server crashes.

    Edit: More info.

    With the server shut down the data file has what looks to me to be valid data. The only thing is that the Current Page: number is not the page I was last on. Don't know if this matters or not.

    Then I start up the server and client and log in. The data file still looks the same. The thing is the bottom bar has the first block highlighted but the bar shows no items. I do a shift scroll and then the items show up. At this point the data file has data in the Current Page area but all of the rest are null. Logging out of the client does not write data back to the file. At this point if the server locked up, all items would be gone.

    I don't know if this is a bug or you designed it this way but it is for sure wrong. That data should be getting updated.
     
  27. Offline

    Afforess

    Backpack auto-saves the inventory of every player every 5 minutes, in addition to saving on server shutdown. It saves the contents of each inventory page, in slot order. The first number is the item id, then item amount, then durability/data value. "null" or "0:0:-1" is empty slot or air.

    The only time that data loss can occur is when saving/reloading data. I already mentioned when data is saved, but the data is only reloaded when a player joins the server for the first time since the startup.

    You can test this by giving yourself some items, then using /reload to force the plugin to save to the file. Check your file for your player, and you should expect to find some non-air entries there.

    No, actually, it isn't. I'm not using the server's list of online players, I'm using a custom list of players who've logged on since the server's started. Every player who's logged on since the server started it kept in memory until the shutdown. So the data does not need to be saved at the client logoff. If you log back in later, without shutting down the server, it uses the information still in memory, not the saved data, so there's no data loss. The 5 minute save interval should be plenty of time to save stuff, in addition to the saving at server shutdown.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 10, 2016
  28. Offline

    sintri

    I've had some pages disappearing, page # replacing page 1, and page 1 duplicating to page # before. There were some instances of server crashes from other unstable plugins, but rest of the shutdowns are all done by /stop. At any rate, trying 1.1.
     
  29. Offline

    Badzilla

    Afforess:
    This plugin needs work to fix the data saves. I just lost all of my items again.
    I was testing moving to CB561 and of course many many errors on start up.
    I did a stop and removed the plugins that had errors and started back up.
    Started the client and logged in. All items except one page were gone.
    Fortunately, before I messed with CB561 I saved a copy of the data file.
    I like this plugin but every hour or so I have to log out and stop the server and save the file.
    There has to be a better way to implement the saving of the data.
     
  30. Offline

    Afforess

    Without reproducible steps to cause the data loss, I can't fix it. I have every data backup and exception handling system in place that I can imagine.
     
  31. Offline

    bob3695

    Hello,

    I have yet to try this plugin out but I had a quick question before I did. I am currently using Multiverse to have multiple worlds and MultiInv to give me the ability to restrict access to sharing inventory over certain worlds. I doubt it but will this plugin work with it? If not and I decide to switch to this plugin has anyone done that? Will all my users loose their inventory?

    Once I have these questions answered I will be able to come to a decision as to if I will use this plugin or not.

    Thanks
     

Share This Page