Search in sources :

Example 81 with Minecraft

use of net.minecraft.client.Minecraft in project LogisticsPipes by RS485.

the class HUDItemSink method renderContent.

@Override
public void renderContent(boolean shifted) {
    Minecraft mc = FMLClientHandler.instance().getClient();
    GL11.glScalef(1.0F, 1.0F, -0.00001F);
    ItemStackRenderer.renderItemIdentifierStackListIntoGui(ItemIdentifierStack.getListFromInventory(module.getFilterInventory()), null, 0, -25, -32, 3, 9, 18, 18, 100.0F, DisplayAmount.NEVER, true, false, shifted);
    GL11.glScalef(1.0F, 1.0F, 1 / -0.00001F);
    mc.fontRenderer.drawString("Default:", -29, 25, 0);
    if (module.isDefaultRoute()) {
        mc.fontRenderer.drawString("Yes", 11, 25, 0);
    } else {
        mc.fontRenderer.drawString("No", 15, 25, 0);
    }
}
Also used : Minecraft(net.minecraft.client.Minecraft)

Example 82 with Minecraft

use of net.minecraft.client.Minecraft in project LogisticsPipes by RS485.

the class HUDProviderModule method renderContent.

@Override
public void renderContent(boolean shifted) {
    Minecraft mc = FMLClientHandler.instance().getClient();
    GL11.glScalef(1.0F, 1.0F, -0.00001F);
    ItemStackRenderer.renderItemIdentifierStackListIntoGui(module.displayList, null, page, -25, -24, 3, 9, 18, 18, 100.0F, DisplayAmount.ALWAYS, true, false, shifted);
    GL11.glScalef(1.0F, 1.0F, 1 / -0.00001F);
}
Also used : Minecraft(net.minecraft.client.Minecraft)

Example 83 with Minecraft

use of net.minecraft.client.Minecraft in project LogisticsPipes by RS485.

the class SneakyConfigurationPopup method drawGuiContainerForegroundLayer.

@Override
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY, float partialTick) {
    drawRect(bounds.x, bounds.y, bounds.x + bounds.width, bounds.y + bounds.height, 0xff000000);
    Minecraft mc = Minecraft.getMinecraft();
    ScaledResolution scaledresolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
    int vpx = bounds.x * scaledresolution.getScaleFactor();
    int vpy = (bounds.y + 10) * scaledresolution.getScaleFactor();
    int w = bounds.width * scaledresolution.getScaleFactor();
    int h = (bounds.height - 1) * scaledresolution.getScaleFactor();
    mc.fontRenderer.drawString(StringUtils.translate(PREFIX + "sneakyTitle"), guiLeft + 8, guiTop + 8, Color.getValue(Color.DARKER_GREY), false);
    configDisplay.drawScreen(mouseX, mouseY, partialTick, new Rectangle(vpx, vpy, w, h), bounds);
}
Also used : ScaledResolution(net.minecraft.client.gui.ScaledResolution) Rectangle(java.awt.Rectangle) Minecraft(net.minecraft.client.Minecraft)

Example 84 with Minecraft

use of net.minecraft.client.Minecraft in project Bookshelf by Darkhax-Minecraft.

the class RenderUtils method renderFluid.

/**
     * Renders a fluid at the given position.
     *
     * @param fluid The fluid to render.
     * @param pos The position in the world to render the fluid.
     * @param x The base X position.
     * @param y The base Y position.
     * @param z The base Z position.
     * @param x1 The middle X position.
     * @param y1 The middle Y position.
     * @param z1 The middle Z position.
     * @param x2 The max X position.
     * @param y2 The max Y position.
     * @param z2 The max Z position.
     * @param color The color offset used by the fluid. Default is white.
     */
