Java 类net.minecraftforge.client.event.RenderItemInFrameEvent 实例源码

项目:ItemBlacklist    文件:ClientEventHandlers.java   
@SubscribeEvent
public void renderItemInFrameEvent(final RenderItemInFrameEvent event)
{
    ItemStack stack = event.getItem();
    if (stack.isEmpty() || stack.getItem() != ItemBlacklisted.I) return;
    if (!ItemBlacklisted.canUnpack(stack)) return;
    ItemStack unpacked = ItemBlacklisted.unpack(stack);

    GlStateManager.pushMatrix();
    GlStateManager.scale(0.5F, 0.5F, 0.5F);
    GlStateManager.pushAttrib();
    RenderHelper.enableStandardItemLighting();
    GlStateManager.translate(0.001, -0.001, 0.001);
    Minecraft.getMinecraft().getRenderItem().renderItem(unpacked, ItemCameraTransforms.TransformType.FIXED);
    RenderHelper.disableStandardItemLighting();
    GlStateManager.popAttrib();
    GlStateManager.popMatrix();
}
项目:CodeChickenLib    文件:MapRenderRegistry.java   
@SubscribeEvent
public void onItemFrameRender(RenderItemInFrameEvent event) {
    if (shouldHandle(event.getItem(), true)) {
        event.setCanceled(true);
        handleRender(event.getItem(), true);
    }
}
项目:Kingdom-Keys-Re-Coded    文件:RenderingEvents.java   
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void onRenderItemInFrame (RenderItemInFrameEvent event) {
    if (!ItemStack.areItemStacksEqual(event.getItem(), ItemStack.EMPTY)) if (event.getItem().getItem() instanceof ItemKeyblade) GlStateManager.scale(0.02f, 0.02f, 0.02f);
}