Guest User

ModelObsidianBoat

a guest
Feb 1st, 2015
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.19 KB | None | 0 0
  1. package com.obsidian.mod.model;
  2.  
  3. import net.minecraft.client.model.ModelBase;
  4. import net.minecraft.client.model.ModelRenderer;
  5. import net.minecraft.entity.Entity;
  6. import net.minecraftforge.fml.relauncher.Side;
  7. import net.minecraftforge.fml.relauncher.SideOnly;
  8.  
  9. @SideOnly(Side.CLIENT)
  10. public class ModelObsidianBoat extends ModelBase {
  11. public ModelRenderer[] boatSides = new ModelRenderer[5];
  12.  
  13. public ModelObsidianBoat()
  14. {
  15. this.boatSides[0] = new ModelRenderer(this, 0, 8);
  16. this.boatSides[1] = new ModelRenderer(this, 0, 0);
  17. this.boatSides[2] = new ModelRenderer(this, 0, 0);
  18. this.boatSides[3] = new ModelRenderer(this, 0, 0);
  19. this.boatSides[4] = new ModelRenderer(this, 0, 0);
  20. byte b0 = 24;
  21. byte b1 = 6;
  22. byte b2 = 20;
  23. byte b3 = 4;
  24. this.boatSides[0].addBox((float)(-b0 / 2), (float)(-b2 / 2 + 2), -3.0F, b0, b2 - 4, 4, 0.0F);
  25. this.boatSides[0].setRotationPoint(0.0F, (float)b3, 0.0F);
  26. this.boatSides[1].addBox((float)(-b0 / 2 + 2), (float)(-b1 - 1), -1.0F, b0 - 4, b1, 2, 0.0F);
  27. this.boatSides[1].setRotationPoint((float)(-b0 / 2 + 1), (float)b3, 0.0F);
  28. this.boatSides[2].addBox((float)(-b0 / 2 + 2), (float)(-b1 - 1), -1.0F, b0 - 4, b1, 2, 0.0F);
  29. this.boatSides[2].setRotationPoint((float)(b0 / 2 - 1), (float)b3, 0.0F);
  30. this.boatSides[3].addBox((float)(-b0 / 2 + 2), (float)(-b1 - 1), -1.0F, b0 - 4, b1, 2, 0.0F);
  31. this.boatSides[3].setRotationPoint(0.0F, (float)b3, (float)(-b2 / 2 + 1));
  32. this.boatSides[4].addBox((float)(-b0 / 2 + 2), (float)(-b1 - 1), -1.0F, b0 - 4, b1, 2, 0.0F);
  33. this.boatSides[4].setRotationPoint(0.0F, (float)b3, (float)(b2 / 2 - 1));
  34. this.boatSides[0].rotateAngleX = ((float)Math.PI / 2F);
  35. this.boatSides[1].rotateAngleY = ((float)Math.PI * 3F / 2F);
  36. this.boatSides[2].rotateAngleY = ((float)Math.PI / 2F);
  37. this.boatSides[3].rotateAngleY = (float)Math.PI;
  38. }
  39.  
  40. public void render(Entity entity, float f1, float f2, float f3, float f4, float f5, float f6)
  41. {
  42. for (int i = 0; i < 5; ++i)
  43. {
  44. this.boatSides[i].render(f6);
  45. }
  46. }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment