package land.chipmunk.chipmunkmod.mixin;

import land.chipmunk.chipmunkmod.modules.CommandCore;
import net.minecraft.client.player.LocalPlayer;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.level.Level;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(LocalPlayer.class)
public abstract class LocalPlayerMixin extends Entity {
    public LocalPlayerMixin (final EntityType<?> type, final Level world) {
        super(type, world);
    }

    @Inject(at = @At("TAIL"), method = "move")
    public void move (final CallbackInfo ci) {
        CommandCore.INSTANCE.resetIfNeeded(this.position());
    }
}
