Class EntityList

java.lang.Object
net.minecraft.world.EntityList

public class EntityList extends Object
A storage of entities that supports modification during iteration.

The entities are stored by their network IDs.

See Also:
Mappings:
Namespace Name
official dfn
intermediary net/minecraft/class_5574
named net/minecraft/world/EntityList
  • Field Details

    • entities

      private Int2ObjectMap<Entity> entities
      Mappings:
      Namespace Name Mixin selector
      official a Ldfn;a:Lit/unimi/dsi/fastutil/ints/Int2ObjectMap;
      intermediary field_27254 Lnet/minecraft/class_5574;field_27254:Lit/unimi/dsi/fastutil/ints/Int2ObjectMap;
      named entities Lnet/minecraft/world/EntityList;entities:Lit/unimi/dsi/fastutil/ints/Int2ObjectMap;
    • temp

      private Int2ObjectMap<Entity> temp
      Mappings:
      Namespace Name Mixin selector
      official b Ldfn;b:Lit/unimi/dsi/fastutil/ints/Int2ObjectMap;
      intermediary field_27255 Lnet/minecraft/class_5574;field_27255:Lit/unimi/dsi/fastutil/ints/Int2ObjectMap;
      named temp Lnet/minecraft/world/EntityList;temp:Lit/unimi/dsi/fastutil/ints/Int2ObjectMap;
    • iterating

      Mappings:
      Namespace Name Mixin selector
      official c Ldfn;c:Lit/unimi/dsi/fastutil/ints/Int2ObjectMap;
      intermediary field_27256 Lnet/minecraft/class_5574;field_27256:Lit/unimi/dsi/fastutil/ints/Int2ObjectMap;
      named iterating Lnet/minecraft/world/EntityList;iterating:Lit/unimi/dsi/fastutil/ints/Int2ObjectMap;
  • Constructor Details

    • EntityList

      public EntityList()
  • Method Details

    • ensureSafe

      private void ensureSafe()
      Ensures that the modified entities map is not currently iterated. If entities is iterated, this moves its value to temp so modification to entities is safe.
      Mappings:
      Namespace Name Mixin selector
      official a Ldfn;a()V
      intermediary method_31789 Lnet/minecraft/class_5574;method_31789()V
      named ensureSafe Lnet/minecraft/world/EntityList;ensureSafe()V
    • add

      public void add(Entity entity)
      Mappings:
      Namespace Name Mixin selector
      official a Ldfn;a(Lbfh;)V
      intermediary method_31790 Lnet/minecraft/class_5574;method_31790(Lnet/minecraft/class_1297;)V
      named add Lnet/minecraft/world/EntityList;add(Lnet/minecraft/entity/Entity;)V
    • remove

      public void remove(Entity entity)
      Mappings:
      Namespace Name Mixin selector
      official b Ldfn;b(Lbfh;)V
      intermediary method_31792 Lnet/minecraft/class_5574;method_31792(Lnet/minecraft/class_1297;)V
      named remove Lnet/minecraft/world/EntityList;remove(Lnet/minecraft/entity/Entity;)V
    • has

      public boolean has(Entity entity)
      Mappings:
      Namespace Name Mixin selector
      official c Ldfn;c(Lbfh;)Z
      intermediary method_31793 Lnet/minecraft/class_5574;method_31793(Lnet/minecraft/class_1297;)Z
      named has Lnet/minecraft/world/EntityList;has(Lnet/minecraft/entity/Entity;)Z
    • forEach

      public void forEach(Consumer<Entity> action)
      Runs an action on every entity in this storage.

      If this storage is updated during the iteration, the iteration will not be updated to reflect updated contents. For example, if an entity is added by the action, the action won't run on that entity later.

      Throws:
      UnsupportedOperationException - if this is called before an iteration has finished, such as within the action or from another thread
      Mappings:
      Namespace Name Mixin selector
      official a Ldfn;a(Ljava/util/function/Consumer;)V
      intermediary method_31791 Lnet/minecraft/class_5574;method_31791(Ljava/util/function/Consumer;)V
      named forEach Lnet/minecraft/world/EntityList;forEach(Ljava/util/function/Consumer;)V