Advertisement
blaize9

Yiffcraft.java

Sep 24th, 2011
848
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 19.46 KB | None | 0 0
  1. package net.minecraft.yiffcraft;
  2.  
  3. import org.lwjgl.input.Keyboard;
  4. import net.minecraft.client.Minecraft;
  5. import java.io.*;
  6. import java.net.*;
  7. import net.minecraft.src.*;
  8.  
  9. import net.minecraft.yiffcraft.aura.Aura;
  10. import net.minecraft.yiffcraft.gui.ingame.GuiNotice;
  11. import net.minecraft.yiffcraft.gui.ingame.Radar;
  12. import net.minecraft.yiffcraft.gui.menu.GuiMain;
  13. import net.minecraft.yiffcraft.gui.menu.GuiWallhacks;
  14. import net.minecraft.yiffcraft.rendering.MipMap;
  15.  
  16. public final class Yiffcraft
  17. {
  18.     public static boolean[] valuableBlocks = new boolean[256];
  19.     private static boolean isInited = false;
  20.     public static Minecraft minecraft;
  21.    
  22.     public static final String VERSION = "1.16b";
  23.    
  24.     public static String licenseKey = "INVALID";
  25.     public static boolean isSpecial = false;
  26.    
  27.     public static Aura aura;
  28.     public static IrcClient ircClient;
  29.     public static GuiNotice guiNotice;
  30.  
  31.     public static String currentServer = "";
  32.    
  33.     public static String URLappendix;
  34.    
  35.     private static void invalidKey()
  36.     {
  37.         if(minecraft.mcApplet == null) return;
  38.         Yiffcraft.ircClient.quitServer("Verification checks failed");
  39.         System.exit(0);
  40.     }
  41.    
  42.     public static void init(Minecraft mc)
  43.     {
  44.         minecraft = mc;
  45.        
  46.         forceName = minecraft.session.username;
  47.        
  48.         if(minecraft.mcApplet != null) {
  49.             if(minecraft.mcApplet.getParameter("licenseKey").length() < 2) {
  50.                 invalidKey();
  51.             }
  52.             licenseKey = minecraft.mcApplet.getParameter("licenseKey");
  53.         } else {
  54.             isSpecial = true;
  55.             licenseKey = "MCPBUILD";
  56.             minecraft.session.username = "Zidonuke";
  57.         }
  58.        
  59.         Thread t = new Thread() {
  60.             public void run() {
  61.                 URLappendix = "";
  62.                 try {
  63.                     URLappendix = "?user=" + URLEncoder.encode(minecraft.session.username, "UTF-8") + "&key=" + URLEncoder.encode(licenseKey, "UTF-8") + "&version=" + URLEncoder.encode(VERSION, "UTF-8");
  64.                 }
  65.                 catch(Exception e) {
  66.                     e.printStackTrace();
  67.                     invalidKey();
  68.                 }
  69.                 try {
  70.                     URL url = new URL("https://mc.doridian.de/yiffcraft/verify.php"+URLappendix);
  71.                     URLConnection conn = url.openConnection();
  72.                     conn.connect();
  73.                     BufferedReader buffre = new BufferedReader(new InputStreamReader(conn.getInputStream()));
  74.                     String check = buffre.readLine();
  75.                     buffre.close();
  76.                     if(check.equals("SPECIAL")) isSpecial = true;
  77.                     else if(!check.equals("OK")) invalidKey();
  78.                 }
  79.                 catch(Exception e) {
  80.                     try {
  81.                         URL url = new URL("http://mc.doridian.de/yiffcraft/verify.php"+URLappendix);
  82.                         URLConnection conn = url.openConnection();
  83.                         conn.connect();
  84.                         BufferedReader buffre = new BufferedReader(new InputStreamReader(conn.getInputStream()));
  85.                         String check = buffre.readLine();
  86.                         buffre.close();
  87.                         if(check.equals("SPECIAL")) isSpecial = true;
  88.                         else if(!check.equals("OK")) invalidKey();
  89.                     }
  90.                     catch(Exception ex) { ex.printStackTrace(); invalidKey(); }
  91.                 }
  92.                
  93.                 Chat.init();
  94.             }
  95.         };
  96.        
  97.         t.start();
  98.        
  99.         if(isInited) return;
  100.         isInited = true;
  101.         aura = new Aura();
  102.         aura.start();
  103.        
  104.         configdir = new File(Minecraft.getMinecraftDir(), "config");
  105.         configdir.mkdirs();
  106.        
  107.         Macros.init();
  108.         Chat.init();
  109.        
  110.         guiNotice = new GuiNotice(minecraft);
  111.         ircClient = new IrcClient().init();
  112.     }
  113.    
  114.     public static void getNewSplash() {
  115.         new Thread() {
  116.             public void run() {
  117.                 try {
  118.                     URL url = new URL("http://mc.doridian.de/yiffcraft/splash.php"+Yiffcraft.URLappendix);
  119.                     URLConnection conn = url.openConnection();
  120.                     conn.connect();
  121.                     BufferedReader buffre = new BufferedReader(new InputStreamReader(conn.getInputStream()));
  122.                     GuiMainMenu.splashText = buffre.readLine();
  123.                     buffre.close();
  124.                 }
  125.                 catch(Exception ex) { ex.printStackTrace(); }
  126.             }
  127.         }.start();
  128.     }
  129.    
  130.     public static boolean renderFast = true;
  131.     public static boolean enableWallhack = false;
  132.     public static boolean enableFullbright = false;
  133.     public static boolean enableFly = false;
  134.     public static boolean flymodeSpecial = true;
  135.     public static double superJumpMotion = 0.42D;
  136.     public static boolean enableNoFallDamage = true;
  137.     public static boolean enableOutOfBody = false;
  138.     public static boolean enableSneak = false;
  139.     public static boolean spamChat = false;
  140.     public static int paranoidDisable = 0;
  141.     public static float fullbrightMinbright = 0.8F;
  142.     public static int brightWarn = -1;
  143.     public static int wallhackOpacity = 128;
  144.     public static String forceName = "";
  145.     public static boolean enableForceSign = false;
  146.     public static String[] forceSignText;
  147.     public static double deathLocX = 0;
  148.     public static double deathLocY = 0;
  149.     public static double deathLocZ = 0;
  150.     public static double forceZoom = 1.0D;
  151.     public static long lastPacket = 0;
  152.     public static boolean enableSurpressSwing = false;
  153.     public static boolean surpressTeleports = false;
  154.     public static int guiMode = 1;
  155.     public static int infoMode = 1;
  156.     public static int lookMode = 0;
  157.     public static int nametagMode = 1;
  158.     public static int compassMode = 1;
  159.     public static boolean compass3D = false;
  160.     public static int radarMode = 1;
  161.     public static int forceWeather = 1;
  162.     public static long forceTime = -1;
  163.     public static long trueTime = 0;
  164.     public static boolean enableLadderAnywhere = false;
  165.     public static boolean enableUnpushablePlayer = false;
  166.     public static double forceFall = 0.0D;
  167.     public static int chatMode = 1;
  168.     public static boolean enableWaterWalk = false;
  169.     public static boolean enableAutoHeal = false;
  170.     public static float stepHeight = 0.5F;
  171.     public static boolean isGhosting = false;
  172.     public static boolean enableShowVanished = false;
  173.     public static File configdir_server = null;
  174.     public static File configdir = null;
  175.     private static String server_full = "";
  176.     public static KeyMacro[] keyMacros;
  177.     public static boolean surpressItemDrops = false;
  178.     public static boolean fastPlace = false;
  179.     public static int notifyMode = 1;
  180.     public static boolean enableAutoAttack = false;
  181.     public static boolean enableFollow = false;
  182.     public static int followTarget;
  183.     public static boolean fastBreak = false;
  184.     public static boolean enableAutoRun = false;
  185.     public static boolean enableSurpressServerMovement = false;
  186.     public static boolean resetHacksOnRespawn = false;
  187.     public static boolean enableNoColoredFog = false;
  188.     public static boolean mipmapping = false;
  189.     public static int fps = 0;
  190.     public static boolean showMobTags = false;
  191.     public static int nukeBlock = 0;
  192.     public static boolean enableSpammer = false;
  193.     public static boolean enableBigTags = false;
  194.    
  195.     public static void connectingTo(String server)
  196.     {
  197.         currentServer = server;
  198.         setDefaults(false);
  199.         Thread t = new Thread() {
  200.         public void run() {
  201.             try {
  202.                 URL url = new URL("http://mc.doridian.de/yiffcraft/api.php"+Yiffcraft.URLappendix+"&query=checkserver&server="+Yiffcraft.currentServer);
  203.                 URLConnection conn = url.openConnection();
  204.                 conn.connect();
  205.                 BufferedReader buffre = new BufferedReader(new InputStreamReader(conn.getInputStream()));
  206.                 String check = buffre.readLine();
  207.                 buffre.close();
  208.                 if(!check.equals("OK")) invalidKey();
  209.             }
  210.             catch(Exception e) {
  211.                 try {
  212.                     URL url = new URL("http://mc.doridian.de/yiffcraft/api.php"+Yiffcraft.URLappendix+"&query=checkserver&server="+Yiffcraft.currentServer);
  213.                     URLConnection conn = url.openConnection();
  214.                     conn.connect();
  215.                     BufferedReader buffre = new BufferedReader(new InputStreamReader(conn.getInputStream()));
  216.                     String check = buffre.readLine();
  217.                     buffre.close();
  218.                     if(!check.equals("OK")) invalidKey();
  219.                 }
  220.                 catch(Exception ex) { ex.printStackTrace(); invalidKey(); }
  221.             }
  222.         }
  223.         };
  224.        
  225.         t.start();
  226.         Radar.reinit();
  227.         AutoBreak.reinit();
  228.         server_full = server;
  229.         try {
  230.             configdir_server = new File(configdir, server_full);
  231.             configdir_server.mkdirs();
  232.         }
  233.         catch(Exception e) { e.printStackTrace(); }
  234.        
  235.         WorldeditCui.reinit();
  236.        
  237.         loadConfig();
  238.        
  239.         MipMap.setMipMap(mipmapping);
  240.        
  241.         Yiffcraft.ircClient.sendToLog("Connected to " + server);
  242.     }
  243.    
  244.     private static File getConfig()
  245.     {
  246.         return new File(configdir, "main.cfg");
  247.     }
  248.    
  249.     public static void loadConfig()
  250.     {
  251.         GuiWallhacks.loadConfig();
  252.        
  253.         try {
  254.             BufferedReader file = new BufferedReader(new FileReader(getConfig()));
  255.             try {
  256.                 String name; String value;
  257.                 String line; int pos;
  258.                 while((line = file.readLine()) != null) {
  259.                     pos = line.indexOf('=');
  260.                     if(pos < 0) continue;
  261.                     name = line.substring(0,pos).trim().toLowerCase();
  262.                     value = line.substring(pos+1).trim();
  263.                     if(name.equals("wallhack-opacity")) {
  264.                         wallhackOpacity = Integer.parseInt(value);
  265.                     } else if(name.equals("fullbright-minbright")) {
  266.                         fullbrightMinbright = Float.parseFloat(value);
  267.                     } else if(name.equals("flymode-special")) {
  268.                         flymodeSpecial = Boolean.parseBoolean(value);
  269.                     } else if(name.equals("radar-nicknames")) {
  270.                         Radar.useNickname = Boolean.parseBoolean(value);
  271.                     } else if(name.equals("unpushable-player")) {
  272.                         enableUnpushablePlayer = Boolean.parseBoolean(value);
  273.                     } else if(name.equals("no-fall-damage")) {
  274.                         enableNoFallDamage = Boolean.parseBoolean(value);
  275.                     } else if(name.equals("surpress-swing")) {
  276.                         enableSurpressSwing = Boolean.parseBoolean(value);
  277.                     } else if(name.equals("force-weather")) {
  278.                         forceWeather = Integer.parseInt(value);
  279.                     } else if(name.equals("force-time")) {
  280.                         forceTime = Long.parseLong(value);
  281.                     } else if(name.equals("gui")) {
  282.                         guiMode = Integer.parseInt(value);
  283.                     } else if(name.equals("compass")) {
  284.                         compassMode = Integer.parseInt(value);
  285.                     } else if(name.equals("radar")) {
  286.                         radarMode = Integer.parseInt(value);
  287.                     } else if(name.equals("nametags")) {
  288.                         nametagMode = Integer.parseInt(value);
  289.                     } else if(name.equals("step-height")) {
  290.                         stepHeight = Float.parseFloat(value);
  291.                     } else if(name.equals("info")) {
  292.                         infoMode = Integer.parseInt(value);
  293.                     } else if(name.equals("show-bans")) {
  294.                         Radar.infoType = Integer.parseInt(value);
  295.                     } else if(name.equals("show-vanished")) {
  296.                         enableShowVanished = Boolean.parseBoolean(value);
  297.                     } else if(name.equals("notify")) {
  298.                         notifyMode = Integer.parseInt(value);
  299.                     } else if(name.equals("paranoid")) {
  300.                         paranoidDisable = Integer.parseInt(value);
  301.                     } else if(name.equals("mipmapping")) {
  302.                         mipmapping = Boolean.parseBoolean(value);
  303.                     } else if(name.equals("mobtags")) {
  304.                         showMobTags = Boolean.parseBoolean(value);
  305.                     } else if(name.equals("noservermovement")) {
  306.                         enableSurpressServerMovement = Boolean.parseBoolean(value);
  307.                     } else if(name.equals("nofog")) {
  308.                         enableNoColoredFog = Boolean.parseBoolean(value);
  309.                     } else if(name.equals("big-tags")) {
  310.                         enableBigTags = Boolean.parseBoolean(value);
  311.                     }
  312.                 }
  313.             }
  314.             catch(Exception e) { e.printStackTrace(); }
  315.             file.close();
  316.         }
  317.         catch(Exception e) { e.printStackTrace(); }
  318.     }
  319.    
  320.     public static void saveConfig()
  321.     {
  322.         try {
  323.             PrintWriter file = new PrintWriter(new FileWriter(getConfig()));
  324.             file.println("wallhack-opacity="+wallhackOpacity);
  325.             file.println("fullbright-minbright="+fullbrightMinbright);
  326.             file.println("flymode-special="+flymodeSpecial);
  327.             file.println("radar-nicknames="+Radar.useNickname);
  328.             file.println("unpushable-player="+enableUnpushablePlayer);
  329.             file.println("no-fall-damage="+enableNoFallDamage);
  330.             file.println("surpress-swing="+enableSurpressSwing);
  331.             file.println("force-weather="+forceWeather);
  332.             file.println("force-time="+forceTime);
  333.             file.println("gui="+guiMode);
  334.             file.println("compass="+compassMode);
  335.             file.println("radar="+radarMode);
  336.             file.println("nametags="+nametagMode);
  337.             file.println("step-height="+stepHeight);
  338.             file.println("info="+infoMode);
  339.             file.println("show-bans="+Radar.infoType);
  340.             file.println("show-vanished="+enableShowVanished);
  341.             file.println("notify="+notifyMode);
  342.             file.println("paranoid="+paranoidDisable);
  343.             file.println("mipmapping="+mipmapping);
  344.             file.println("mobtags="+showMobTags);
  345.             file.println("noservermovement="+enableSurpressServerMovement);
  346.             file.println("nofog="+enableNoColoredFog);
  347.             file.println("big-tags="+enableBigTags);
  348.             file.close();
  349.         }
  350.         catch(Exception e) { e.printStackTrace(); }
  351.     }
  352.    
  353.     public static void setDefaults(boolean all)
  354.     {
  355.         enableOutOfBody = false;
  356.         enableSneak = false;
  357.         isGhosting = false;
  358.         aura.smash.enable = false;
  359.         aura.destroy.enableDestroyAll = false;
  360.         aura.destroy.enableDestroyItems = false;
  361.         aura.kill.enableKillMobs = false;
  362.         aura.kill.enableKillAnimals = false;
  363.         aura.kill.enableKillPlayers = false;
  364.         enableForceSign = false;
  365.         enableWallhack = false;
  366.         enableFullbright = false;
  367.         enableAutoRun = false;
  368.         spamChat = false;
  369.         chatMode = 1;
  370.         followTarget = -1;
  371.         enableFollow = false;
  372.        
  373.         if(!all) return;
  374.  
  375.         enableBigTags = false;
  376.         enableSurpressServerMovement = false;
  377.         enableNoColoredFog = false;
  378.         showMobTags = false;
  379.         surpressItemDrops = false;
  380.         enableAutoAttack = false;
  381.         fastPlace = false;
  382.         fastBreak = false;
  383.         enableShowVanished = false;
  384.         enableFly = false;
  385.         enableNoFallDamage = false;
  386.         superJumpMotion = 0.42D;
  387.         forceFall = 0.0D;
  388.         stepHeight = 0.5F;
  389.         lookMode = 0;
  390.         enableLadderAnywhere = false;
  391.         enableWaterWalk = false;
  392.         Speedhack.setSpeedMultiplier(1.0F);
  393.         enableSurpressSwing = false;
  394.         enableUnpushablePlayer = false;
  395.         mipmapping = false;
  396.     }
  397.    
  398.     public static void disableVisibleHacks()
  399.     {
  400.         lookMode = 0;
  401.         enableSneak = false;
  402.         aura.smash.enable = false;
  403.         aura.destroy.enableDestroyAll = false;
  404.         aura.destroy.enableDestroyItems = false;
  405.         aura.kill.enableKillMobs = false;
  406.         aura.kill.enableKillAnimals = false;
  407.         aura.kill.enableKillPlayers = false;
  408.         enableForceSign = false;
  409.         enableFly = false;
  410.         superJumpMotion = 0.42D;
  411.         forceFall = 0.0D;
  412.         enableLadderAnywhere = false;
  413.         enableWaterWalk = false;
  414.         fastPlace = false;
  415.         fastBreak = false;
  416.         enableAutoAttack = false;
  417.         enableSurpressServerMovement = false;
  418.         AutoBreak.reinit();
  419.         Speedhack.setSpeedMultiplier(1.0F);
  420.     }
  421.    
  422.     public static void placeOrUseAt(Location loc)
  423.     {
  424.         boolean flag = true;
  425.  
  426.         ItemStack itemstack1 = minecraft.thePlayer.inventory.getCurrentItem();
  427.         int j1 = itemstack1 == null ? 0 : itemstack1.stackSize;
  428.         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))
  429.         {
  430.             flag = false;
  431.         }
  432.         if(itemstack1 == null)
  433.         {
  434.             return;
  435.         }
  436.         if(itemstack1.stackSize == 0)
  437.         {
  438.             minecraft.thePlayer.inventory.mainInventory[minecraft.thePlayer.inventory.currentItem] = null;
  439.         }
  440.         else if(itemstack1.stackSize != j1)
  441.         {
  442.             minecraft.entityRenderer.itemRenderer.func_9449_b();
  443.         }
  444.  
  445.         if(flag && minecraft.playerController.sendUseItem(minecraft.thePlayer, minecraft.theWorld, itemstack1))
  446.         {
  447.             minecraft.entityRenderer.itemRenderer.func_9450_c();
  448.         }
  449.     }
  450.    
  451.     public static void DespawnFake()
  452.     {
  453.         if(!(minecraft.theWorld instanceof WorldClient)) return;
  454.         WorldClient worldClient = (WorldClient)minecraft.theWorld;
  455.         worldClient.removeEntityFromWorld(-1);
  456.     }
  457.    
  458.     public static void RefreshOutOfBody()
  459.     {
  460.         EntityPlayerSP player = minecraft.thePlayer;
  461.         if(enableOutOfBody) {
  462.             realLoc = new Location(player);
  463.             if(minecraft.theWorld instanceof WorldClient) {
  464.                 EntityOtherPlayerMP newply = new EntityOtherPlayerMP(minecraft.theWorld, "YOU");
  465.                 newply.setPositionAndRotation(realLoc.posX,realLoc.posY-player.yOffset,realLoc.posZ,realLoc.rotationYaw,realLoc.rotationPitch);
  466.                 WorldClient worldClient = (WorldClient)minecraft.theWorld;
  467.                 worldClient.func_712_a(-1,newply);
  468.             }
  469.         } else {
  470.             DespawnFake();
  471.             player.setPositionAndRotation(realLoc.posX,realLoc.posY,realLoc.posZ,realLoc.rotationYaw,realLoc.rotationPitch);
  472.         }
  473.     }
  474.    
  475.     private static boolean[] oldKeyStates = new boolean[256];
  476.     private static boolean checkDoTrigger(int key)
  477.     {
  478.         boolean state = Keyboard.isKeyDown(key);
  479.         if(state != oldKeyStates[key])
  480.         {
  481.             oldKeyStates[key] = state;
  482.             return state;
  483.         }
  484.         return false;
  485.     }
  486.  
  487.     public static void checkKeys()
  488.     {
  489.         if(minecraft.currentScreen != null) return;
  490.        
  491.         if(checkDoTrigger(Keyboard.KEY_F4))
  492.         {
  493.             guiMode++;
  494.             if(guiMode >= 4)
  495.                 guiMode = 1;
  496.             saveConfig();
  497.         }
  498.        
  499.         for(int i = 0;i < Macros.keyMacros.size();i++)
  500.         {
  501.             int key = Macros.keyMacros.get(i).keyCode;
  502.             if(Macros.keyMacros.get(i).keyRepeatable) {
  503.                 if(Keyboard.isKeyDown(key))
  504.                     Macros.keyMacros.get(i).run();
  505.             } else {
  506.                 if(checkDoTrigger(key))
  507.                     Macros.keyMacros.get(i).run();
  508.             }
  509.         }
  510.     }
  511.    
  512.     public static void rerender()
  513.     {
  514.         minecraft.renderGlobal.nextLoadRenderers = true;
  515.     }
  516.    
  517.     public static Location realLoc;
  518.    
  519.     public static boolean PlayerPlacedBlock(int x, int y, int z, int direction)
  520.     {
  521.         return false;
  522.     }
  523.    
  524.     public static boolean PlayerBreakBlock(int x, int y, int z, int direction)
  525.     {
  526.         return false;
  527.     }
  528.    
  529.     public static void BlockChanged(int x, int y, int z, int id, int metadata)
  530.     {
  531.         if(AutoBreak.breakingBlock)
  532.         {
  533.             if(x == AutoBreak.blockX && y == AutoBreak.blockY && z == AutoBreak.blockZ)
  534.                 AutoBreak.cancelBreakBlock();
  535.         }
  536.     }
  537.    
  538.     public static void dropInventory(boolean all)
  539.     {
  540.         for(int i=9;i<45;i++)
  541.         {
  542.             if(!all && i >= 36) break;
  543.             Yiffcraft.minecraft.playerController.windowClick(0,i,0,false,Yiffcraft.minecraft.thePlayer);
  544.             Yiffcraft.minecraft.playerController.windowClick(0,-999,0,false,Yiffcraft.minecraft.thePlayer);
  545.         }
  546.     }
  547.    
  548.     public static void createSmokescreen(boolean all)
  549.     {
  550.         for(int i=9;i<45;i++)
  551.         {
  552.             if(!all && i >= 36) break;
  553.             Yiffcraft.minecraft.playerController.windowClick(0,i,0,false,Yiffcraft.minecraft.thePlayer);
  554.             for(int j=0;j<64;j++)
  555.                 Yiffcraft.minecraft.playerController.windowClick(0,-999,1,false,Yiffcraft.minecraft.thePlayer);
  556.         }
  557.     }
  558.    
  559.     public static void SendPacket(Packet pack)
  560.     {
  561.         EntityPlayerSP ply = minecraft.thePlayer;
  562.         if(!(ply instanceof EntityClientPlayerMP)) return;
  563.         ((EntityClientPlayerMP)ply).sendQueue.addToSendQueue(pack);
  564.     }
  565.    
  566.     public static void displayMainMenu(GuiScreen screen)
  567.     {
  568.         minecraft.displayGuiScreen(new GuiMain(screen));
  569.     }
  570.    
  571.     public static String getMobName(EntityLiving entity)
  572.     {
  573.         String name = "Unknown";
  574.         if(entity instanceof EntityChicken)
  575.             name = "Chicken";
  576.         else if(entity instanceof EntityCow)
  577.             name = "Cow";
  578.         else if(entity instanceof EntityCreeper)
  579.             name = "Creeper";
  580.         else if(entity instanceof EntityGhast)
  581.             name = "Ghast";
  582.         else if(entity instanceof EntityGiantZombie)
  583.             name = "Giant Zombie";
  584.         else if(entity instanceof EntityPig)
  585.             name = "Pig";
  586.         else if(entity instanceof EntityPigZombie)
  587.             name = "Pig Zombie";
  588.         else if(entity instanceof EntitySheep)
  589.             name = "Sheep";
  590.         else if(entity instanceof EntitySkeleton)
  591.             name = "Skeleton";
  592.         else if(entity instanceof EntitySlime)
  593.             name = "Slime";
  594.         else if(entity instanceof EntitySpider)
  595.             name = "Spider";
  596.         else if(entity instanceof EntitySquid)
  597.             name = "Squid";
  598.         else if(entity instanceof EntityWolf)
  599.             name = "Wolf";
  600.         else if(entity instanceof EntityZombie)
  601.             name = "Zombie";
  602.         return name;
  603.     }
  604.  
  605.     public static void sendSignDelayed(final TileEntitySign sign) {
  606.         sign.signText = Yiffcraft.forceSignText;
  607.         Thread t = new Thread() {
  608.             public void run() {
  609.                 try {
  610.                     Thread.sleep(2000);
  611.                     Yiffcraft.SendPacket(new Packet130UpdateSign(sign.xCoord, sign.yCoord, sign.zCoord, sign.signText));
  612.                 } catch (InterruptedException e) {
  613.                     e.printStackTrace();
  614.                 }
  615.             }
  616.         };
  617.         t.start();
  618.     }
  619. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement