EntityByClass

Discussion in 'Bukkit Preview' started by Mike Primm, Jan 18, 2012.

  1. Offline

    Mike Primm

    This enhancement provides a generic means to enumerate the population of entities matching one or more provided types. This is a significant advantage over the present World.getEntites() and World.getLivingEntities() - both of which return entity populations greatly in excess of what most plugin authors need. Also, by allowing more than once class/interface to be provided, plugins can get all the entities that they have a need to return with a single call (and, thus, a single traversal of the entity population), versus requiring one traversal for each desired class or population. When more than one class is provided, any entity matching one or more of them will be returned once in the Collection returned (i.e. it is logical set consisting of the union of the entities matching each classes provided).
     

Share This Page