use of net.minecraft.client.renderer.RenderItem in project RFTools by McJty.
the class RenderGameOverlayEventHandler method renderBuffs.
private static void renderBuffs() {
if (buffs == null || buffs.isEmpty()) {
return;
}
EntityPlayerSP player = Minecraft.getMinecraft().player;
PreferencesProperties preferences = McJtyLib.getPreferencesProperties(player);
int x = preferences.getBuffX();
int y = preferences.getBuffY();
if (x == -1 || y == -1) {
return;
}
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glDisable(GL11.GL_LIGHTING);
for (PlayerBuff buff : buffs) {
Item item = getBuffItem(buff);
if (item != null) {
RenderItem itemRender = Minecraft.getMinecraft().getRenderItem();
RenderHelper.renderItemStack(Minecraft.getMinecraft(), itemRender, new ItemStack(item), x, y, "", false);
// itemRender.renderItem(new ItemStack(item), player, ItemCameraTransforms.TransformType.FIXED, true);
x += BUFF_ICON_SIZE;
}
}
}
use of net.minecraft.client.renderer.RenderItem in project BloodMagic by WayofTime.
the class RenderDemonCrucible method renderItem.
private void renderItem(World world, ItemStack stack, float partialTicks) {
RenderItem itemRenderer = mc.getRenderItem();
if (!stack.isEmpty()) {
GlStateManager.translate(0.5, 1.5, 0.5);
EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, stack);
entityitem.getItem().setCount(1);
entityitem.hoverStart = 0.0F;
GlStateManager.pushMatrix();
GlStateManager.disableLighting();
float rotation = (float) (720.0 * (System.currentTimeMillis() & 0x3FFFL) / 0x3FFFL);
GlStateManager.rotate(rotation, 0.0F, 1.0F, 0);
GlStateManager.scale(0.5F, 0.5F, 0.5F);
GlStateManager.pushAttrib();
RenderHelper.enableStandardItemLighting();
itemRenderer.renderItem(entityitem.getItem(), ItemCameraTransforms.TransformType.FIXED);
RenderHelper.disableStandardItemLighting();
GlStateManager.popAttrib();
GlStateManager.enableLighting();
GlStateManager.popMatrix();
}
}
use of net.minecraft.client.renderer.RenderItem in project Solar by Martacus.
the class RenderMenhir method render.
@Override
public void render(TileMenhir tileEntity, double x, double y, double z, float partialTicks, int destroyStage, float alpha) {
if (tileEntity.getBaseMenhir() != tileEntity) {
return;
}
ItemStack inputStack = tileEntity.getItemStackHandler().getStackInSlot(0);
if (inputStack.isEmpty()) {
return;
}
GlStateManager.pushMatrix();
GlStateManager.translate(x, y, z);
RenderItem itemRenderer = Minecraft.getMinecraft().getRenderItem();
if (!inputStack.isEmpty()) {
GlStateManager.translate(0.5, 1.5, 0);
GlStateManager.disableLighting();
IBlockState blockState = tileEntity.getWorld().getBlockState(tileEntity.getPos().add(0, 1, 0));
if (blockState.getBlock() != ModBlocks.MENHIR) {
return;
}
EnumFacing enumFace = blockState.getValue(BlockMenhir.FACING);
if (enumFace == EnumFacing.NORTH) {
GlStateManager.translate(0, 0, 0.1);
} else if (enumFace == EnumFacing.SOUTH) {
GlStateManager.translate(0, 0, 0.9);
} else if (enumFace == EnumFacing.WEST) {
GlStateManager.rotate(90, 0.0F, 1.0F, 0);
GlStateManager.translate(-0.5, 0, -0.4);
} else if (enumFace == EnumFacing.EAST) {
GlStateManager.rotate(90, 0.0F, 1.0F, 0);
GlStateManager.translate(-0.5, 0, 0.4);
}
GlStateManager.scale(0.5F, 0.5F, 0.5F);
RenderHelper.enableStandardItemLighting();
itemRenderer.renderItem(inputStack, ItemCameraTransforms.TransformType.FIXED);
RenderHelper.disableStandardItemLighting();
GlStateManager.enableLighting();
}
GlStateManager.popMatrix();
}
use of net.minecraft.client.renderer.RenderItem in project Solar by Martacus.
the class RenderUtil method renderRisingFromTopOfBlock.
public static void renderRisingFromTopOfBlock(ItemStack renderItem, float height, float rotation) {
RenderItem itemRenderer = Minecraft.getMinecraft().getRenderItem();
if (!renderItem.isEmpty()) {
GlStateManager.translate(0.5, 1 + height, 0.5);
GlStateManager.pushMatrix();
GlStateManager.disableLighting();
GlStateManager.rotate(rotation, 0F, 1.0F, 1f);
GlStateManager.scale(0.5F, 0.5F, 0.5F);
RenderHelper.enableStandardItemLighting();
itemRenderer.renderItem(renderItem, ItemCameraTransforms.TransformType.FIXED);
RenderHelper.disableStandardItemLighting();
GlStateManager.enableLighting();
GlStateManager.popMatrix();
}
}
use of net.minecraft.client.renderer.RenderItem in project Solar by Martacus.
the class RenderUtil method renderItemFloatingOnTileEntity.
public static void renderItemFloatingOnTileEntity(ItemStack renderItem) {
RenderItem itemRenderer = Minecraft.getMinecraft().getRenderItem();
if (!renderItem.isEmpty()) {
GlStateManager.translate(0.5, 2, 0.5);
GlStateManager.pushMatrix();
GlStateManager.disableLighting();
float rotation = (float) (720.0 * (System.currentTimeMillis() & 0x3FFFL) / 0x3FFFL);
GlStateManager.rotate(rotation, 0.0F, 1.0F, 0);
GlStateManager.scale(0.5F, 0.5F, 0.5F);
RenderHelper.enableStandardItemLighting();
itemRenderer.renderItem(renderItem, ItemCameraTransforms.TransformType.FIXED);
RenderHelper.disableStandardItemLighting();
GlStateManager.enableLighting();
GlStateManager.popMatrix();
}
}
Aggregations