Tutoriel [Guide] [MAJ 12/07/14]Créer un launcher pour 1.6.2/1.6.4 avec mods

Statut
N'est pas ouverte pour d'autres réponses.

BlackGB

Aventurier
19 Mai 2014
30
0
1
73
Enfin une dernier petite modif qui pourrait etre apporté au sujet du :
J'ai fait une modification ndans le launcher et a chaquelancement du jeu mon launcher est re-telecharger !

Verifier votre fichier MD5.TXT

Voici une modif du launcher permetant de voir le MD5 de votre launcher Actuel afin de mettre a jour votre MD5.txt:


Rendez-vous dans la class : Launcher (net.minecraft.launcher.Launcher)

au dessus de la methode (constructor) : public Launcher(final JFrame frame, final File workingDirectory, final Proxy proxy, final PasswordAuthentication proxyAuth, final String[] args, final Integer bootstrapVersion)

definir la methode :

public String getMd5(final File file) {
DigestInputStream stream = null;
try {
stream = new DigestInputStream(new FileInputStream(file), MessageDigest.getInstance("MD5"));
final byte[] buffer = new byte[65536];

int read = stream.read(buffer);
while(read >= 1)
read = stream.read(buffer);
}
catch(final Exception ignored) {
return "";
}
finally {
if( stream != null)
{
try {
stream.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}

return String.format("%1$032x", new Object[] { new BigInteger(1, stream.getMessageDigest().digest()) });
}


Puis modifier :


refreshVersionsAndProfiles();

println("Launcher " + LauncherConstants.VERSION_NAME + " (through bootstrap " + bootstrapVersion + ") started on " + OperatingSystem.getCurrentPlatform().getName() + "...");
println("Current time is " + DateFormat.getDateTimeInstance(2, 2, Locale.US).format(new Date()));

if(!OperatingSystem.getCurrentPlatform().isSupported())
println("This operating system is unknown or unsupported, we cannot guarantee that the game will launch.");
println("System.getProperty('os.name') == '" + System.getProperty("os.name") + "'");
println("System.getProperty('os.version') == '" + System.getProperty("os.version") + "'");
println("System.getProperty('os.arch') == '" + System.getProperty("os.arch") + "'");
println("System.getProperty('java.version') == '" + System.getProperty("java.version") + "'");
println("System.getProperty('java.vendor') == '" + System.getProperty("java.vendor") + "'");
println("System.getProperty('sun.arch.data.model') == '" + System.getProperty("sun.arch.data.model") + "'");


par


refreshVersionsAndProfiles();

// MODIF CEDRIC 2
final File launcherJar = new File( workingDirectory, "launcher.jar" );
final String launcherMD5 = getMd5(launcherJar);
// FIN MODIF CEDRIC 2

println("Launcher " + LauncherConstants.VERSION_NAME + " (through bootstrap " + bootstrapVersion + ") started on " + OperatingSystem.getCurrentPlatform().getName() + "...");
println("Current time is " + DateFormat.getDateTimeInstance(2, 2, Locale.US).format(new Date()));

if(!OperatingSystem.getCurrentPlatform().isSupported())
println("This operating system is unknown or unsupported, we cannot guarantee that the game will launch.");
println("System.getProperty('os.name') == '" + System.getProperty("os.name") + "'");
println("System.getProperty('os.version') == '" + System.getProperty("os.version") + "'");
println("System.getProperty('os.arch') == '" + System.getProperty("os.arch") + "'");
println("System.getProperty('java.version') == '" + System.getProperty("java.version") + "'");
println("System.getProperty('java.vendor') == '" + System.getProperty("java.vendor") + "'");
println("System.getProperty('sun.arch.data.model') == '" + System.getProperty("sun.arch.data.model") + "'");
println("Launcher MD5 == '" + launcherMD5 + "'"); // MODIF CEDRIC 2


ainsi lors le lancement du jeu vous devriez voir apparaitre :

Refreshing local version list...
Launcher 1.0 (through bootstrap 5) started on windows...
Current time is May 30, 2014 2:00:57 PM
System.getProperty('os.name') == 'Windows 7'
System.getProperty('os.version') == '6.1'
System.getProperty('os.arch') == 'amd64'
System.getProperty('java.version') == '1.7.0_15'
System.getProperty('java.vendor') == 'Oracle Corporation'
System.getProperty('sun.arch.data.model') == '64'
Launcher MD5 == 'dd44b8e8e51c7f7ff4a1a3496f333c1d'
 

nathklan

Aventurier
9 Mars 2013
2
0
1
34
Bonjour.
Merci de ce tuto pour le luncher mais j'ai un probleme dans mon luncher ca m'affiche ca:
(j'ai la verssion 1.7.2)
Bootstrap (v5)
Current time is May 30, 2014 4:36:40 PM
System.getProperty('os.name') == 'Windows 8.1'
System.getProperty('os.version') == '6.3'
System.getProperty('os.arch') == 'x86'
System.getProperty('java.version') == '1.7.0_55'
System.getProperty('java.vendor') == 'Oracle Corporation'
System.getProperty('sun.arch.data.model') == '32'

Looking for update
Downloading: (le lien que j'ai mis)
Got reply in: 0ms
Found update in time, waiting to download
Downloaded 1316,3kb in 11s at 119,3kb/s
Renaming C:\Users\NATHAN\AppData\Roaming\.essencraft\launcher.jar.new to C:\Users\NATHAN\AppData\Roaming\.essencraft\launcher.jar
Unable to rename - could be on another filesystem, trying copy & delete.
Copy & delete succeeded.
Starting launcher.
FATAL ERROR: net.minecraft.bootstrap.FatalBootstrapError: Unable to start: java.lang.reflect.InvocationTargetException
at net.minecraft.bootstrap.Bootstrap.startLauncher(Bootstrap.java:368)
at net.minecraft.bootstrap.Bootstrap.execute(Bootstrap.java:271)
at net.minecraft.bootstrap.Bootstrap.main(Bootstrap.java:144)


Please fix the error and restart.


J'ai deja essayer de remplacer la ligne
versionText.setText("Prêt pour jouer à "+LauncherConstants.SERVER_NAME + version.getLatestVersion().getId());
Par
versionText.setText("Prêt pour jouer à TonServeur");
mais ca n'a pas marcher.
Merci de vos reponsses.
 

BlackGB

Aventurier
19 Mai 2014
30
0
1
73
Bonjour.
Merci de ce tuto pour le luncher mais j'ai un probleme dans mon luncher ca m'affiche ca:
(j'ai la verssion 1.7.2)
Bootstrap (v5)
Current time is May 30, 2014 4:36:40 PM
System.getProperty('os.name') == 'Windows 8.1'
System.getProperty('os.version') == '6.3'
System.getProperty('os.arch') == 'x86'
System.getProperty('java.version') == '1.7.0_55'
System.getProperty('java.vendor') == 'Oracle Corporation'
System.getProperty('sun.arch.data.model') == '32'

Looking for update
Downloading: (le lien que j'ai mis)
Got reply in: 0ms
Found update in time, waiting to download
Downloaded 1316,3kb in 11s at 119,3kb/s
Renaming C:\Users\NATHAN\AppData\Roaming\.essencraft\launcher.jar.new to C:\Users\NATHAN\AppData\Roaming\.essencraft\launcher.jar
Unable to rename - could be on another filesystem, trying copy & delete.
Copy & delete succeeded.
Starting launcher.
FATAL ERROR: net.minecraft.bootstrap.FatalBootstrapError: Unable to start: java.lang.reflect.InvocationTargetException
at net.minecraft.bootstrap.Bootstrap.startLauncher(Bootstrap.java:368)
at net.minecraft.bootstrap.Bootstrap.execute(Bootstrap.java:271)
at net.minecraft.bootstrap.Bootstrap.main(Bootstrap.java:144)


Please fix the error and restart.


J'ai deja essayer de remplacer la ligne
versionText.setText("Prêt pour jouer à "+LauncherConstants.SERVER_NAME + version.getLatestVersion().getId());
Par
versionText.setText("Prêt pour jouer à TonServeur");
mais ca n'a pas marcher.
Merci de vos reponsses.


Salut, j'ai pas Windows 8.1 donc je peux pas tester mais deja je vois que t'as java 32 bit : passe a l'occase en 64bits mais ca n'a probablement rien a voir.

Apres tu plantes dans la class Bootstrap dans la methode startLauncher en ligne 368

t'as quoi a cette ligne car j'ai pas le meme bootstrap que toi ?


Sinon je penses peut etre a un probleme de compilation du bootstrap ou t'aurais pas mis les memes options de compilation que pour le launcher genre : compiler le launcher en java 1.7 et le laucnher en 1.6 ...

Pour les 2 projet vas dans les Propriété et dans Java Compileur

decoches Use compliance from ....

et coche

use default compliance setttings

et mets toi en 1.5

Ca permettra peut etre de corriger ton probleme enfin tiens moi au courant

Pour infos mon bootstrap fonctionne en win8 chez un minecraftien de mon serveur alors ca doit marcher pour toi ;)
 

nathklan

Aventurier
9 Mars 2013
2
0
1
34
Salut, j'ai pas Windows 8.1 donc je peux pas tester mais deja je vois que t'as java 32 bit : passe a l'occase en 64bits mais ca n'a probablement rien a voir.

Apres tu plantes dans la class Bootstrap dans la methode startLauncher en ligne 368

t'as quoi a cette ligne car j'ai pas le meme bootstrap que toi ?


Sinon je penses peut etre a un probleme de compilation du bootstrap ou t'aurais pas mis les memes options de compilation que pour le launcher genre : compiler le launcher en java 1.7 et le laucnher en 1.6 ...

Pour les 2 projet vas dans les Propriété et dans Java Compileur

decoches Use compliance from ....

et coche

use default compliance setttings

et mets toi en 1.5

Ca permettra peut etre de corriger ton probleme enfin tiens moi au courant

Pour infos mon bootstrap fonctionne en win8 chez un minecraftien de mon serveur alors ca doit marcher pour toi ;)

Bonjour,
Merci de votre reponsse j'ai fait comme vous avez dis mais cela me donne toujour le meme message.
Apres dans mon Bootstrap.java a la ligne 368 j'ai :
throw new FatalBootstrapError(new StringBuilder().append("Unable to start: ").append(e).toString());.

Apres si vous pensser que c'est du a moi et pas au config du luncher je peut l'envoyer a un amis a moi pour qu'il test chez lui.
 

Cyberium

Fondateur de Realitycraft-reborn.fr
14 Septembre 2011
149
3
125
Salut, j'ai pas Windows 8.1 donc je peux pas tester mais deja je vois que t'as java 32 bit : passe a l'occase en 64bits mais ca n'a probablement rien a voir.

Bonjour,

Merci pour ton travail, c'est sympathique ! :)
Par contre, ça ne fonctionne pas chez moi et j'ai du mal à comprendre pourquoi...

Code:
Couldn't get complete version info for PartialVersion{id='1.6.2-custom', updateTime=Mon Sep 16 06:04:53 CEST 2013, releaseTime=Fri Jan 01 08:00:00 CET 1960, type=RELEASE}
java.io.IOException: Couldn't load local assets 1.6.2
    at net.minecraft.launcher.updater.VersionList.getCompleteVersion(VersionList.java:114)
    at net.minecraft.launcher.updater.VersionManager.getLatestCompleteVersion(VersionManager.java:94)
    at net.minecraft.launcher.GameLauncher.playGame(GameLauncher.java:542)
    at net.minecraft.launcher.ui.bottombar.PlayButtonPanel$1$1.run(PlayButtonPanel.java:34)
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1
    at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:176)
    at com.google.gson.Gson.fromJson(Gson.java:803)
    at com.google.gson.Gson.fromJson(Gson.java:768)
    at com.google.gson.Gson.fromJson(Gson.java:717)
    at com.google.gson.Gson.fromJson(Gson.java:689)
    at net.minecraft.launcher.updater.VersionList.getCompleteVersion(VersionList.java:106)
    ... 8 more
Caused by: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1
    at com.google.gson.stream.JsonReader.beginObject(JsonReader.java:374)
    at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:165)
    ... 13 more
Si tu sais d'où cela peut bien venir, je t'en remercie d'avance de me tenir au courant :)
 

Hardstylerz59

Bucheron
1 Juin 2014
2
0
11
28
Bonsoir à tous,

J'ai un petit soucis avec le launcher que j'ai fais pour mon serveur (version 1.7.2 Forge). A l'ouverture du launcher tout se passe bien, il télécharge les ressources, les librairies etc. Mais lorsqu'il a tout finit de télécharger et que j'appuie sur Play, il me dit : "Client> Erreur : impossible de trouver ou charger la classe principale net.minecraft.client.main.Main"
Sauf que j'ai aucune idée de pourquoi elle manque .. Si vous pourriez m'éclairer.

Hard
 

BlackGB

Aventurier
19 Mai 2014
30
0
1
73
C'est ton version.json qui n'est pas bon car ce n'est pas le nom de la class principal de la version forge. pour info si tu la pris toute faite sur le tuto je crois que le .json est celui de la 1.7.2 et non de la 1.7.2 forges

Régénéres ta version 1.7.2 forge : (Voir qq pages avant ... 80 je crois)
 

BlackGB

Aventurier
19 Mai 2014
30
0
1
73
Bonjour,

Merci pour ton travail, c'est sympathique ! :)
Par contre, ça ne fonctionne pas chez moi et j'ai du mal à comprendre pourquoi...

Code:
Couldn't get complete version info for PartialVersion{id='1.6.2-custom', updateTime=Mon Sep 16 06:04:53 CEST 2013, releaseTime=Fri Jan 01 08:00:00 CET 1960, type=RELEASE}
java.io.IOException: Couldn't load local assets 1.6.2
    at net.minecraft.launcher.updater.VersionList.getCompleteVersion(VersionList.java:114)
    at net.minecraft.launcher.updater.VersionManager.getLatestCompleteVersion(VersionManager.java:94)
    at net.minecraft.launcher.GameLauncher.playGame(GameLauncher.java:542)
    at net.minecraft.launcher.ui.bottombar.PlayButtonPanel$1$1.run(PlayButtonPanel.java:34)
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1
    at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:176)
    at com.google.gson.Gson.fromJson(Gson.java:803)
    at com.google.gson.Gson.fromJson(Gson.java:768)
    at com.google.gson.Gson.fromJson(Gson.java:717)
    at com.google.gson.Gson.fromJson(Gson.java:689)
    at net.minecraft.launcher.updater.VersionList.getCompleteVersion(VersionList.java:106)
    ... 8 more
Caused by: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1
    at com.google.gson.stream.JsonReader.beginObject(JsonReader.java:374)
    at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:165)
    ... 13 more
Si tu sais d'où cela peut bien venir, je t'en remercie d'avance de me tenir au courant :)

Oui c'est ton fichier %appdata%\.minecraft\assets\indexes\1.6.2.json qui est pourri

(il serait intéressant que tu le sauvegarde et que tu compares apres avoir fait les modifs suivantes pour nous dire qu'elle était le problème, ou comment tu en es arriveé la)

Donc : efface le et efface aussi le dossier %appdata%\.minecraft\versions\1.6.2-custom

ou plutot effaces juste %appdata%\.minecraft\versions\1.6.2-custom je penses que ca va le regenéré (tiens nous au courant)

Et oui ya des bugs des fois alors tant que t'as pas finalisé ta version (que tu fais des essais), en cas de problème n'hesites pas a effacer le répertoire versions\xxxx

Penses a faire le report des 3 modifs que j'indique plus haut qui corrige notamment le probleme de lancement qd le jeu etait deja installé avec le launcher officiel (liste des version vide du a un manque du version_mod.json)
 
Statut
N'est pas ouverte pour d'autres réponses.