Skip to content
This repository has been archived by the owner on Mar 14, 2023. It is now read-only.

Commit

Permalink
More mantle work
Browse files Browse the repository at this point in the history
  • Loading branch information
Ingoleth committed Sep 16, 2018
1 parent 91c3ebe commit beacff1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@

import com.bewitchment.common.lib.LibMod;

import baubles.api.render.IRenderBauble;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.client.Minecraft;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.entity.Entity;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.MathHelper;


/**
Expand Down Expand Up @@ -183,26 +186,27 @@ public ModelMantle() {
this.hoodRight1.addChild(this.hoodLeft1);
this.capeLeft1.addChild(this.capeLeft2);
this.capeLeft2.addChild(this.capeLeftFront1);
this.bipedLeftArm.addChild(shoulderLeft);


}

@Override
public void render(Entity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float ptick) {
this.cape.render(1);
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
Minecraft.getMinecraft().renderEngine.bindTexture(TEXTURE);
super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale, entityIn);
this.cape.render(1);
this.hood.render(1);
cape.rotateAngleX = limbSwingAmount;
capeRightFront1.rotateAngleY = 1.57079632679F - limbSwingAmount*1.5F;
capeLeftFront1.rotateAngleY = -capeRightFront1.rotateAngleY;
bipedHead = hood;
hood.rotateAngleX = 0;
hood.rotateAngleY = 0;
this.hood.rotateAngleX = bipedHead.rotateAngleX;
this.hood.rotateAngleY = bipedHead.rotateAngleY;
System.out.println(cape.rotateAngleY);
}





/**
* This is a helper function from Tabula to set the rotation of model parts
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,6 @@ public boolean willAutoSync(ItemStack itemstack, EntityLivingBase player) {
@Override
public void onEquipped(ItemStack itemstack, EntityLivingBase player) {
player.playSound(SoundEvents.ITEM_ARMOR_EQUIP_LEATHER, 0.75F, 1.9f);
player.getCapability(BarkCapability.CAPABILITY, null).pieces = ((EntityPlayer) player).isCreative() ? 5 : 0;
player.getCapability(BarkCapability.CAPABILITY, null).markDirty();
}

@Override
Expand All @@ -102,7 +100,7 @@ public void onUnequipped(ItemStack itemstack, EntityLivingBase player) {
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, @Nullable World player, List<String> tooltip, ITooltipFlag advanced) {
tooltip.add(TextFormatting.DARK_GREEN + I18n.format("witch.tooltip." + getUnlocalizedNameInefficiently(stack).substring(5) + "_description.name"));
tooltip.add(TextFormatting.DARK_PURPLE + I18n.format("witch.tooltip." + getUnlocalizedNameInefficiently(stack).substring(5) + "_description.name"));
}

@Override
Expand All @@ -119,11 +117,7 @@ public void onPlayerBaubleRender(ItemStack stack, EntityPlayer player, RenderTyp
}
GL11.glPushMatrix();
IRenderBauble.Helper.rotateIfSneaking(player);
GL11.glRotated(180, 1, 0, 0);
GL11.glTranslated(0, 0, 0.02);
GL11.glScaled(0.125, 0.125, 0.125);
IRenderBauble.Helper.translateToChest();
IRenderBauble.Helper.defaultTransforms();
GL11.glScaled(0.07, 0.07, 0.07);
model.render(player, player.limbSwing, player.limbSwingAmount, player.ticksExisted, player.rotationYaw, player.rotationPitch, 1);
GL11.glPopMatrix();
}
Expand Down

0 comments on commit beacff1

Please sign in to comment.