Search in sources :

Example 1 with IMixinModelPlayer

use of cc.hyperium.mixinsimp.client.model.IMixinModelPlayer in project Hyperium by HyperiumClient.

the class AbstractAnimationHandler method modify.

protected void modify(AbstractClientPlayer entity, IMixinModelBiped player, boolean pre) {
    if (Settings.DISABLE_DANCES) {
        if (!reset) {
            resetAnimation(player);
            reset = true;
        }
        return;
    } else {
        reset = false;
    }
    AnimationState animationState = get(entity.getUniqueID());
    int ticks = animationState.frames;
    player.getBipedBody().rotateAngleZ = 0F;
    player.getBipedRightUpperLeg().rotateAngleZ = 0F;
    player.getBipedLeftUpperLeg().rotateAngleZ = 0F;
    player.getBipedRightUpperLeg().offsetX = 0F;
    player.getBipedLeftUpperLeg().offsetX = 0F;
    player.getBipedHead().rotateAngleZ = 0F;
    player.getBipedHeadwear().rotateAngleZ = 0F;
    if (player instanceof IMixinModelPlayer) {
        IMixinModelPlayer player1 = (IMixinModelPlayer) player;
        player1.getBipedBodywear().rotateAngleZ = 0F;
        player1.getBipedRightUpperLegwear().rotateAngleZ = 0F;
        player1.getBipedLeftUpperLegwear().rotateAngleZ = 0F;
        player1.getBipedRightUpperLegwear().offsetX = 0F;
        player1.getBipedLeftUpperLegwear().offsetX = 0F;
    }
    if (ticks <= 0) {
        if (pre) {
            player.getBipedBody().offsetZ = 0;
            player.getBipedLeftLowerLeg().offsetZ = 0;
            player.getBipedRightLowerLeg().offsetZ = 0;
            player.getBipedRightUpperLeg().offsetZ = 0;
            player.getBipedLeftUpperLeg().offsetZ = 0;
            player.getBipedRightUpperArm().offsetZ = 0;
            player.getBipedLeftUpperArm().offsetZ = 0;
            player.getBipedBody().offsetY = 0;
            player.getBipedLeftLowerLeg().offsetY = 0;
            player.getBipedRightLowerLeg().offsetY = 0;
            player.getBipedRightUpperLeg().offsetY = 0;
            player.getBipedLeftUpperLeg().offsetY = 0;
            player.getBipedRightUpperArm().offsetY = 0;
            player.getBipedLeftUpperArm().offsetY = 0;
            player.getBipedHead().offsetZ = 0;
            player.getBipedHead().offsetY = 0;
            player.getBipedHeadwear().offsetZ = 0;
            player.getBipedHeadwear().offsetY = 0;
            player.getBipedRightForeArm().offsetY = 0;
            player.getBipedRightForeArm().offsetX = 0;
            if (player instanceof IMixinModelPlayer) {
                IMixinModelPlayer player1 = (IMixinModelPlayer) player;
                player1.getBipedLeftUpperArmwear().offsetY = 0;
                player1.getBipedRightUpperArmwear().offsetY = 0;
                player1.getBipedBodywear().offsetY = 0;
                player1.getBipedLeftUpperLegwear().offsetY = 0;
                player1.getBipedLeftLowerLegwear().offsetY = 0;
                player1.getBipedRightUpperLegwear().offsetY = 0;
                player1.getBipedRightLowerLegwear().offsetY = 0;
                player1.getBipedLeftUpperArmwear().offsetZ = 0;
                player1.getBipedRightUpperArmwear().offsetZ = 0;
                player1.getBipedBodywear().offsetZ = 0;
                player1.getBipedLeftUpperLegwear().offsetZ = 0;
                player1.getBipedLeftLowerLegwear().offsetZ = 0;
                player1.getBipedRightUpperLegwear().offsetZ = 0;
                player1.getBipedRightLowerLegwear().offsetZ = 0;
            }
        }
        return;
    }
    float heldPercent = state / 100F;
    if (CosmeticsUtil.shouldHide(null))
        return;
    if (player instanceof IMixinModelPlayer)
        modifyPlayer(entity, ((IMixinModelPlayer) player), heldPercent);
    else
        modifyPlayer(entity, player, heldPercent);
}
Also used : IMixinModelPlayer(cc.hyperium.mixinsimp.client.model.IMixinModelPlayer)

Example 2 with IMixinModelPlayer

use of cc.hyperium.mixinsimp.client.model.IMixinModelPlayer in project Hyperium by HyperiumClient.

the class AbstractAnimationHandler method resetAnimation.

protected void resetAnimation(IMixinModelBiped player) {
    resetModelRenderers(player.getBipedHead(), player.getBipedHeadwear(), player.getBipedBody(), player.getBipedRightUpperLeg(), player.getBipedRightLowerLeg(), player.getBipedLeftUpperLeg(), player.getBipedLeftLowerLeg(), player.getBipedRightUpperArm(), player.getBipedRightForeArm(), player.getBipedLeftUpperArm(), player.getBipedLeftForeArm());
    if (player instanceof IMixinModelPlayer) {
        IMixinModelPlayer modelPlayer = (IMixinModelPlayer) player;
        resetModelRenderers(modelPlayer.getBipedBodywear(), modelPlayer.getBipedRightUpperLegwear(), modelPlayer.getBipedRightLowerLegwear(), modelPlayer.getBipedLeftUpperLegwear(), modelPlayer.getBipedLeftLowerLegwear(), modelPlayer.getBipedRightUpperArmwear(), modelPlayer.getBipedRightForeArmwear(), modelPlayer.getBipedLeftUpperArmwear(), modelPlayer.getBipedLeftForeArmwear());
    }
}
Also used : IMixinModelPlayer(cc.hyperium.mixinsimp.client.model.IMixinModelPlayer)

Example 3 with IMixinModelPlayer

use of cc.hyperium.mixinsimp.client.model.IMixinModelPlayer in project Hyperium by HyperiumClient.

the class ButtCosmetic method preCopy.

@InvokeEvent(priority = Priority.HIGH)
public void preCopy(PreCopyPlayerModelAnglesEvent event) {
    if (!(event.getModel() instanceof IMixinModelPlayer))
        return;
    if (!isPurchasedBy(event.getEntity().getUniqueID())) {
        ((IMixinModelPlayer) event.getModel()).getButt().showModel = false;
        return;
    }
    HyperiumPurchase packageIfReady = PurchaseApi.getInstance().getPackageIfReady(event.getEntity().getUniqueID());
    if (packageIfReady == null)
        return;
    ((IMixinModelPlayer) event.getModel()).getButt().showModel = !packageIfReady.getCachedSettings().isButtDisabled();
    ((IMixinModelPlayer) event.getModel()).getButt().offsetY = event.getEntity().isSneaking() ? -.45F : -.4F;
    ((IMixinModelPlayer) event.getModel()).getButt().offsetZ = event.getEntity().isSneaking() ? .3F : 0F;
}
Also used : IMixinModelPlayer(cc.hyperium.mixinsimp.client.model.IMixinModelPlayer) HyperiumPurchase(cc.hyperium.purchases.HyperiumPurchase) InvokeEvent(cc.hyperium.event.InvokeEvent)

Aggregations

IMixinModelPlayer (cc.hyperium.mixinsimp.client.model.IMixinModelPlayer)3 InvokeEvent (cc.hyperium.event.InvokeEvent)1 HyperiumPurchase (cc.hyperium.purchases.HyperiumPurchase)1