当前位置: 首页>>代码示例>>Java>>正文


Java ItemCameraTransforms类代码示例

本文整理汇总了Java中net.minecraft.client.renderer.block.model.ItemCameraTransforms的典型用法代码示例。如果您正苦于以下问题:Java ItemCameraTransforms类的具体用法?Java ItemCameraTransforms怎么用?Java ItemCameraTransforms使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ItemCameraTransforms类属于net.minecraft.client.renderer.block.model包,在下文中一共展示了ItemCameraTransforms类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: renderHeldItem

import net.minecraft.client.renderer.block.model.ItemCameraTransforms; //导入依赖的package包/类
private void renderHeldItem(EntityObj entityObj, ItemStack itemStack, ItemCameraTransforms.TransformType cameraTransforms, EnumHandSide handSide)
{
	if (!itemStack.isEmpty())
	{
		GlStateManager.pushMatrix();

		if (entityObj.isSneaking())
		{
			GlStateManager.translate(0.0F, 0.2F, 0.0F);
		}
		objRenderer.transformToHandAndRotateAndScale(handSide);
		GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F);
		GlStateManager.rotate(-180.0F, 0.0F, 1.0F, 0.0F);
		boolean flag = handSide == EnumHandSide.LEFT;
		Minecraft.getMinecraft().getItemRenderer().renderItemSide(entityObj, itemStack, cameraTransforms, flag);
		GlStateManager.popMatrix();
	}
}
 
开发者ID:ObsidianSuite,项目名称:ObsidianSuite,代码行数:19,代码来源:LayerHeldItemAnimated.java

示例2: handlePerspective

import net.minecraft.client.renderer.block.model.ItemCameraTransforms; //导入依赖的package包/类
@Override
public Pair<? extends IBakedModel, Matrix4f> handlePerspective(TransformType cameraTransformType) {
	if (baseSpellPageModel instanceof IPerspectiveAwareModel) {
		Matrix4f matrix4f = ((IPerspectiveAwareModel) baseSpellPageModel).handlePerspective(cameraTransformType)
				.getRight();
		return Pair.of(this, matrix4f);
	}
	ItemCameraTransforms itemCameraTransforms = baseSpellPageModel.getItemCameraTransforms();
	ItemTransformVec3f itemTransformVec3f = itemCameraTransforms.getTransform(cameraTransformType);
	TRSRTransformation tr = new TRSRTransformation(itemTransformVec3f);
	Matrix4f mat = null;
	if (tr != null) {
		mat = tr.getMatrix();
	}
	return Pair.of(this, mat);
}
 
开发者ID:the-realest-stu,项目名称:Infernum,代码行数:17,代码来源:ModelSpellPage.java

示例3: makeModelCube

