Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package net.minecraft.yiffcraft;
- import org.lwjgl.input.Keyboard;
- import net.minecraft.client.Minecraft;
- import java.io.*;
- import java.net.*;
- import net.minecraft.src.*;
- import net.minecraft.yiffcraft.aura.Aura;
- import net.minecraft.yiffcraft.gui.ingame.GuiNotice;
- import net.minecraft.yiffcraft.gui.ingame.Radar;
- import net.minecraft.yiffcraft.gui.menu.GuiMain;
- import net.minecraft.yiffcraft.gui.menu.GuiWallhacks;
- import net.minecraft.yiffcraft.rendering.MipMap;
- public final class Yiffcraft
- {
- public static boolean[] valuableBlocks = new boolean[256];
- private static boolean isInited = false;
- public static Minecraft minecraft;
- public static final String VERSION = "1.16b";
- public static String licenseKey = "INVALID";
- public static boolean isSpecial = false;
- public static Aura aura;
- public static IrcClient ircClient;
- public static GuiNotice guiNotice;
- public static String currentServer = "";
- public static String URLappendix;
- private static void invalidKey()
- {
- if(minecraft.mcApplet == null) return;
- Yiffcraft.ircClient.quitServer("Verification checks failed");
- System.exit(0);
- }
- public static void init(Minecraft mc)
- {
- minecraft = mc;
- forceName = minecraft.session.username;
- if(minecraft.mcApplet != null) {
- if(minecraft.mcApplet.getParameter("licenseKey").length() < 2) {
- invalidKey();
- }
- licenseKey = minecraft.mcApplet.getParameter("licenseKey");
- } else {
- isSpecial = true;
- licenseKey = "MCPBUILD";
- minecraft.session.username = "Zidonuke";
- }
- Thread t = new Thread() {
- public void run() {
- URLappendix = "";
- try {
- URLappendix = "?user=" + URLEncoder.encode(minecraft.session.username, "UTF-8") + "&key=" + URLEncoder.encode(licenseKey, "UTF-8") + "&version=" + URLEncoder.encode(VERSION, "UTF-8");
- }
- catch(Exception e) {
- e.printStackTrace();
- invalidKey();
- }
- try {
- URL url = new URL("https://mc.doridian.de/yiffcraft/verify.php"+URLappendix);
- URLConnection conn = url.openConnection();
- conn.connect();
- BufferedReader buffre = new BufferedReader(new InputStreamReader(conn.getInputStream()));
- String check = buffre.readLine();
- buffre.close();
- if(check.equals("SPECIAL")) isSpecial = true;
- else if(!check.equals("OK")) invalidKey();
- }
- catch(Exception e) {
- try {
- URL url = new URL("http://mc.doridian.de/yiffcraft/verify.php"+URLappendix);
- URLConnection conn = url.openConnection();
- conn.connect();
- BufferedReader buffre = new BufferedReader(new InputStreamReader(conn.getInputStream()));
- String check = buffre.readLine();
- buffre.close();
- if(check.equals("SPECIAL")) isSpecial = true;
- else if(!check.equals("OK")) invalidKey();
- }
- catch(Exception ex) { ex.printStackTrace(); invalidKey(); }
- }
- Chat.init();
- }
- };
- t.start();
- if(isInited) return;
- isInited = true;
- aura = new Aura();
- aura.start();
- configdir = new File(Minecraft.getMinecraftDir(), "config");
- configdir.mkdirs();
- Macros.init();
- Chat.init();
- guiNotice = new GuiNotice(minecraft);
- ircClient = new IrcClient().init();
- }
- public static void getNewSplash() {
- new Thread() {
- public void run() {
- try {
- URL url = new URL("http://mc.doridian.de/yiffcraft/splash.php"+Yiffcraft.URLappendix);
- URLConnection conn = url.openConnection();
- conn.connect();
- BufferedReader buffre = new BufferedReader(new InputStreamReader(conn.getInputStream()));
- GuiMainMenu.splashText = buffre.readLine();
- buffre.close();
- }
- catch(Exception ex) { ex.printStackTrace(); }
- }
- }.start();
- }
- public static boolean renderFast = true;
- public static boolean enableWallhack = false;
- public static boolean enableFullbright = false;
- public static boolean enableFly = false;
- public static boolean flymodeSpecial = true;
- public static double superJumpMotion = 0.42D;
- public static boolean enableNoFallDamage = true;
- public static boolean enableOutOfBody = false;
- public static boolean enableSneak = false;
- public static boolean spamChat = false;
- public static int paranoidDisable = 0;
- public static float fullbrightMinbright = 0.8F;
- public static int brightWarn = -1;
- public static int wallhackOpacity = 128;
- public static String forceName = "";
- public static boolean enableForceSign = false;
- public static String[] forceSignText;
- public static double deathLocX = 0;
- public static double deathLocY = 0;
- public static double deathLocZ = 0;
- public static double forceZoom = 1.0D;
- public static long lastPacket = 0;
- public static boolean enableSurpressSwing = false;
- public static boolean surpressTeleports = false;
- public static int guiMode = 1;
- public static int infoMode = 1;
- public static int lookMode = 0;
- public static int nametagMode = 1;
- public static int compassMode = 1;
- public static boolean compass3D = false;
- public static int radarMode = 1;
- public static int forceWeather = 1;
- public static long forceTime = -1;
- public static long trueTime = 0;
- public static boolean enableLadderAnywhere = false;
- public static boolean enableUnpushablePlayer = false;
- public static double forceFall = 0.0D;
- public static int chatMode = 1;
- public static boolean enableWaterWalk = false;
- public static boolean enableAutoHeal = false;
- public static float stepHeight = 0.5F;
- public static boolean isGhosting = false;
- public static boolean enableShowVanished = false;
- public static File configdir_server = null;
- public static File configdir = null;
- private static String server_full = "";
- public static KeyMacro[] keyMacros;
- public static boolean surpressItemDrops = false;
- public static boolean fastPlace = false;
- public static int notifyMode = 1;
- public static boolean enableAutoAttack = false;
- public static boolean enableFollow = false;
- public static int followTarget;
- public static boolean fastBreak = false;
- public static boolean enableAutoRun = false;
- public static boolean enableSurpressServerMovement = false;
- public static boolean resetHacksOnRespawn = false;
- public static boolean enableNoColoredFog = false;
- public static boolean mipmapping = false;
- public static int fps = 0;
- public static boolean showMobTags = false;
- public static int nukeBlock = 0;
- public static boolean enableSpammer = false;
- public static boolean enableBigTags = false;
- public static void connectingTo(String server)
- {
- currentServer = server;
- setDefaults(false);
- Thread t = new Thread() {
- public void run() {
- try {
- URL url = new URL("http://mc.doridian.de/yiffcraft/api.php"+Yiffcraft.URLappendix+"&query=checkserver&server="+Yiffcraft.currentServer);
- URLConnection conn = url.openConnection();
- conn.connect();
- BufferedReader buffre = new BufferedReader(new InputStreamReader(conn.getInputStream()));
- String check = buffre.readLine();
- buffre.close();
- if(!check.equals("OK")) invalidKey();
- }
- catch(Exception e) {
- try {
- URL url = new URL("http://mc.doridian.de/yiffcraft/api.php"+Yiffcraft.URLappendix+"&query=checkserver&server="+Yiffcraft.currentServer);
- URLConnection conn = url.openConnection();
- conn.connect();
- BufferedReader buffre = new BufferedReader(new InputStreamReader(conn.getInputStream()));
- String check = buffre.readLine();
- buffre.close();
- if(!check.equals("OK")) invalidKey();
- }
- catch(Exception ex) { ex.printStackTrace(); invalidKey(); }
- }
- }
- };
- t.start();
- Radar.reinit();
- AutoBreak.reinit();
- server_full = server;
- try {
- configdir_server = new File(configdir, server_full);
- configdir_server.mkdirs();
- }
- catch(Exception e) { e.printStackTrace(); }
- WorldeditCui.reinit();
- loadConfig();
- MipMap.setMipMap(mipmapping);
- Yiffcraft.ircClient.sendToLog("Connected to " + server);
- }
- private static File getConfig()
- {
- return new File(configdir, "main.cfg");
- }
- public static void loadConfig()
- {
- GuiWallhacks.loadConfig();
- try {
- BufferedReader file = new BufferedReader(new FileReader(getConfig()));
- try {
- String name; String value;
- String line; int pos;
- while((line = file.readLine()) != null) {
- pos = line.indexOf('=');
- if(pos < 0) continue;
- name = line.substring(0,pos).trim().toLowerCase();
- value = line.substring(pos+1).trim();
- if(name.equals("wallhack-opacity")) {
- wallhackOpacity = Integer.parseInt(value);
- } else if(name.equals("fullbright-minbright")) {
- fullbrightMinbright = Float.parseFloat(value);
- } else if(name.equals("flymode-special")) {
- flymodeSpecial = Boolean.parseBoolean(value);
- } else if(name.equals("radar-nicknames")) {
- Radar.useNickname = Boolean.parseBoolean(value);
- } else if(name.equals("unpushable-player")) {
- enableUnpushablePlayer = Boolean.parseBoolean(value);
- } else if(name.equals("no-fall-damage")) {
- enableNoFallDamage = Boolean.parseBoolean(value);
- } else if(name.equals("surpress-swing")) {
- enableSurpressSwing = Boolean.parseBoolean(value);
- } else if(name.equals("force-weather")) {
- forceWeather = Integer.parseInt(value);
- } else if(name.equals("force-time")) {
- forceTime = Long.parseLong(value);
- } else if(name.equals("gui")) {
- guiMode = Integer.parseInt(value);
- } else if(name.equals("compass")) {
- compassMode = Integer.parseInt(value);
- } else if(name.equals("radar")) {
- radarMode = Integer.parseInt(value);
- } else if(name.equals("nametags")) {
- nametagMode = Integer.parseInt(value);
- } else if(name.equals("step-height")) {
- stepHeight = Float.parseFloat(value);
- } else if(name.equals("info")) {
- infoMode = Integer.parseInt(value);
- } else if(name.equals("show-bans")) {
- Radar.infoType = Integer.parseInt(value);
- } else if(name.equals("show-vanished")) {
- enableShowVanished = Boolean.parseBoolean(value);
- } else if(name.equals("notify")) {
- notifyMode = Integer.parseInt(value);
- } else if(name.equals("paranoid")) {
- paranoidDisable = Integer.parseInt(value);
- } else if(name.equals("mipmapping")) {
- mipmapping = Boolean.parseBoolean(value);
- } else if(name.equals("mobtags")) {
- showMobTags = Boolean.parseBoolean(value);
- } else if(name.equals("noservermovement")) {
- enableSurpressServerMovement = Boolean.parseBoolean(value);
- } else if(name.equals("nofog")) {
- enableNoColoredFog = Boolean.parseBoolean(value);
- } else if(name.equals("big-tags")) {
- enableBigTags = Boolean.parseBoolean(value);
- }
- }
- }
- catch(Exception e) { e.printStackTrace(); }
- file.close();
- }
- catch(Exception e) { e.printStackTrace(); }
- }
- public static void saveConfig()
- {
- try {
- PrintWriter file = new PrintWriter(new FileWriter(getConfig()));
- file.println("wallhack-opacity="+wallhackOpacity);
- file.println("fullbright-minbright="+fullbrightMinbright);
- file.println("flymode-special="+flymodeSpecial);
- file.println("radar-nicknames="+Radar.useNickname);
- file.println("unpushable-player="+enableUnpushablePlayer);
- file.println("no-fall-damage="+enableNoFallDamage);
- file.println("surpress-swing="+enableSurpressSwing);
- file.println("force-weather="+forceWeather);
- file.println("force-time="+forceTime);
- file.println("gui="+guiMode);
- file.println("compass="+compassMode);
- file.println("radar="+radarMode);
- file.println("nametags="+nametagMode);
- file.println("step-height="+stepHeight);
- file.println("info="+infoMode);
- file.println("show-bans="+Radar.infoType);
- file.println("show-vanished="+enableShowVanished);
- file.println("notify="+notifyMode);
- file.println("paranoid="+paranoidDisable);
- file.println("mipmapping="+mipmapping);
- file.println("mobtags="+showMobTags);
- file.println("noservermovement="+enableSurpressServerMovement);
- file.println("nofog="+enableNoColoredFog);
- file.println("big-tags="+enableBigTags);
- file.close();
- }
- catch(Exception e) { e.printStackTrace(); }
- }
- public static void setDefaults(boolean all)
- {
- enableOutOfBody = false;
- enableSneak = false;
- isGhosting = false;
- aura.smash.enable = false;
- aura.destroy.enableDestroyAll = false;
- aura.destroy.enableDestroyItems = false;
- aura.kill.enableKillMobs = false;
- aura.kill.enableKillAnimals = false;
- aura.kill.enableKillPlayers = false;
- enableForceSign = false;
- enableWallhack = false;
- enableFullbright = false;
- enableAutoRun = false;
- spamChat = false;
- chatMode = 1;
- followTarget = -1;
- enableFollow = false;
- if(!all) return;
- enableBigTags = false;
- enableSurpressServerMovement = false;
- enableNoColoredFog = false;
- showMobTags = false;
- surpressItemDrops = false;
- enableAutoAttack = false;
- fastPlace = false;
- fastBreak = false;
- enableShowVanished = false;
- enableFly = false;
- enableNoFallDamage = false;
- superJumpMotion = 0.42D;
- forceFall = 0.0D;
- stepHeight = 0.5F;
- lookMode = 0;
- enableLadderAnywhere = false;
- enableWaterWalk = false;
- Speedhack.setSpeedMultiplier(1.0F);
- enableSurpressSwing = false;
- enableUnpushablePlayer = false;
- mipmapping = false;
- }
- public static void disableVisibleHacks()
- {
- lookMode = 0;
- enableSneak = false;
- aura.smash.enable = false;
- aura.destroy.enableDestroyAll = false;
- aura.destroy.enableDestroyItems = false;
- aura.kill.enableKillMobs = false;
- aura.kill.enableKillAnimals = false;
- aura.kill.enableKillPlayers = false;
- enableForceSign = false;
- enableFly = false;
- superJumpMotion = 0.42D;
- forceFall = 0.0D;
- enableLadderAnywhere = false;
- enableWaterWalk = false;
- fastPlace = false;
- fastBreak = false;
- enableAutoAttack = false;
- enableSurpressServerMovement = false;
- AutoBreak.reinit();
- Speedhack.setSpeedMultiplier(1.0F);
- }
- public static void placeOrUseAt(Location loc)
- {
- boolean flag = true;
- ItemStack itemstack1 = minecraft.thePlayer.inventory.getCurrentItem();
- int j1 = itemstack1 == null ? 0 : itemstack1.stackSize;
- if(minecraft.playerController.sendPlaceBlock(minecraft.thePlayer, minecraft.theWorld, itemstack1, (int)Math.ceil(loc.posX) - 1, (int)Math.floor(loc.posY) - 2, (int)Math.ceil(loc.posZ) - 1, 0))
- {
- flag = false;
- }
- if(itemstack1 == null)
- {
- return;
- }
- if(itemstack1.stackSize == 0)
- {
- minecraft.thePlayer.inventory.mainInventory[minecraft.thePlayer.inventory.currentItem] = null;
- }
- else if(itemstack1.stackSize != j1)
- {
- minecraft.entityRenderer.itemRenderer.func_9449_b();
- }
- if(flag && minecraft.playerController.sendUseItem(minecraft.thePlayer, minecraft.theWorld, itemstack1))
- {
- minecraft.entityRenderer.itemRenderer.func_9450_c();
- }
- }
- public static void DespawnFake()
- {
- if(!(minecraft.theWorld instanceof WorldClient)) return;
- WorldClient worldClient = (WorldClient)minecraft.theWorld;
- worldClient.removeEntityFromWorld(-1);
- }
- public static void RefreshOutOfBody()
- {
- EntityPlayerSP player = minecraft.thePlayer;
- if(enableOutOfBody) {
- realLoc = new Location(player);
- if(minecraft.theWorld instanceof WorldClient) {
- EntityOtherPlayerMP newply = new EntityOtherPlayerMP(minecraft.theWorld, "YOU");
- newply.setPositionAndRotation(realLoc.posX,realLoc.posY-player.yOffset,realLoc.posZ,realLoc.rotationYaw,realLoc.rotationPitch);
- WorldClient worldClient = (WorldClient)minecraft.theWorld;
- worldClient.func_712_a(-1,newply);
- }
- } else {
- DespawnFake();
- player.setPositionAndRotation(realLoc.posX,realLoc.posY,realLoc.posZ,realLoc.rotationYaw,realLoc.rotationPitch);
- }
- }
- private static boolean[] oldKeyStates = new boolean[256];
- private static boolean checkDoTrigger(int key)
- {
- boolean state = Keyboard.isKeyDown(key);
- if(state != oldKeyStates[key])
- {
- oldKeyStates[key] = state;
- return state;
- }
- return false;
- }
- public static void checkKeys()
- {
- if(minecraft.currentScreen != null) return;
- if(checkDoTrigger(Keyboard.KEY_F4))
- {
- guiMode++;
- if(guiMode >= 4)
- guiMode = 1;
- saveConfig();
- }
- for(int i = 0;i < Macros.keyMacros.size();i++)
- {
- int key = Macros.keyMacros.get(i).keyCode;
- if(Macros.keyMacros.get(i).keyRepeatable) {
- if(Keyboard.isKeyDown(key))
- Macros.keyMacros.get(i).run();
- } else {
- if(checkDoTrigger(key))
- Macros.keyMacros.get(i).run();
- }
- }
- }
- public static void rerender()
- {
- minecraft.renderGlobal.nextLoadRenderers = true;
- }
- public static Location realLoc;
- public static boolean PlayerPlacedBlock(int x, int y, int z, int direction)
- {
- return false;
- }
- public static boolean PlayerBreakBlock(int x, int y, int z, int direction)
- {
- return false;
- }
- public static void BlockChanged(int x, int y, int z, int id, int metadata)
- {
- if(AutoBreak.breakingBlock)
- {
- if(x == AutoBreak.blockX && y == AutoBreak.blockY && z == AutoBreak.blockZ)
- AutoBreak.cancelBreakBlock();
- }
- }
- public static void dropInventory(boolean all)
- {
- for(int i=9;i<45;i++)
- {
- if(!all && i >= 36) break;
- Yiffcraft.minecraft.playerController.windowClick(0,i,0,false,Yiffcraft.minecraft.thePlayer);
- Yiffcraft.minecraft.playerController.windowClick(0,-999,0,false,Yiffcraft.minecraft.thePlayer);
- }
- }
- public static void createSmokescreen(boolean all)
- {
- for(int i=9;i<45;i++)
- {
- if(!all && i >= 36) break;
- Yiffcraft.minecraft.playerController.windowClick(0,i,0,false,Yiffcraft.minecraft.thePlayer);
- for(int j=0;j<64;j++)
- Yiffcraft.minecraft.playerController.windowClick(0,-999,1,false,Yiffcraft.minecraft.thePlayer);
- }
- }
- public static void SendPacket(Packet pack)
- {
- EntityPlayerSP ply = minecraft.thePlayer;
- if(!(ply instanceof EntityClientPlayerMP)) return;
- ((EntityClientPlayerMP)ply).sendQueue.addToSendQueue(pack);
- }
- public static void displayMainMenu(GuiScreen screen)
- {
- minecraft.displayGuiScreen(new GuiMain(screen));
- }
- public static String getMobName(EntityLiving entity)
- {
- String name = "Unknown";
- if(entity instanceof EntityChicken)
- name = "Chicken";
- else if(entity instanceof EntityCow)
- name = "Cow";
- else if(entity instanceof EntityCreeper)
- name = "Creeper";
- else if(entity instanceof EntityGhast)
- name = "Ghast";
- else if(entity instanceof EntityGiantZombie)
- name = "Giant Zombie";
- else if(entity instanceof EntityPig)
- name = "Pig";
- else if(entity instanceof EntityPigZombie)
- name = "Pig Zombie";
- else if(entity instanceof EntitySheep)
- name = "Sheep";
- else if(entity instanceof EntitySkeleton)
- name = "Skeleton";
- else if(entity instanceof EntitySlime)
- name = "Slime";
- else if(entity instanceof EntitySpider)
- name = "Spider";
- else if(entity instanceof EntitySquid)
- name = "Squid";
- else if(entity instanceof EntityWolf)
- name = "Wolf";
- else if(entity instanceof EntityZombie)
- name = "Zombie";
- return name;
- }
- public static void sendSignDelayed(final TileEntitySign sign) {
- sign.signText = Yiffcraft.forceSignText;
- Thread t = new Thread() {
- public void run() {
- try {
- Thread.sleep(2000);
- Yiffcraft.SendPacket(new Packet130UpdateSign(sign.xCoord, sign.yCoord, sign.zCoord, sign.signText));
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
- };
- t.start();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement