ViaVersionMCP / ViaMCP

Client-side Implementation of the Via* projects for MCP
GNU General Public License v3.0
57 stars 10 forks source link

sendConditionalSwing() won't wave #35

Open Physics3r opened 3 months ago

Physics3r commented 3 months ago

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

FlorianMichael commented 3 months ago

Use english and explain how this is related to ViaMCP

Physics3r commented 3 months ago

(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 commented 3 months ago

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 commented 3 months ago

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

Physics3r commented 3 months ago
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 commented 3 months ago

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