本文整理匯總了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();
}