本文整理汇总了Java中net.minecraft.client.model.ModelQuadruped类的典型用法代码示例。如果您正苦于以下问题:Java ModelQuadruped类的具体用法?Java ModelQuadruped怎么用?Java ModelQuadruped使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ModelQuadruped类属于net.minecraft.client.model包,在下文中一共展示了ModelQuadruped类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setupRenderer
import net.minecraft.client.model.ModelQuadruped; //导入依赖的package包/类
/**
* Setup renderer
*
* This method is responsible for setting up any client side stuff like
* the renderer, texture of the entity and the "hands"
*/
@SideOnly(Side.CLIENT)
protected void setupRenderer()
{
this.renderer = Minecraft.getMinecraft().getRenderManager().getEntityRenderObject(this.entity);
if (this.renderer instanceof RenderLivingBase<?>)
{
ModelBase model = ((RenderLivingBase<?>) renderer).getMainModel();
if (this.customSettings && model instanceof ModelBiped || model instanceof ModelQuadruped)
{
this.settings.hands = true;
}
}
}
示例2: createModel
import net.minecraft.client.model.ModelQuadruped; //导入依赖的package包/类
@Override
public ModelQuadruped createModel(ItemStack itemStack, EntityLivingBase entity)
{
transforms.defineParts();
final ICarvingVariation variation = CarvingUtils.getChiselRegistry().getVariation(itemStack);
final BlockPos position = entity.getPosition();
final World world = entity.getEntityWorld();
final ModelQuadruped quadrupedModel = new ModelSheep1();
transforms.getBodyPartDefinition().ifPresent(definition -> quadrupedModel.body = getChiselBodyModelRenderer(variation, definition, world, position));
transforms.getHeadPartDefinition().ifPresent(definition -> quadrupedModel.head = getChiselBodyModelRenderer(variation, definition, world, position));
transforms.getLeg1PartDefinition().ifPresent(definition -> quadrupedModel.leg1 = getChiselBodyModelRenderer(variation, definition, world, position));
transforms.getLeg2PartDefinition().ifPresent(definition -> quadrupedModel.leg2 = getChiselBodyModelRenderer(variation, definition, world, position));
transforms.getLeg3PartDefinition().ifPresent(definition -> quadrupedModel.leg3 = getChiselBodyModelRenderer(variation, definition, world, position));
transforms.getLeg4PartDefinition().ifPresent(definition -> quadrupedModel.leg4 = getChiselBodyModelRenderer(variation, definition, world, position));
return quadrupedModel;
}
示例3: createModel
import net.minecraft.client.model.ModelQuadruped; //导入依赖的package包/类
@Override
public ModelQuadruped createModel(ItemStack itemStack, EntityLivingBase entity)
{
transforms.defineParts();
final ModelQuadruped quadrupedModel = new ModelSheep1();
quadrupedModel.body = defaultRenderer;
quadrupedModel.head = defaultRenderer;
quadrupedModel.leg1 = defaultRenderer;
quadrupedModel.leg2 = defaultRenderer;
quadrupedModel.leg3 = defaultRenderer;
quadrupedModel.leg4 = defaultRenderer;
final IBakedModel bakedModelForItem = getBakedModelForItem(itemStack, entity);
transforms.getBodyPartDefinition().ifPresent(definition -> quadrupedModel.body = getModelRendererForBlockState(definition, null, bakedModelForItem));
transforms.getHeadPartDefinition().ifPresent(definition -> quadrupedModel.head = getModelRendererForBlockState(definition, null, bakedModelForItem));
transforms.getLeg1PartDefinition().ifPresent(definition -> quadrupedModel.leg1 = getModelRendererForBlockState(definition, null, bakedModelForItem));
transforms.getLeg2PartDefinition().ifPresent(definition -> quadrupedModel.leg2 = getModelRendererForBlockState(definition, null, bakedModelForItem));
transforms.getLeg3PartDefinition().ifPresent(definition -> quadrupedModel.leg3 = getModelRendererForBlockState(definition, null, bakedModelForItem));
transforms.getLeg4PartDefinition().ifPresent(definition -> quadrupedModel.leg4 = getModelRendererForBlockState(definition, null, bakedModelForItem));
return quadrupedModel;
}
示例4: func_77115_a
import net.minecraft.client.model.ModelQuadruped; //导入依赖的package包/类
protected void func_77115_a(EntityMooshroom p_77115_1_, float p_77115_2_) {
super.func_77029_c(p_77115_1_, p_77115_2_);
if(!p_77115_1_.func_70631_g_()) {
this.func_110776_a(TextureMap.field_110575_b);
GL11.glEnable(2884);
GL11.glPushMatrix();
GL11.glScalef(1.0F, -1.0F, 1.0F);
GL11.glTranslatef(0.2F, 0.4F, 0.5F);
GL11.glRotatef(42.0F, 0.0F, 1.0F, 0.0F);
this.field_76988_d.func_78600_a(Block.field_72103_ag, 0, 1.0F);
GL11.glTranslatef(0.1F, 0.0F, -0.6F);
GL11.glRotatef(42.0F, 0.0F, 1.0F, 0.0F);
this.field_76988_d.func_78600_a(Block.field_72103_ag, 0, 1.0F);
GL11.glPopMatrix();
GL11.glPushMatrix();
((ModelQuadruped)this.field_77045_g).field_78150_a.func_78794_c(0.0625F);
GL11.glScalef(1.0F, -1.0F, 1.0F);
GL11.glTranslatef(0.0F, 0.75F, -0.2F);
GL11.glRotatef(12.0F, 0.0F, 1.0F, 0.0F);
this.field_76988_d.func_78600_a(Block.field_72103_ag, 0, 1.0F);
GL11.glPopMatrix();
GL11.glDisable(2884);
}
}
示例5: doRenderLayer
import net.minecraft.client.model.ModelQuadruped; //导入依赖的package包/类
public void doRenderLayer(EntityMooshroom entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale)
{
if (!entitylivingbaseIn.isChild() && !entitylivingbaseIn.isInvisible())
{
BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
this.mooshroomRenderer.bindTexture(TextureMap.locationBlocksTexture);
GlStateManager.enableCull();
GlStateManager.cullFace(1028);
GlStateManager.pushMatrix();
GlStateManager.scale(1.0F, -1.0F, 1.0F);
GlStateManager.translate(0.2F, 0.35F, 0.5F);
GlStateManager.rotate(42.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.pushMatrix();
GlStateManager.translate(-0.5F, -0.5F, 0.5F);
blockrendererdispatcher.renderBlockBrightness(Blocks.red_mushroom.getDefaultState(), 1.0F);
GlStateManager.popMatrix();
GlStateManager.pushMatrix();
GlStateManager.translate(0.1F, 0.0F, -0.6F);
GlStateManager.rotate(42.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.translate(-0.5F, -0.5F, 0.5F);
blockrendererdispatcher.renderBlockBrightness(Blocks.red_mushroom.getDefaultState(), 1.0F);
GlStateManager.popMatrix();
GlStateManager.popMatrix();
GlStateManager.pushMatrix();
((ModelQuadruped)this.mooshroomRenderer.getMainModel()).head.postRender(0.0625F);
GlStateManager.scale(1.0F, -1.0F, 1.0F);
GlStateManager.translate(0.0F, 0.7F, -0.2F);
GlStateManager.rotate(12.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.translate(-0.5F, -0.5F, 0.5F);
blockrendererdispatcher.renderBlockBrightness(Blocks.red_mushroom.getDefaultState(), 1.0F);
GlStateManager.popMatrix();
GlStateManager.cullFace(1029);
GlStateManager.disableCull();
}
}
示例6: getModelRenderer
import net.minecraft.client.model.ModelQuadruped; //导入依赖的package包/类
public ModelRenderer getModelRenderer(ModelBase model, String modelPart)
{
if (!(model instanceof ModelQuadruped))
{
return null;
}
else
{
ModelQuadruped modelquadruped = (ModelQuadruped)model;
return modelPart.equals("head") ? modelquadruped.head : (modelPart.equals("body") ? modelquadruped.body : (modelPart.equals("leg1") ? modelquadruped.leg1 : (modelPart.equals("leg2") ? modelquadruped.leg2 : (modelPart.equals("leg3") ? modelquadruped.leg3 : (modelPart.equals("leg4") ? modelquadruped.leg4 : null)))));
}
}
示例7: doRenderLayer
import net.minecraft.client.model.ModelQuadruped; //导入依赖的package包/类
public void doRenderLayer(EntityMooshroom entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
if (!entitylivingbaseIn.isChild() && !entitylivingbaseIn.isInvisible())
{
BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
this.mooshroomRenderer.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
GlStateManager.enableCull();
GlStateManager.cullFace(GlStateManager.CullFace.FRONT);
GlStateManager.pushMatrix();
GlStateManager.scale(1.0F, -1.0F, 1.0F);
GlStateManager.translate(0.2F, 0.35F, 0.5F);
GlStateManager.rotate(42.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.pushMatrix();
GlStateManager.translate(-0.5F, -0.5F, 0.5F);
blockrendererdispatcher.renderBlockBrightness(Blocks.RED_MUSHROOM.getDefaultState(), 1.0F);
GlStateManager.popMatrix();
GlStateManager.pushMatrix();
GlStateManager.translate(0.1F, 0.0F, -0.6F);
GlStateManager.rotate(42.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.translate(-0.5F, -0.5F, 0.5F);
blockrendererdispatcher.renderBlockBrightness(Blocks.RED_MUSHROOM.getDefaultState(), 1.0F);
GlStateManager.popMatrix();
GlStateManager.popMatrix();
GlStateManager.pushMatrix();
((ModelQuadruped)this.mooshroomRenderer.getMainModel()).head.postRender(0.0625F);
GlStateManager.scale(1.0F, -1.0F, 1.0F);
GlStateManager.translate(0.0F, 0.7F, -0.2F);
GlStateManager.rotate(12.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.translate(-0.5F, -0.5F, 0.5F);
blockrendererdispatcher.renderBlockBrightness(Blocks.RED_MUSHROOM.getDefaultState(), 1.0F);
GlStateManager.popMatrix();
GlStateManager.cullFace(GlStateManager.CullFace.BACK);
GlStateManager.disableCull();
}
}
示例8: renderEquippedItems
import net.minecraft.client.model.ModelQuadruped; //导入依赖的package包/类
protected void renderEquippedItems(EntityMooshroom par1EntityMooshroom, float par2)
{
super.renderEquippedItems(par1EntityMooshroom, par2);
if (!par1EntityMooshroom.isChild())
{
this.bindTexture(TextureMap.locationBlocksTexture);
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glPushMatrix();
GL11.glScalef(1.0F, -1.0F, 1.0F);
GL11.glTranslatef(0.2F, 0.4F, 0.5F);
GL11.glRotatef(42.0F, 0.0F, 1.0F, 0.0F);
this.field_147909_c.renderBlockAsItem(Blocks.red_mushroom, 0, 1.0F);
GL11.glTranslatef(0.1F, 0.0F, -0.6F);
GL11.glRotatef(42.0F, 0.0F, 1.0F, 0.0F);
this.field_147909_c.renderBlockAsItem(Blocks.red_mushroom, 0, 1.0F);
GL11.glPopMatrix();
GL11.glPushMatrix();
((ModelQuadruped)this.mainModel).head.postRender(0.0625F);
GL11.glScalef(1.0F, -1.0F, 1.0F);
GL11.glTranslatef(0.0F, 0.75F, -0.2F);
GL11.glRotatef(12.0F, 0.0F, 1.0F, 0.0F);
this.field_147909_c.renderBlockAsItem(Blocks.red_mushroom, 0, 1.0F);
GL11.glPopMatrix();
GL11.glDisable(GL11.GL_CULL_FACE);
}
}
示例9: renderEquippedItems
import net.minecraft.client.model.ModelQuadruped; //导入依赖的package包/类
@Override
protected void renderEquippedItems(EntityLivingBase entity, float par2) {
super.renderEquippedItems(entity, par2);
if (!entity.isChild()) {
this.bindTexture(TextureMap.locationBlocksTexture);
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glPushMatrix();
GL11.glScalef(1.0F, -1.0F, 1.0F);
GL11.glTranslatef(0.2F, 0.4F, 0.5F);
GL11.glRotatef(42.0F, 0.0F, 1.0F, 0.0F);
this.field_147909_c.renderBlockAsItem(Blocks.red_mushroom, 0, 1.0F);
GL11.glTranslatef(0.1F, 0.0F, -0.6F);
GL11.glRotatef(42.0F, 0.0F, 1.0F, 0.0F);
this.field_147909_c.renderBlockAsItem(Blocks.red_mushroom, 0, 1.0F);
GL11.glPopMatrix();
GL11.glPushMatrix();
((ModelQuadruped) this.mainModel).head.postRender(0.0625F);
GL11.glScalef(1.0F, -1.0F, 1.0F);
GL11.glTranslatef(0.0F, 0.75F, -0.2F);
GL11.glRotatef(12.0F, 0.0F, 1.0F, 0.0F);
this.field_147909_c.renderBlockAsItem(Blocks.red_mushroom, 0, 1.0F);
GL11.glPopMatrix();
GL11.glDisable(GL11.GL_CULL_FACE);
}
}
示例10: renderEquippedItems
import net.minecraft.client.model.ModelQuadruped; //导入依赖的package包/类
protected void renderEquippedItems(EntityMooshroom p_77029_1_, float p_77029_2_)
{
super.renderEquippedItems(p_77029_1_, p_77029_2_);
if (!p_77029_1_.isChild())
{
this.bindTexture(TextureMap.locationBlocksTexture);
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glPushMatrix();
GL11.glScalef(1.0F, -1.0F, 1.0F);
GL11.glTranslatef(0.2F, 0.4F, 0.5F);
GL11.glRotatef(42.0F, 0.0F, 1.0F, 0.0F);
this.field_147909_c.renderBlockAsItem(Blocks.red_mushroom, 0, 1.0F);
GL11.glTranslatef(0.1F, 0.0F, -0.6F);
GL11.glRotatef(42.0F, 0.0F, 1.0F, 0.0F);
this.field_147909_c.renderBlockAsItem(Blocks.red_mushroom, 0, 1.0F);
GL11.glPopMatrix();
GL11.glPushMatrix();
((ModelQuadruped)this.mainModel).head.postRender(0.0625F);
GL11.glScalef(1.0F, -1.0F, 1.0F);
GL11.glTranslatef(0.0F, 0.75F, -0.2F);
GL11.glRotatef(12.0F, 0.0F, 1.0F, 0.0F);
this.field_147909_c.renderBlockAsItem(Blocks.red_mushroom, 0, 1.0F);
GL11.glPopMatrix();
GL11.glDisable(GL11.GL_CULL_FACE);
}
}
示例11: renderMooshroomEquippedItems
import net.minecraft.client.model.ModelQuadruped; //导入依赖的package包/类
protected void renderMooshroomEquippedItems(EntityMooshroom par1EntityMooshroom, float par2)
{
super.renderEquippedItems(par1EntityMooshroom, par2);
if (!par1EntityMooshroom.isChild())
{
this.bindTexture(TextureMap.locationBlocksTexture);
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glPushMatrix();
GL11.glScalef(1.0F, -1.0F, 1.0F);
GL11.glTranslatef(0.2F, 0.4F, 0.5F);
GL11.glRotatef(42.0F, 0.0F, 1.0F, 0.0F);
this.renderBlocks.renderBlockAsItem(Block.mushroomRed, 0, 1.0F);
GL11.glTranslatef(0.1F, 0.0F, -0.6F);
GL11.glRotatef(42.0F, 0.0F, 1.0F, 0.0F);
this.renderBlocks.renderBlockAsItem(Block.mushroomRed, 0, 1.0F);
GL11.glPopMatrix();
GL11.glPushMatrix();
((ModelQuadruped)this.mainModel).head.postRender(0.0625F);
GL11.glScalef(1.0F, -1.0F, 1.0F);
GL11.glTranslatef(0.0F, 0.75F, -0.2F);
GL11.glRotatef(12.0F, 0.0F, 1.0F, 0.0F);
this.renderBlocks.renderBlockAsItem(Block.mushroomRed, 0, 1.0F);
GL11.glPopMatrix();
GL11.glDisable(GL11.GL_CULL_FACE);
}
}
示例12: doRenderLayer
import net.minecraft.client.model.ModelQuadruped; //导入依赖的package包/类
@Override
public void doRenderLayer(EntityCrystalCow entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale)
{
if (!entitylivingbaseIn.isChild() && !entitylivingbaseIn.isInvisible() && entitylivingbaseIn.isCrystalGrown())
{
BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
this.mooshroomRenderer.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
IBlockState state = Blocks.RED_MUSHROOM.getDefaultState();
try{
switch(entitylivingbaseIn.getColor()){
default : case 0 : state = ModBlocks.crystalPlant.getDefaultState().withProperty(BlockCrystalPlant.TYPE, PlantType.BLUE); break;
case 1 : state = ModBlocks.crystalPlant.getDefaultState().withProperty(BlockCrystalPlant.TYPE, PlantType.RED); break;
case 2 : state = ModBlocks.crystalPlant.getDefaultState().withProperty(BlockCrystalPlant.TYPE, PlantType.GREEN); break;
case 3 : state = ModBlocks.crystalPlant.getDefaultState().withProperty(BlockCrystalPlant.TYPE, PlantType.DARK); break;
}
}catch(Exception e){
e.printStackTrace();
}
GlStateManager.enableCull();
GlStateManager.cullFace(GlStateManager.CullFace.FRONT);
GlStateManager.pushMatrix();
GlStateManager.scale(1.0F, -1.0F, 1.0F);
GlStateManager.translate(0.2F, 0.35F, 0.5F);
GlStateManager.rotate(42.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.pushMatrix();
GlStateManager.translate(-0.5F, -0.5F, 0.5F);
GlStateManager.pushMatrix();
GlStateManager.scale(0.5F, 0.5F, 0.5F);
GlStateManager.translate(0.5F, 0.0F, /*Different to fit on back*/-0.8F);
blockrendererdispatcher.renderBlockBrightness(state, 1.0F);
GlStateManager.popMatrix();
GlStateManager.popMatrix();
GlStateManager.pushMatrix();
GlStateManager.translate(0.1F, 0.0F, -0.6F);
GlStateManager.rotate(42.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.translate(-0.5F, -0.5F, 0.5F);
GlStateManager.pushMatrix();
GlStateManager.scale(0.5F, 0.5F, 0.5F);
GlStateManager.translate(0.5F, 0.0F, -0.5F);
blockrendererdispatcher.renderBlockBrightness(state, 1.0F);
GlStateManager.popMatrix();
GlStateManager.popMatrix();
GlStateManager.popMatrix();
GlStateManager.pushMatrix();
((ModelQuadruped)this.mooshroomRenderer.getMainModel()).head.postRender(0.0625F);
GlStateManager.scale(1.0F, -1.0F, 1.0F);
GlStateManager.translate(0.0F, 0.7F, -0.2F);
GlStateManager.rotate(12.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.translate(-0.5F, -0.5F, 0.5F);
GlStateManager.pushMatrix();
GlStateManager.scale(0.5F, 0.5F, 0.5F);
GlStateManager.translate(0.5F, 0.0F, -0.5F);
blockrendererdispatcher.renderBlockBrightness(state, 1.0F);
GlStateManager.popMatrix();
GlStateManager.popMatrix();
GlStateManager.cullFace(GlStateManager.CullFace.BACK);
GlStateManager.disableCull();
}
}
示例13: createModel
import net.minecraft.client.model.ModelQuadruped; //导入依赖的package包/类
@Override
public ModelQuadruped createModel(ItemStack itemStack, EntityLivingBase entity)
{
ModelQuadruped quadruped = super.createModel(itemStack, entity);
quadruped.body = new ModelRenderer(new ModelSheep1(), 0, 0);
quadruped.head = createModelRenderer(getTransforms().getHeadPartDefinition().get());
final EntityMesh mesh = new EntityMesh(quadruped.head);
quadruped.head.cubeList.add(mesh);
final Matrix4f antenna1Matrix = new Matrix4f();
antenna1Matrix.translate(new Vector3f(1, -3, -4));
antenna1Matrix.scale(new Vector3f(20, -20, 20));
antenna1Matrix.rotate(fifteenDegrees, new Vector3f(1, 0, 0));
antenna1Matrix.rotate(-thirtyDegrees, new Vector3f(0, 0, 1));
antenna1Matrix.rotate(-nintyDegrees, new Vector3f(0, 1, 0));
antenna1Matrix.translate(new Vector3f(-0.5f, -0.5f, -0.5f));
final IBakedModel bakedModelForItem = getBakedModelForItem(itemStack, entity);
addBlockModelToEntityMesh(mesh,
new PartDefinition(
new Vector3f(0, 0, 0),
antenna1Matrix,
new Matrix3f()),
null,
bakedModelForItem
);
final Matrix4f antenna2Matrix = new Matrix4f();
antenna2Matrix.translate(new Vector3f(-1, -3, -4));
antenna2Matrix.scale(new Vector3f(20, -20, 20));
antenna2Matrix.rotate(fifteenDegrees, new Vector3f(1, 0, 0));
antenna2Matrix.rotate(thirtyDegrees, new Vector3f(0, 0, 1));
antenna2Matrix.rotate(nintyDegrees, new Vector3f(0, 1, 0));
antenna2Matrix.translate(new Vector3f(-0.5f, -0.5f, -0.5f));
addBlockModelToEntityMesh(mesh,
new PartDefinition(
new Vector3f(0, 0, 0),
antenna2Matrix,
new Matrix3f()),
null,
bakedModelForItem
);
return quadruped;
}
示例14: createModel
import net.minecraft.client.model.ModelQuadruped; //导入依赖的package包/类
@Override
public ModelQuadruped createModel(ItemStack itemStack, EntityLivingBase entity)
{
ModelQuadruped quadruped = super.createModel(itemStack, entity);
final float nintyDegrees = (float) Math.toRadians(90);
quadruped.body = new ModelRenderer(new ModelSheep1(), 0, 0);
quadruped.head = createModelRenderer(getTransforms().getHeadPartDefinition().get());
final EntityMesh mesh = new EntityMesh(quadruped.head);
quadruped.head.cubeList.add(mesh);
final Matrix4f antenna1Matrix = new Matrix4f();
antenna1Matrix.translate(new Vector3f(8, 0, -2));
antenna1Matrix.scale(new Vector3f(20, -20, 20));
antenna1Matrix.rotate(-nintyDegrees, new Vector3f(0, 1, 0));
antenna1Matrix.translate(new Vector3f(-0.5f, -0.5f, -0.5f));
final IBakedModel bakedModelForItem = getBakedModelForItem(itemStack, entity);
addBlockModelToEntityMesh(mesh,
new PartDefinition(
new Vector3f(0, 0, 0),
antenna1Matrix,
new Matrix3f()),
null,
bakedModelForItem
);
final Matrix4f antenna2Matrix = new Matrix4f();
antenna2Matrix.translate(new Vector3f(-8, 0, -2));
antenna2Matrix.scale(new Vector3f(20, -20, 20));
antenna2Matrix.rotate(nintyDegrees, new Vector3f(0, 1, 0));
antenna2Matrix.translate(new Vector3f(-0.5f, -0.5f, -0.5f));
addBlockModelToEntityMesh(mesh,
new PartDefinition(
new Vector3f(0, 0, 0),
antenna2Matrix,
new Matrix3f()),
null,
bakedModelForItem
);
return quadruped;
}
示例15: getPotentialArm
import net.minecraft.client.model.ModelQuadruped; //导入依赖的package包/类
public static ModelRenderer getPotentialArm(ModelBase parent)
{
if(parent != null)
{
Class clz = parent.getClass();
if(armMappings.containsKey(clz))
{
return armMappings.get(clz);
}
if(clz == ModelHorse.class)
{
ModelHorse dummy = new ModelHorse();
ModelRenderer leg = new ModelRenderer(dummy, 60, 29);
leg.addBox(-1.1F, -1.0F, -2.1F, 3, 8, 4);
leg.setRotationPoint(-4.0F, 9.0F, -8.0F);
ModelRenderer shin = new ModelRenderer(dummy, 60, 41);
shin.addBox(-1.1F, 0.0F, -1.6F, 3, 5, 3);
shin.setRotationPoint(0.0F, 7.0F, 0.0F);
leg.addChild(shin);
ModelRenderer hoof = new ModelRenderer(dummy, 60, 51);
hoof.addBox(-1.6F, 5.1F, -2.1F, 4, 3, 4);
hoof.setRotationPoint(0.0F, 0.0F, 0.0F);
shin.addChild(hoof);
return leg;
}
else
{
while(clz != ModelBase.class && ModelBase.class.isAssignableFrom(clz))
{
try
{
Field[] fields = clz.getDeclaredFields();
for(Field f : fields)
{
f.setAccessible(true);
if(f.getType() == ModelRenderer.class)
{
if(clz == ModelBiped.class && (f.getName().equalsIgnoreCase("bipedRightArm") || f.getName().equalsIgnoreCase("f") || f.getName().equalsIgnoreCase("field_78112_f")) ||
clz == ModelQuadruped.class && (f.getName().equalsIgnoreCase("leg3") || f.getName().equalsIgnoreCase("e") || f.getName().equalsIgnoreCase("field_78147_e")) ||
clz == ModelCreeper.class && (f.getName().equalsIgnoreCase("leg3") || f.getName().equalsIgnoreCase("f") || f.getName().equalsIgnoreCase("field_78129_f")) ||
clz == ModelIronGolem.class && (f.getName().equalsIgnoreCase("ironGolemRightArm") || f.getName().equalsIgnoreCase("c") || f.getName().equalsIgnoreCase("field_78177_c")) ||
clz == ModelSpider.class && (f.getName().equalsIgnoreCase("spiderLeg7") || f.getName().equalsIgnoreCase("j") || f.getName().equalsIgnoreCase("field_78210_j")) ||
clz == ModelWolf.class && (f.getName().equalsIgnoreCase("wolfLeg3") || f.getName().equalsIgnoreCase("e") || f.getName().equalsIgnoreCase("field_78182_e")) ||
clz == ModelOcelot.class && (f.getName().equalsIgnoreCase("ocelotFrontRightLeg") || f.getName().equalsIgnoreCase("d") || f.getName().equalsIgnoreCase("field_78157_d")) ||
clz != ModelBiped.class && clz != ModelQuadruped.class && clz != ModelCreeper.class && clz != ModelIronGolem.class && clz != ModelSpider.class && clz != ModelWolf.class && clz != ModelOcelot.class &&
(f.getName().contains("Right") || f.getName().contains("right")) && (f.getName().contains("arm") || f.getName().contains("hand") || f.getName().contains("Arm") || f.getName().contains("Hand")))
{
ModelRenderer arm = (ModelRenderer)f.get(parent);
if(arm != null)
{
return arm; // Add normal parent fields
}
}
}
else if(f.getType() == ModelRenderer[].class && clz == ModelSquid.class && (f.getName().equalsIgnoreCase("squidTentacles") || f.getName().equalsIgnoreCase("b") || f.getName().equalsIgnoreCase("field_78201_b")))
{
return ((ModelRenderer[])f.get(parent))[0];
}
}
clz = clz.getSuperclass();
}
catch(Exception e)
{
throw new UnableToAccessFieldException(new String[0], e);
}
}
}
}
return null;
}