本文整理汇总了Java中net.minecraftforge.client.event.RenderItemInFrameEvent类的典型用法代码示例。如果您正苦于以下问题:Java RenderItemInFrameEvent类的具体用法?Java RenderItemInFrameEvent怎么用?Java RenderItemInFrameEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RenderItemInFrameEvent类属于net.minecraftforge.client.event包,在下文中一共展示了RenderItemInFrameEvent类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: renderItemInFrameEvent
import net.minecraftforge.client.event.RenderItemInFrameEvent; //导入依赖的package包/类
@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();
}
示例2: onItemFrameRender
import net.minecraftforge.client.event.RenderItemInFrameEvent; //导入依赖的package包/类
@SubscribeEvent
public void onItemFrameRender(RenderItemInFrameEvent event) {
if (shouldHandle(event.getItem(), true)) {
event.setCanceled(true);
handleRender(event.getItem(), true);
}
}
示例3: onRenderItemInFrame
import net.minecraftforge.client.event.RenderItemInFrameEvent; //导入依赖的package包/类
@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);
}