mirror of
https://github.com/ProjectSWGCore/NGECore2.git
synced 2026-10-05 20:12:51 -04:00
Added a method to get items in inventory by STF name
This commit is contained in:
@@ -1821,6 +1821,15 @@ public class CreatureObject extends TangibleObject implements Serializable {
|
||||
getSlottedObject("inventory").viewChildren(this, true, true, (obj) -> adder.increment());
|
||||
return adder.intValue();
|
||||
}
|
||||
|
||||
public Vector<SWGObject> getItemsInInventoryByStfName(CreatureObject creature, String stfName) {
|
||||
Vector<SWGObject> itemList = new Vector<SWGObject>();
|
||||
SWGObject inventory = creature.getSlottedObject("inventory");
|
||||
|
||||
inventory.viewChildren(creature, false, false, (item) -> { if (item.getStfName() == stfName) { itemList.add(item); } });
|
||||
|
||||
return itemList;
|
||||
}
|
||||
|
||||
public ObjectMessageBuilder getMessageBuilder() {
|
||||
return messageBuilder;
|
||||
|
||||
Reference in New Issue
Block a user