Skip to content

Commit

Permalink
feat: chakra charging animation
Browse files Browse the repository at this point in the history
  • Loading branch information
sekwah41 committed Sep 18, 2022
1 parent dc28d7a commit 301863b
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
package com.sekwah.narutomod.anims;

import com.sekwah.narutomod.abilities.NarutoAbilities;
import com.sekwah.narutomod.capabilities.NinjaCapabilityHandler;
import net.minecraft.client.model.PlayerModel;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.LivingEntity;

public class PlayerAnimHandler {

public static <T extends LivingEntity> void sprintingAnim(Entity entity, PlayerModel playerModel) {
entity.getCapability(NinjaCapabilityHandler.NINJA_DATA).ifPresent((ninjaData -> {
var channeledAbility = ninjaData.getCurrentlyChanneledAbility();
if (channeledAbility != null && channeledAbility.equals(NarutoAbilities.CHAKRA_CHARGE.getId())) {
playerModel.rightArm.setRotation(-1.375616F, -0.5948606F, 0F);
playerModel.leftArm.setRotation(-1.375616F, 0.5948606F, 0F);
}
}));
if(entity.isSprinting() && !entity.isVisuallySwimming()) {
playerModel.rightArm.setRotation(1.412787F, 0F, 0F);
playerModel.rightArm.setPos(-5F, 3.933333F, -3F - 2F);
Expand Down

0 comments on commit 301863b

Please sign in to comment.