plethora
plethora copied to clipboard
displayName for AE2 listAvailableItems
As the title suggest I would like a displayName in the function listAvailableItems.
data.put("displayName", stack.getItem().getDisplayName());
I tried adding this line too getItemStackProperties() but it didn't work for me, I am a beginner at programming so probably my fault.
Kudos for attempting to fix yourself, people like you rock. Also yes, I vouch for this enhancement.
Hrmr, going to need to have a wee think about this.
The general idea of item methods like list
and listAvailableItems
is that they provide sufficient metadata to uniquely determine the item, but most of the interesting stuff should only be accessible from .getItemMeta
, findItem
, etc...
On the other hand, I have compromised on this in the past, and I can definitely see why this would be a useful shortcut.
data.put("displayName", stack.getDisplayName());
ended up adding this in method fillBasicMeta
(org.squiddev.plethora.integration.vanilla.method.MethodsInventory
) so list
and listAvailableItems
return a displayName, I did this cause I wanted to monitor my items
this might be bad, let me know if it is
@SquidDev You could probably motivate an implementation like this in the context of reducing server load, since getItemMeta is an entire peripheral call by itself, so compare needing to do .list
once or .getItemMeta
in a loop. Anyhow, if you're going to implement this be sure to have it consistent amongst all containers and inventories!
I would also like to see it added since calling finditem().getMetadata() on ae2 is very slow...