本文整理汇总了Java中net.minecraft.client.renderer.entity.RenderItem.renderItem方法的典型用法代码示例。如果您正苦于以下问题:Java RenderItem.renderItem方法的具体用法?Java RenderItem.renderItem怎么用?Java RenderItem.renderItem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.client.renderer.entity.RenderItem
的用法示例。
在下文中一共展示了RenderItem.renderItem方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: renderTileEntityAt
import net.minecraft.client.renderer.entity.RenderItem; //导入方法依赖的package包/类
@Override
public void renderTileEntityAt(TileEntityShaft shaft, double dx, double dy, double dz, float partial, int destroyingStage) {
GlStateManager.enableTexture2D();
GlStateManager.enableRescaleNormal();
GlStateManager.enableBlend();
Minecraft.getMinecraft().getTextureManager().bindTexture(Core.blockAtlas);
GL11.glPushMatrix();
GL11.glTranslated(dx + 0.5, dy + 0.5, dz + 0.5);
if (shaft.axis.getDirectionVec().getX() == 1) {
GL11.glRotatef(90, 0, 0, 1);
} else if (shaft.axis.getDirectionVec().getZ() == 1) {
GL11.glRotatef(90, 1, 0, 0);
}
double angle = Math.toDegrees(NumUtil.interp(shaft.prev_angle, shaft.angle, partial));
GL11.glRotatef((float) angle, 0, 1, 0);
Minecraft mc = Minecraft.getMinecraft();
RenderItem ri = mc.getRenderItem();
RenderUtil.scale3(2);
IBakedModel model = ri.getItemModelMesher().getItemModel(shaft.shaftItem);
ri.renderItem(shaft.shaftItem, model);
GL11.glPopMatrix();
}
示例2: renderTesr
import net.minecraft.client.renderer.entity.RenderItem; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
public void renderTesr(@Nullable ServoMotor motor, float partial) {
final Minecraft mc = Minecraft.getMinecraft();
final RenderItem ri = mc.getRenderItem();
RenderUtil.scale3(2);
GL11.glPushMatrix();
GL11.glTranslated(0.25, 0.25, 0.25);
for (int i = 0; i < parts.length; i++) {
ItemStack part = parts[i];
if (part == null) continue;
if (motor == null && isStaticPart(i, part)) continue;
GL11.glPushMatrix();
stateForPart(i, part, partial);
ri.renderItem(part, ItemCameraTransforms.TransformType.NONE);
GL11.glPopMatrix();
}
GL11.glPopMatrix();
}