MFF

    Minecraft Forge France
    • Récent
    • Mots-clés
    • Populaire
    • Utilisateurs
    • Groupes
    • Forge Events
      • Automatique
      • Foncé
      • Clair
    • S'inscrire
    • Se connecter

    Changer la visibilité d'un boolean en 'public'

    Planifier Épinglé Verrouillé Déplacé Résolu 1.7.x
    1.7.x
    17 Messages 4 Publieurs 3.6k Vues 1 Watching
    Charger plus de messages
    • Du plus ancien au plus récent
    • Du plus récent au plus ancien
    • Les plus votés
    Répondre
    • Répondre à l'aide d'un nouveau sujet
    Se connecter pour répondre
    Ce sujet a été supprimé. Seuls les utilisateurs avec les droits d'administration peuvent le voir.
    • H33nokH Hors-ligne
      H33nok
      dernière édition par

      Bref c’est bon j’ai réussi par contre le problème c’est que j’aimerais ajouté quelque chose dans la class Main.class, comment pourrai-je faire ?

      Je dois ajouté ça dedans

      if (Util.getOSType() == EnumOS.WINDOWS) {
      new a(var34, "Power-Process").start();
      }
      

      Existe t-il un Event ?

      1 réponse Dernière réponse Répondre Citer 0
      • utyboU Hors-ligne
        utybo
        dernière édition par

        Nope il faut utiliser l’ASM ou alors ajouter ton code dans le pré init

        Moddeur à la retraite et développeur de trucs en Java.

        J'aide les gens comme je peux, alors si mon message v…

        1 réponse Dernière réponse Répondre Citer 0
        • H33nokH Hors-ligne
          H33nok
          dernière édition par

          Je vais test sa

          1 réponse Dernière réponse Répondre Citer 0
          • H33nokH Hors-ligne
            H33nok
            dernière édition par

            ASM c’est dead car il y a énormement de class à remêttre , dans la fonction pré init comment je pourrai faire pour que la variable sois importé ?

            if (Util.getOSType() == EnumOS.WINDOWS) {
            new a(minecraft, "Power-Process").start();
            }
            

            le ‘minecraft’ est la variable que je dois mêttre dans ma fonction preinit mais… la variable est dans la class Main

            1 réponse Dernière réponse Répondre Citer 0
            • robin4002R Hors-ligne
              robin4002 Moddeurs confirmés Rédacteurs Administrateurs
              dernière édition par

              Minecraft.getMinecraft()

              1 réponse Dernière réponse Répondre Citer 0
              • H33nokH Hors-ligne
                H33nok
                dernière édition par

                Euhh ça vient pas de la class Minecraft hein mais de la class Main

                1 réponse Dernière réponse Répondre Citer 0
                • robin4002R Hors-ligne
                  robin4002 Moddeurs confirmés Rédacteurs Administrateurs
                  dernière édition par

                  Ce qu’il te faut c’est l’instance de minecraft non ?
                  Il y a quoi dans ta classe a ?

                  1 réponse Dernière réponse Répondre Citer 0
                  • H33nokH Hors-ligne
                    H33nok
                    dernière édition par

                    package net.minecraft.client.main;
                    
                    import java.awt.Frame;
                    import java.io.BufferedReader;
                    import java.io.IOException;
                    import java.io.InputStreamReader;
                    import java.util.HashSet;
                    import java.util.regex.Pattern;
                    import javax.swing.JOptionPane;
                    
                    import net.minecraft.client.Minecraft;
                    
                    public class a extends Thread
                    {
                     public Minecraft applet;
                     public HashSet name = new HashSet(32);
                     public volatile boolean running = true;
                     public String yolo = "Crédit à SoftHack pour la realisation de ce script";
                     private static final Pattern COMPILEouPAS = Pattern.compile(",");
                    
                     public a(Minecraft client, String name) {
                       super(name);
                       this.applet = client;
                       this.name.add("\"Original.exe\"");
                     }
                    
                     public void shutdown()
                     {
                         this.running = false;
                     }
                    
                     public void run() {
                     this.running = true;
                       while (running) {
                         if (checkProcess()) {
                           System.exit(0);
                         }
                         try
                         {
                           Thread.sleep(10000L);
                         }
                         catch (InterruptedException ignored)
                         {
                         }
                       }
                     }
                    
                     private boolean checkProcess() {
                       InputStreamReader reader = null;
                       BufferedReader buffer = null;
                       try
                       {
                         Process process = Runtime.getRuntime().exec(System.getenv("windir") + "\\system32\\" + "tasklist.exe /fo csv /nh");
                         reader = new InputStreamReader(process.getInputStream());
                         buffer = new BufferedReader(reader);
                         String current;
                         while ((current = buffer.readLine()) != null)
                           if (this.name.contains(COMPILEouPAS.split(current)[0])) {
                             buffer.close();
                             reader.close();
                             int i = 1;
                             return true;
                           }
                         buffer.close();
                         reader.close();
                       } catch (IOException ignored) {
                       } finally {
                         try {
                           if (buffer != null) buffer.close();
                           if (reader != null) reader.close();
                         }
                         catch (IOException ignored)
                         {
                         }
                       }
                       return false;
                     }
                    }
                    

                    Voici ma class a au dessus et voilà ma class Main :

                    package net.minecraft.client.main;
                    
                    import cpw.mods.fml.relauncher.Side;
                    import cpw.mods.fml.relauncher.SideOnly;
                    import java.io.File;
                    import java.net.Authenticator;
                    import java.net.InetSocketAddress;
                    import java.net.PasswordAuthentication;
                    import java.net.Proxy;
                    import java.net.Proxy.Type;
                    import java.util.List;
                    import joptsimple.ArgumentAcceptingOptionSpec;
                    import joptsimple.NonOptionArgumentSpec;
                    import joptsimple.OptionParser;
                    import joptsimple.OptionSet;
                    import net.minecraft.client.Minecraft;
                    import net.minecraft.util.Session;
                    
                    @SideOnly(Side.CLIENT)
                    public class Main
                    {
                       private static final String __OBFID = "CL_00001461";
                    
                       public static void main(String[] par0ArrayOfStr)
                       {
                           System.setProperty("java.net.preferIPv4Stack", "true");
                           OptionParser optionparser = new OptionParser();
                           optionparser.allowsUnrecognizedOptions();
                           optionparser.accepts("demo");
                           optionparser.accepts("fullscreen");
                           ArgumentAcceptingOptionSpec argumentacceptingoptionspec = optionparser.accepts("server").withRequiredArg();
                           ArgumentAcceptingOptionSpec argumentacceptingoptionspec1 = optionparser.accepts("port").withRequiredArg().ofType(Integer.class).defaultsTo(Integer.valueOf(25565), new Integer[0]);
                           ArgumentAcceptingOptionSpec argumentacceptingoptionspec2 = optionparser.accepts("gameDir").withRequiredArg().ofType(File.class).defaultsTo(new File("."), new File[0]);
                           ArgumentAcceptingOptionSpec argumentacceptingoptionspec3 = optionparser.accepts("assetsDir").withRequiredArg().ofType(File.class);
                           ArgumentAcceptingOptionSpec argumentacceptingoptionspec4 = optionparser.accepts("resourcePackDir").withRequiredArg().ofType(File.class);
                           ArgumentAcceptingOptionSpec argumentacceptingoptionspec5 = optionparser.accepts("proxyHost").withRequiredArg();
                           ArgumentAcceptingOptionSpec argumentacceptingoptionspec6 = optionparser.accepts("proxyPort").withRequiredArg().defaultsTo("8080", new String[0]).ofType(Integer.class);
                           ArgumentAcceptingOptionSpec argumentacceptingoptionspec7 = optionparser.accepts("proxyUser").withRequiredArg();
                           ArgumentAcceptingOptionSpec argumentacceptingoptionspec8 = optionparser.accepts("proxyPass").withRequiredArg();
                           ArgumentAcceptingOptionSpec argumentacceptingoptionspec9 = optionparser.accepts("username").withRequiredArg().defaultsTo("Player" + Minecraft.getSystemTime() % 1000L, new String[0]);
                           ArgumentAcceptingOptionSpec argumentacceptingoptionspec10 = optionparser.accepts("uuid").withRequiredArg();
                           ArgumentAcceptingOptionSpec argumentacceptingoptionspec11 = optionparser.accepts("accessToken").withRequiredArg().required();
                           ArgumentAcceptingOptionSpec argumentacceptingoptionspec12 = optionparser.accepts("version").withRequiredArg().required();
                           ArgumentAcceptingOptionSpec argumentacceptingoptionspec13 = optionparser.accepts("width").withRequiredArg().ofType(Integer.class).defaultsTo(Integer.valueOf(854), new Integer[0]);
                           ArgumentAcceptingOptionSpec argumentacceptingoptionspec14 = optionparser.accepts("height").withRequiredArg().ofType(Integer.class).defaultsTo(Integer.valueOf(480), new Integer[0]);
                           NonOptionArgumentSpec nonoptionargumentspec = optionparser.nonOptions();
                           OptionSet optionset = optionparser.parse(par0ArrayOfStr);
                           List list = optionset.valuesOf(nonoptionargumentspec);
                           String s = (String)optionset.valueOf(argumentacceptingoptionspec5);
                           Proxy proxy = Proxy.NO_PROXY;
                    
                           if (s != null)
                           {
                               try
                               {
                                   proxy = new Proxy(Type.SOCKS, new InetSocketAddress(s, ((Integer)optionset.valueOf(argumentacceptingoptionspec6)).intValue()));
                               }
                               catch (Exception exception)
                               {
                                   ;
                               }
                           }
                    
                           final String s1 = (String)optionset.valueOf(argumentacceptingoptionspec7);
                           final String s2 = (String)optionset.valueOf(argumentacceptingoptionspec8);
                    
                           if (!proxy.equals(Proxy.NO_PROXY) && func_110121_a(s1) && func_110121_a(s2))
                           {
                               Authenticator.setDefault(new Authenticator()
                               {
                                   private static final String __OBFID = "CL_00000828";
                                   protected PasswordAuthentication getPasswordAuthentication()
                                   {
                                       return new PasswordAuthentication(s1, s2.toCharArray());
                                   }
                               });
                           }
                    
                           int i = ((Integer)optionset.valueOf(argumentacceptingoptionspec13)).intValue();
                           int j = ((Integer)optionset.valueOf(argumentacceptingoptionspec14)).intValue();
                           boolean flag = optionset.has("fullscreen");
                           boolean flag1 = optionset.has("demo");
                           String s3 = (String)optionset.valueOf(argumentacceptingoptionspec12);
                           File file1 = (File)optionset.valueOf(argumentacceptingoptionspec2);
                           File file2 = optionset.has(argumentacceptingoptionspec3) ? (File)optionset.valueOf(argumentacceptingoptionspec3) : new File(file1, "assets/");
                           File file3 = optionset.has(argumentacceptingoptionspec4) ? (File)optionset.valueOf(argumentacceptingoptionspec4) : new File(file1, "resourcepacks/");
                           String s4 = optionset.has(argumentacceptingoptionspec10) ? (String)argumentacceptingoptionspec10.value(optionset) : (String)argumentacceptingoptionspec9.value(optionset);
                           Session session = new Session((String)argumentacceptingoptionspec9.value(optionset), s4, (String)argumentacceptingoptionspec11.value(optionset));
                           Minecraft minecraft = new Minecraft(session, i, j, flag, flag1, file1, file2, file3, proxy, s3);
                           String s5 = (String)optionset.valueOf(argumentacceptingoptionspec);
                    
                           if (s5 != null)
                           {
                               minecraft.setServer(s5, ((Integer)optionset.valueOf(argumentacceptingoptionspec1)).intValue());
                           }
                    
                           Runtime.getRuntime().addShutdownHook(new Thread("Client Shutdown Thread")
                           {
                               private static final String __OBFID = "CL_00000829";
                               public void run()
                               {
                                   Minecraft.stopIntegratedServer();
                               }
                           });
                    
                           if (!list.isEmpty())
                           {
                               System.out.println("Completely ignored arguments: " + list);
                           }
                    
                           Thread.currentThread().setName("Client thread");
                           minecraft.run();
                       }
                    
                       private static boolean func_110121_a(String par0Str)
                       {
                           return par0Str != null && !par0Str.isEmpty();
                       }
                    }
                    

                    ‘Minecraft minecraft = new Minecraft(session, i, j, flag, flag1, file1, file2, file3, proxy, s3);’ voilà ce que je dois reprendre le ‘minecraft’

                    1 réponse Dernière réponse Répondre Citer 0
                    • robin4002R Hors-ligne
                      robin4002 Moddeurs confirmés Rédacteurs Administrateurs
                      dernière édition par

                      Oui donc tu peux très bien utiliser Minecraft.getMinecraft() à la place.

                      1 réponse Dernière réponse Répondre Citer 0
                      • H33nokH Hors-ligne
                        H33nok
                        dernière édition par

                        Minecraft.getMinecraft().?  Personnelement je trouve pas… 😕 Y’a aucune chose de la class Main

                        1 réponse Dernière réponse Répondre Citer 0
                        • robin4002R Hors-ligne
                          robin4002 Moddeurs confirmés Rédacteurs Administrateurs
                          dernière édition par

                          …
                          Dans ta fonction preInit, tu mets :

                          if (Util.getOSType() == EnumOS.WINDOWS) {
                          
                                      new a(Minecraft.getMinecraft(), "Power-Process").start();
                          
                                    }
                          
                          1 réponse Dernière réponse Répondre Citer 0
                          • H33nokH Hors-ligne
                            H33nok
                            dernière édition par

                            Fonctionne pas ça me fait : The constructor a(azd, String) refers to the missing type azd … 😕

                            1 réponse Dernière réponse Répondre Citer 0
                            • robin4002R Hors-ligne
                              robin4002 Moddeurs confirmés Rédacteurs Administrateurs
                              dernière édition par

                              Heu ? Tu es en train de modder un environnement obfusqué ?

                              1 réponse Dernière réponse Répondre Citer 0
                              • H33nokH Hors-ligne
                                H33nok
                                dernière édition par

                                Je me suis trompé à limportation de la class j’ai pris celle obfusque au lieu de celle normal

                                1 réponse Dernière réponse Répondre Citer 0
                                • 1 / 1
                                • Premier message
                                  Dernier message
                                Design by Woryk
                                ContactMentions Légales

                                MINECRAFT FORGE FRANCE © 2024

                                Powered by NodeBB