本文整理匯總了Java中net.minecraft.client.renderer.RenderItem.renderItem方法的典型用法代碼示例。如果您正苦於以下問題:Java RenderItem.renderItem方法的具體用法?Java RenderItem.renderItem怎麽用?Java RenderItem.renderItem使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.client.renderer.RenderItem
的用法示例。
在下文中一共展示了RenderItem.renderItem方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: renderItemInWorld
import net.minecraft.client.renderer.RenderItem; //導入方法依賴的package包/類
@SideOnly(Side.CLIENT)
public static void renderItemInWorld(ItemStack stack){
if(!stack.isEmpty()){
Minecraft mc = Minecraft.getMinecraft();
RenderItem renderer = mc.getRenderItem();
TextureManager manager = mc.getTextureManager();
IBakedModel model = renderer.getItemModelWithOverrides(stack, null, null);
manager.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
manager.getTexture(TextureMap.LOCATION_BLOCKS_TEXTURE).setBlurMipmap(false, false);
GlStateManager.enableRescaleNormal();
GlStateManager.enableBlend();
GlStateManager.pushMatrix();
model = ForgeHooksClient.handleCameraTransforms(model, ItemCameraTransforms.TransformType.FIXED, false);
renderer.renderItem(stack, model);
GlStateManager.cullFace(GlStateManager.CullFace.BACK);
GlStateManager.popMatrix();
GlStateManager.disableRescaleNormal();
GlStateManager.disableBlend();
manager.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
manager.getTexture(TextureMap.LOCATION_BLOCKS_TEXTURE).restoreLastBlurMipmap();
}
}
示例2: renderAffinity
import net.minecraft.client.renderer.RenderItem; //導入方法依賴的package包/類
private void renderAffinity(ItemStack affinity) {
RenderItem itemRenderer = minecraft.getRenderItem();
if (affinity != null) {
double local = (period * (System.currentTimeMillis() & 0x3FFFL) / 0x3FFFL);
float hoverHeight = (float) ((0.4 * (Math.sin(local))) / 8);
GlStateManager.translate(0.5F, 1.2F + hoverHeight, 0.5F);
EntityItem entityItem = new EntityItem(getWorld(), 0, 0, 0, affinity);
entityItem.getEntityItem().stackSize = 1;
entityItem.hoverStart = 0.0F;
GlStateManager.pushMatrix();
GlStateManager.disableLighting();
float rotation = (float) (720.0 * (System.currentTimeMillis() & 0x3FFFL) / 0x3FFFL);
GlStateManager.rotate(rotation, 0.0F, 1.0F, 0.0F);
GlStateManager.scale(0.5F, 0.5F, 0.5F);
GlStateManager.pushAttrib();
RenderHelper.enableStandardItemLighting();
itemRenderer.renderItem(entityItem.getEntityItem(), ItemCameraTransforms.TransformType.FIXED);
RenderHelper.disableStandardItemLighting();
GlStateManager.popAttrib();
GlStateManager.enableLighting();
GlStateManager.popMatrix();
GlStateManager.translate(0.0F, -hoverHeight, 0.0F);
}
}
示例3: renderSaiLeft
import net.minecraft.client.renderer.RenderItem; //導入方法依賴的package包/類
private void renderSaiLeft(int id) {
RenderItem renderer = Minecraft.getMinecraft().getRenderItem();
GlStateManager.pushMatrix();
GlStateManager.translate(0, 0, -0.1);
GlStateManager.translate(0, 0.625, 0);
GlStateManager.rotate(180, 1, 0, 0);
GlStateManager.translate(0.275, 0, 0);
GlStateManager.rotate(-90, 0, 1, 0);
GlStateManager.scale(0.5, 0.5, 1);
renderer.renderItem(this.itemsToRender[id], ItemCameraTransforms.TransformType.NONE);
GlStateManager.popMatrix();
}
示例4: renderSaiRight
import net.minecraft.client.renderer.RenderItem; //導入方法依賴的package包/類
private void renderSaiRight(int id) {
RenderItem renderer = Minecraft.getMinecraft().getRenderItem();
GlStateManager.pushMatrix();
GlStateManager.translate(0, 0, -0.1);
GlStateManager.translate(0, 0.625, 0);
GlStateManager.rotate(180, 1, 0, 0);
GlStateManager.translate(-0.275, 0, 0);
GlStateManager.rotate(-90, 0, 1, 0);
GlStateManager.scale(0.5, 0.5, 1);
renderer.renderItem(this.itemsToRender[id], ItemCameraTransforms.TransformType.NONE);
GlStateManager.popMatrix();
}
示例5: renderRopeCoil
import net.minecraft.client.renderer.RenderItem; //導入方法依賴的package包/類
private void renderRopeCoil(int id) {
RenderItem renderer = Minecraft.getMinecraft().getRenderItem();
GlStateManager.pushMatrix();
GlStateManager.translate(0, 0, -0.15);
GlStateManager.translate(0, 1.25, 0);
GlStateManager.rotate(180, 1, 0, 0);
GlStateManager.translate(0.3, 0, 0);
GlStateManager.rotate(-90, 0, 1, 0);
GlStateManager.rotate(-90, 0, 0, 1);
GlStateManager.scale(0.8, 0.8, 1);
renderer.renderItem(this.itemsToRender[id], ItemCameraTransforms.TransformType.NONE);
GlStateManager.popMatrix();
}
示例6: renderTileEntityAt
import net.minecraft.client.renderer.RenderItem; //導入方法依賴的package包/類
@Override
public void renderTileEntityAt(TileMetal te, double x, double y, double z, float partialTicks, int destroyStage)
{
RenderItem renderer = Minecraft.getMinecraft().getRenderItem();
GlStateManager.pushMatrix();
GlStateManager.translate(x+0.5D,y+0.05D,z+0.5D);
EntityItem stack = new EntityItem(getWorld(),0,0,0,te.blankStack);
stack.getEntityItem().stackSize = 1;
stack.hoverStart = 0.0F;
GlStateManager.disableLighting();
GlStateManager.rotate(-90,1,0,0);
GlStateManager.scale(0.5D,0.5D,0.5D);
GlStateManager.pushAttrib();
RenderHelper.disableStandardItemLighting();
renderer.renderItem(stack.getEntityItem(), ItemCameraTransforms.TransformType.FIXED);
RenderHelper.enableStandardItemLighting();
GlStateManager.popAttrib();
GlStateManager.enableLighting();
GlStateManager.popMatrix();
}
示例7: renderItemOnBlock
import net.minecraft.client.renderer.RenderItem; //導入方法依賴的package包/類
private void renderItemOnBlock(World world, ItemStack itemStack)
{
RenderItem itemRenderer = minecraft.getRenderItem();
if (itemStack != null && !(itemStack.getItem() instanceof ItemBlock))
{
GlStateManager.translate(0.0F, -0.98F, 0.0F);
EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, itemStack);
entityitem.getEntityItem().stackSize = 1;
entityitem.hoverStart = 0.0F;
GlStateManager.pushMatrix();
GlStateManager.disableLighting();
GlStateManager.rotate(180, 0.0F, 1.0F, 1.0F);
GlStateManager.scale(0.75F, 0.75F, 0.75F);
GlStateManager.pushAttrib();
RenderHelper.enableStandardItemLighting();
itemRenderer.renderItem(entityitem.getEntityItem(), ItemCameraTransforms.TransformType.FIXED);
RenderHelper.disableStandardItemLighting();
GlStateManager.popAttrib();
GlStateManager.enableLighting();
GlStateManager.popMatrix();
}
}
示例8: renderItemModel
import net.minecraft.client.renderer.RenderItem; //導入方法依賴的package包/類
protected void renderItemModel(ItemStack stack, double x, double y, IBakedModel bakedmodel, RenderItem renderItem) {
GlStateManager.pushMatrix();
mc.renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
mc.renderEngine.getTexture(TextureMap.LOCATION_BLOCKS_TEXTURE).setBlurMipmap(false, false);
GlStateManager.enableRescaleNormal();
GlStateManager.enableAlpha();
GlStateManager.alphaFunc(516, 0.1F);
GlStateManager.enableBlend();
GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.setupGuiTransform((int) x, (int) y);
bakedmodel = net.minecraftforge.client.ForgeHooksClient.handleCameraTransforms(bakedmodel, ItemCameraTransforms.TransformType.GUI, false);
renderItem.renderItem(stack, bakedmodel);
GlStateManager.disableAlpha();
GlStateManager.disableRescaleNormal();
GlStateManager.disableLighting();
GlStateManager.popMatrix();
mc.renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
mc.renderEngine.getTexture(TextureMap.LOCATION_BLOCKS_TEXTURE).restoreLastBlurMipmap();
}
示例9: render
import net.minecraft.client.renderer.RenderItem; //導入方法依賴的package包/類
@Override
public void render(ItemStack stack, float patrtialTicks) {
GlStateManager.pushMatrix();
RenderItem renderItem = Minecraft.getMinecraft().getRenderItem();
renderItem.renderItem(stack, parent);
InventoryBPortableBarrel barrel = BlocksItemsBetterChests.betterportablebarrel.getInventoryFor(stack, null);
if (barrel != null && barrel.getChestPart().isItemSet()) {
InventoryPartBarrel part = barrel.getChestPart();
GlStateManager.pushMatrix();
GlStateManager.translate(0, 0, -0.05);
GlStateManager.scale(0.8, 0.8, 0.8);
renderItem.renderItem(part.getDummy(), TransformType.FIXED);
GlStateManager.enableBlend();
GlStateManager.popMatrix();
}
GlStateManager.popMatrix();
}
示例10: renderItem
import net.minecraft.client.renderer.RenderItem; //導入方法依賴的package包/類
private void renderItem(ItemStack itemStack) {
parent.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
final RenderItem itemRenderer = parent.getItemRenderer();
final ItemModelMesher itemModelMesher = itemRenderer.getItemModelMesher();
final IBakedModel model = itemModelMesher.getItemModel(stack);
GlStateManager.disableLighting();
GlStateManager.enableRescaleNormal();
GlStateManager.alphaFunc(GL11.GL_GREATER, 0.1F);
GlStateManager.enableBlend();
GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
GlStateManager.pushMatrix();
itemRenderer.renderItem(stack, model);
GlStateManager.cullFace(CullFace.BACK);
GlStateManager.popMatrix();
GlStateManager.disableRescaleNormal();
GlStateManager.disableBlend();
GlStateManager.enableLighting();
}
示例11: renderStack
import net.minecraft.client.renderer.RenderItem; //導入方法依賴的package包/類
public static void renderStack(RenderItem ri, ItemStack stack, int cols, int col, int rows, int row)
{
GlStateManager.pushMatrix();
GlStateManager.pushAttrib();
GlStateManager.translate(0.4f * (cols / 2.0 - col) - 0.2f, 0.4f * (rows / 2.0 - row), 0);
GlStateManager.pushMatrix();
GlStateManager.rotate((float) (360.0 * (double) (System.currentTimeMillis() & 0x3FFFL) / (double) 0x3FFFL), 0, 1, 0);
GlStateManager.scale(0.45, 0.45, 0.45);
ri.renderItem(stack, ItemCameraTransforms.TransformType.FIXED);
if (stack.hasEffect())
{
GlStateManager.disableAlpha();
GlStateManager.disableRescaleNormal();
GlStateManager.disableLighting();
}
GlStateManager.popMatrix();
GlStateManager.popAttrib();
GlStateManager.popMatrix();
}
示例12: renderItemGlow
import net.minecraft.client.renderer.RenderItem; //導入方法依賴的package包/類
public void renderItemGlow(EntityLivingBase entity, ItemStack drop, ItemCameraTransforms.TransformType transform, EnumHandSide hand,
int glowColor) {
// enchantments mess up the rendering
ItemStack drop2 = drop.copy();
if (drop2.hasEffect()) {
removeEnch(drop2.getTagCompound());
}
float red = (glowColor >> 16 & 255) / 255.0F;
float green = (glowColor >> 8 & 255) / 255.0F;
float blue = (glowColor & 255) / 255.0F;
float alpha = 0.2F;
pushMatrix();
disableLighting();
GL14.glBlendColor(red, green, blue, alpha);
RenderItem renderItem = Minecraft.getMinecraft().getRenderItem();
((IRenderItem) renderItem).useTransparency(true);
scale(1.1, 1.1, 1.1);
translate(0, .01, .01);
renderItem.renderItem(drop, entity, transform, hand == EnumHandSide.LEFT);
translate(.01, -.01, -.02);
renderItem.renderItem(drop, entity, transform, hand == EnumHandSide.LEFT);
((IRenderItem) renderItem).useTransparency(false);
enableLighting();
popMatrix();
// I hate rendering
}
示例13: renderKatana
import net.minecraft.client.renderer.RenderItem; //導入方法依賴的package包/類
private void renderKatana(int id) {
RenderItem renderer = Minecraft.getMinecraft().getRenderItem();
GlStateManager.pushMatrix();
GlStateManager.translate(0, 0, -0.2);
GlStateManager.translate(0, 1.125, 0);
GlStateManager.rotate(180, 1, 0, 0);
GlStateManager.scale(0.8, 0.8, 1);
renderer.renderItem(this.itemsToRender[id], ItemCameraTransforms.TransformType.NONE);
GlStateManager.popMatrix();
}
示例14: renderShuriken
import net.minecraft.client.renderer.RenderItem; //導入方法依賴的package包/類
private void renderShuriken(int id) {
RenderItem renderer = Minecraft.getMinecraft().getRenderItem();
GlStateManager.pushMatrix();
GlStateManager.translate(0, 0, 0.2);
GlStateManager.translate(0, 0.75, 0);
GlStateManager.translate(-0.15, 0, 0);
GlStateManager.scale(0.2, 0.2, 0.5);
renderer.renderItem(this.itemsToRender[id], ItemCameraTransforms.TransformType.NONE);
GlStateManager.popMatrix();
}
示例15: renderSmokeBomb
import net.minecraft.client.renderer.RenderItem; //導入方法依賴的package包/類
private void renderSmokeBomb(int id) {
RenderItem renderer = Minecraft.getMinecraft().getRenderItem();
GlStateManager.pushMatrix();
GlStateManager.translate(0, 0, -0.2);
GlStateManager.translate(0, 0.75, 0);
GlStateManager.rotate(180, 0, 1, 0);
GlStateManager.translate(0.125, 0, 0);
GlStateManager.scale(0.3, 0.3, 1);
renderer.renderItem(this.itemsToRender[id], ItemCameraTransforms.TransformType.NONE);
GlStateManager.popMatrix();
}