package com.tiedup.remake.state; import net.minecraft.world.entity.Entity; import org.jetbrains.annotations.Nullable; /** * Capture, leash, and transport interface for kidnapped entities. * *
Covers the capture lifecycle: being captured by a captor, being freed, * being transferred to another captor, and querying capture state.
* * @see IRestrainableEntity * @see IBondageState * @see IRestrainable */ public interface ICapturable extends IRestrainableEntity { // CAPTURE LIFECYCLE /** * Capture this entity by the given captor. * *Prerequisites:
*Process for Players:
*Process for NPCs:
*This will:
*Only works if current captor allows captive transfer * ({@link ICaptor#allowCaptiveTransfer()} == true).
* * * @param newCaptor The new captor to transfer to */ void transferCaptivityTo(ICaptor newCaptor); // STATE QUERIES - CAPTURE /** * Check if this entity can be captured. * *From original code (PlayerBindState.java:195-225):
*For Players: Returns true when LeashProxyEntity is attached and leashed to captor
*For NPCs: Returns true when vanilla leash is attached
* * * @return true if captured (has leash holder) */ boolean isCaptive(); /** * Check if this entity can be tied up (not already restrained). * * @return true if entity can accept bind items */ boolean canBeTiedUp(); /** * Check if this entity is tied to a pole (immobilized). * * @return true if tied to a static pole entity */ boolean isTiedToPole(); /** * Tie this entity to the closest fence/pole within range. * Searches for fence blocks near the entity's current position. * * @param searchRadius The radius in blocks to search for fences * @return true if successfully tied to a pole */ boolean tieToClosestPole(int searchRadius); /** * Check if this entity can be auto-kidnapped by events. * Used by EntityKidnapper AI to determine valid targets. * * @return true if can be targeted by kidnapping events */ boolean canBeKidnappedByEvents(); /** * Get the current captor (the entity holding the leash). * * * @return The captor, or null if not captured */ ICaptor getCaptor(); /** * Get the leash proxy or transport entity for this captive. * *For Players: Returns the LeashProxyEntity following the player
*For NPCs: Returns null (NPCs use vanilla leash directly)
* * @return The proxy/transport entity, or null if not applicable */ @Nullable Entity getTransport(); }