brunyman / CustomEnderChest

8 stars 14 forks source link

Create custom InventoryHolder class #13

Open mfnalex opened 4 years ago

mfnalex commented 4 years ago

Hello, I am the author of ChestSort (www.chestsort.de). I was asked to add support for your CustomEnderChest plugin here: https://github.com/JEFF-Media-GbR/Spigot-ChestSort/issues/80

As it seems, you use inventories with the player as holder. In ChestSort, I check if an inventory is sortable by checking different criteria. For example, if an inventory's holder is a player, but the inventory does not equal Player#getInventory(), it's most likely some GUI that should NOT be sorted.

So, I currently have no way to check whether an inventory belongs to a CustomEnderChest.

Suggestion: You create a subclass for InventoryHolder, e.g. called CustomEnderChestInventoryHolder, and use that as a holder instead of the player. That way I could just check if Inventory#getHolder#getClass#getName equals net.craftersland.customenderchests.CustomEnderChestInventoryHolder and it would work fine.

I would create a pull request myself but you don't use maven, so I would either convert the project myself or wait until you implement the custom class.

It would be nice if you could think about adding this :)

mfnalex commented 4 years ago

I already converted the project to maven: https://github.com/brunyman/CustomEnderChest/pull/14