mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2025-02-13 08:14:23 +01:00
Fixed crash when ancountering a guardian wearing armour
This commit is contained in:
parent
2aafc214ac
commit
7f0163d47d
4 changed files with 15 additions and 1 deletions
|
@ -39,6 +39,11 @@ public abstract class ClientPonyModel<T extends LivingEntity> extends MsonPlayer
|
|||
attributes.updateLivingState(entity, pony, mode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void copyAttributes(BipedEntityModel<T> other) {
|
||||
setAttributes(other);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ModelAttributes<?> getAttributes() {
|
||||
return attributes;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.minelittlepony.client.model;
|
||||
|
||||
import net.minecraft.client.model.ModelPart;
|
||||
import net.minecraft.client.render.entity.model.BipedEntityModel;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.util.Arm;
|
||||
|
@ -33,6 +34,11 @@ public interface IPonyMixinModel<T extends LivingEntity, M extends IPonyModel<T>
|
|||
mixin().updateLivingState(entity, pony, mode);
|
||||
}
|
||||
|
||||
@Override
|
||||
default void copyAttributes(BipedEntityModel<T> other) {
|
||||
mixin().copyAttributes(other);
|
||||
}
|
||||
|
||||
@Override
|
||||
default void transform(BodyPart part, MatrixStack stack) {
|
||||
mixin().transform(part, stack);
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.minelittlepony.client.model;
|
||||
|
||||
import net.minecraft.client.model.ModelPart;
|
||||
import net.minecraft.client.render.entity.model.BipedEntityModel;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
|
||||
import com.minelittlepony.client.render.EquineRenderManager;
|
||||
|
@ -13,6 +14,8 @@ import com.minelittlepony.pony.IPony;
|
|||
|
||||
public interface IPonyModel<T extends LivingEntity> extends PonyModelConstants, IModel, ICapitated<ModelPart>, ICompartmented<ModelPart>, MsonModel {
|
||||
|
||||
void copyAttributes(BipedEntityModel<T> other);
|
||||
|
||||
void updateLivingState(T entity, IPony pony, EquineRenderManager.Mode mode);
|
||||
|
||||
@Override
|
||||
|
|
|
@ -58,7 +58,7 @@ public class ArmourFeature<T extends LivingEntity, M extends EntityModel<T> & IP
|
|||
V armour = ArmourFeature.getArmorModel(entity, itemstack, armorSlot, layer, pony.<V>getArmor().getArmorForLayer(layer));
|
||||
|
||||
if (armour.prepareToRender(armorSlot, layer)) {
|
||||
((BipedEntityModel<T>)pony.getBody()).setAttributes(armour);
|
||||
pony.getBody().copyAttributes(armour);
|
||||
armour.setAngles(entity, limbAngle, limbDistance, age, headYaw, headPitch);
|
||||
armour.synchroniseLegs(pony.getBody());
|
||||
|
||||
|
|
Loading…
Reference in a new issue