mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2024-11-22 12:37:59 +01:00
Fix incompatibility with mods that mess with armour stand rendering
This commit is contained in:
parent
777f53b4b5
commit
f0d16efd18
1 changed files with 8 additions and 3 deletions
|
@ -13,6 +13,7 @@ import net.minecraft.client.render.entity.model.EntityModelLayers;
|
|||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.EquipmentSlot;
|
||||
import net.minecraft.entity.decoration.ArmorStandEntity;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
|
||||
import com.minelittlepony.api.model.armour.ArmourLayer;
|
||||
import com.minelittlepony.api.pony.meta.Race;
|
||||
|
@ -39,10 +40,14 @@ public class PonyStandRenderer extends ArmorStandEntityRenderer {
|
|||
addFeature(new HeadFeatureRenderer<>(this, context.getModelLoader(), context.getHeldItemRenderer()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(ArmorStandEntity entity, float entityYaw, float tickDelta, MatrixStack stack, VertexConsumerProvider renderContext, int lightUv) {
|
||||
public Vec3d getPositionOffset(ArmorStandEntity entity, float tickDelta) {
|
||||
this.model = isPonita(entity) ? pony : human;
|
||||
super.render(entity, entityYaw, tickDelta, stack, renderContext, lightUv);
|
||||
try {
|
||||
return super.getPositionOffset(entity, tickDelta);
|
||||
} catch (Throwable t) {
|
||||
// We need to avoid overriding render() because other mods keep overriding it via mixins which breaks the class heirarchy.
|
||||
return Vec3d.ZERO;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue