本文整理汇总了Java中net.minecraft.client.renderer.RenderBlocks.renderItemIn3d方法的典型用法代码示例。如果您正苦于以下问题:Java RenderBlocks.renderItemIn3d方法的具体用法?Java RenderBlocks.renderItemIn3d怎么用?Java RenderBlocks.renderItemIn3d使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.client.renderer.RenderBlocks
的用法示例。
在下文中一共展示了RenderBlocks.renderItemIn3d方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: renderItemUniform
import net.minecraft.client.renderer.RenderBlocks; //导入方法依赖的package包/类
/**
* Renders items and blocks in the world at 0,0,0 with transformations that size them appropriately
* @param spin The spin angle of the item around the y axis in degrees
*/
public static void renderItemUniform(ItemStack item, double spin)
{
IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(item, ENTITY);
boolean is3D = customRenderer != null && customRenderer.shouldUseRenderHelper(ENTITY, item, BLOCK_3D);
boolean larger = false;
if (item.getItem() instanceof ItemBlock && RenderBlocks.renderItemIn3d(Block.getBlockFromItem(item.getItem()).getRenderType()))
{
int renderType = Block.getBlockFromItem(item.getItem()).getRenderType();
larger = !(renderType == 1 || renderType == 19 || renderType == 12 || renderType == 2);
}
else if(is3D)
{
larger = true;
}
double d = 2;
double d1 = 1/d;
if(larger)
GL11.glScaled(d, d, d);
GL11.glColor4f(1, 1, 1, 1);
entityItem.setEntityItemStack(item);
uniformRenderItem.doRender(entityItem, 0, larger ? 0.09 : 0.06, 0, 0, (float)(spin*9/Math.PI));
if(larger)
GL11.glScaled(d1, d1, d1);
}
示例2: renderEquippedItems
import net.minecraft.client.renderer.RenderBlocks; //导入方法依赖的package包/类
@Override
protected void renderEquippedItems(EntityLivingBase entityliving, float f)
{
ItemStack itemstack = entityliving.getHeldItem();
if (itemstack != null)
{
GL11.glPushMatrix();
fairyModel.bipedRightArm.postRender(0.0625F);
GL11.glTranslatef(0.0F, 0.1F, 0.0F);
if( itemstack.getItem() instanceof ItemBlock && RenderBlocks.renderItemIn3d(Block.getBlockFromItem(itemstack.getItem()).getRenderType()) )
{
float f1 = 0.5F;
GL11.glTranslatef(0.0F, 0.1875F, -0.3125F);
f1 *= 0.75F;
GL11.glRotatef(20F, 1.0F, 0.0F, 0.0F);
GL11.glRotatef(45F, 0.0F, 1.0F, 0.0F);
GL11.glScalef(f1, -f1, f1);
}
else if (itemstack.getItem().isFull3D())
{
float f2 = 0.625F;
GL11.glTranslatef(0.0F, 0.1875F, 0.0F);
GL11.glScalef(f2, -f2, f2);
GL11.glRotatef(-100F, 1.0F, 0.0F, 0.0F);
GL11.glRotatef(45F, 0.0F, 1.0F, 0.0F);
}
else
{
float f3 = 0.375F;
GL11.glTranslatef(0.25F, 0.1875F, -0.1875F);
GL11.glScalef(f3, f3, f3);
GL11.glRotatef(60F, 0.0F, 0.0F, 1.0F);
GL11.glRotatef(-90F, 1.0F, 0.0F, 0.0F);
GL11.glRotatef(20F, 0.0F, 0.0F, 1.0F);
}
if (itemstack.getItem() == Items.potionitem)
{
int j = itemstack.getItem().getColorFromItemStack(itemstack, 0);
float f9 = (float)(j >> 16 & 0xff) / 255F;
float f10 = (float)(j >> 8 & 0xff) / 255F;
float f11 = (float)(j & 0xff) / 255F;
GL11.glColor4f(f9, f10, f11, 1.0F);
renderManager.itemRenderer.renderItem(entityliving, itemstack, 0);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
renderManager.itemRenderer.renderItem(entityliving, itemstack, 1);
}
else
{
renderManager.itemRenderer.renderItem(entityliving, itemstack, 0);
}
GL11.glPopMatrix();
}
}