Contents
- Description
- Nested Class Summary
- Field Summary
- Constructor Summary
- Method Summary
- Constructor Details
- Method Details
- setup(WildernessTracker, TriPredicate)
- setup(WildernessTracker, TriConsumer)
- setup(WildernessTracker, IntTriObjectConsumer)
- test(ArchetypeChunk, CommandBuffer)
- accept(ArchetypeChunk, CommandBuffer)
- accept(int, ArchetypeChunk, CommandBuffer)
- asConsumer()
- asPredicate()
- close()
- clone()
- getChunkResourceType()
- getEntityResourceType()
Class WildernessVisitor<ECS_TYPE>
java.lang.Object
com.hypixel.hytale.builtin.adventure.wilderness.resource.WildernessVisitor<ECS_TYPE>
- Type Parameters:
ECS_TYPE- the type of the ECS store (e.g., ChunkStore, EntityStore).
- All Implemented Interfaces:
Resource<ECS_TYPE>, IntBiObjectConsumer<ArchetypeChunk<ECS_TYPE>, CommandBuffer<ECS_TYPE>>, AutoCloseable, Cloneable, BiConsumer<ArchetypeChunk<ECS_TYPE>, CommandBuffer<ECS_TYPE>>, BiPredicate<ArchetypeChunk<ECS_TYPE>, CommandBuffer<ECS_TYPE>>
- Direct Known Subclasses:
WildernessVisitor.ChunkVisitor, WildernessVisitor.EntityVisitor
public abstract class WildernessVisitor<ECS_TYPE>
extends Object
implements AutoCloseable, BiConsumer<ArchetypeChunk<ECS_TYPE>, CommandBuffer<ECS_TYPE>>, BiPredicate<ArchetypeChunk<ECS_TYPE>, CommandBuffer<ECS_TYPE>>, IntBiObjectConsumer<ArchetypeChunk<ECS_TYPE>, CommandBuffer<ECS_TYPE>>, Resource<ECS_TYPE>
An abstract utility class that facilitates visiting and processing ECS (Entity Component System)
archetypes and entities with integration for
WildernessTracker.
It implements several functional interfaces to allow it to be used as a predicate or consumer
in ECS iterators, while holding a reference to a WildernessTracker to provide
wilderness-aware logic during iteration.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classAWildernessVisitorimplementation forChunkStore.static classAWildernessVisitorimplementation forEntityStore. -
Field Summary
Fields inherited from interface Resource
EMPTY_ARRAY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(int i, ArchetypeChunk<ECS_TYPE> table, CommandBuffer<ECS_TYPE> buffer) Accepts and processes an entity within the given archetype chunk using the configured entity consumer and tracker.voidaccept(ArchetypeChunk<ECS_TYPE> table, CommandBuffer<ECS_TYPE> buffer) Accepts and processes the given archetype chunk using the configured table consumer and tracker.Returns this visitor as aBiConsumer.Returns this visitor as aBiPredicate.abstract WildernessVisitor<ECS_TYPE> clone()Creates a clone of this visitor.voidclose()Closes the visitor, clearing references to the tracker and consumers.Gets a WildernessVisitor resource for visiting ChunkStore entities.Gets a WildernessVisitor resource for visiting EntityStore entities.setup(WildernessTracker tracker, IntTriObjectConsumer<ArchetypeChunk<ECS_TYPE>, CommandBuffer<ECS_TYPE>, WildernessTracker> consumer) Sets up the visitor with a tracker and an entity consumer.setup(WildernessTracker tracker, TriConsumer<ArchetypeChunk<ECS_TYPE>, CommandBuffer<ECS_TYPE>, WildernessTracker> consumer) Sets up the visitor with a tracker and a table consumer.setup(WildernessTracker tracker, TriPredicate<ArchetypeChunk<ECS_TYPE>, CommandBuffer<ECS_TYPE>, WildernessTracker> predicate) Sets up the visitor with a tracker and a predicate.booleantest(ArchetypeChunk<ECS_TYPE> table, CommandBuffer<ECS_TYPE> buffer) Tests the given archetype chunk using the configured predicate and tracker.Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface BiConsumer
andThenMethods inherited from interface BiPredicate
and, negate, or
-
Constructor Details
-
WildernessVisitor
public WildernessVisitor()
-
-
Method Details
-
setup
public WildernessVisitor<ECS_TYPE> setup(@Nonnull WildernessTracker tracker, @Nonnull TriPredicate<ArchetypeChunk<ECS_TYPE>, CommandBuffer<ECS_TYPE>, WildernessTracker> predicate) Sets up the visitor with a tracker and a predicate.- Parameters:
tracker- the wilderness tracker to use.predicate- the predicate to test against chunks.- Returns:
- this visitor for chaining.
-
setup
public WildernessVisitor<ECS_TYPE> setup(@Nonnull WildernessTracker tracker, @Nonnull TriConsumer<ArchetypeChunk<ECS_TYPE>, CommandBuffer<ECS_TYPE>, WildernessTracker> consumer) Sets up the visitor with a tracker and a table consumer.- Parameters:
tracker- the wilderness tracker to use.consumer- the consumer to apply to chunks.- Returns:
- this visitor for chaining.
-
setup
public WildernessVisitor<ECS_TYPE> setup(@Nonnull WildernessTracker tracker, @Nonnull IntTriObjectConsumer<ArchetypeChunk<ECS_TYPE>, CommandBuffer<ECS_TYPE>, WildernessTracker> consumer) Sets up the visitor with a tracker and an entity consumer.- Parameters:
tracker- the wilderness tracker to use.consumer- the consumer to apply to individual entities.- Returns:
- this visitor for chaining.
-
test
Tests the given archetype chunk using the configured predicate and tracker.- Specified by:
testin interfaceBiPredicate<ArchetypeChunk<ECS_TYPE>, CommandBuffer<ECS_TYPE>>- Parameters:
table- the archetype chunk to test.buffer- the command buffer for ECS operations.- Returns:
- the result of the predicate test.
-
accept
Accepts and processes the given archetype chunk using the configured table consumer and tracker.- Specified by:
acceptin interfaceBiConsumer<ArchetypeChunk<ECS_TYPE>, CommandBuffer<ECS_TYPE>>- Parameters:
table- the archetype chunk to process.buffer- the command buffer for ECS operations.
-
accept
Accepts and processes an entity within the given archetype chunk using the configured entity consumer and tracker.- Specified by:
acceptin interfaceIntBiObjectConsumer<ArchetypeChunk<ECS_TYPE>, CommandBuffer<ECS_TYPE>>- Parameters:
i- the index of the entity within the chunk.table- the archetype chunk containing the entity.buffer- the command buffer for ECS operations.
-
asConsumer
Returns this visitor as aBiConsumer.- Returns:
- this instance.
-
asPredicate
Returns this visitor as aBiPredicate.- Returns:
- this instance.
-
close
public void close()Closes the visitor, clearing references to the tracker and consumers.- Specified by:
closein interfaceAutoCloseable
-
clone
Creates a clone of this visitor. -
getChunkResourceType
Gets a WildernessVisitor resource for visiting ChunkStore entities.- Returns:
- the resource type for chunk-based visitors.
-
getEntityResourceType
Gets a WildernessVisitor resource for visiting EntityStore entities.- Returns:
- the resource type for entity-based visitors.
-