Add idEquals to NPCQuery
This commit is contained in:
@@ -40,4 +40,21 @@ public class NPCQuery extends ActorQuery<NPC, NPCQuery>
|
|||||||
.filter(predicate)
|
.filter(predicate)
|
||||||
.toArray(NPC[]::new);
|
.toArray(NPC[]::new);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
public NPCQuery idEquals(int... ids)
|
||||||
|
{
|
||||||
|
predicate = and(object ->
|
||||||
|
{
|
||||||
|
for (int id : ids)
|
||||||
|
{
|
||||||
|
if (object.getId() == id)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
return (NPCQuery) this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user