/
Belyash5
/
Flu
Обзор
Документация
Войти
/
Belyash5
/
Flu
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/main/java/com/hbm/render/model/ModelT45Boots.java
126 строк
4 KB
ItsMakar
Refactor models, fix ModelArmorBase compatibility with SkinPort and Galacticraft
01 апр 2025, 13:06
01 апр 2025, 13:06
bfede6d
Код
Авторство
О чём код?
// Date: 25.12.2015 00:50:09 // Template version 1.1 // Java generated by Techne // Keep in mind that you still need to fill in some blanks // - ZeuX package com.hbm.render.model; import org.lwjgl.opengl.GL11; import net.minecraft.client.model.ModelBiped; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; public class ModelT45Boots extends ModelBiped { ModelRenderer leftleg; ModelRenderer rightleg; ModelRenderer Shape1; ModelRenderer Shape2; ModelRenderer Shape3; ModelRenderer Shape4; public ModelT45Boots() { this.textureWidth = 64; this.textureHeight = 32; this.leftleg = new ModelRenderer(this, 0, 0); this.rightleg = new ModelRenderer(this, 0, 0); this.Shape1 = new ModelRenderer(this, 0, 0); this.Shape1.addBox(0F, 0F, 0F, 4, 2, 6); this.Shape1.setRotationPoint(-4F + 2, 0F + 9.5F, -4F); this.Shape1.setTextureSize(64, 32); this.Shape1.mirror = true; setRotation(this.Shape1, 0F, 0F, 0F); convertToChild(this.leftleg, this.Shape1); this.Shape2 = new ModelRenderer(this, 0, 8); this.Shape2.addBox(0F, 0F, 0F, 4, 2, 6); this.Shape2.setRotationPoint(0F - 2, 0F + 9.5F, -4F); this.Shape2.setTextureSize(64, 32); this.Shape2.mirror = true; setRotation(this.Shape2, 0F, 0F, 0F); convertToChild(this.rightleg, this.Shape2); this.Shape3 = new ModelRenderer(this, 0, 16); this.Shape3.addBox(0F, -1F, 0F, 4, 2, 4); this.Shape3.setRotationPoint(-4F + 2, 0F + 9.5F, -4F); this.Shape3.setTextureSize(64, 32); this.Shape3.mirror = true; setRotation(this.Shape3, 0.2617994F, 0F, 0F); convertToChild(this.leftleg, this.Shape3); this.Shape4 = new ModelRenderer(this, 0, 22); this.Shape4.addBox(0F, -1F, 0F, 4, 2, 4); this.Shape4.setRotationPoint(0F - 2, 0F + 9.5F, -4F); this.Shape4.setTextureSize(64, 32); this.Shape4.mirror = true; setRotation(this.Shape4, 0.2617994F, 0F, 0F); convertToChild(this.rightleg, this.Shape4); } @Override public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entity) { this.isSneak = entity.isSneaking(); this.isRiding = entity.isRiding(); super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entity); this.leftleg.rotationPointX = this.bipedLeftLeg.rotationPointX; this.leftleg.rotationPointY = this.bipedLeftLeg.rotationPointY - 1.5F; this.leftleg.rotationPointZ = this.bipedLeftLeg.rotationPointZ; this.leftleg.rotateAngleX = this.bipedLeftLeg.rotateAngleX; this.leftleg.rotateAngleY = this.bipedLeftLeg.rotateAngleY; this.leftleg.rotateAngleZ = this.bipedLeftLeg.rotateAngleZ; this.rightleg.rotationPointX = this.bipedRightLeg.rotationPointX; this.rightleg.rotationPointY = this.bipedRightLeg.rotationPointY - 1.5F; this.rightleg.rotationPointZ = this.bipedRightLeg.rotationPointZ; this.rightleg.rotateAngleX = this.bipedRightLeg.rotateAngleX; this.rightleg.rotateAngleY = this.bipedRightLeg.rotateAngleY; this.rightleg.rotateAngleZ = this.bipedRightLeg.rotateAngleZ; if (this.isSneak) { this.leftleg.rotationPointZ -= 0.5F; this.rightleg.rotationPointZ -= 0.5F; this.leftleg.rotationPointY += 0.5F; this.rightleg.rotationPointY += 0.5F; } } @Override public void render(Entity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor) { this.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entity); GL11.glPushMatrix(); GL11.glScalef(1.125F, 1.125F, 1.125F); // this.leftleg.addChild(Shape1); // this.leftleg.addChild(Shape3); this.leftleg.render(scaleFactor); // this.rightleg.addChild(Shape2); // this.rightleg.addChild(Shape4); this.rightleg.render(scaleFactor); GL11.glPopMatrix(); } protected static void convertToChild(ModelRenderer parent, ModelRenderer child) { // move child rotation point to be relative to parent child.rotationPointX -= parent.rotationPointX; child.rotationPointY -= parent.rotationPointY; child.rotationPointZ -= parent.rotationPointZ; // make rotations relative to parent child.rotateAngleX -= parent.rotateAngleX; child.rotateAngleY -= parent.rotateAngleY; child.rotateAngleZ -= parent.rotateAngleZ; // create relationship parent.addChild(child); } private static void setRotation(ModelRenderer model, float x, float y, float z) { model.rotateAngleX = x; model.rotateAngleY = y; model.rotateAngleZ = z; } }