use of net.minecraft.client.Minecraft in project LogisticsPipes by RS485.
the class LogisticsHUDRenderer method displayOneView.
private void displayOneView(IHeadUpDisplayRendererProvider renderer, IHUDConfig config, float partialTick, boolean shifted) {
Minecraft mc = FMLClientHandler.instance().getClient();
EntityPlayer player = mc.thePlayer;
double x = renderer.getX() + 0.5 - player.prevPosX - ((player.posX - player.prevPosX) * partialTick);
double y = renderer.getY() + 0.5 - player.prevPosY - ((player.posY - player.prevPosY) * partialTick);
double z = renderer.getZ() + 0.5 - player.prevPosZ - ((player.posZ - player.prevPosZ) * partialTick);
GL11.glTranslatef((float) x, (float) y, (float) z);
GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F);
GL11.glRotatef(getAngle(z, x) + 90, 0.0F, 0.0F, 1.0F);
GL11.glRotatef((-1) * getAngle(Math.hypot(x, z), y) + 180, 1.0F, 0.0F, 0.0F);
GL11.glTranslatef(0.0F, 0.0F, -0.4F);
GL11.glScalef(0.01F, 0.01F, 1F);
renderer.getRenderer().renderHeadUpDisplay(Math.hypot(x, Math.hypot(y, z)), false, shifted, mc, config);
}
use of net.minecraft.client.Minecraft in project LogisticsPipes by RS485.
the class ThaumCraftProxy method renderAspectAt.
/**
* Used to render a icon of an aspect at a give x and y on top of a given
* GuiScreen.
*
* @param tag
* The EnumTag (aspect) to render
* @param x
* @param y
* @param gui
* The gui to render on.
*/
private void renderAspectAt(Aspect tag, int x, int y, GuiScreen gui, int amount, boolean drawBackground) {
if (!(tag instanceof Aspect)) {
return;
}
Minecraft mc = FMLClientHandler.instance().getClient();
if (drawBackground) {
UtilsFX.bindTexture("textures/aspects/_back.png");
GL11.glPushMatrix();
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glTranslated(x - 2, y - 2, 0.0D);
GL11.glScaled(1.25D, 1.25D, 0.0D);
UtilsFX.drawTexturedQuadFull(0, 0, gui.zLevel);
GL11.glDisable(GL11.GL_BLEND);
GL11.glPopMatrix();
}
if (Thaumcraft.proxy.playerKnowledge.hasDiscoveredAspect(mc.thePlayer.getDisplayName(), tag)) {
UtilsFX.drawTag(x, y, tag, amount, 0, gui.zLevel);
} else {
UtilsFX.bindTexture("textures/aspects/_unknown.png");
GL11.glPushMatrix();
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glTranslated(x, y, 0.0D);
UtilsFX.drawTexturedQuadFull(0, 0, gui.zLevel);
GL11.glDisable(GL11.GL_BLEND);
GL11.glPopMatrix();
}
}
use of net.minecraft.client.Minecraft in project LogisticsPipes by RS485.
the class DisconnectionConfigurationPopup 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 + "disconnectTitle"), guiLeft + 8, guiTop + 8, logisticspipes.utils.Color.getValue(logisticspipes.utils.Color.DARKER_GREY), false);
configDisplay.drawScreen(mouseX, mouseY, partialTick, new Rectangle(vpx, vpy, w, h), bounds);
}
use of net.minecraft.client.Minecraft in project LogisticsPipes by RS485.
the class HUDElectricManager method renderContent.
@Override
public void renderContent(boolean shifted) {
Minecraft mc = FMLClientHandler.instance().getClient();
GL11.glScalef(1.0F, 1.0F, -0.000001F);
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.000001F);
mc.fontRenderer.drawString("Charge:", -29, 25, 0);
if (module.isDischargeMode()) {
mc.fontRenderer.drawString("No", 15, 25, 0);
} else {
mc.fontRenderer.drawString("Yes", 11, 25, 0);
}
}
use of net.minecraft.client.Minecraft in project LogisticsPipes by RS485.
the class HUDExtractor method renderContent.
@Override
public void renderContent(boolean shifted) {
Minecraft mc = FMLClientHandler.instance().getClient();
ForgeDirection d = module.getSneakyDirection();
mc.fontRenderer.drawString("Extract", -22, -22, 0);
mc.fontRenderer.drawString("from:", -22, -9, 0);
mc.fontRenderer.drawString(((d == ForgeDirection.UNKNOWN) ? "DEFAULT" : d.name()), -22, 18, 0);
}
Aggregations