Nouvelle table d'enchantement
-
private static final ResourceLocation field_147078_C = new ResourceLocation( "Arthania:textures/gui/container/enchanting_table.png");Le modid doit être en minuscules, ça doit être marqué dans les logs
-
rien a voir je veux dir que je n’ai pas de slot n’y rien pardon oublier de préciser
Avec texture : http://prntscr.com/aw6vmp
Meme l’inventaire est a la dèche -
Etrange, regarde si les fonctions addSlotToContainer sont appelées
-
Y’en a dans le container et le container est appler ici das le gui
public GuiEnchantment(InventoryPlayer inventory, World world, String p_i45502_3_) {
super(new ContainerEnchantment(inventory, world, 0,0,0));
this.field_175379_F = inventory;
this.field_147075_G = ((ContainerEnchantment) this.inventorySlots);
this.field_175380_I = p_i45502_3_;
} -
Oui mais rajoute “System.out.println(“quelque chose”)” lorsque tu ajoutes le slot pour voir si la fonction est bien appelée
-
[15:40:25] [Client thread/INFO] [STDOUT]: [fr.Mosca421.Arthania.EnchantementTable.ContainerEnchantment:<init>:76]: slot
[15:40:25] [Client thread/INFO] [STDOUT]: [fr.Mosca421.Arthania.EnchantementTable.ContainerEnchantment:<init>:76]: slot
[15:40:25] [Client thread/INFO] [STDOUT]: [fr.Mosca421.Arthania.EnchantementTable.ContainerEnchantment:<init>:76]: slot
[15:40:25] [Client thread/INFO] [STDOUT]: [fr.Mosca421.Arthania.EnchantementTable.ContainerEnchantment:<init>:76]: slot
[15:40:25] [Client thread/INFO] [STDOUT]: [fr.Mosca421.Arthania.EnchantementTable.GuiEnchantment:<init>:57]: GUI
Il y a encore des slots avantpublic GuiEnchantment(InventoryPlayer inventory, World world, String p_i45502_3_) {
super(new ContainerEnchantment(inventory, world, 0,0,0));
this.field_175379_F = inventory;
this.field_147075_G = ((ContainerEnchantment) this.inventorySlots);
this.field_175380_I = p_i45502_3_;
System.out.println(“GUI”);
}for (int var4 = 0; var4 < 3; var4++) {
for (int var5 = 0; var5 < 9; var5++) {
addSlotToContainer(new Slot(inventory, var5 + var4 * 9 + 9, 8 + var5 * 18, 84 + var4 * 18));
System.out.println(“slot”);
}
}</init></init></init></init></init> -
Ce qui est étrange c’est que le code n’est pas appelé côté serveur, rajoute un System.out.println dans la fonction getServerGuiElement pour voir si le code est appelé.
PS : pense à respecter la convention java.
PS 2 : il y a un GuiHandler par mod et non par block -
switch (ID)
{
case 0:
System.out.println(“pris”);
return new ContainerEnchantment(player.inventory, world, x, y, z);
}[15:52:14] [Server thread/INFO] [STDOUT]: [fr.Mosca421.Arthania.EnchantementTable.GuiHandlerTable:getServerGuiElement:14]: pris
[15:52:14] [Server thread/INFO] [STDOUT]: [fr.Mosca421.Arthania.EnchantementTable.ContainerEnchantment:<init>:76]: slot
Merci pour le GuiHandler
Convention je suis franglais xD</init> -
Aucune idée alors
PS : pour la convention, je parlais pas du franglais, parce que à la limite même si c’est pas de l’anglais correct c’est bon, mais il faut tout mettre en minuscule pour les noms de package
-
@‘SCAREX’:
Ce qui est étrange c’est que le code n’est pas appelé côté serveur, rajoute un System.out.println dans la fonction getServerGuiElement pour voir si le code est appelé.
PS : pense à respecter la convention java.
PS 2 : il y a un GuiHandler par mod et non par blockJe pense que si, il a dit dans son message “Il y a encore des slots avant”, c’est un autre problème… Mais comme je te l’ai dis en mp, essaye de faire un gui tout simple, sans système d’enchant avec juste l’inventaire du joueur, après rajoutes-y tes 2 slots puis le système d’enchant complet.