Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package net.machinemuse.powersuits.client.render.item;
- import api.player.model.ModelPlayer;
- import java.util.List;
- import net.machinemuse.powersuits.client.render.modelspec.RenderPart;
- import net.minecraft.client.model.ModelRenderer;
- import net.minecraft.entity.Entity;
- import net.minecraft.entity.EntityLivingBase;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.item.EnumAction;
- import net.minecraft.item.ItemStack;
- import net.minecraft.nbt.NBTTagCompound;
- import net.smart.render.SmartRenderModel;
- import net.smart.render.playerapi.SmartRender;
- import net.smart.render.playerapi.SmartRenderModelPlayerBase;
- public class SMovingArmorModel
- extends ModelPlayer
- implements IArmorModel
- {
- public static NBTTagCompound renderSpec = null;
- public static int visibleSection = 0;
- private SmartRenderModelPlayerBase renderPlayerBase = SmartRender.getPlayerBase(this);
- private static SMovingArmorModel INSTANCE;
- public SMovingArmorModel()
- {
- super(0.0F);
- SmartRenderModel model = this.renderPlayerBase.getRenderModel();
- this.field_78115_e = model.bipedBody;
- this.field_78112_f = model.bipedRightArm;
- this.field_78113_g = model.bipedLeftArm;
- this.field_78123_h = model.bipedRightLeg;
- this.field_78124_i = model.bipedLeftLeg;
- this.field_78114_d = model.bipedHeadwear;
- this.field_78121_j = model.bipedEars;
- this.field_78122_k = model.bipedCloak;
- init();
- }
- public static SMovingArmorModel getInstance()
- {
- if (INSTANCE == null) {
- INSTANCE = new SMovingArmorModel();
- }
- return INSTANCE;
- }
- public NBTTagCompound getRenderSpec()
- {
- return renderSpec;
- }
- public void setRenderSpec(NBTTagCompound nbt)
- {
- renderSpec = nbt;
- }
- public int getVisibleSection()
- {
- return visibleSection;
- }
- public void setVisibleSection(int value)
- {
- visibleSection = value;
- }
- public void func_78088_a(Entity entity, float par2, float par3, float par4, float par5, float par6, float scale)
- {
- prep(entity, par2, par3, par4, par5, par6, scale);
- this.renderPlayerBase.setRotationAngles(par2, par3, par4, par5, par6, scale, entity);
- this.renderPlayerBase.render(entity, par2, par3, par4, par5, par6, scale);
- post(entity, par2, par3, par4, par5, par6, scale);
- }
- public void clearAndAddChildWithInitialOffsets(ModelRenderer mr, float xo, float yo, float zo)
- {
- mr.field_78804_l.clear();
- RenderPart rp = new RenderPart(this, mr);
- mr.func_78792_a(rp);
- setInitialOffsets(rp, xo, yo, zo);
- }
- public void init()
- {
- clearAndAddChildWithInitialOffsets(this.field_78116_c, 0.0F, 0.0F, 0.0F);
- clearAndAddChildWithInitialOffsets(this.field_78115_e, 0.0F, 0.0F, 0.0F);
- clearAndAddChildWithInitialOffsets(this.field_78112_f, 5.0F, 2.0F, 0.0F);
- clearAndAddChildWithInitialOffsets(this.field_78113_g, -5.0F, 2.0F, 0.0F);
- clearAndAddChildWithInitialOffsets(this.field_78123_h, 2.0F, 12.0F, 0.0F);
- clearAndAddChildWithInitialOffsets(this.field_78124_i, -2.0F, 12.0F, 0.0F);
- this.field_78114_d.field_78804_l.clear();
- this.field_78121_j.field_78804_l.clear();
- this.field_78122_k.field_78804_l.clear();
- }
- public void setInitialOffsets(ModelRenderer r, float x, float y, float z)
- {
- r.field_82906_o = x;
- r.field_82908_p = y;
- r.field_82907_q = z;
- }
- public void prep(Entity entity, float par2, float par3, float par4, float par5, float par6, float scale)
- {
- try
- {
- EntityLivingBase entLive = (EntityLivingBase)entity;
- ItemStack stack = entLive.func_71124_b(0);
- this.field_78120_m = (stack != null ? 1 : 0);
- this.field_78117_n = entLive.func_70093_af();
- this.field_78093_q = entLive.func_70115_ae();
- EntityPlayer entPlayer = (EntityPlayer)entLive;
- if ((stack != null) && (entPlayer.func_71052_bv() > 0))
- {
- EnumAction enumaction = stack.func_77975_n();
- if (enumaction == EnumAction.block) {
- this.field_78120_m = 3;
- } else if (enumaction == EnumAction.bow) {
- this.field_78118_o = true;
- }
- }
- }
- catch (Exception localException) {}
- this.field_78116_c.field_78807_k = false;
- this.field_78115_e.field_78807_k = false;
- this.field_78112_f.field_78807_k = false;
- this.field_78113_g.field_78807_k = false;
- this.field_78123_h.field_78807_k = false;
- this.field_78124_i.field_78807_k = false;
- this.field_78116_c.field_78806_j = true;
- this.field_78115_e.field_78806_j = true;
- this.field_78112_f.field_78806_j = true;
- this.field_78113_g.field_78806_j = true;
- this.field_78123_h.field_78806_j = true;
- this.field_78124_i.field_78806_j = true;
- }
- public void post(Entity entity, float par2, float par3, float par4, float par5, float par6, float scale)
- {
- this.field_78118_o = false;
- this.field_78117_n = false;
- this.field_78120_m = 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement