mirror of
https://github.com/ProjectSWGCore/NGECore2.git
synced 2026-07-28 23:15:53 -04:00
Changed method for getting items by STF name to work with any container
Also moved it out of CreatureObject since that didn't really make sense anymore.
This commit is contained in:
@@ -731,6 +731,16 @@ public class ObjectService implements INetworkDispatch {
|
||||
return objectId;
|
||||
}
|
||||
|
||||
|
||||
public Vector<SWGObject> getItemsInContainerByStfName(CreatureObject creature, String containerName, String stfName) {
|
||||
Vector<SWGObject> itemList = new Vector<SWGObject>();
|
||||
SWGObject container = creature.getSlottedObject(containerName);
|
||||
|
||||
container.viewChildren(creature, false, false, (item) -> { if (item.getStfName() == stfName) { itemList.add(item); } });
|
||||
|
||||
return itemList;
|
||||
}
|
||||
|
||||
public void useObject(CreatureObject creature, final SWGObject object) {
|
||||
|
||||
if (creature == null || object == null) {
|
||||
|
||||
Reference in New Issue
Block a user