Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package botCraft.client;
- import botCraft.entities.EntityDrillBot;
- import net.minecraft.client.model.ModelBase;
- import net.minecraft.client.model.ModelRenderer;
- import net.minecraft.entity.Entity;
- public class ModelDrillBot extends ModelBase{
- //fields
- ModelRenderer Back;
- ModelRenderer Front;
- private ModelRenderer Drill3;
- ModelRenderer Drill2;
- ModelRenderer Drill1;
- ModelRenderer Locomotion;
- private int locoType;
- private int drill3YCoord;
- private int drill2YCoord;
- private int drill1YCoord;
- public ModelDrillBot(int modelLocoType, int modelDrillType){
- textureWidth = 64;
- textureHeight = 32;
- switch(modelDrillType) {
- case 0:
- drill3YCoord = 8;
- drill2YCoord = 0;
- drill1YCoord = 8;
- break;
- case 1:
- drill3YCoord = 8;
- drill2YCoord = 8;
- drill1YCoord = 8;
- break;
- case 2:
- drill3YCoord = 0;
- drill2YCoord = 0;
- drill1YCoord = 0;
- break;
- default:
- drill3YCoord = 0;
- drill2YCoord = 0;
- drill1YCoord = 0;
- }
- Back = new ModelRenderer(this, 27, 18);
- Back.addBox(-4F, -2F, 0F, 8, 5, 9);
- Back.setRotationPoint(0F, 0F, 0F);
- setRotation(Back, 0F, 0F, 0F);
- Front = new ModelRenderer(this, 0, 19);
- Front.addBox(-4F, -4F, 0F, 8, 8, 5);
- Front.setRotationPoint(0F, -1F, -5F);
- setRotation(Front, 0F, 0F, 0F);
- Back.addChild(Front);
- Drill3 = new ModelRenderer(this, 20, drill3YCoord);
- Drill3.addBox(-3F, -3F, -1F, 6, 6, 2);
- Drill3.setRotationPoint(0F, -1F, -6F);
- setRotation(Drill3, 0F, 0F, 0F);
- Drill2 = new ModelRenderer(this, 7, drill2YCoord);
- Drill2.addBox(-2F, -2F, -1F, 4, 4, 2);
- Drill2.setRotationPoint(0F, -1F, -8F);
- setRotation(Drill2, 0F, 0F, 0F);
- Drill1 = new ModelRenderer(this, 0, drill1YCoord);
- Drill1.addBox(-1F, -1F, -1F, 2, 2, 1);
- Drill1.setRotationPoint(0F, 0F, -3F);
- setRotation(Drill1, 0F, 0F, 0F);
- Drill3.addChild(Drill1);
- switch(modelLocoType) {
- case 0:
- break;
- case 1:
- Locomotion = new ModelRenderer(this, 36, 0);
- Locomotion.addBox(-5F, 2F, 5F, 2, 3, 3);
- Locomotion.addBox(3F, 2F, 5F, 2, 3, 3);
- Locomotion.addBox(-5F, 2F, -2F, 2, 3, 3);
- Locomotion.addBox(3F, 2F, -2F, 2, 3, 3);
- Locomotion.setRotationPoint(0F, 0F, 0F);
- setRotation(Locomotion, 0F, 0F, 0F);
- locoType = 1;
- break;
- case 2:
- Locomotion = new ModelRenderer(this, 42, 6);
- Locomotion.addBox(-5F, 2F, -2F, 2, 3, 9);
- Locomotion.addBox(3F, 2F, -2F, 2, 3, 9);
- Locomotion.setRotationPoint(0F, 0F, 0F);
- setRotation(Locomotion, 0F, 0F, 0F);
- locoType = 2;
- break;
- default:
- }
- }
- public void render(Entity entity, float drill3Rotation, float bodyRotation, float f2, float f3, float f4, float f5)
- {
- EntityDrillBot bot = (EntityDrillBot)entity;
- Drill3.rotateAngleZ = drill3Rotation;
- Drill2.rotateAngleZ = -(drill3Rotation);
- super.render(entity, drill3Rotation, bodyRotation, f2, f3, f4, f5);
- setRotationAngles(drill3Rotation, bodyRotation, f2, f3, f4, f5);
- if(bot != null){
- Back.rotateAngleY = bodyRotation;
- Drill3.rotateAngleY = bodyRotation;
- Drill2.rotateAngleY = bodyRotation;
- Locomotion.rotateAngleY = bodyRotation;
- }
- Back.render(f5);
- Drill3.render(f5);
- Drill2.render(f5);
- if(locoType == 1 || locoType == 2) {
- Locomotion.render(f5);
- }
- }
- private void setRotation(ModelRenderer model, float x, float y, float z)
- {
- model.rotateAngleX = x;
- model.rotateAngleY = y;
- model.rotateAngleZ = z;
- }
- public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5)
- {
- super.setRotationAngles(f, f1, f2, f3, f4, f5, null);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement