HEY GUYS HAPPYGOPUCKEY HERE WITH ANOTHER PLUGIN
Spoiler: Show
Image


This one's called Provo and I made it basically as a compilation of various features I found were somehow missing from other plugins.

Here's a list of features that are implemented in 1.0:
  • (Crown jewel) Inventory sorting
  • /recipe
  • /measure
  • /math
  • /unenchant
  • Mail
  • Reminders

Use /provo in-game to see a full list of commands and how to use them.

For now, this post will be mostly geared towards explaining and teaching you how to use what is by far the most powerful and complex tool in the plugin:

Sorting

The sorting feature on this plugin is inspired by the mods InventoryTweaks and the late ConvenientInventory, both great mods. However, neither of them work too well on multiplayer, due to lag issues. Also, this requires no client-side installation!

I also borrowed the "inventory description" system from InventoryTweaks, so if you're familiar with that then this feature should be much easier to understand.

For a quick start, no configuration is needed, simply jump to the game and use /sortinginfo for a brief tutorial. The below is focused on understanding every feature.

Sorting is done by the /sort command and can sort player inventories or chests. /sort takes one argument, and that is the name of a class you have. Classes are sets of rules about exactly how you want your inventory sorted.

You can have several classes, for instance I started out with one "mining", one "farming", and one "building".

Classes (as previously shown) have names, and are also made for a certain type of inventory. You can make a class for a PLAYER, CHEST, or DOUBLECHEST. Player classes will only sort your inventory. CHEST classes can be used on single and double chests (though only the first 3 rows will be sorted). DOUBLECHEST classes can only be used on double chests.

A class, is, as I defined above, a set of rules. To understand classes, you must first understand rules. A rule is basically just a pair of two things: An item (or group thereof, we'll discuss that later), and an area in your inventory to where you want those items to go. Classes can also inherit each other (more on that later).

InventoryTweaks had rules like these, so I borrowed their system. These areas are defined as follows: A letter for the row of the inventory (A-C for chests, A-D for players, A-F for doublechests), and a number for the column. A is always the first row, descending from there. For example, A9 is the top right corner on all inventories. In player inventories, D1 is the first slot of the hotbar (personally, I like to keep my swords there). Keep in mind that this is limited to the size of the inventory.

Areas can be either defined by a singular coordinate (A9, or D1), or a range (for example A1-B3). This range can either be a line that wraps around, or a rectangle. For this we have certain area types. For commands (see later): for a line, the type is LINEAR, and for a rectangle the type is RECTANGULAR. For a single coordinate, you don't need to specify a type.

Singular rules for a tool type (e.g. D1 for a sword) will always match the strongest of that tool type in your inventory.

Rules can also have priorities (more on that later).

Now that you're familiar with these concepts, you can create your classes and rules! While sorting itself is done in the /sort command, managing your preferences is done in the /sorting command. The addition commands are as follows:

Code:
/sorting add-class <name>[:inherits] <type>
/sorting add-rule <class>[:priority] <item/group> <area> (area type)


Note that there are many more /sorting commands than this but these are the ones for creating things. For a full list of sorting commands, see /sorting help.

To create a class, use /sorting add-class. <name> is the name of the class that you want. <type> is the type of the inventory you wish it to sort (if you recall earlier, PLAYER, CHEST, or DOUBLECHEST). More on inherits later.

To add a rule to a class, use /sorting add-rule. <class> is the name of the class you wish to add the rule to. <item/group> is the name of the item (or group, more on those later) you wish for this rule to match. Area and area type are the areas this rule will match. (If you recall earlier, area types can be LINEAR or RECTANGULAR). For example, /sorting add-rule myclass sword D1 will add a rule to a class named "myclass" that matches the strongest sword to slot D1. /sorting add-rule mining cobblestone A1-C5 RECTANGULAR will add a rule matching cobblestone to a rectangle around slots A1 and C5.

Seting the item/group to "locked" will make the items in that slot stay there, regardless of whatever rules are in place. For example, if you want to lock items on your hotbar, for instance D4-D8, you can do so. However note that as of now, regardless of priorities, locked rules take precedence over everything. This is to be changed in a later update.

Note: For items that don't match any rules, the plugin will always try to put them in spaces that aren't touched by any rules before putting them in spaces that are already "claimed".

Groups are, as their name implies, groups of items. They are configurable by the server, which means if you have an idea for a group, you can suggest it! To see a list of groups, use /sorting list-groups. To see what items a group contains, use /sorting view-group <groupname>. Groups can be used just like item names can. There are a few groups "hardcoded" in the plugin, which means that they'll always be there, but they can also be overriden by server admins. These groups are blocks, items, edible, flammable, and burnable. They match what their name implies, and are based on Bukkit's definitions of those words. For another example, /sorting add-rule mining blocks A1-B9 RECTANGULAR will try to put blocks in the top half of the player's inventory. Also, the groups "*" or "any" match any item. These can be used for inherited classes, more on that later.

By default you are given a class named base. Here's a list of rules in that class:
  • sword D1
  • shovel D2
  • pickaxe D3
  • torch D9

Classes can inherit each other. Classes that inherit another class take on the rules of that class. To make a class inherit another, simply put a colon (:) and the name of the class you wish to inherit after the name of the class you're making in your /sorting add-class command. For example, /sorting add-class mining:base PLAYER creates a class (for a player inventory) called "mining" that inherits the class "base".

Rules can have priorities. Rules with higher priorities will match items before rules with lower ones. To add a priority, when using the /sorting add-rule command put the number after a colon (:) after the class's name. Priorities can be positive, zero, or negative. Rules have a default priority of 1, EXCEPT for inherited classes, whose rules have a default priority of one PLUS their original priority (e.g. a rule in class base with a priority of 1 will have a priority of 2 when it's inherited). Priorities are useful for overriding rules of a class that you decide to inherit. For example, /sorting add-rule myclass:3 pickaxe D2 creates a rule with priority 3 in class "myclass" that matches a pickaxe to slot D2. If "myclass" inherited base, then pickaxes would go to D2 before they went to D3. The "*" and "any" groups can be used to override a rule, you can use that to "fix" the fact that the plugin will try not to match items to spaces "claimed" by inherited rules.

Thanks for reading! I hope the plugin is as useful to use as it was painstaking for me to write :lol: Contact me if you have any questions!

_________________
transformation tuesday: my selfie from the original selfie thread vs my selfie now