- Баллы
- 103
- Ник в Minecraft
- Sany007
А для 1.5.2 можно? Можешь пожалуйста мне настроить?Например, так:
В ThreadUtils в методе
Первой строкой вставитьКод:public static void runUpdater(String answer)
Затем, например, в cpw.mods.fml.common.discovery.ModDiscoverer изменить метод findModDirMods на такой (для 1.6.4)Код:System.setProperty("answer",answer);
Код:public void findModDirMods(File modsDir) { File[] modList = modsDir.listFiles(); // Sort the files into alphabetical order first Arrays.sort(modList, new Comparator<File>() { @Override public int compare(File o1, File o2) { return o1.getName().compareToIgnoreCase(o2.getName()); } }); for (File modFile : modList) { // skip loaded coremods if (CoreModManager.getLoadedCoremods().contains(modFile.getName())) { FMLLog.finer("Skipping already parsed coremod or tweaker %s", modFile.getName()); } else if (modFile.isDirectory()) { } else { Matcher matcher = zipJar.matcher(modFile.getName()); if (matcher.matches()) { FMLLog.fine("Found a candidate zip or jar file %s", matcher.group(0)); if(System.getProperty("answer","").contains(modFile.getName()+":>"+getMD5(modFile.getAbsolutePath()))) candidates.add(new ModCandidate(modFile, modFile, ContainerType.JAR)); } else { FMLLog.fine("Ignoring unknown file %s in mods directory", modFile.getName()); } } } } public static String getMD5(String filename) { FileInputStream fis = null; DigestInputStream dis = null; BufferedInputStream bis = null; Formatter formatter = null; try { MessageDigest messagedigest = MessageDigest.getInstance("MD5"); fis = new FileInputStream(filename); bis = new BufferedInputStream(fis); dis = new DigestInputStream(bis, messagedigest); while(dis.read() != -1); byte abyte0[] = messagedigest.digest(); formatter = new Formatter(); byte abyte1[] = abyte0; int i = abyte1.length; for(int j = 0; j < i; j++) { byte byte0 = abyte1[j]; formatter.format("%02x", new Object[] { Byte.valueOf(byte0) }); } return formatter.toString(); } catch(Exception e) { return BaseUtils.empty; } finally { try { fis.close(); } catch (Exception e){} try { dis.close(); } catch (Exception e){} try { bis.close(); } catch (Exception e){} try { formatter.close(); } catch (Exception e){} } }
В итоге. Каждый запускаемый мод проверяется, а моды в виде папок не загружаются
Помогите поставить защиту от подмены файлов Java.
Прошу помогите, кто умеет!
У меня не работет ОУ, что делать помогите!? Игроки заменяют Java файл, "rt.jar"

