本文整理匯總了Java中net.minecraft.entity.item.EntityItemFrame.getRotation方法的典型用法代碼示例。如果您正苦於以下問題:Java EntityItemFrame.getRotation方法的具體用法?Java EntityItemFrame.getRotation怎麽用?Java EntityItemFrame.getRotation使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.entity.item.EntityItemFrame
的用法示例。
在下文中一共展示了EntityItemFrame.getRotation方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: renderItem
import net.minecraft.entity.item.EntityItemFrame; //導入方法依賴的package包/類
private void renderItem(EntityItemFrame itemFrame)
{
ItemStack itemstack = itemFrame.getDisplayedItem();
if (!itemstack.func_190926_b())
{
if (!Config.zoomMode)
{
Entity entity = this.mc.player;
double d0 = itemFrame.getDistanceSq(entity.posX, entity.posY, entity.posZ);
if (d0 > 4096.0D)
{
return;
}
}
EntityItem entityitem = new EntityItem(itemFrame.world, 0.0D, 0.0D, 0.0D, itemstack);
Item item = entityitem.getEntityItem().getItem();
entityitem.getEntityItem().func_190920_e(1);
entityitem.hoverStart = 0.0F;
GlStateManager.pushMatrix();
GlStateManager.disableLighting();
int i = itemFrame.getRotation();
if (item instanceof ItemMap)
{
i = i % 4 * 2;
}
GlStateManager.rotate((float)i * 360.0F / 8.0F, 0.0F, 0.0F, 1.0F);
if (!Reflector.postForgeBusEvent(Reflector.RenderItemInFrameEvent_Constructor, new Object[] {itemFrame, this}))
{
if (item instanceof ItemMap)
{
this.renderManager.renderEngine.bindTexture(MAP_BACKGROUND_TEXTURES);
GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F);
float f = 0.0078125F;
GlStateManager.scale(0.0078125F, 0.0078125F, 0.0078125F);
GlStateManager.translate(-64.0F, -64.0F, 0.0F);
MapData mapdata = Items.FILLED_MAP.getMapData(entityitem.getEntityItem(), itemFrame.world);
GlStateManager.translate(0.0F, 0.0F, -1.0F);
if (mapdata != null)
{
this.mc.entityRenderer.getMapItemRenderer().renderMap(mapdata, true);
}
}
else
{
GlStateManager.scale(0.5F, 0.5F, 0.5F);
GlStateManager.pushAttrib();
RenderHelper.enableStandardItemLighting();
this.itemRenderer.renderItem(entityitem.getEntityItem(), ItemCameraTransforms.TransformType.FIXED);
RenderHelper.disableStandardItemLighting();
GlStateManager.popAttrib();
}
}
GlStateManager.enableLighting();
GlStateManager.popMatrix();
}
if (Config.isShaders())
{
ShadersTex.updatingTex = null;
}
}
示例2: renderItem
import net.minecraft.entity.item.EntityItemFrame; //導入方法依賴的package包/類
private void renderItem(EntityItemFrame itemFrame)
{
ItemStack itemstack = itemFrame.getDisplayedItem();
if (itemstack != null)
{
EntityItem entityitem = new EntityItem(itemFrame.worldObj, 0.0D, 0.0D, 0.0D, itemstack);
Item item = entityitem.getEntityItem().getItem();
entityitem.getEntityItem().stackSize = 1;
entityitem.hoverStart = 0.0F;
GlStateManager.pushMatrix();
GlStateManager.disableLighting();
int i = itemFrame.getRotation();
if (item instanceof net.minecraft.item.ItemMap)
{
i = i % 4 * 2;
}
GlStateManager.rotate((float)i * 360.0F / 8.0F, 0.0F, 0.0F, 1.0F);
net.minecraftforge.client.event.RenderItemInFrameEvent event = new net.minecraftforge.client.event.RenderItemInFrameEvent(itemFrame, this);
if (!net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event))
{
if (item instanceof net.minecraft.item.ItemMap)
{
this.renderManager.renderEngine.bindTexture(MAP_BACKGROUND_TEXTURES);
GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F);
float f = 0.0078125F;
GlStateManager.scale(0.0078125F, 0.0078125F, 0.0078125F);
GlStateManager.translate(-64.0F, -64.0F, 0.0F);
MapData mapdata = Items.FILLED_MAP.getMapData(entityitem.getEntityItem(), itemFrame.worldObj);
GlStateManager.translate(0.0F, 0.0F, -1.0F);
if (mapdata != null)
{
this.mc.entityRenderer.getMapItemRenderer().renderMap(mapdata, true);
}
}
else
{
GlStateManager.scale(0.5F, 0.5F, 0.5F);
if (!this.itemRenderer.shouldRenderItemIn3D(entityitem.getEntityItem()) || item instanceof ItemSkull)
{
GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F);
}
GlStateManager.pushAttrib();
RenderHelper.enableStandardItemLighting();
this.itemRenderer.renderItem(entityitem.getEntityItem(), ItemCameraTransforms.TransformType.FIXED);
RenderHelper.disableStandardItemLighting();
GlStateManager.popAttrib();
}
}
GlStateManager.enableLighting();
GlStateManager.popMatrix();
}
}