mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2025-02-13 16:24:23 +01:00
Skeletons should now hold their items correctly
This commit is contained in:
parent
2dc2642bc9
commit
32df82ba77
2 changed files with 20 additions and 12 deletions
|
@ -3,7 +3,6 @@ package com.minelittlepony.model.player;
|
|||
import com.minelittlepony.model.components.UnicornHorn;
|
||||
import com.minelittlepony.render.PonyRenderer;
|
||||
|
||||
import net.minecraft.client.model.ModelBiped.ArmPose;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.EnumHandSide;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
|
|
|
@ -10,26 +10,35 @@ import net.minecraft.util.EnumHand;
|
|||
import net.minecraft.util.EnumHandSide;
|
||||
|
||||
public class ModelSkeletonPony extends ModelMobPony {
|
||||
@Override
|
||||
public boolean isCasting() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLivingAnimations(EntityLivingBase entity, float move, float swing, float ticks) {
|
||||
rightArmPose = ArmPose.EMPTY;
|
||||
leftArmPose = ArmPose.EMPTY;
|
||||
ItemStack itemstack = entity.getHeldItem(EnumHand.MAIN_HAND);
|
||||
|
||||
if (itemstack.getItem() == Items.BOW && ((AbstractSkeleton)entity).isSwingingArms())
|
||||
{
|
||||
if (entity.getPrimaryHand() == EnumHandSide.RIGHT) {
|
||||
rightArmPose = ArmPose.BOW_AND_ARROW;
|
||||
ItemStack mainHand = entity.getHeldItem(EnumHand.MAIN_HAND);
|
||||
ItemStack offHand = entity.getHeldItem(EnumHand.OFF_HAND);
|
||||
|
||||
boolean right = entity.getPrimaryHand() == EnumHandSide.RIGHT;
|
||||
|
||||
if (!offHand.isEmpty()) {
|
||||
if (right) {
|
||||
leftArmPose = ArmPose.ITEM;
|
||||
} else {
|
||||
leftArmPose = ArmPose.BOW_AND_ARROW;
|
||||
rightArmPose = ArmPose.ITEM;
|
||||
}
|
||||
}
|
||||
|
||||
if (!mainHand.isEmpty()) {
|
||||
ArmPose pose = mainHand.getItem() == Items.BOW && ((AbstractSkeleton)entity).isSwingingArms() ? ArmPose.BOW_AND_ARROW : ArmPose.ITEM;
|
||||
|
||||
if (right) {
|
||||
rightArmPose = pose;
|
||||
} else {
|
||||
leftArmPose = pose;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
super.setLivingAnimations(entity, move, swing, ticks);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue