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)
As it says above, if there are no issues that I can fix (ie, aren't on Bukkit's side) then I'm going to promote 1.4.1 to recommended on August 21st :)
<<reply 871596="">>
great so if they had enchanted diamond items in there and other valuables im the one who has to deal with them complaining :(
and yes i used the importer
@PhanaticD
They'll lose their Ender Chest contents when they first open it but I'm glad to hear everything else seems ok!
(Edit: When Bukkit add an API for getting the player's Ender Chest properly they won't need to lose everything)
Did you use the importer?
one person complained they lost the contents of their enderchest, (other peoples enderchest contents are still there so IDK) after using 1.4.0 but otherwise everything seems to be fine
@snowy007
If you're willing to test something (please make backups first!) the build mentioned above has a "loadinvonlogin: true" option. That forces the player's inventory to load on login (the default behaviour is to let Minecraft handle it). The downside is that you have to import your old files. Might be worth a try :)
I'm having a little problem..... I am using this plugin for per-world inventories, and xAuth for player authentication.
Now, xauth removes your inventory when you are not logged in and gives it back to you, after you log in. I can't remember having this problem before 1.3.1 though, but when i am not logged in (so my inventory is still empty) and then quit the game. (so world-inventories saves the current empty inventory) I lose all the items i had in my inventory. When i log back in i don't get my old inventory back.
I don't know which of the 2 plugins causes this, its probably the combination between the two but i can't remember having this problem before updating world-inventories from 1.2 to 1.3. 2 people already complained about this after i updated the plugin to 1.3 and i never heard anyone say anything about it before. (and i'm using this plugin since januari)
Edit!: The problem might be xAuth though.... seems more people are having problems with disappearing inventories.
@dogbig
Fixed a few bugs and uploaded the new build #83, give it a try (how to import is described above).
http://ci.crafte.rs/job/WorldInventories/83/
@dogbig
It's written and I'm testing it now :) However, is there a chance you could do me a favour? I could use a bunch of test files and they're kind of difficult to generate myself. If you feel like helping could you drop it in here: https://github.com/Drayshak/WorldInventories/issues/40
Thanks!
I hope you will write import to new file format soon in dev build :)
@WizardCM
I'll take a look at the Multiverse-Inventories API. I have to write an importer for old saves from this plugin too (for the recent dev builds).
Last I remember MV-I has a much more complex configuration system, I'll have to do some thinking as to what the default behavior should be.
I was wondering, is there a way to export Multiverse-Inventories to World Inventories? I'm looking into switching from Multiverse this plugin but I cannot without this.
There's a build with preliminary Ender Chest support available up above in the "Ender Chests and written books" section. Please read the text in bold!
@Tux2
Hi there,
Listening for those events is the approach I've taken on my local testing branch. It seems to work ok but there are a couple of issues so I'm going to wait for Bukkit to mature a little before pushing it up.
As a heads up - the license for my work changed today. It's now public-domain but requires attribution for any source copied part or in full. Whilst I don't believe you have to do anything in particular for code copied before the change (as it was perfectly acceptable to do so before under the GPL license), I'd like to ask that you attribute the bits copied out of courtesy :) The full (but thankfully quite short) license is linked above, or available in LICENSE.md in the root of the project. Feel free to message me if you have any concerns (or to tell me that I'm an idiot and missed any attribution done already! :D).
Edit: As a second heads up, I'm rewriting the saving/loading stuff (which means a whole bunch of the plugin is changing too) - this might break importing stuff.
@CarrotCodes
I have integrated enderchest support into MultiInv and wouldn't mind you looking over the code in order to see how to do it yourself. Although it may seem a little convoluted as far as all the methods I have in place they are to prevent different dupe exploits I found during testing. Hopefully this helps: https://github.com/Pluckerpluck/MultiInv/blob/master/src/uk/co/tggl/pluckerpluck/multiinv/listener/MIEnderChest.java
@Ekevoo
That makes sense to me too. I'd like each set of inventory/worlds to have its own ender chest if possible.
Is there a way to switch from this to multiinv?
@CarrotCodes
In my opinion the Ender Chest is an extension of the player's inventory, just a bit more difficult to reach. If in this world the player keeps the same inventory when going to that world, then the same applies to that player's Ender Chest. So if we have that trio (world / world_nether / world_the_end) with inventories preserved, the enderchest is preserved, then that other creative world has its own creative world inventory+enderchest.
@breezeyboy
Competion isn't a bad thing, and a lot of people appear not to like MultiInv, which is why they are using this.
it autoswitch from creative to survival mode and viceversa?
Sorry but multiinv already does this