public static void renderFluid(FluidStack fluid, BlockPos pos, double x, double y, double z, double x1, double y1, double z1, double x2, double y2, double z2, int color) {
    final Minecraft mc = Minecraft.getMinecraft();
    final Tessellator tessellator = Tessellator.getInstance();
    final VertexBuffer buffer = tessellator.getBuffer();
    final int brightness = mc.world.getCombinedLight(pos, fluid.getFluid().getLuminosity());
    buffer.begin(GL11.GL_QUADS, DefaultVertexFormats.BLOCK);
    mc.renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
    setupRenderState(x, y, z);
    GlStateManager.translate(x, y, z);
    final TextureAtlasSprite still = mc.getTextureMapBlocks().getTextureExtry(fluid.getFluid().getStill(fluid).toString());
    final TextureAtlasSprite flowing = mc.getTextureMapBlocks().getTextureExtry(fluid.getFluid().getFlowing(fluid).toString());
    addTexturedQuad(buffer, still, x1, y1, z1, x2 - x1, y2 - y1, z2 - z1, EnumFacing.DOWN, color, brightness);
    addTexturedQuad(buffer, flowing, x1, y1, z1, x2 - x1, y2 - y1, z2 - z1, EnumFacing.NORTH, color, brightness);
    addTexturedQuad(buffer, flowing, x1, y1, z1, x2 - x1, y2 - y1, z2 - z1, EnumFacing.EAST, color, brightness);
    addTexturedQuad(buffer, flowing, x1, y1, z1, x2 - x1, y2 - y1, z2 - z1, EnumFacing.SOUTH, color, brightness);
    addTexturedQuad(buffer, flowing, x1, y1, z1, x2 - x1, y2 - y1, z2 - z1, EnumFacing.WEST, color, brightness);
    addTexturedQuad(buffer, still, x1, y1, z1, x2 - x1, y2 - y1, z2 - z1, EnumFacing.UP, color, brightness);
    tessellator.draw();
    cleanupRenderState();
}
Also used : Tessellator(net.minecraft.client.renderer.Tessellator) VertexBuffer(net.minecraft.client.renderer.VertexBuffer) TextureAtlasSprite(net.minecraft.client.renderer.texture.TextureAtlasSprite) Minecraft(net.minecraft.client.Minecraft)

Example 85 with Minecraft

use of net.minecraft.client.Minecraft in project RFToolsDimensions by McJty.

the class SkyRenderer method registerNoSky.

public static void registerNoSky(GenericWorldProvider provider) {
    provider.setSkyRenderer(new IRenderHandler() {

        @Override
        public void render(float partialTicks, WorldClient world, Minecraft mc) {
        }
    });
    provider.setCloudRenderer(new IRenderHandler() {

        @Override
        public void render(float partialTicks, WorldClient world, Minecraft mc) {
        }
    });
}
Also used : IRenderHandler(net.minecraftforge.client.IRenderHandler) WorldClient(net.minecraft.client.multiplayer.WorldClient) Minecraft(net.minecraft.client.Minecraft)

Aggregations

Minecraft (net.minecraft.client.Minecraft)100 ItemStack (net.minecraft.item.ItemStack)17 ScaledResolution (net.minecraft.client.gui.ScaledResolution)15 EntityPlayer (net.minecraft.entity.player.EntityPlayer)15 SubscribeEvent (cpw.mods.fml.common.eventhandler.SubscribeEvent)10 ResourceLocation (net.minecraft.util.ResourceLocation)8 ArrayList (java.util.ArrayList)7 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)7 FontRenderer (net.minecraft.client.gui.FontRenderer)6 WorldClient (net.minecraft.client.multiplayer.WorldClient)6 World (net.minecraft.world.World)6 Tessellator (net.minecraft.client.renderer.Tessellator)5 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)5 Block (net.minecraft.block.Block)4 EntityPlayerSP (net.minecraft.client.entity.EntityPlayerSP)4 IRenderHandler (net.minecraftforge.client.IRenderHandler)4 SimplePageView (com.almuradev.almura.feature.guide.client.gui.SimplePageView)3 SideOnly (cpw.mods.fml.relauncher.SideOnly)3 Field (java.lang.reflect.Field)3 GuiScreen (net.minecraft.client.gui.GuiScreen)3