本文整理汇总了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();
}
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
}
}
}
}
示例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();
}
示例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();
}
示例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;
}
示例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();
}
}
示例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;
}
示例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();
}
}
示例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();
}
}
示例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();
}
示例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;
}
示例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();
}
}