package com.tiedup.remake.client.events; import com.mojang.logging.LogUtils; import com.tiedup.remake.client.animation.AnimationStateRegistry; import com.tiedup.remake.client.animation.BondageAnimationManager; import com.tiedup.remake.client.animation.PendingAnimationManager; import com.tiedup.remake.client.animation.render.DogPoseRenderHandler; import com.tiedup.remake.client.animation.render.HeldItemHideHandler; import com.tiedup.remake.client.animation.render.PetBedRenderHandler; import com.tiedup.remake.client.animation.render.PlayerArmHideEventHandler; import com.tiedup.remake.client.animation.tick.AnimationTickHandler; import com.tiedup.remake.client.animation.tick.MCAAnimationTickCache; import com.tiedup.remake.client.animation.tick.NpcAnimationTickHandler; import com.tiedup.remake.client.gltf.GltfAnimationApplier; import com.tiedup.remake.client.state.MovementStyleClientState; import com.tiedup.remake.client.state.PetBedClientState; import com.tiedup.remake.core.TiedUpMod; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.event.entity.EntityLeaveLevelEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; import org.slf4j.Logger; /** * Fans out {@link EntityLeaveLevelEvent} to every per-entity state map on * the client — the single source of truth for "entity is gone, drop its * tracked state". Each target owns its own static map; this handler * ensures none of them leak entries for dead/unloaded entities. */ @Mod.EventBusSubscriber( modid = TiedUpMod.MOD_ID, bus = Mod.EventBusSubscriber.Bus.FORGE, value = Dist.CLIENT ) public class EntityCleanupHandler { private static final Logger LOGGER = LogUtils.getLogger(); /** * Automatically clean up animation resources when an entity leaves the world. * *
This event fires when: *
Cleanup includes: *