use of net.minecraft.client.Minecraft in project PneumaticCraft by MineMaarten.
the class GuiKeybindCheckBox method onKeyInput.
@SubscribeEvent
public void onKeyInput(InputEvent.KeyInputEvent event) {
Minecraft mc = FMLClientHandler.instance().getClient();
if (mc.inGameHasFocus && keyBinding != null && keyBinding.isPressed()) {
onMouseClicked(0, 0, 0);
HUDHandler.instance().addMessage(I18n.format("pneumaticHelmet.message." + (checked ? "enable" : "disable") + "Setting", I18n.format(text)), new ArrayList<String>(), 60, 0x7000AA00);
}
}
use of net.minecraft.client.Minecraft in project PneumaticCraft by MineMaarten.
the class RenderLaser method render.
public void render(float partialTicks, double x1, double y1, double z1, double x2, double y2, double z2) {
Minecraft mc = FMLClientHandler.instance().getClient();
TextureManager textureManager = mc.renderEngine;
double laserLength = PneumaticCraftUtils.distBetween(x1, y1, z1, x2, y2, z2);
double laserSize = 0.4;
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glTranslated(x1, y1, z1);
double dx = x2 - x1;
double dy = y2 - y1;
double dz = z2 - z1;
float f3 = MathHelper.sqrt_double(dx * dx + dz * dz);
double rotYaw = Math.atan2(dx, dz) * 180.0D / Math.PI;
double rotPitch = 90 - (float) (Math.atan2(dy, f3) * 180.0D / Math.PI);
GL11.glRotated(rotYaw, 0, 1, 0);
GL11.glRotated(rotPitch, 1, 0, 0);
GL11.glScaled(laserSize, laserSize, laserSize);
GL11.glTranslated(0, 0.6, 0);
GL11.glRotated((ticksExisted + partialTicks) * 200, 0, 1, 0);
GL11.glPushMatrix();
GL11.glScaled(1, laserLength / laserSize, 1);
/* GL11.glTranslated(0, -0.01, 0);
textureManager.bindTexture(Textures.RENDER_LASER_ANIMATION);
renderAnimation(partialTicks, laserLength / laserSize);
GL11.glTranslated(0, 0.01, 0);*/
textureManager.bindTexture(Textures.RENDER_LASER);
renderQuad(glowColor);
textureManager.bindTexture(Textures.RENDER_LASER_OVERLAY);
renderQuad(coreColor);
GL11.glPopMatrix();
GL11.glRotated(180, 1, 0, 0);
textureManager.bindTexture(Textures.RENDER_LASER_START);
renderQuad(glowColor);
textureManager.bindTexture(Textures.RENDER_LASER_START_OVERLAY);
renderQuad(coreColor);
GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glColor4d(1, 1, 1, 1);
}
use of net.minecraft.client.Minecraft in project PneumaticCraft by MineMaarten.
the class ClientSemiBlockManager method renderWorldLastEvent.
@SubscribeEvent
public void renderWorldLastEvent(RenderWorldLastEvent event) {
Minecraft mc = FMLClientHandler.instance().getClient();
EntityPlayer player = mc.thePlayer;
double playerX = player.prevPosX + (player.posX - player.prevPosX) * event.partialTicks;
double playerY = player.prevPosY + (player.posY - player.prevPosY) * event.partialTicks;
double playerZ = player.prevPosZ + (player.posZ - player.prevPosZ) * event.partialTicks;
GL11.glPushMatrix();
GL11.glTranslated(-playerX, -playerY, -playerZ);
// GL11.glEnable(GL11.GL_BLEND);
// GL11.glEnable(GL11.GL_LIGHTING);
RenderHelper.enableStandardItemLighting();
for (Map<ChunkPosition, ISemiBlock> map : SemiBlockManager.getInstance(player.worldObj).getSemiBlocks().values()) {
for (ISemiBlock semiBlock : map.values()) {
ISemiBlockRenderer renderer = getRenderer(semiBlock);
if (renderer != null) {
GL11.glPushMatrix();
GL11.glTranslated(semiBlock.getPos().chunkPosX, semiBlock.getPos().chunkPosY, semiBlock.getPos().chunkPosZ);
renderer.render(semiBlock, event.partialTicks);
GL11.glPopMatrix();
}
}
}
GL11.glDisable(GL11.GL_BLEND);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
use of net.minecraft.client.Minecraft in project PneumaticCraft by MineMaarten.
the class ProgWidgetItemFilter method drawItemStack.
public static void drawItemStack(ItemStack p_146982_1_, int p_146982_2_, int p_146982_3_, String p_146982_4_) {
RenderHelper.disableStandardItemLighting();
GL11.glPushMatrix();
Minecraft mc = Minecraft.getMinecraft();
GL11.glTranslatef(0.0F, 0.0F, 32.0F);
// zLevel = 200.0F;
if (itemRender == null)
itemRender = new RenderItem();
itemRender.zLevel = 200.0F;
FontRenderer font = null;
if (p_146982_1_ != null)
font = p_146982_1_.getItem().getFontRenderer(p_146982_1_);
if (font == null)
font = mc.fontRenderer;
itemRender.renderItemAndEffectIntoGUI(font, mc.getTextureManager(), p_146982_1_, p_146982_2_, p_146982_3_);
itemRender.renderItemOverlayIntoGUI(font, mc.getTextureManager(), p_146982_1_, p_146982_2_, p_146982_3_, p_146982_4_);
GL11.glPopMatrix();
//GL11.glEnable(GL11.GL_LIGHTING);
RenderHelper.enableGUIStandardItemLighting();
// zLevel = 0.0F;
// itemRender.zLevel = 0.0F;
GL11.glDisable(GL11.GL_LIGHTING);
}
use of net.minecraft.client.Minecraft in project MinecraftForge by MinecraftForge.
the class ClientCommandHandler method autoComplete.
public void autoComplete(String leftOfCursor) {
latestAutoComplete = null;
if (leftOfCursor.charAt(0) == '/') {
leftOfCursor = leftOfCursor.substring(1);
Minecraft mc = FMLClientHandler.instance().getClient();
if (mc.currentScreen instanceof GuiChat) {
List<String> commands = getTabCompletions(mc.player, leftOfCursor, mc.player.getPosition());
if (!commands.isEmpty()) {
if (leftOfCursor.indexOf(' ') == -1) {
for (int i = 0; i < commands.size(); i++) {
commands.set(i, GRAY + "/" + commands.get(i) + RESET);
}
} else {
for (int i = 0; i < commands.size(); i++) {
commands.set(i, GRAY + commands.get(i) + RESET);
}
}
latestAutoComplete = commands.toArray(new String[commands.size()]);
}
}
}
}
Aggregations