Archetype
Package: com.hypixel.hytale.component
public class Archetype<ECS_TYPE> implements Query<ECS_TYPE>Represents a unique combination of ComponentType instances that defines an entity’s shape. Entities with identical archetypes are stored together in the same ArchetypeChunk, enabling cache-friendly iteration. Archetype also implements Query, matching any entity whose archetype contains all of this archetype’s component types.
Archetypes are immutable. Adding or removing a component produces a new Archetype instance.
Type Parameters
Section titled “Type Parameters”ECS_TYPE— the store type parameter
Static Factory Methods
Section titled “Static Factory Methods”public static <ECS_TYPE> Archetype<ECS_TYPE> empty()@Nonnullpublic static <ECS_TYPE> Archetype<ECS_TYPE> of(@Nonnull ComponentType<ECS_TYPE, ?> componentType)@SafeVarargspublic static <ECS_TYPE> Archetype<ECS_TYPE> of(@Nonnull ComponentType<ECS_TYPE, ?>... componentTypes)@Nonnullpublic static <ECS_TYPE, T extends Component<ECS_TYPE>> Archetype<ECS_TYPE> add(@Nonnull Archetype<ECS_TYPE> archetype, @Nonnull ComponentType<ECS_TYPE, T> componentType)public static <ECS_TYPE, T extends Component<ECS_TYPE>> Archetype<ECS_TYPE> remove(@Nonnull Archetype<ECS_TYPE> archetype, @Nonnull ComponentType<ECS_TYPE, T> componentType)Query Methods
Section titled “Query Methods”public int count()Returns the number of component types in this archetype.
public boolean isEmpty()public boolean contains(@Nonnull ComponentType<ECS_TYPE, ?> componentType)public boolean contains(@Nonnull Archetype<ECS_TYPE> archetype)Returns true if this archetype contains all component types in the given archetype.
@Nonnullpublic ExactArchetypeQuery<ECS_TYPE> asExactQuery()Returns an exact-match query for this specific archetype.
Related Types
Section titled “Related Types”- ArchetypeChunk — stores entities sharing the same archetype
- ComponentType — the component handles that compose an archetype
- Holder — carries an Archetype alongside component data
Hydex is an independent community resource. Hytale is a trademark of Hypixel Studios. Hydex is not affiliated with or endorsed by Hypixel Studios.