WeakComponentReference
Package: com.hypixel.hytale.component
public class WeakComponentReference<ECS_TYPE, T extends Component<ECS_TYPE>>A weak reference to a specific component on a specific entity. Caches the component instance via a WeakReference for fast access, falling back to a full store lookup if the cached reference has been garbage collected. Automatically invalidated when the owning entity is removed.
Methods
Section titled “Methods”@Nullablepublic T get()Returns the component, or null if the entity has been removed.
@Nonnullpublic Store<ECS_TYPE> getStore()@Nonnullpublic ComponentType<ECS_TYPE, T> getType()@Nullablepublic Ref<ECS_TYPE> getEntityReference()Related Types
Section titled “Related Types”- Ref — the entity reference this wraps
- ComponentType — the component type being referenced
Hydex is an independent community resource. Hytale is a trademark of Hypixel Studios. Hydex is not affiliated with or endorsed by Hypixel Studios.