Package net.minecraft.world.entity
Class SimpleEntityLookup<T extends EntityLike>
java.lang.Object
net.minecraft.world.entity.SimpleEntityLookup<T>
- Type Parameters:
T
- the type of indexed entity
- All Implemented Interfaces:
EntityLookup<T>
public class SimpleEntityLookup<T extends EntityLike> extends Object implements EntityLookup<T>
An implementation of entity lookup backed by two separate
EntityIndex
and SectionedEntityCache
.
It's up to the user to ensure that the index and the cache are consistent with each other.
- Mappings:
Namespace Name official cmh
intermediary net/minecraft/class_5578
named net/minecraft/world/entity/SimpleEntityLookup
-
Field Summary
Fields Modifier and Type Field Description private SectionedEntityCache<T>
cache
private EntityIndex<T>
index
-
Constructor Summary
Constructors Constructor Description SimpleEntityLookup(EntityIndex<T> index, SectionedEntityCache<T> cache)
-
Method Summary
Modifier and Type Method Description <U extends T>
voidforEach(TypeFilter<T,U> filter, Consumer<U> action)
Performs anaction
on each entity of typeU
within this lookup.void
forEachIntersects(Box box, Consumer<T> action)
<U extends T>
voidforEachIntersects(TypeFilter<T,U> filter, Box box, Consumer<U> action)
T
get(int id)
Returns an entity by its network ID, ornull
if none is found.T
get(UUID uuid)
Returns an entity by its UUID, ornull
if none is found.Iterable<T>
iterate()
Returns an unmodifiable iterable over all entities in this lookup.
-
Field Details
-
index
- Mappings:
Namespace Name Mixin selector official a
Lcmh;a:Lclz;
intermediary field_27258
Lnet/minecraft/class_5578;field_27258:Lnet/minecraft/class_5570;
named index
Lnet/minecraft/world/entity/SimpleEntityLookup;index:Lnet/minecraft/world/entity/EntityIndex;
-
cache
- Mappings:
Namespace Name Mixin selector official b
Lcmh;b:Lcmc;
intermediary field_27259
Lnet/minecraft/class_5578;field_27259:Lnet/minecraft/class_5573;
named cache
Lnet/minecraft/world/entity/SimpleEntityLookup;cache:Lnet/minecraft/world/entity/SectionedEntityCache;
-
-
Constructor Details
-
SimpleEntityLookup
- Mappings:
Namespace Name Mixin selector official <init>
Lcmh;<init>(Lclz;Lcmc;)V
intermediary <init>
Lnet/minecraft/class_5578;<init>(Lnet/minecraft/class_5570;Lnet/minecraft/class_5573;)V
named <init>
Lnet/minecraft/world/entity/SimpleEntityLookup;<init>(Lnet/minecraft/world/entity/EntityIndex;Lnet/minecraft/world/entity/SectionedEntityCache;)V
-
-
Method Details
-
get
Returns an entity by its network ID, ornull
if none is found.- Specified by:
get
in interfaceEntityLookup<T extends EntityLike>
- Mappings:
Namespace Name Mixin selector official a
Lcmg;a(I)Lclx;
intermediary method_31804
Lnet/minecraft/class_5577;method_31804(I)Lnet/minecraft/class_5568;
named get
Lnet/minecraft/world/entity/EntityLookup;get(I)Lnet/minecraft/world/entity/EntityLike;
-
get
Returns an entity by its UUID, ornull
if none is found.- Specified by:
get
in interfaceEntityLookup<T extends EntityLike>
- Mappings:
Namespace Name Mixin selector official a
Lcmg;a(Ljava/util/UUID;)Lclx;
intermediary method_31808
Lnet/minecraft/class_5577;method_31808(Ljava/util/UUID;)Lnet/minecraft/class_5568;
named get
Lnet/minecraft/world/entity/EntityLookup;get(Ljava/util/UUID;)Lnet/minecraft/world/entity/EntityLike;
-
iterate
Returns an unmodifiable iterable over all entities in this lookup.- Specified by:
iterate
in interfaceEntityLookup<T extends EntityLike>
- Mappings:
Namespace Name Mixin selector official a
Lcmg;a()Ljava/lang/Iterable;
intermediary method_31803
Lnet/minecraft/class_5577;method_31803()Ljava/lang/Iterable;
named iterate
Lnet/minecraft/world/entity/EntityLookup;iterate()Ljava/lang/Iterable;
-
forEach
Performs anaction
on each entity of typeU
within this lookup.- Specified by:
forEach
in interfaceEntityLookup<T extends EntityLike>
- Type Parameters:
U
- the type of entity to perform action on- Parameters:
filter
- specifies the desired type of entityaction
- the action to perform- Mappings:
Namespace Name Mixin selector official a
Lcmg;a(Lcme;Ljava/util/function/Consumer;)V
intermediary method_31806
Lnet/minecraft/class_5577;method_31806(Lnet/minecraft/class_5575;Ljava/util/function/Consumer;)V
named forEach
Lnet/minecraft/world/entity/EntityLookup;forEach(Lnet/minecraft/util/TypeFilter;Ljava/util/function/Consumer;)V
-
forEachIntersects
- Specified by:
forEachIntersects
in interfaceEntityLookup<T extends EntityLike>
- Mappings:
Namespace Name Mixin selector official a
Lcmg;a(Ldki;Ljava/util/function/Consumer;)V
intermediary method_31807
Lnet/minecraft/class_5577;method_31807(Lnet/minecraft/class_238;Ljava/util/function/Consumer;)V
named forEachIntersects
Lnet/minecraft/world/entity/EntityLookup;forEachIntersects(Lnet/minecraft/util/math/Box;Ljava/util/function/Consumer;)V
-
forEachIntersects
- Specified by:
forEachIntersects
in interfaceEntityLookup<T extends EntityLike>
- Mappings:
Namespace Name Mixin selector official a
Lcmg;a(Lcme;Ldki;Ljava/util/function/Consumer;)V
intermediary method_31805
Lnet/minecraft/class_5577;method_31805(Lnet/minecraft/class_5575;Lnet/minecraft/class_238;Ljava/util/function/Consumer;)V
named forEachIntersects
Lnet/minecraft/world/entity/EntityLookup;forEachIntersects(Lnet/minecraft/util/TypeFilter;Lnet/minecraft/util/math/Box;Ljava/util/function/Consumer;)V
-