Un GUI basique
-
Voila, et les classes ContainerTuto et GuiTuto maintenant ? Je mets quoi dedans ?
-
Regarde le code du livre. Pour le bouton, il faudra faire que lorsque tu clic, ça ouvre un autre gui au joueur (l’id 2 ducoup).
-
Dans la console, il m’affiche
2014-02-18 17:57:44 [Avertissement] [ForgeModLoader] A mod tried to open a gui on the server without being a NetworkMod 2014-02-18 17:57:44 [Avertissement] [ForgeModLoader] A mod tried to open a gui on the server without being a NetworkMod 2014-02-18 17:57:45 [Avertissement] [ForgeModLoader] A mod tried to open a gui on the server without being a NetworkMod 2014-02-18 17:57:45 [Avertissement] [ForgeModLoader] A mod tried to open a gui on the server without being a NetworkModDès que j’appuie sur P ?
-
@NetworkMod(clientSideRequired = true, serverSideRequired = false) à mettre dans la classe principale en dessus de @Mod.
-
Il y est déjà
-
Ton gui handler est enregistré dans ta classe principale ?
NetworkRegistry.instance().registerGuiHandler(new TonGuiHandler()); (ou quelque chose comme ça, je ne connais pas par cœur la méthode) -
Toujours aucun changements.
-
Tu as le
@Instance(“modid”)
public NomDelaClasse instance; dans ta classe principale ? -
ça ?
@Mod(modid = "MGS", name = "Metal gear cubid", version = "1.1.0") -
Non, envoie toute ta classe principale (sur un paste bin si elle est longue).
-
-
NetworkRegistry.instance().registerGuiHandler(new GuiHandler(), null);
Remplace null par this.INSTANCEEt remplace :
public static Main INSTANCE;
par :
@Instance(“MGS”)
public static Main INSTANCE; -
Il me donne une erreur a @Instance(“MGS”) et a registerGuiHandler :
The method registerGuiHandler(Object, IGuiHandler) in the type NetworkRegistry is not applicable for the arguments (GuiHandler, Main) -
Pour le @Instance, importe cpw.mod.fml.common.Mod.Instance
Pour NetworkRegistry, inverse :
NetworkRegistry.instance().registerGuiHandler(this.INSTANCE, new GuiHandler()); -

CA MARCHE !
Plus qu’a faire les détails. Merci. -
j’ai un crash, voici les log: http://pastebin.com/20UhCpqY
-
Merci de créer une nouvelle discussion plutôt que de up les anciennes.
Tu as un problème avec tes proxy, mets le code de ta classe principale dans la nouvelle discussion.