Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package net.minecraft.yugecin;
- import java.awt.MouseInfo;
- import java.util.List;
- import org.lwjgl.input.Keyboard;
- import org.lwjgl.opengl.GL11;
- import net.minecraft.client.Minecraft;
- import net.minecraft.src.AchievementList;
- import net.minecraft.src.Gui;
- import net.minecraft.src.GuiMultiplayer;
- import net.minecraft.src.GuiScreen;
- public class Menu extends GuiScreen{
- private enum menu{
- INVALID ,
- PLAYER,
- XRAY,
- ESP,
- WORLD
- }
- public int offsetX = 0;
- public int offsetY = 0;
- private int clickItem;
- private int menuItem;
- public int x;
- public int y;
- private Minecraft mc;
- private menu drag = menu.INVALID;
- public Menu(Minecraft minecraft){
- x = MouseInfo.getPointerInfo().getLocation().x;
- y = MouseInfo.getPointerInfo().getLocation().y;
- mc = minecraft;
- height = mc.displayHeight;
- width = mc.displayWidth;
- }
- public boolean doesGuiPauseGame(){
- return false;
- }
- public void initGui(){
- mc.thePlayer.addStat(AchievementList.openInventory, 1);
- Keyboard.enableRepeatEvents(true);
- }
- public void onGuiClosed(){
- Keyboard.enableRepeatEvents(true);
- }
- protected void keyTyped(char c, int i){
- if(i == 1){
- net.minecraft.yugecin.Main.menu = false;
- mc.displayGuiScreen(null);
- return;
- }
- }
- public void drawScreen(int i, int j, float f){
- int pos[] = {0, 0, 0};
- pos = new int[3];
- mouseDraggedMode(i, j);
- drawRect(0, height, width / 2 - 100, height - 12, 0x70000000);
- Main.drawOutlinedRect(fontRenderer, "Reset GUI", 2, height - 12, 53, height - 1, 0xFFFFFFFF, 0xA0000000, 0xFFFFFFFF, 1);
- Main.drawOutlinedRect(fontRenderer, "Console", 55, height - 12, 97, height - 1, 0xFFFFFFFF, 0xA0000000, 0xFFFFFFFF, 1);
- drawTopMenuRect("Player", Main.playerX, Main.playerY, Main.playerWidth);
- drawTopMenuRect("x-Ray ยง1[X] [W]", Main.xrayX, Main.xrayY, Main.xrayWidth);
- drawTopMenuRect("ESP", Main.espX, Main.espY, Main.espWidth);
- drawTopMenuRect("World", Main.worldX, Main.worldY, Main.worldWidth);
- //PLAYER
- pos[0] = Main.playerX;
- pos[1] = Main.playerY;
- pos[2] = Main.playerWidth;
- drawMenuRect(Main.playerX, Main.playerWidth, Main.playerY, 15);
- drawMenuItem(pos, "Fastbreak", Main.fastbreak);
- drawMenuItem(pos, "Dolphin", Main.dolphin);
- drawMenuItem(pos, "AntiWater", Main.antiwater);
- drawMenuItem(pos, "Spider", Main.spider);
- drawMenuItem(pos, "Nofall", Main.nofall);
- drawMenuItem(pos, "Step", Main.step);
- drawMenuItem(pos, "Sprint", Main.sprint);
- drawMenuItem(pos, "Sneak", Main.sneak);
- drawMenuItem(pos, "Herp", Main.herp);
- drawMenuItem(pos, "Derp", Main.derp);
- drawMenuItem(pos, "Kill Aura", Main.killaura);
- drawMenuItem(pos, "Mob Aura", Main.mobaura);
- drawMenuItem(pos, "Nopumpkin", Main.nopumpkin);
- drawMenuItem(pos, "Noswing", Main.noswing);
- drawMenuItem(pos, "Freecam", Main.freecam);
- menuItem = 0;
- //XRAY
- pos[0] = Main.xrayX;
- pos[1] = Main.xrayY;
- pos[2] = Main.xrayWidth;
- drawMenuRect(Main.xrayX, Main.xrayWidth, Main.xrayY, 8);
- drawMenuItem(pos, "Coal", Main.xCoal);
- drawMenuItem(pos, "Iron", Main.xIron);
- drawMenuItem(pos, "Gold", Main.xGold);
- drawMenuItem(pos, "Diamond", Main.xDiamond);
- drawMenuItem(pos, "Redstone", Main.xRedstone);
- drawMenuItem(pos, "Lapiz", Main.xLapiz);
- drawMenuItem(pos, "Emerald", Main.xEmerald);
- drawMenuItem(pos, "Dungeon", Main.xDungeon);
- menuItem = 0;
- //ESP
- pos[0] = Main.espX;
- pos[1] = Main.espY;
- pos[2] = Main.espWidth;
- drawMenuRect(Main.espX, Main.espWidth, Main.espY, 4);
- drawMenuItem(pos, "Tracer", Main.esptracer);
- drawMenuItem(pos, "Player", Main.espplayer);
- drawMenuItem(pos, "Mobtracer", Main.espmobs);
- drawMenuItem(pos, "Chest", Main.espchest);
- menuItem = 0;
- //WORLD
- pos[0] = Main.worldX;
- pos[1] = Main.worldY;
- pos[2] = Main.worldWidth;
- drawMenuRect(Main.worldX, Main.worldWidth, Main.worldY, 3);
- drawMenuItem(pos, "x-Ray", Main.xray);
- drawMenuItem(pos, "Wallhack", Main.wallhack);
- drawMenuItem(pos, "Fullbright", Main.fullbright);
- menuItem = 0;
- }
- protected void mouseClicked(int i, int j, int k){
- int pos[] = {0, 0, 0};
- pos = new int[3];
- //PLAYER
- pos[0] = Main.playerX;
- pos[1] = Main.playerY;
- pos[2] = Main.playerWidth;
- if(clickedMenuItem(i, j, pos)) Main.fastbreak = !Main.fastbreak;
- if(clickedMenuItem(i, j, pos)) Main.dolphin = !Main.dolphin;
- if(clickedMenuItem(i, j, pos)) Main.antiwater = !Main.antiwater;
- if(clickedMenuItem(i, j, pos)) {
- Main.spider = !Main.spider;
- if(!Main.nofall) Main.nofall = true;
- }
- if(clickedMenuItem(i, j, pos)) Main.nofall = !Main.nofall;
- if(clickedMenuItem(i, j, pos)) Main.step = !Main.step;
- if(clickedMenuItem(i, j, pos)) Main.sprint = !Main.sprint;
- if(clickedMenuItem(i, j, pos)) Main.sneak = !Main.sneak;
- if(clickedMenuItem(i, j, pos)) {
- Main.herp = !Main.herp;
- Main.derp = false;
- }
- if(clickedMenuItem(i, j, pos)) {
- Main.derp = !Main.derp;
- Main.herp = false;
- }
- if(clickedMenuItem(i, j, pos)) Main.killaura = !Main.killaura;
- if(clickedMenuItem(i, j, pos)) Main.mobaura = !Main.mobaura;
- if(clickedMenuItem(i, j, pos)) Main.nopumpkin = !Main.nopumpkin;
- if(clickedMenuItem(i, j, pos)) Main.noswing = !Main.noswing;
- if(clickedMenuItem(i, j, pos)) {
- Main.freecam = !Main.freecam;
- if(Main.freecam){
- Main.freecamStartX = mc.thePlayer.posX;
- Main.freecamStartY = mc.thePlayer.posY;
- Main.freecamStartZ = mc.thePlayer.posZ;
- Main.freecamStartPitch = mc.thePlayer.rotationPitch;
- Main.freecamStartYaw = mc.thePlayer.rotationYaw;
- mc.displayGuiScreen(null);
- }
- }
- clickItem = 0;
- //XRAY
- pos[0] = Main.xrayX;
- pos[1] = Main.xrayY;
- pos[2] = Main.xrayWidth;
- if(clickedMenuItem(i, j, pos)) {
- Main.xCoal = !Main.xCoal;
- if(Main.xray || Main.wallhack) mc.renderGlobal.loadRenderers();
- }
- if(clickedMenuItem(i, j, pos)) {
- Main.xIron = !Main.xIron;
- if(Main.xray || Main.wallhack) mc.renderGlobal.loadRenderers();
- }
- if(clickedMenuItem(i, j, pos)) {
- Main.xGold = !Main.xGold;
- if(Main.xray || Main.wallhack) mc.renderGlobal.loadRenderers();
- }
- if(clickedMenuItem(i, j, pos)) {
- Main.xDiamond = !Main.xDiamond;
- if(Main.xray || Main.wallhack) mc.renderGlobal.loadRenderers();
- }
- if(clickedMenuItem(i, j, pos)) {
- Main.xRedstone = !Main.xRedstone;
- if(Main.xray || Main.wallhack) mc.renderGlobal.loadRenderers();
- }
- if(clickedMenuItem(i, j, pos)) {
- Main.xLapiz = !Main.xLapiz;
- if(Main.xray || Main.wallhack) mc.renderGlobal.loadRenderers();
- }
- if(clickedMenuItem(i, j, pos)) {
- Main.xEmerald = !Main.xEmerald;
- if(Main.xray || Main.wallhack) mc.renderGlobal.loadRenderers();
- }
- if(clickedMenuItem(i, j, pos)) {
- Main.xDungeon = !Main.xDungeon;
- if(Main.xray || Main.wallhack) mc.renderGlobal.loadRenderers();
- }
- clickItem = 0;
- //ESP
- pos[0] = Main.espX;
- pos[1] = Main.espY;
- pos[2] = Main.espWidth;
- if(clickedMenuItem(i, j, pos)) Main.esptracer = !Main.esptracer;
- if(clickedMenuItem(i, j, pos)) Main.espplayer = !Main.espplayer;
- if(clickedMenuItem(i, j, pos)) Main.espmobs = !Main.espmobs;
- if(clickedMenuItem(i, j, pos)) Main.espchest = !Main.espchest;
- clickItem = 0;
- //WORLD
- pos[0] = Main.worldX;
- pos[1] = Main.worldY;
- pos[2] = Main.worldWidth;
- if(clickedMenuItem(i, j, pos)) {
- Main.wallhack = false;
- Main.xray = !Main.xray;
- mc.renderGlobal.loadRenderers();
- }
- if(clickedMenuItem(i, j, pos)) {
- Main.xray = false;
- Main.wallhack = !Main.wallhack;
- mc.renderGlobal.loadRenderers();
- }
- if(clickedMenuItem(i, j, pos)) {
- Main.fullbright = !Main.fullbright;
- mc.renderGlobal.loadRenderers();
- }
- clickItem = 0;
- //DRAG
- if(clickedTopMenu(i, j, Main.playerX, Main.playerY, Main.playerWidth)){
- drag = menu.PLAYER;
- setOffset(i, j, Main.playerX, Main.playerY);
- }
- if(clickedTopMenu(i, j, Main.xrayX, Main.xrayY, Main.xrayWidth)){
- drag = menu.XRAY;
- setOffset(i, j, Main.xrayX, Main.xrayY);
- }
- if(clickedTopMenu(i, j, Main.espX, Main.espY, Main.espWidth)){
- drag = menu.ESP;
- setOffset(i, j, Main.espX, Main.espY);
- }
- if(clickedTopMenu(i, j, Main.worldX, Main.worldY, Main.worldWidth)){
- drag = menu.WORLD;
- setOffset(i, j, Main.worldX, Main.worldY);
- }
- if(clickedInRect(i, j, 2, height - 12, 53, height - 1)){ // RESET GUI
- Main.playerY = Main.xrayY = Main.espY = Main.worldY = 14;
- Main.playerX = 2;
- Main.xrayX = Main.playerX + Main.playerWidth + 1;
- Main.espX = Main.xrayX + Main.xrayWidth + 1;
- Main.worldX = Main.espX + Main.espWidth + 1;
- }
- if(clickedInRect(i, j, 55, height - 12, 97, height - 1)) mc.displayGuiScreen(new net.minecraft.yugecin.Console(mc, this)); //CONSOLE
- }
- public void mouseDraggedMode(int i, int j)
- {
- if(drag != menu.INVALID){
- switch(drag){
- case PLAYER:
- Main.playerX = i + offsetX;
- Main.playerY = j + offsetY;
- break;
- case XRAY:
- Main.xrayX = i + offsetX;
- Main.xrayY = j + offsetY;
- break;
- case ESP:
- Main.espX = i + offsetX;
- Main.espY = j + offsetY;
- break;
- case WORLD:
- Main.worldX = i + offsetX;
- Main.worldY = j + offsetY;
- break;
- default: drag = menu.INVALID;
- break;
- }
- }
- }
- public void setOffset(int i, int j, int x, int y){
- offsetX = x - i;
- offsetY = y - j;
- }
- protected void mouseMovedOrUp(int i, int j, int k){
- if(k == 0){
- drag = menu.INVALID;
- }
- }
- /************************ UTILS **************************/
- public boolean clickedTopMenu(int par0, int par1, int par2, int par3, int par4){
- if(par2 <= par0 && par3 <= par1 && (par2 + par4) >= par0 && (par3 + 12) >= par1) return true;
- return false;
- }
- public boolean clickedInRect(int par0, int par1, int par2, int par3, int par4, int par5){
- if(par2 <= par0 && par3 <= par1 && par5 >= par0 && par5 >= par1) return true;
- return false;
- }
- public boolean clickedMenuItem(int par0, int par1, int par2[]){
- clickItem++;
- if(par2[0] + par2[2] - 22 <= par0 && par2[1] + 12 + 1 + 2 + (clickItem - 1)*10 <= par1 && par2[0] + par2[2] - 2 >= par0 && par2[1] + 12 + 1 + 2 + (clickItem - 1)*10+8 >= par1) return true;
- return false;
- }
- public void drawOutlinedGradientRect(int x1, int y1, int x2, int y2, int color, int color1, int color2)
- {
- drawGradientRect(x1, y1, x2, y2, color1, color2);
- drawHorizontalLine(x1, x2, y2, color);
- drawHorizontalLine(x1, x2, y1, color);
- drawVerticalLine(x1, y2, y1, color);
- drawVerticalLine(x2, y2, y1, color);
- }
- public void drawMenuItem(int pos[], String hack, boolean var){
- fontRenderer.drawString(hack, Main.MainOffsetX + pos[0], pos[1] + 12 + 1 + 2 + menuItem*10, var ? 0x00FF00 : 0xFF0000);
- drawGradientRect(pos[0] + pos[2] - 22, pos[1] + 12 + 1 + 2 + menuItem*10, pos[0] + pos[2] - 2, pos[1] + 12 + 1 + 2 + menuItem*10 + 8, 0xFF555555, 0xFFAAAAAA);
- GL11.glScalef(0.5f, 0.5f, 0.5f);
- fontRenderer.drawString(var ? "Disable" : "Enable", (pos[0] + pos[2] - 22 + 2)*2, (pos[1] + 12 +1 + 2 + menuItem*10 + 2)*2, 0xFFFFFF);
- GL11.glScalef(2f,2f, 2f);
- menuItem++;
- }
- public void drawMenuRect(int x, int width, int y, int items){
- drawRect(x, y + 12 + 1, x + width, y + 12 + 1 + 12 + (items-1)*10, 0xA0000000);
- }
- public void drawTopMenuRect(String par0, int par1, int par2, int par3){
- drawRect(par1, par2, par1 + par3, par2 + 12, 0xA0000000); //world
- fontRenderer.drawString(par0, Main.MainOffsetX + par1, par2 + 2, 0xFFFFFF); //player
- }
- }
- ####
- public static void drawOutlinedRect(int x1, int y1, int x2, int y2, int rcolor, int color, int thickness){
- Gui.drawRect(x1, y1, x2, y2, rcolor);
- Gui.drawRect(x1, y1, x2, y1 + thickness, color);
- Gui.drawRect(x1, y2, x2, y2 - thickness, color);
- Gui.drawRect(x1, y1, x1 + thickness, y2, color);
- Gui.drawRect(x2, y1, x2 - thickness, y2, color);
- }
- public static void drawOutlinedRect(FontRenderer fr, String str, int x1, int y1, int x2, int y2, int fcolor, int rcolor, int color, int thickness){
- Gui.drawRect(x1, y1, x2, y2, rcolor);
- Gui.drawRect(x1, y1, x2, y1 + thickness, color);
- Gui.drawRect(x1, y2, x2, y2 - thickness, color);
- Gui.drawRect(x1, y1, x1 + thickness, y2, color);
- Gui.drawRect(x2, y1, x2 - thickness, y2, color);
- fr.drawString(str, x1 + 2, y1 + 2, fcolor);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement