Suggestion: Enchantment Stripper
Alex-hawks opened this issue ยท 1 comments
A Block that we put next to any of the Barrels (including the AntiBarrel) that we feed books and some kind of other balancing agent (be it power, lapis because of enchanting, or liquid XP), and strips enchantments from the items entering the Barrel. In the case of the Item Barrel Connector or the AntiBarrel, it'd insert both the now unenchanted item and the freshly enchanted book into the Connector or AntiBarrel. If it fails to insert the book, or the barrel is a plain old Barrel, it'd insert the book into another adjacent inventory, starting with the one opposite the Enchantment Stripper from the Barrel or Connector.
The best way that I see to do this is to use Block#onNeighborChanged() to scan for an Enchantment Stripper to cache in the Barrel's TE, starting with the direction of the changed Block, but checking all directions for the case of a player having two (or more) Enchantment Strippers next to a Barrel, and breaking the one that was cached. As it's not the sort of data that needs to be written to disk, a check in TileEntity#onLoad() would be needed as well