Bon,
Après avoir regarder encore de plus près le soucis vient de la fonction draw (du moins je crois).
J’ai ajouter un debug dans la fonction draw, elle ne s’affiche pas dans les logs.
Dans les logs du client j’ai ça:
[19:03:42] [Client thread/INFO] [FML/]: [Client thread] Client side modded connection established
[19:03:42] [Client thread/DEBUG] [FML/]: Overriding dimension: using 0
[19:04:30] [Client thread/INFO] [STDOUT/]: [com.DeathDelay.net.Gui.Mort:func_73866_w_:49]: initgui
[19:04:30] [Client thread/INFO] [STDOUT/]: [com.DeathDelay.net.packet.PacketGui$Handler:onMessage:38]: Packet client
[19:05:46] [Client thread/DEBUG] [FML/]: Reverting to frozen data state.
[19:05:46] [Client thread/INFO] [FML/]: Applying holder lookups
[19:05:46] [Client thread/INFO] [FML/]: Holder lookups applied
Log Serveur:
[19:04:30] [Server thread/INFO] [/]: Packet serveur
[19:04:30] [Server thread/INFO] [/]: Event onDeath
[19:04:30] [Server thread/INFO] [/]: boolean: true
Classe de mon gui:
| package com.DeathDelay.net.Gui; |
| |
| import com.DeathDelay.net.Main; |
| import com.DeathDelay.net.packet.PacketGui; |
| import com.DeathDelay.net.packet.PacketMedecin; |
| |
| import cpw.mods.fml.relauncher.Side; |
| import cpw.mods.fml.relauncher.SideOnly; |
| import net.minecraft.client.Minecraft; |
| import net.minecraft.client.gui.GuiButton; |
| import net.minecraft.client.gui.GuiScreen; |
| import net.minecraft.entity.Entity; |
| import net.minecraft.entity.player.EntityPlayer; |
| import net.minecraft.server.MinecraftServer; |
| import net.minecraft.util.ChatComponentText; |
| import net.minecraft.util.ResourceLocation; |
| |
| public class Mort extends GuiScreen { |
| |
| private ResourceLocation ressource = new ResourceLocation("dd:textures/gui/death.png"); |
| |
| private int medecin; |
| |
| private int spawn; |
| |
| public static int timer = 10000; |
| |
| int guiWidth = 256; |
| |
| int guiHeight = 256; |
| |
| public Mort() { |
| |
| } |
| |
| @Override |
| public void initGui() { |
| |
| int guiX = (this.width - guiWidth) / 2; |
| |
| int guiY = (this.height - guiHeight) / 2; |
| |
| medecin = 0; |
| |
| spawn = 1; |
| |
| System.out.println("initgui"); |
| |
| buttonList.clear(); |
| |
| buttonList.add(new GuiButton(medecin, guiX + 170, guiY + 226 + 5, 58, 20, "§aAppeller un médecin")); |
| |
| buttonList.add(new GuiButton(spawn, guiX + 80, guiY, 120, 20, "§5Respawn possible dans")); |
| |
| super.initGui(); |
| } |
| |
| @Override |
| protected void keyTyped(char typedChar, int keyCode) { |
| |
| } |
| |
| @Override |
| protected void actionPerformed(GuiButton button) { |
| |
| switch(button.id) { |
| case 0: |
| Main.network.sendToServer(new PacketMedecin()); |
| break; |
| case 1: |
| if(timer > 0) |
| { |
| EntityPlayer player1 = Minecraft.getMinecraft().thePlayer; |
| ChatComponentText text1 = new ChatComponentText("§7Vous ne pouvez pas respawn ! il vous reste: " + timer / 20 + " §7secondes"); |
| player1.addChatComponentMessage(text1); |
| timer –; |
| } |
| else |
| { |
| Minecraft.getMinecraft().thePlayer.closeScreen(); |
| EntityPlayer player1 = Minecraft.getMinecraft().thePlayer; |
| player1.setDead(); |
| |
| } |
| break; |
| default: |
| break; |
| } |
| |
| super.actionPerformed(button); |
| } |
| |
| public void updateScreen() { |
| super.updateScreen(); |
| } |
| |
| public void drawScreen(int mouseX, int mouseY, float partialTick) |
| |
| { |
| |
| System.out.println("drawsceen"); |
| |
| String tilename = "§5 : " + timer-- / 20; |
| |
| mc.getTextureManager().bindTexture(ressource); |
| |
| this.drawTexturedModalRect(this.width / 2 - 135, this.height / 2 - 127, 0, 0, 256, 255); |
| if(timer > 0) |
| { |
| this.fontRendererObj.drawString(tilename, this.width / 2 + 95 - this.fontRendererObj.getStringWidth(tilename) / 2, 1, 0); |
| } |
| super.drawScreen(mouseX, mouseY, partialTick); |
| } |
| |
| public static void settimer(int newtimer) |
| { |
| timer = newtimer; |
| } |
| |
| public void onGuiClosed() { |
| |
| } |
| |
| } |
| |
| ```Mais la question que je me pose c'est si y'aurais un soucis dans la fonction drawscreen j'aurais quand même une fenêtre ouverte non ? une fenêtre transparente ? |
| Je sais pas d'ou le problème vient c'est plutôt chiant SCAREX me dis que ça marche chez lui perso moi ça marche je sais pas pourquoi.. |
| Si quelqu'un d'autre peut essayer de son côté voir parce que c'est bizarre.. |