diff --git a/src/main/java/com/tiedup/remake/rig/patch/LivingEntityPatch.java b/src/main/java/com/tiedup/remake/rig/patch/LivingEntityPatch.java index 56b049d..6f7a8f3 100644 --- a/src/main/java/com/tiedup/remake/rig/patch/LivingEntityPatch.java +++ b/src/main/java/com/tiedup/remake/rig/patch/LivingEntityPatch.java @@ -13,6 +13,7 @@ import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.phys.Vec3; +import com.tiedup.remake.rig.TiedUpRigConstants; import com.tiedup.remake.rig.anim.Animator; import com.tiedup.remake.rig.anim.LivingMotion; import com.tiedup.remake.rig.anim.LivingMotions; @@ -22,26 +23,64 @@ import com.tiedup.remake.rig.anim.types.DynamicAnimation; import com.tiedup.remake.rig.armature.Armature; /** - * Stub RIG Phase 0 — patch de capability attaché à un {@link LivingEntity}. - * Expose l'animator, l'armature, la motion courante + quelques helpers. - * La version finale sera étoffée en Phase 2 (NPCs + player) avec les données - * d'entraînement/bondage spécifiques. + * RIG Phase 2 — patch de capability attaché à un {@link LivingEntity}. Porte + * l'{@link Animator} (initialisé eager via {@link TiedUpRigConstants#ANIMATOR_PROVIDER} + * dans {@link #onConstructed(LivingEntity)}) et expose {@link #getArmature()} + * (abstract — subclass fournit son biped armature via {@code TiedUpRigRegistry}). + * + *
Pattern init EF-style (voir EF LivingEntityPatch:146-156) : + *
Exemple subclass :
+ *
+ * protected void initAnimator(Animator a) {
+ * a.addLivingAnimation(LivingMotions.IDLE, TiedUpAnimationRegistry.CONTEXT_STAND_IDLE);
+ * }
+ *
+ */
+ protected void initAnimator(Animator animator) {
+ // no-op par défaut
+ }
+
public Animator getAnimator() {
- return null;
+ return this.animator;
}
@Nullable
public ClientAnimator getClientAnimator() {
- return null;
+ return this.animator instanceof ClientAnimator ca ? ca : null;
}
public LivingMotion getCurrentLivingMotion() {