import net.minecraft.client.renderer.block.model.ItemCameraTransforms; //导入依赖的package包/类
public static IBakedModel makeModelCube(TextureAtlasSprite p_makeModelCube_0_, int p_makeModelCube_1_)
{
    List list = new ArrayList();
    EnumFacing[] aenumfacing = EnumFacing.VALUES;
    Map<EnumFacing, List<BakedQuad>> map = new HashMap();

    for (int i = 0; i < aenumfacing.length; ++i)
    {
        EnumFacing enumfacing = aenumfacing[i];
        List list1 = new ArrayList();
        list1.add(makeBakedQuad(enumfacing, p_makeModelCube_0_, p_makeModelCube_1_));
        map.put(enumfacing, list1);
    }

    ItemOverrideList itemoverridelist = new ItemOverrideList(new ArrayList());
    IBakedModel ibakedmodel = new SimpleBakedModel(list, map, true, true, p_makeModelCube_0_, ItemCameraTransforms.DEFAULT, itemoverridelist);
    return ibakedmodel;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:19,代码来源:BlockModelUtils.java

示例4: handlePerspective

import net.minecraft.client.renderer.block.model.ItemCameraTransforms; //导入依赖的package包/类
@Override
public Pair<? extends IBakedModel, Matrix4f> handlePerspective(TransformType cameraTransformType) {
	if (parentModel instanceof IPerspectiveAwareModel) {
		Matrix4f matrix4f = ((IPerspectiveAwareModel) parentModel).handlePerspective(cameraTransformType)
				.getRight();
		return Pair.of(this, matrix4f);
	}
	ItemCameraTransforms itemCameraTransforms = parentModel.getItemCameraTransforms();
	ItemTransformVec3f itemTransformVec3f = itemCameraTransforms.getTransform(cameraTransformType);
	TRSRTransformation tr = new TRSRTransformation(itemTransformVec3f);
	Matrix4f mat = null;
	if (tr != null) {
		mat = tr.getMatrix();
	}
	return Pair.of(this, mat);
}
 
开发者ID:the-realest-stu,项目名称:Infernum,代码行数:17,代码来源:BakedModelSpellPage.java

示例5: renderItem

import net.minecraft.client.renderer.block.model.ItemCameraTransforms; //导入依赖的package包/类
public void renderItem(ItemStack stack, IBakedModel model) {
	if (!stack.isEmpty()) {
		if (model.isBuiltInRenderer() && !(stack.getItem() instanceof ItemDankNullHolder)) {
			Minecraft.getMinecraft().getItemRenderer().renderItem(EasyMappings.player(), stack, ItemCameraTransforms.TransformType.NONE);
		}
		else {
			RenderModel.render(model, stack);
			if (stack.hasEffect()) {
				if ((stack.getItem() instanceof ItemDankNull)) {
					if (!Options.superShine) {
						GlintEffectRenderer.apply(model, stack.getItemDamage());
					}
					else {
						GlintEffectRenderer.apply2(model, DankNullUtils.getColor(stack.getItemDamage(), false));
					}
				}
				else {
					GlintEffectRenderer.apply(model, -1);
				}
			}
		}
	}
}
 
开发者ID:p455w0rd,项目名称:DankNull,代码行数:24,代码来源:DankNullRenderer.java

示例6: renderItemModelTransform

import net.minecraft.client.renderer.block.model.ItemCameraTransforms; //导入依赖的package包/类
protected void renderItemModelTransform(ItemStack stack, IBakedModel model, ItemCameraTransforms.TransformType cameraTransformType)
{
    this.textureManager.bindTexture(TextureMap.locationBlocksTexture);
    this.textureManager.getTexture(TextureMap.locationBlocksTexture).setBlurMipmap(false, false);
    this.preTransform(stack);
    GlStateManager.enableRescaleNormal();
    GlStateManager.alphaFunc(516, 0.1F);
    GlStateManager.enableBlend();
    GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
    GlStateManager.pushMatrix();
    ItemCameraTransforms itemcameratransforms = model.getItemCameraTransforms();
    itemcameratransforms.applyTransform(cameraTransformType);

    if (this.func_183005_a(itemcameratransforms.getTransform(cameraTransformType)))
    {
        GlStateManager.cullFace(1028);
    }

    this.renderItem(stack, model);
    GlStateManager.cullFace(1029);
    GlStateManager.popMatrix();
    GlStateManager.disableRescaleNormal();
    GlStateManager.disableBlend();
    this.textureManager.bindTexture(TextureMap.locationBlocksTexture);
    this.textureManager.getTexture(TextureMap.locationBlocksTexture).restoreLastBlurMipmap();
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:27,代码来源:RenderItem.java

示例7: renderItemIntoGUI

import net.minecraft.client.renderer.block.model.ItemCameraTransforms; //导入依赖的package包/类
public void renderItemIntoGUI(ItemStack stack, int x, int y)
{
    IBakedModel ibakedmodel = this.itemModelMesher.getItemModel(stack);
    GlStateManager.pushMatrix();
    this.textureManager.bindTexture(TextureMap.locationBlocksTexture);
    this.textureManager.getTexture(TextureMap.locationBlocksTexture).setBlurMipmap(false, false);
    GlStateManager.enableRescaleNormal();
    GlStateManager.enableAlpha();
    GlStateManager.alphaFunc(516, 0.1F);
    GlStateManager.enableBlend();
    GlStateManager.blendFunc(770, 771);
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    this.setupGuiTransform(x, y, ibakedmodel.isGui3d());
    ibakedmodel.getItemCameraTransforms().applyTransform(ItemCameraTransforms.TransformType.GUI);
    this.renderItem(stack, ibakedmodel);
    GlStateManager.disableAlpha();
    GlStateManager.disableRescaleNormal();
    GlStateManager.disableLighting();
    GlStateManager.popMatrix();
    this.textureManager.bindTexture(TextureMap.locationBlocksTexture);
    this.textureManager.getTexture(TextureMap.locationBlocksTexture).restoreLastBlurMipmap();
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:23,代码来源:RenderItem.java

示例8: makeModelCube

import net.minecraft.client.renderer.block.model.ItemCameraTransforms; //导入依赖的package包/类
public static IBakedModel makeModelCube(TextureAtlasSprite p_makeModelCube_0_, int p_makeModelCube_1_)
{
    List list = new ArrayList();
    EnumFacing[] aenumfacing = EnumFacing.VALUES;
    List list1 = new ArrayList(aenumfacing.length);

    for (int i = 0; i < aenumfacing.length; ++i)
    {
        EnumFacing enumfacing = aenumfacing[i];
        List list2 = new ArrayList();
        list2.add(makeBakedQuad(enumfacing, p_makeModelCube_0_, p_makeModelCube_1_));
        list1.add(list2);
    }

    IBakedModel ibakedmodel = new SimpleBakedModel(list, list1, true, true, p_makeModelCube_0_, ItemCameraTransforms.DEFAULT);
    return ibakedmodel;
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:18,代码来源:BlockModelUtils.java

示例9: renderHeldItem

import net.minecraft.client.renderer.block.model.ItemCameraTransforms; //导入依赖的package包/类
private void renderHeldItem(EntityLivingBase p_188358_1_, ItemStack p_188358_2_, ItemCameraTransforms.TransformType p_188358_3_, EnumHandSide handSide)
{
    if (p_188358_2_ != null)
    {
        GlStateManager.pushMatrix();

        if (p_188358_1_.isSneaking())
        {
            GlStateManager.translate(0.0F, 0.2F, 0.0F);
        }
        // Forge: moved this call down, fixes incorrect offset while sneaking.
        ((ModelBiped)this.livingEntityRenderer.getMainModel()).postRenderArm(0.0625F, handSide);
        GlStateManager.rotate(-90.0F, 1.0F, 0.0F, 0.0F);
        GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F);
        boolean flag = handSide == EnumHandSide.LEFT;
        GlStateManager.translate((float)(flag ? -1 : 1) / 16.0F, 0.125F, -0.625F);
        Minecraft.getMinecraft().getItemRenderer().renderItemSide(p_188358_1_, p_188358_2_, p_188358_3_, flag);
        GlStateManager.popMatrix();
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:21,代码来源:LayerHeldItem.java

示例10: makeModelCube

import net.minecraft.client.renderer.block.model.ItemCameraTransforms; //导入依赖的package包/类
public static IBakedModel makeModelCube(TextureAtlasSprite p_makeModelCube_0_, int p_makeModelCube_1_)
{
    List list = new ArrayList();
    EnumFacing[] aenumfacing = EnumFacing.values();
    List list1 = new ArrayList(aenumfacing.length);

    for (int i = 0; i < aenumfacing.length; ++i)
    {
        EnumFacing enumfacing = aenumfacing[i];
        List list2 = new ArrayList();
        list2.add(makeBakedQuad(enumfacing, p_makeModelCube_0_, p_makeModelCube_1_));
        list1.add(list2);
    }

    IBakedModel ibakedmodel = new SimpleBakedModel(list, list1, true, true, p_makeModelCube_0_, ItemCameraTransforms.DEFAULT);
    return ibakedmodel;
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:18,代码来源:BlockModelUtils.java

示例11: renderItemSide

import net.minecraft.client.renderer.block.model.ItemCameraTransforms; //导入依赖的package包/类
public void renderItemSide(EntityLivingBase entitylivingbaseIn, ItemStack heldStack, ItemCameraTransforms.TransformType transform, boolean leftHanded)
{
    if (!heldStack.func_190926_b())
    {
        Item item = heldStack.getItem();
        Block block = Block.getBlockFromItem(item);
        GlStateManager.pushMatrix();
        boolean flag = this.itemRenderer.shouldRenderItemIn3D(heldStack) && block.getBlockLayer() == BlockRenderLayer.TRANSLUCENT;

        if (flag && (!Config.isShaders() || !Shaders.renderItemKeepDepthMask))
        {
            GlStateManager.depthMask(false);
        }

        this.itemRenderer.renderItem(heldStack, entitylivingbaseIn, transform, leftHanded);

        if (flag)
        {
            GlStateManager.depthMask(true);
        }

        GlStateManager.popMatrix();
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:25,代码来源:ItemRenderer.java

示例12: doRenderLayer

import net.minecraft.client.renderer.block.model.ItemCameraTransforms; //导入依赖的package包/类
public void doRenderLayer(EntityLivingBase entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
    boolean flag = entitylivingbaseIn.getPrimaryHand() == EnumHandSide.RIGHT;
    ItemStack itemstack = flag ? entitylivingbaseIn.getHeldItemOffhand() : entitylivingbaseIn.getHeldItemMainhand();
    ItemStack itemstack1 = flag ? entitylivingbaseIn.getHeldItemMainhand() : entitylivingbaseIn.getHeldItemOffhand();

    if (itemstack != null || itemstack1 != null)
    {
        GlStateManager.pushMatrix();

        if (this.livingEntityRenderer.getMainModel().isChild)
        {
            float f = 0.5F;
            GlStateManager.translate(0.0F, 0.625F, 0.0F);
            GlStateManager.rotate(-20.0F, -1.0F, 0.0F, 0.0F);
            GlStateManager.scale(0.5F, 0.5F, 0.5F);
        }

        this.renderHeldItem(entitylivingbaseIn, itemstack1, ItemCameraTransforms.TransformType.THIRD_PERSON_RIGHT_HAND, EnumHandSide.RIGHT);
        this.renderHeldItem(entitylivingbaseIn, itemstack, ItemCameraTransforms.TransformType.THIRD_PERSON_LEFT_HAND, EnumHandSide.LEFT);
        GlStateManager.popMatrix();
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:24,代码来源:LayerHeldItem.java

示例13: renderItemStack

import net.minecraft.client.renderer.block.model.ItemCameraTransforms; //导入依赖的package包/类
public static void renderItemStack(ItemStack stack) {
	//Fix stack 'y' center
	if(stack.getItem() instanceof ItemBlock) {
		GlStateManager.translate(0F, -0.1F, 0F);
	}
	RenderItem render = Minecraft.getMinecraft().getRenderItem();
	GlStateManager.pushAttrib();
	net.minecraft.client.renderer.RenderHelper.enableStandardItemLighting();
	render.renderItem(stack, ItemCameraTransforms.TransformType.GROUND);
	net.minecraft.client.renderer.RenderHelper.disableStandardItemLighting();
	GlStateManager.popAttrib();
}
 
开发者ID:ArekkuusuJerii,项目名称:Solar,代码行数:13,代码来源:RenderHelper.java

示例14: handleCameraTransforms

import net.minecraft.client.renderer.block.model.ItemCameraTransforms; //导入依赖的package包/类
@SuppressWarnings("deprecation")
public static IBakedModel handleCameraTransforms(IBakedModel model, ItemCameraTransforms.TransformType cameraTransformType, boolean leftHandHackery)
{
    if(model instanceof IPerspectiveAwareModel)
    {
        Pair<? extends IBakedModel, Matrix4f> pair = ((IPerspectiveAwareModel)model).handlePerspective(cameraTransformType);

        if(pair.getRight() != null)
        {
            Matrix4f matrix = new Matrix4f(pair.getRight());
            if(leftHandHackery)
            {
                matrix.mul(flipX, matrix);
                matrix.mul(matrix, flipX);
            }
            multiplyCurrentGlMatrix(matrix);
        }
        return pair.getLeft();
    }
    else
    {
        //if(leftHandHackery) GlStateManager.scale(-1, 1, 1);
        ItemCameraTransforms.applyTransformSide(model.getItemCameraTransforms().getTransform(cameraTransformType), leftHandHackery);
        //if(leftHandHackery) GlStateManager.scale(-1, 1, 1);
    }
    return model;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:28,代码来源:ForgeHooksClient.java

示例15: renderItem

import net.minecraft.client.renderer.block.model.ItemCameraTransforms; //导入依赖的package包/类
private void renderItem(TilePedestal te) {
    ItemStack stack = te.getStack();
    if (stack != null) {
        RenderHelper.enableStandardItemLighting();
        GlStateManager.enableLighting();
        GlStateManager.pushMatrix();
        GlStateManager.translate(0.5, 0.75, 0.5);
        GlStateManager.scale(0.4F, .4F, 0.4F);

        Minecraft.getMinecraft().getRenderItem().renderItem(stack, ItemCameraTransforms.TransformType.NONE);

        GlStateManager.popMatrix();
    }
}
 
开发者ID:the-realest-stu,项目名称:Infernum,代码行数:15,代码来源:TESRPedestal.java


注:本文中的net.minecraft.client.renderer.block.model.ItemCameraTransforms类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。