WorldInventories
WorldInventories
Discontinued
As of 11/05/2013 I'm no longer working on this project. I haven't played vanilla/Bukkit in a very long time, updates are becoming tedious and break often requiring rewrites, and I'm not enjoying development any more. The last uploaded version for 1.5.1 works fine (aside from the importing), and there's a chance it will also work across updates, but moving to another plugin, such as MultiInv, is highly recommended - you should also be able to import settings in to it.
Description
Switch any of the following player information when teleporting between groups of worlds:
- Inventory,
- Armour,
- Ender Chest contents,
- Potion effects,
- Health,
- Hunger,
- Experience,
- Game mode.
Player information is separated in to small YAML files (that you can edit) based on groups. Designed to be fast, simple and easy to use.
Want to keep existing player information? Use the vanilla import option as outlined in the configuration example. Players will get a blank inventory by default if you don't import data first!
Need to chat, notify me of a bug, suggest a feature or try and get some help? Go to the IRC channel! (information down in Links)
How to use
Simply put WorldInventories in the Bukkit plugins folder, run it once, edit the config file it creates. An example is included below (with an explanation of each configuration option).
Any worlds not included in groups share a "default" group.
Changes in 1.7.0
Importing support for files previous to v5 has been dropped. This was necessary to clean the project up (just look at the GitHub page if you want proof!) and make it easier to maintain. If you need to import previous to this, use 1.6 as a go-between. Vanilla importing still works fine.
Other changes and additions:
- Added message hiding granularity (hide specific message types, on login for example),
- Added language support,
- Massive code cleanup,
- Event priorities changed a bit, should improve compatibility with other mods,
- Built against 1.5.1,
- Added API - tell me if you would like something added to it!
A note about the dev builds: All importing is currently broken. I'm fixing vanilla importing, it will involve using the OpenInv plugin to load offline player inventories. OpenInv is optional and only required when doing the vanilla import.
Language support
As of 1.7.0 a new file, langs.yml, will be created on the first plugin run. A new configuration option, "language: en_GB" will also be generated.
To add a new language:
- Run the new version once, it'll generate lang.yml in the same place as config.yml, and add "language: en_GB" to the config as a default,
- Open lang.yml, copy one of the sections and call it something (preferably the country code),
- Set "language" to whatever you called it, save,
- Either do "/wireload language" or restart the server, check the console to see if there were any errors when trying to load your new language.
If you add a different language please let me know, I can add it to the defaults!
Why no SQL support?
For a plugin like this, it isn't necessary. Files are very, very small (you'd probably hit 10kb for a player with a completely full inventory), load extremely quickly and are fast to copy and backup as they are.
If you disagree with me, provide a performance report to me on IRC (there are lots of plugins to profile performance) and I'll think about it again.
Configuration example (with explanations)
Version 1.7.0
# A "group" is a collection of worlds which will share an inventory. # In this example there are two groups, a creative and a survival group # Each group has an overworld and a nether, which will share an inventory # Inventory switching examples # Scenarios when the inventory will not switch: # creative_overworld to creative_nether # survival_nether to survival_overworld # survival_end to survival_overworld # Scenarios when the inventory will switch: # creative_overworld to survival_end # survival_nether to creative_nether groups: creativegroup: - creative_overworld - creative_nether survivalgroup: - survival_overworld - survival_nether - survival_end # Add a player to the "exempt" collection to make this plugin ignore them completely # No saves, loads or anything else done by this plugin will apply to them until you remove them from the list exempt: - exampleplayer - exampleplayer2 # This is deprecated as of 1.7.0 - use message-hidden at the bottom instead! # donotifications: true # Set this to true to make WorldInventories attempt to import MultiInv data # Automatically sets itself to false when an attempt is made domiimport: false # Set "miimportmode" to the integer identifier of the mode WI should import from (eg, 0 for MI survival) miimportmode: 0 # Set to true to make hearts, food level, experience and such track with inventory dostats: true # If a save interval is specified below, set this to false to stop it from outputting to the console outputtimertoconsole: true # Set to anything above 30 to make inventories/stats save automatically every x seconds saveinterval: 0 # Set "do78import" to true to force a conversion of the pre build 78 files for use in newer versions # Automatically resets itself to false on an attempt do78import: false # Set "do141import" to true to force a conversion of the pre version 1.4.1 files for use in newer versions # Automatically resets itself to false on an attempt do141import: false # Set "dovanillaimport" to true to attempt an import of the items and stats stored in players player.dat file # Set "vanillatogroup" to the group you want to import to. If blank it will use the default group. dovanillaimport: false # When this plugin loads it will automatically try to convert pre build 78 files and add "auto78updated: true" to this file if successful # When this plugin loads it will automatically try to convert pre version 1.4.1 files and add "auto141updated: true" to this file if successful # Set "dogamemodeswitch" to true and add groups to gamemodes as per the example to enforce gamemodes # SURVIVAL, CREATIVE or HARDCORE at the time of writing (follows Bukkit's names) gamemodes: default: SURVIVAL creativegroup: CREATIVE survivalgroup: SURVIVAL dogamemodeswitch: false # Below are 1.7.0 and above # Set language to something stored in lang.yml language: en_GB # To hide a particular message type, set any of these to true message-hidden: died-message: false changed-message: false nochange-message: false loaded-message: false
Commands & Permissions
There are two commands as of 1.5.7:
- /wireload: Reloads the configuration,
- /wiexempt [add/remove] [player]: Add or remove the player from the exemptions list (whether the plugin does anything to their information specifically, e.g. when they switch a world).
In 1.7.0 the reload command changed slightly:
- /wireload [all/language]: Reloads the entire configuration or just the language.
There are also two permissions:
- worldinventories.reload: Allows the use of the /wireload command,
- worldinventories.exempt: Allows the use of the /wiexempt command.
Licenses
This work is distributed under the BSD 2-Clause license. Read the license
This plugin also uses XStream. Read the XStream license
Links / Download
Bukkit require me to include this notice when linking Jenkins builds, like the one below.
Development builds of this project can be acquired at the provided continuous integration server. These builds have not been approved by the BukkitDev staff. Use them at your own risk.
- Source code
- Available in the BukkitDev downloads!
- No beta builds.
- Issues / known bugs
- IRC - EsperNet #worldinventories
- Donate
Use IRC for new build notifications, telling me about issues and getting faster help!
(Only shows stats for version 1.4.1 and above)
Alright, well update on my last status. I think I finally figured out how to work the importer, but in the process of doing that I went from 1.2 to 1.4.1 to 1.5.7 to 1.6.0-dev-2 on a local test server to get my files imported. I think everything should be good now, so disregard my last comment. But from what I can gather, here is a quick writeup for people who have gone a long time without updating, like me.
If your inventories disappear after you update, stop your server and go to your worldinventories plugin folder. Check the config.yml. Set all the "autoupdated" fields to false, and set one of the "doimport" fields to true depending on your situation.
vanilla - I guess if you are setting up the plugin from not having it before? seems like it would do this automatically.
78import - if you are updating from before 1.4.1 (.inventory files)
141import - if you are updating 1.4.1 inventory files (.v3 files)
15import - if you are updating 1.5+ inventory files (.v4.xml files)
I'm having trouble importing my old inventories and was wondering if you could help. The new config stuff is a little confusing to me.
I moved my old plugin folder to a backup location and started fresh, hoping to go back and convert. I can't get anything I try to work, but cliffs notes is I have all my old files backed up (version 1.2.0-beta, and folder containing config and inventory files), and I'm trying to load 1.6.0-dev#2. Simply running the new plugin with the old folder in place didn't work for me either. Could you advise?
Really good plugin!! I use it for my PVP arena, when they gain stuff if they win! Perfect plugin! I would recommend it to everyone. We are currently rebuilding the arena, but when you are finished, you can see your plugin in action? Just visit the server in the signature
@DrayShack
We've been having an odd issue, and finally pinned it down.
When a player has an item that has an enchant with a level higher than the normal Vanilla MC limit, the player loses their whole inventory upon login. When this happens, the following error appears.
@InfroCZE
Not sure how you are having your server save (intervals set? Is a plugin doing it or do you have it set at a timed interval in bukkit.yml?), but mine works just fine.
Are you just force shutting down the server or doing a normal /stop?
Have you tried doing /save-all then stopping the server?
would it be possible to save inventories on server restart/shutdown? every time i restart my server and the invs are not saved, they are reverted to last save...
@Meindratheal
Yeah it's the same issue.
Trying to implement a blanket find/replace myself for the six/seven recorded servers on the 1.4.5 builds is bound to cause many more problems than the server administrator doing a find/replace batch on files (there are plenty of programs to do this). I try really hard to mitigate problems but it's the nature of dev builds and Bukkit changing things unexpectedly. Sorry :(
I was having issues importing my 1.4.5 inventory (WI version 1.6.0-dev) to 1.4.6 (WI version 1.6.0-dev2), with the ItemMeta issues you describe. For some reason, enchantments were recorded within ItemMeta blocks (not sure if this is supposed to happen or not).
As a workaround, I opened each of the *.inventory.v4 files and replaced all instances of '145' and '1_4_5' with '146' and '1_4_6' respectively. This seems to have worked fine. Could people with items with ItemMeta attached do the same thing? And, as a thought, maybe you could add something that does the same thing before importing the file?
So some where along the lines I goofed.
When I re-enabled worldinventories, (no world inventory folders) everyone's inventories were emptied.
I still have a backup of the worlds the day before, so the items are not totally lost.
How would I go about forcing it to gather the player's vanilla inv on their next login?
Could you add auto saving? Any server crash means players can lose lots of their items.
Can you add a parameter to say if enderchest is shared between worlds? If possible, separated from inventories, please.
@sillyrosster
Could you grab build #151 from the Jenkins page (link in the downloads section) and let me know if your issue persists? (I'm fairly sure that build fixes it).
Edit: if you'd rather wait for BukkitDev to check it I've uploaded a version to this site and it should appear in a day or so.
@CarrotCodes
Getting this on every start up: http://paste.royaldev.org/view/291
Every time I start the server, it says it's the first time using this version of WI and converts. I'm using the latest WI build that is available on BukkitDev.
Edit: A few peoples inventories are getting reset every time the server restarts. How do I turn off the conversion? I really need to.
@CarrotCodes
Thanks. I have how ever found a work around. Disable the Creative world for a week, before I update the server, so all players, who are active at least, will be logging out with the Survival inventories. Once the server is updated to MC 1.4.6, I will have WorldInventories wiped clean (folders backed up, details coming). Then as slightly inactive players rejoin and don't have their proper inventories, I'll look up their meta data. Though it might be a pain for the admins for each person, we don't really have a ton of active players that stay in the creative world.
Build #151 changes the default behaviour of importing slightly - an error will now no longer make it attempt again on the next try. Set "do15import: true" manually when you want to force an import again!
@Liger_XT5
Ah ok. Yeah, the best way is to get them to put their stuff in a chest before the update. There is no way for me to manually set offline players inventories without some nasty hacks, unfortunately.
@CarrotCodes
The items players get at 1.4.5 from diablodrops, if in the player's inventory when we update to 1.4.6, the player's inventory data would not transfer, if I read correctly above.
"Things that might not transfer include book data, item names and such"
The only work around I can think of that would save a lot of time and effort for players is to place all their inventories in a chest before the server updates.
I had a thought last night before I went to bed. We only have two inventory groups on our server. Survival and Creative. Since Creative Inventory is not a worry, any possible way to force all saved inventory data and login location to Survival and Main world Spawn? That way I can disable World Inventories and Creative World, update the server to 1.4.6 and no players lose their survival inventories. Once the server is updated to 1.4.6, I can pretty much start WorldInventories fresh.
Other than that, I don't suppose the chest idea I mentioned before would work in the conversion. Players could do a pre-update conversion, which would take the data in world inventories, save each player in their own chest-data-file, then when the server updates to 1.4.6, it loads the data back from the chests data files.
@Liger_XT5
I believe they would have the inventory of whichever group they logged out in last.
How come DiabloDrops would break things? 1.4.6 metadata works fine, I think Bukkit should serialize those items properly. (might be worth testing).
<<reply 1137185="">>
Thanks, I installed #150 en manual edited some inventory files.
Seems to work for now.
Thanks for all the work you punt into this plugin Drayshak.