plethora icon indicating copy to clipboard operation
plethora copied to clipboard

displayName for AE2 listAvailableItems

Open jztmanyl opened this issue 5 years ago • 5 comments

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.

jztmanyl avatar Jul 04 '19 21:07 jztmanyl

Kudos for attempting to fix yourself, people like you rock. Also yes, I vouch for this enhancement.

Wendelstein7 avatar Jul 05 '19 18:07 Wendelstein7

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.

SquidDev avatar Jul 05 '19 20:07 SquidDev

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

jztmanyl avatar Jul 05 '19 20:07 jztmanyl

@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!

Wendelstein7 avatar Jul 05 '19 20:07 Wendelstein7

I would also like to see it added since calling finditem().getMetadata() on ae2 is very slow...

fionera avatar Jan 26 '20 19:01 fionera