Magic Chest
Nobody enjoys rummaging through inventories to organize the contents. Why not hand that job down to the gremlins? Magic Chest auto-sorts your inventories while you have them closed, so that when you open them they are completely sorted and it's easy to find your stuff.
How It Works
1. Stacks of the same material are combined.
2. Stacks are sorted by item name.
3. Stacks of the same item name are sorted by Data (i.e. Wool Color)
4. Stacks with the same name and Data are sorted by Quantity (So the incomplete stack will be last)
- Note: Chests that are renamed in an anvil or that do not have the default Minecraft inventory title are excluded from sorting.
Before
After
Commands
/mgcs help: shows a command usage help page.
/mgcs on: turns auto-sorting on for the player that ran the command.
/mgcs off: turns auto-sorting off for the player that ran the command.
/mgcs invon: turns auto-sorting on for the players inventory when an item is picked up. (v1.2.4 and above)
/mgcs invoff: turns auto-sorting off for the players inventory. (v1.2.4 and above)
/mgcs reload: reloads all of MagicChest's config.
Permissions
magicchest.sort: Sorts all inventories that this player opens.
magicchest.sort.chest: Sorts chests that this player opens.
magicchest.sort.dispenser: Sorts dispensers that this player opens.
magicchest.sort.enderchest: Sorts ender chests that this player opens.
magicchest.sort.shulkerbox: Sorts a shulker box that this player opens.
magicchest.help: Shows a usage help.
magicchest.reload: Reloads all of MagicChest's config.
Reviews
cobwebster's (aka. ShinyTinselWorm) overview of MagicChest
Plugin Stats
Plugin Compatibility
dtlTraders- Avoids sorting TNPC inventories.
ChestCommands- Ignores sorting ChestCommands inventories.
FastCraft- Avoids sorting FastCraft menu.
AShops- Avoids sorting AShops inventories.
SkillAPI- Avoids sorting SkillTrees and other menus.
- If you have a problem with MagicChest sorting another plugins inventory or something like that please do not hesitate to leave a comment and let me know.
InventorySortEvent API (for plugin devs)
If you need to cancel MagicChest sorting an inventory, this is for you. Github Wiki
Massive shoutout & thanks to:
dandielo - making dtlTraders compatibility possible! Couldn't have helped folks without you!
timsavage - dtlTraders plugin compatibility request!
filoghost - author of the awesome ChestCommands plugin and the help and support of MagicChest! Couldn't have done it without your suggestion! :)
lecraeman - for requesting support of ChestCommands!
Kepler_ - author of FastCraft and supporter of MagicChest. Thanks for letting me know and working with me!
Metrics Information
Quote:This plugin utilises Hidendra's plugin metrics system, which means that the following information is collected and sent to mcstats.org:
A unique identifier The server's version of Java Whether the server is in offline or online mode The plugin's version The server's version The OS version/name and architecture The core count for the CPU The number of players online The Metrics version Opting out of this service can be done by editing plugins/Plugin Metrics/config.yml and changing opt-out to true.
@Kepler_
Check your PMs.
@uvbeenzaned
Okay, I wrote the api. I'll pm you the plugin and you let me know if it works correctly.
@Kepler_
Ok let me know.
@uvbeenzaned
That seems simple enough, I'll see what I can do.
@Kepler_
OK. Here's another suggestion, maybe you'll like it or not. I'll do all the plugin hooking and stuff and possibly you could supply a function/method like so that returns true or false based on if the supplied Inventory given to your plugin is owned by your plugin:
public static boolean isFastCraftInventory(Inventory i) { if(check for fastcraft inv here is true) { return true; } else { return false; } }
Adapt it maybe to what you need. It makes it really easy to do it that way rather than having to set up a way for plugins to talk to each other. This is basically a way of setting up a public API for other plugins to check against.
So is that possibly good enough for you?
@uvbeenzaned
Actually you can probably add an InventorySortEvent to your plugin, and my plugin will be able to cancel that to let yours know not to sort the inventory. Either way should work, let me know which way you prefer.
@uvbeenzaned
I'll see if I can add an event that triggers when a fastcraft inventory opens. It'll supply information like the inventory that's opening, and you can use that to determine if the inventory should be sorted. I'm not too experienced with plugin hooking, so if you know of a better way than using events, let me know.
@Kepler_
Also, may I add, if these ways mentioned are not going to be efficient enough, would you be willing to expose a public method for my plugin to access?
@Kepler_
I'll will fix it as soon as possible for you. I've had lots of experience lately with compatibility lately. Its fairly easy to do because I have a custom class just for plugin compatibility. Thanks for reporting your plugin! I'll post back when I upload a fixed version.
hmmmm... This plugin is conflicting with my plugin FastCraft. I use the inventory as a gui in this plugin, and the automatic item sorting in this plugin moves the items in the gui around. There are two ways I can think of to fix this: one is to check if the inventory is from a chest, and only sort the inventory if it is. The other is to use the PlayerInteractEvent instead of the inventory open event, and if the player interact event isn't cancelled, sort the inventory for the chest the player clicked. I hope you'll be able to fix it :D
@Mre30
Lol, I can sympathize with you. I kinda hate it because Material has so many weird names for the item names, for example, Gunpowder is sulfur instead. Because of this, gunpowder will show up in the S's at the bottom instead of the G's at the top. Ugggg Bukkit... Still love the Bukkit team though for all the hard work they do!
@uvbeenzaned
lol... that REALLY pissed me off. I have SOOOO many plugins I have made for my server... It took me ALL day to update to the new ItemStack(Material.whatever lol.
But whats funny... is that you still need to (short)number xD
All of you who are using this plugin as of now, please look at the new notice at the top of the description for a very important update to be coming soon hopefully!
@CommodoreAlpha
I am actually working on sorting by name right now. It is way more advanced to add features like that. I will keep your request in mind for sure because that's something even I wanted to do. I do have to tell you right now though, it will be a very long process making a config file that can be read to sort the items. I'll have to get someone who can volunteer to write a config file that will give us some logical sorting of items like you said, wood with wood, stones with stones, and so forth. I'll try to keep you up to date on what is going on. I'll just let you know right now that I'm getting really close to being finished with sorting by name. I've just ran into the bug that I had before where items that are similar to each other are stacked together, therefore loosing all of the special types of that particular item. Just know that more is in store for this plugin. Thanks for asking anyway!
Does it only sort by Item ID, or can we let it sort by our own custom standards? For example, it would be easier to sort by material (e.g. all the chests, wooden doors, wooden plates, wooden fences, wooden planks, logs together, and all the furnaces, stone, cobblestone, stone brick, together, and etc.) than to sort by the order of item IDs.
@nuhll
@lecraeman
Your welcome and thanks guys!
@uvbeenzaned
THANK YOU :D
Best plugin in the world.
@lecraeman
Just uploaded your request! Full support for ChestCommands has been added! Wait for it to be approved here or download it from Networkery: http://dw.networkery.co/bukkitdev/MagicChest/MagicChest.jar
Also please check the shoutout portion of the plugin description above! You are in it for requesting support of ChestCommands!
@lecraeman
I am not Skyping any really. Just subscribe to the comments here instead.