Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sendConditionalSwing() won't wave #35

Open
Physics3r opened this issue Aug 19, 2024 · 6 comments
Open

sendConditionalSwing() won't wave #35

Physics3r opened this issue Aug 19, 2024 · 6 comments

Comments

@Physics3r
Copy link

public static void sendConditionalSwing(MovingObjectPosition mop) {
if (mop != null && mop.typeOfHit != MovingObjectPosition.MovingObjectType.ENTITY) mc.thePlayer.swingItem();
}
MCP918 1.8.8 Optifine H8下,在单人世界中攻击生物时,挥手动画不会被执行

@FlorianMichael
Copy link
Contributor

Use english and explain how this is related to ViaMCP

@Physics3r
Copy link
Author

Physics3r commented Aug 19, 2024

(de.florianmichael.viamcp.fixes.AttackOrder)
public static void sendConditionalSwing(MovingObjectPosition mop) {
if (mop != null && mop.typeOfHit != MovingObjectPosition.MovingObjectType.ENTITY) mc.thePlayer.swingItem();
}

It cause player does not perform the wave animation (swingItem) when attacking entity. (Minecraft 1.8.8, with Optifine H8)

I'm sorry that I didn't use English at the first time.
My English is bad.
forgive me, thanks (

@Physics3r
Copy link
Author

It cause player does not perform the wave animation (swingItem) when attacking entity. (Minecraft 1.8.8, with Optifine H8)

I'm sorry that I didn't use English at the first time.
My English is bad.
forgive me, thanks (

@FlorianMichael
Copy link
Contributor

Where did you replaced/used sendConditionalSwing() in the Minecraft code?

@Physics3r
Copy link
Author

Physics3r commented Aug 19, 2024

private void clickMouse()
{
    if (this.leftClickCounter <= 0)
    {

// this.thePlayer.swingItem();
AttackOrder.sendConditionalSwing(this.objectMouseOver);

        if (this.objectMouseOver == null)
        {
            logger.error("Null returned as \'hitResult\', this shouldn\'t happen!");

            if (this.playerController.isNotCreative())
            {
                this.leftClickCounter = 10;
            }
        }
        else
        {
            switch (this.objectMouseOver.typeOfHit)
            {
                case ENTITY:
                    this.playerController.attackEntity(this.thePlayer, this.objectMouseOver.entityHit);
                    break;

                case BLOCK:
                    BlockPos blockpos = this.objectMouseOver.getBlockPos();

                    if (this.theWorld.getBlockState(blockpos).getBlock().getMaterial() != Material.air)
                    {
                        this.playerController.clickBlock(blockpos, this.objectMouseOver.sideHit);
                        break;
                    }

                case MISS:
                default:
                    if (this.playerController.isNotCreative())
                    {
                        this.leftClickCounter = 10;
                    }
            }
        }
    }
}

(Minecraft.java)

@Physics3r
Copy link
Author

When I followed the README file to fix the Attack Order, it appeared.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants