use of net.minecraft.client.renderer.entity.model.BipedModel in project iChunUtil by iChun.
the class HeadInfo method preChildEntHeadRenderCalls.
@OnlyIn(Dist.CLIENT)
public void preChildEntHeadRenderCalls(E living, MatrixStack stack, LivingRenderer<E, ?> render) {
if (// I don't like this if statement any more than you do.
living.isChild()) {
if (// there is a child override
childEntityScale != null || childEntityOffset != null) {
if (childEntityScale != null) {
stack.scale(childEntityScale[0], childEntityScale[1], childEntityScale[2]);
}
if (childEntityOffset != null) {
stack.translate(childEntityOffset[0], childEntityOffset[1], childEntityOffset[2]);
}
} else // default to MC scaling
{
float modelScale = 0.0625F;
Model model = render.getEntityModel();
if (model instanceof BipedModel) {
stack.scale(0.75F, 0.75F, 0.75F);
stack.translate(0.0F, 16.0F * modelScale, 0.0F);
} else if (model instanceof AgeableModel) {
AgeableModel<?> ageableModel = (AgeableModel<?>) model;
if (ageableModel.isChildHeadScaled) {
float f = 1.5F / ageableModel.childHeadScale;
stack.scale(f, f, f);
}
stack.translate(0.0F, ageableModel.childHeadOffsetY * modelScale, ageableModel.childHeadOffsetZ * modelScale);
}
}
}
}
use of net.minecraft.client.renderer.entity.model.BipedModel in project BudschieMorphMod by Budschie.
the class PlayerRendererMixin method renderLeftArm.
@Inject(at = @At("HEAD"), method = "renderLeftArm(Lcom/mojang/blaze3d/matrix/MatrixStack;Lnet/minecraft/client/renderer/IRenderTypeBuffer;ILnet/minecraft/client/entity/player/AbstractClientPlayerEntity;)V", cancellable = true)
private void renderLeftArm(MatrixStack matrixStackIn, IRenderTypeBuffer bufferIn, int combinedLightIn, AbstractClientPlayerEntity playerIn, CallbackInfo info) {
if (checkMorphPresent(playerIn)) {
// RenderHandler.checkCache(playerIn);
info.cancel();
Entity cachedEntity = RenderHandler.getCachedEntity(playerIn);
EntityRenderer<?> renderer = Minecraft.getInstance().getRenderManager().getRenderer(cachedEntity);
if (renderer instanceof LivingRenderer<?, ?>) {
ModelRenderer armRenderer = null;
LivingRenderer<? super LivingEntity, ?> living = (LivingRenderer<? super LivingEntity, ?>) renderer;
if (living.entityModel instanceof BipedModel<?>)
armRenderer = ((BipedModel<?>) living.entityModel).bipedRightArm;
if (living.entityModel instanceof QuadrupedModel<?>)
armRenderer = ((QuadrupedModel<?>) living.entityModel).legFrontLeft;
if (armRenderer != null)
renderArm(true, playerIn, armRenderer, matrixStackIn, combinedLightIn, bufferIn, living, (LivingEntity) cachedEntity, combinedLightIn);
}
}
}
use of net.minecraft.client.renderer.entity.model.BipedModel in project BudschieMorphMod by Budschie.
the class PlayerRendererMixin method renderRightArm.
@Inject(at = @At("HEAD"), method = "renderRightArm(Lcom/mojang/blaze3d/matrix/MatrixStack;Lnet/minecraft/client/renderer/IRenderTypeBuffer;ILnet/minecraft/client/entity/player/AbstractClientPlayerEntity;)V", cancellable = true)
private void renderRightArm(MatrixStack matrixStackIn, IRenderTypeBuffer bufferIn, int combinedLightIn, AbstractClientPlayerEntity playerIn, CallbackInfo info) {
if (checkMorphPresent(playerIn)) {
// RenderHandler.checkCache(playerIn);
info.cancel();
Entity cachedEntity = RenderHandler.getCachedEntity(playerIn);
EntityRenderer<?> renderer = Minecraft.getInstance().getRenderManager().getRenderer(cachedEntity);
if (renderer instanceof LivingRenderer<?, ?>) {
ModelRenderer armRenderer = null;
LivingRenderer<? super LivingEntity, ?> living = (LivingRenderer<? super LivingEntity, ?>) renderer;
if (living.entityModel instanceof BipedModel<?>)
armRenderer = ((BipedModel<?>) living.entityModel).bipedRightArm;
if (living.entityModel instanceof QuadrupedModel<?>)
armRenderer = ((QuadrupedModel<?>) living.entityModel).legFrontRight;
if (armRenderer != null)
renderArm(false, playerIn, armRenderer, matrixStackIn, combinedLightIn, bufferIn, living, (LivingEntity) cachedEntity, combinedLightIn);
}
}
}
use of net.minecraft.client.renderer.entity.model.BipedModel in project Kingdom-Keys by Wehavecookies56.
the class BaseArmorItem method getArmorModel.
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
@OnlyIn(Dist.CLIENT)
public BipedModel getArmorModel(LivingEntity entityLiving, ItemStack itemStack, EquipmentSlotType armorSlot, BipedModel original) {
BipedModel armorModel = ProxyClient.armorModels.get(this);
if (armorModel != null) {
armorModel.bipedHead.showModel = armorSlot == EquipmentSlotType.HEAD;
armorModel.bipedHeadwear.showModel = false;
armorModel.bipedBody.showModel = armorSlot == EquipmentSlotType.CHEST || armorSlot == EquipmentSlotType.LEGS;
armorModel.bipedRightArm.showModel = armorSlot == EquipmentSlotType.CHEST;
armorModel.bipedLeftArm.showModel = armorSlot == EquipmentSlotType.CHEST;
armorModel.bipedRightLeg.showModel = armorSlot == EquipmentSlotType.FEET || armorSlot == EquipmentSlotType.FEET;
armorModel.bipedLeftLeg.showModel = armorSlot == EquipmentSlotType.LEGS || armorSlot == EquipmentSlotType.FEET;
}
return armorModel;
}
use of net.minecraft.client.renderer.entity.model.BipedModel in project CustomPlayerModels by tom5454.
the class ElytraLayerMixin method onGetRenderTypeNoSkin.
@Redirect(at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/RenderType;armorCutoutNoCull(" + "Lnet/minecraft/util/ResourceLocation;)Lnet/minecraft/client/renderer/RenderType;", ordinal = 0), method = "render(Lcom/mojang/blaze3d/matrix/MatrixStack;Lnet/minecraft/client/renderer/IRenderTypeBuffer;I" + "Lnet/minecraft/entity/LivingEntity;FFFFFF)V")
private RenderType onGetRenderTypeNoSkin(ResourceLocation resLoc, MatrixStack matrixStackIn, IRenderTypeBuffer bufferIn, int packedLightIn, LivingEntity entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch) {
if (getParentModel() instanceof BipedModel) {
ModelTexture mt = new ModelTexture(resLoc, PlayerRenderManager.armor);
ClientProxy.mc.getPlayerRenderManager().bindSkin(elytraModel, mt, TextureSheetType.ELYTRA);
return mt.getRenderType();
}
return RenderType.armorCutoutNoCull(resLoc);
}
Aggregations