MFF

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

    Bug NBTTag pour Item avec craft

    Planifier Épinglé Verrouillé Déplacé Sans suite
    1.7.10
    42 Messages 3 Publieurs 10.1k 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.
    • DeletedD Hors-ligne
      Deleted
      dernière édition par

      Ma méthode proposée et la tienne sont équivalentes
      C’est bon tout marche à merveille !

      EDIT :

      Bon je suis de retour (jamais 2 sans 3) mais vraiment je ne penser pas en avori besoin. J’ai crée une méthode pour afficher une image elle marche très bien dans l’event ItemToolTip mais dans la méthode matches (), elle ne veut rien savoir 
      Mon code

      
      @Override
      public boolean matches(InventoryCrafting craftingTable, World world) 
      {
      
      for (int k1 = 0; k1 < craftingTable.getSizeInventory(); ++k1)
      {
      if(itemImproved.isImprovableInClouMode())
      {
      if(craftingTable.getStackInSlot(1) != null && craftingTable.getStackInSlot(3) != null && craftingTable.getStackInSlot(4) != null && craftingTable.getStackInSlot(5) != null && craftingTable.getStackInSlot(7) != null)
      {
      ItemStack itemstack = craftingTable.getStackInSlot(4);
      if(itemstack.stackTagCompound != null)
      {
      System.out.println("stackTagCompound non null");
      }
      else
      {
      System.out.println("stackTagCompound null");
      }
      if(craftingTable.getStackInSlot(1).getItem() == ItemHandler.boiteClous && craftingTable.getStackInSlot(3).getItem() == ItemHandler.boiteClous && craftingTable.getStackInSlot(5).getItem() == ItemHandler.boiteClous && craftingTable.getStackInSlot(7).getItem() == ItemHandler.boiteClous && craftingTable.getStackInSlot(4).getItem() == itemImproved && itemstack.stackTagCompound == null)
      {
      statut = 1;
      return true;
      }
      else if(craftingTable.getStackInSlot(1).getItem() == ItemHandler.boiteClous && craftingTable.getStackInSlot(3).getItem() == ItemHandler.boiteClous && craftingTable.getStackInSlot(5).getItem() == ItemHandler.boiteClous && craftingTable.getStackInSlot(7).getItem() == ItemHandler.boiteClous && craftingTable.getStackInSlot(4).getItem() == itemImproved && itemstack.stackTagCompound != null)
      {
      drawCraftPicture(30, 16, 0, 0,157, 121, new ResourceLocation("dyingcraftmod", "textures/gui/improvements/errorsMessages.png"));
      }
      }
      }
      if(itemImproved.isImprovableInPoisonMode())
      {
      if(craftingTable.getStackInSlot(1) != null && craftingTable.getStackInSlot(3) != null && craftingTable.getStackInSlot(4) != null && craftingTable.getStackInSlot(5) != null && craftingTable.getStackInSlot(7) != null)
      {
      ItemStack itemstack = craftingTable.getStackInSlot(4);
      if(craftingTable.getStackInSlot(1).getItem() == ItemHandler.fiolePoison && craftingTable.getStackInSlot(3).getItem() == ItemHandler.fiolePoison && craftingTable.getStackInSlot(5).getItem() == ItemHandler.fiolePoison && craftingTable.getStackInSlot(7).getItem() == ItemHandler.fiolePoison && craftingTable.getStackInSlot(4).getItem() == itemImproved && itemstack.stackTagCompound == null)
      {
      statut = 2;
      return true;
      }
      else if(craftingTable.getStackInSlot(1).getItem() == ItemHandler.fiolePoison && craftingTable.getStackInSlot(3).getItem() == ItemHandler.fiolePoison && craftingTable.getStackInSlot(5).getItem() == ItemHandler.fiolePoison && craftingTable.getStackInSlot(7).getItem() == ItemHandler.fiolePoison && craftingTable.getStackInSlot(4).getItem() == itemImproved && itemstack.stackTagCompound != null)
      {
      drawCraftPicture(30, 16, 0, 0, 157, 121, new ResourceLocation("dyingcraftmod", "textures/gui/improvements/errorsMessages.png"));
      }
      }
      }
      }
      return false;
      }
      
      public void drawCraftPicture(int posX, int posY, int u, int v, int width, int heigth, ResourceLocation craftTextureFile) 
      {
      GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
      GL11.glDisable(GL11.GL_LIGHTING);
      Minecraft.getMinecraft().getTextureManager().bindTexture(craftTextureFile);
      Minecraft.getMinecraft().currentScreen.drawTexturedModalRect(posX, posY, u, v, width, heigth);
      }
      

      Le crash report

      –-- Minecraft Crash Report ----
      // On the bright side, I bought you a teddy bear!
      
      Time: 02/07/15 14:57
      Description: Ticking memory connection
      
      java.lang.RuntimeException: No OpenGL context found in the current thread.
      at org.lwjgl.opengl.GLContext.getCapabilities(GLContext.java:124)
      at org.lwjgl.opengl.GL11.glColor4f(GL11.java:891)
      at fr.mrplaigon.dyingcraft.common.customrecipe.ImprovementsRecipe.drawCraftPicture(ImprovementsRecipe.java:81)
      at fr.mrplaigon.dyingcraft.common.customrecipe.ImprovementsRecipe.matches(ImprovementsRecipe.java:55)
      at net.minecraft.item.crafting.CraftingManager.findMatchingRecipe(CraftingManager.java:329)
      at net.minecraft.inventory.ContainerWorkbench.onCraftMatrixChanged(ContainerWorkbench.java:60)
      at net.minecraft.inventory.InventoryCrafting.setInventorySlotContents(InventoryCrafting.java:132)
      at net.minecraft.inventory.Slot.putStack(Slot.java:104)
      at net.minecraft.inventory.Container.slotClick(Container.java:325)
      at net.minecraft.network.NetHandlerPlayServer.processClickWindow(NetHandlerPlayServer.java:955)
      at net.minecraft.network.play.client.C0EPacketClickWindow.processPacket(C0EPacketClickWindow.java:41)
      at net.minecraft.network.play.client.C0EPacketClickWindow.processPacket(C0EPacketClickWindow.java:113)
      at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:241)
      at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:182)
      at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:726)
      at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:614)
      at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118)
      at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:485)
      at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:752)
      
      A detailed walkthrough of the error, its code path and all known details is as follows:
      ---------------------------------------------------------------------------------------
      
      -- Head --
      Stacktrace:
      at org.lwjgl.opengl.GLContext.getCapabilities(GLContext.java:124)
      at org.lwjgl.opengl.GL11.glColor4f(GL11.java:891)
      at fr.mrplaigon.dyingcraft.common.customrecipe.ImprovementsRecipe.drawCraftPicture(ImprovementsRecipe.java:81)
      at fr.mrplaigon.dyingcraft.common.customrecipe.ImprovementsRecipe.matches(ImprovementsRecipe.java:55)
      at net.minecraft.item.crafting.CraftingManager.findMatchingRecipe(CraftingManager.java:329)
      at net.minecraft.inventory.ContainerWorkbench.onCraftMatrixChanged(ContainerWorkbench.java:60)
      at net.minecraft.inventory.InventoryCrafting.setInventorySlotContents(InventoryCrafting.java:132)
      at net.minecraft.inventory.Slot.putStack(Slot.java:104)
      at net.minecraft.inventory.Container.slotClick(Container.java:325)
      at net.minecraft.network.NetHandlerPlayServer.processClickWindow(NetHandlerPlayServer.java:955)
      at net.minecraft.network.play.client.C0EPacketClickWindow.processPacket(C0EPacketClickWindow.java:41)
      at net.minecraft.network.play.client.C0EPacketClickWindow.processPacket(C0EPacketClickWindow.java:113)
      at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:241)
      
      -- Ticking connection --
      Details:
      Connection: net.minecraft.network.NetworkManager@66628065
      Stacktrace:
      at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:182)
      at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:726)
      at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:614)
      at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118)
      at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:485)
      at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:752)
      
      -- System Details --
      Details:
      Minecraft Version: 1.7.10
      Operating System: Windows 7 (amd64) version 6.1
      Java Version: 1.7.0_71, Oracle Corporation
      Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
      Memory: 838059152 bytes (799 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)
      JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
      AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
      IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
      FML: MCP v9.05 FML v7.10.99.99 Minecraft Forge 10.13.3.1408 4 mods loaded, 4 mods active
      mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available
      FML{7.10.99.99} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.3.1408-1.7.10.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available
      Forge{10.13.3.1408} [Minecraft Forge] (forgeSrc-1.7.10-10.13.3.1408-1.7.10.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available
      dyingcraftmod{1.0.0} [DyingCraft Mod] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available
      GL info: ~~ERROR~~ RuntimeException: No OpenGL context found in the current thread.
      Profiler Position: N/A (disabled)
      Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
      Player Count: 1 / 8; [EntityPlayerMP['Player193'/386, l='Nouveau monde', x=941,46, y=4,00, z=-915,92]]
      Type: Integrated Server (map_client.txt)
      Is Modded: Definitely; Client brand changed to 'fml,forge'
      
      1 réponse Dernière réponse Répondre Citer 0
      • DeletedD Hors-ligne
        Deleted
        dernière édition par

        EDIT :

        Bon je suis de retour (jamais 2 sans 3) mais vraiment je ne penser pas en avori besoin. J’ai crée une méthode pour afficher une image elle marche très bien dans l’event ItemToolTip mais dans la méthode matches (), elle ne veut rien savoir 
        Mon code

        
        @Override
         public boolean matches(InventoryCrafting craftingTable, World world) 
        {
        
        for (int k1 = 0; k1 < craftingTable.getSizeInventory(); ++k1)
        {
        if(itemImproved.isImprovableInClouMode())
        {
        if(craftingTable.getStackInSlot(1) != null && craftingTable.getStackInSlot(3) != null && craftingTable.getStackInSlot(4) != null && craftingTable.getStackInSlot(5) != null && craftingTable.getStackInSlot(7) != null)
        {
        ItemStack itemstack = craftingTable.getStackInSlot(4);
        if(itemstack.stackTagCompound != null)
        {
        System.out.println("stackTagCompound non null");
        }
        else
        {
        System.out.println("stackTagCompound null");
        }
        if(craftingTable.getStackInSlot(1).getItem() == ItemHandler.boiteClous && craftingTable.getStackInSlot(3).getItem() == ItemHandler.boiteClous && craftingTable.getStackInSlot(5).getItem() == ItemHandler.boiteClous && craftingTable.getStackInSlot(7).getItem() == ItemHandler.boiteClous && craftingTable.getStackInSlot(4).getItem() == itemImproved && itemstack.stackTagCompound == null)
        {
        statut = 1;
        return true;
        }
        else if(craftingTable.getStackInSlot(1).getItem() == ItemHandler.boiteClous && craftingTable.getStackInSlot(3).getItem() == ItemHandler.boiteClous && craftingTable.getStackInSlot(5).getItem() == ItemHandler.boiteClous && craftingTable.getStackInSlot(7).getItem() == ItemHandler.boiteClous && craftingTable.getStackInSlot(4).getItem() == itemImproved && itemstack.stackTagCompound != null)
        {
        drawCraftPicture(30, 16, 0, 0,157, 121, new ResourceLocation("dyingcraftmod", "textures/gui/improvements/errorsMessages.png"));
        }
        }
        }
        if(itemImproved.isImprovableInPoisonMode())
        {
        if(craftingTable.getStackInSlot(1) != null && craftingTable.getStackInSlot(3) != null && craftingTable.getStackInSlot(4) != null && craftingTable.getStackInSlot(5) != null && craftingTable.getStackInSlot(7) != null)
        {
        ItemStack itemstack = craftingTable.getStackInSlot(4);
        if(craftingTable.getStackInSlot(1).getItem() == ItemHandler.fiolePoison && craftingTable.getStackInSlot(3).getItem() == ItemHandler.fiolePoison && craftingTable.getStackInSlot(5).getItem() == ItemHandler.fiolePoison && craftingTable.getStackInSlot(7).getItem() == ItemHandler.fiolePoison && craftingTable.getStackInSlot(4).getItem() == itemImproved && itemstack.stackTagCompound == null)
        {
        statut = 2;
        return true;
        }
        else if(craftingTable.getStackInSlot(1).getItem() == ItemHandler.fiolePoison && craftingTable.getStackInSlot(3).getItem() == ItemHandler.fiolePoison && craftingTable.getStackInSlot(5).getItem() == ItemHandler.fiolePoison && craftingTable.getStackInSlot(7).getItem() == ItemHandler.fiolePoison && craftingTable.getStackInSlot(4).getItem() == itemImproved && itemstack.stackTagCompound != null)
        {
        drawCraftPicture(30, 16, 0, 0, 157, 121, new ResourceLocation("dyingcraftmod", "textures/gui/improvements/errorsMessages.png"));
        }
        }
        }
        }
        return false;
        }
        
        public void drawCraftPicture(int posX, int posY, int u, int v, int width, int heigth, ResourceLocation craftTextureFile) 
        {
        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
        GL11.glDisable(GL11.GL_LIGHTING);
        Minecraft.getMinecraft().getTextureManager().bindTexture(craftTextureFile);
        Minecraft.getMinecraft().currentScreen.drawTexturedModalRect(posX, posY, u, v, width, heigth);
        }
        
        

        Le crash report

        –-- Minecraft Crash Report ----
        // On the bright side, I bought you a teddy bear!
        
        Time: 02/07/15 14:57
        Description: Ticking memory connection
        
        java.lang.RuntimeException: No OpenGL context found in the current thread.
        at org.lwjgl.opengl.GLContext.getCapabilities(GLContext.java:124)
        at org.lwjgl.opengl.GL11.glColor4f(GL11.java:891)
        at fr.mrplaigon.dyingcraft.common.customrecipe.ImprovementsRecipe.drawCraftPicture(ImprovementsRecipe.java:81)
        at fr.mrplaigon.dyingcraft.common.customrecipe.ImprovementsRecipe.matches(ImprovementsRecipe.java:55)
        at net.minecraft.item.crafting.CraftingManager.findMatchingRecipe(CraftingManager.java:329)
        at net.minecraft.inventory.ContainerWorkbench.onCraftMatrixChanged(ContainerWorkbench.java:60)
        at net.minecraft.inventory.InventoryCrafting.setInventorySlotContents(InventoryCrafting.java:132)
        at net.minecraft.inventory.Slot.putStack(Slot.java:104)
        at net.minecraft.inventory.Container.slotClick(Container.java:325)
        at net.minecraft.network.NetHandlerPlayServer.processClickWindow(NetHandlerPlayServer.java:955)
        at net.minecraft.network.play.client.C0EPacketClickWindow.processPacket(C0EPacketClickWindow.java:41)
        at net.minecraft.network.play.client.C0EPacketClickWindow.processPacket(C0EPacketClickWindow.java:113)
        at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:241)
        at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:182)
        at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:726)
        at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:614)
        at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:485)
        at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:752)
        
        A detailed walkthrough of the error, its code path and all known details is as follows:
        ---------------------------------------------------------------------------------------
        
        -- Head --
        Stacktrace:
        at org.lwjgl.opengl.GLContext.getCapabilities(GLContext.java:124)
        at org.lwjgl.opengl.GL11.glColor4f(GL11.java:891)
        at fr.mrplaigon.dyingcraft.common.customrecipe.ImprovementsRecipe.drawCraftPicture(ImprovementsRecipe.java:81)
        at fr.mrplaigon.dyingcraft.common.customrecipe.ImprovementsRecipe.matches(ImprovementsRecipe.java:55)
        at net.minecraft.item.crafting.CraftingManager.findMatchingRecipe(CraftingManager.java:329)
        at net.minecraft.inventory.ContainerWorkbench.onCraftMatrixChanged(ContainerWorkbench.java:60)
        at net.minecraft.inventory.InventoryCrafting.setInventorySlotContents(InventoryCrafting.java:132)
        at net.minecraft.inventory.Slot.putStack(Slot.java:104)
        at net.minecraft.inventory.Container.slotClick(Container.java:325)
        at net.minecraft.network.NetHandlerPlayServer.processClickWindow(NetHandlerPlayServer.java:955)
        at net.minecraft.network.play.client.C0EPacketClickWindow.processPacket(C0EPacketClickWindow.java:41)
        at net.minecraft.network.play.client.C0EPacketClickWindow.processPacket(C0EPacketClickWindow.java:113)
        at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:241)
        
        -- Ticking connection --
        Details:
        Connection: net.minecraft.network.NetworkManager@66628065
        Stacktrace:
        at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:182)
        at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:726)
        at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:614)
        at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:485)
        at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:752)
        
        -- System Details --
        Details:
        Minecraft Version: 1.7.10
        Operating System: Windows 7 (amd64) version 6.1
        Java Version: 1.7.0_71, Oracle Corporation
        Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
        Memory: 838059152 bytes (799 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)
        JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
        AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
        IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
        FML: MCP v9.05 FML v7.10.99.99 Minecraft Forge 10.13.3.1408 4 mods loaded, 4 mods active
        mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available
        FML{7.10.99.99} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.3.1408-1.7.10.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available
        Forge{10.13.3.1408} [Minecraft Forge] (forgeSrc-1.7.10-10.13.3.1408-1.7.10.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available
        dyingcraftmod{1.0.0} [DyingCraft Mod] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available
        GL info: ~~ERROR~~ RuntimeException: No OpenGL context found in the current thread.
        Profiler Position: N/A (disabled)
        Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
        Player Count: 1 / 8; [EntityPlayerMP['Player193'/386, l='Nouveau monde', x=941,46, y=4,00, z=-915,92]]
        Type: Integrated Server (map_client.txt)
        Is Modded: Definitely; Client brand changed to 'fml,forge'
        
        
        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

          Tu ne peux pas utiliser openGL à cet endroit.

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

            Sa j avais bien compris je sais lire un crash report. Et y a pas de solution, au pire je n utiliserai que la méthode drawRectTextured ()

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

              Utilise un tick event.

              Site web contenant mes scripts : http://SCAREXgaming.github.io

              Pas de demandes de support par MP ni par skype SVP.
              Je n'accepte sur skype que l…

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

                Comment ? Comme tu puis je dans mon TickHandler faore une condition en rapport avec les item présent dans certains slot de la table de craft. La méthode matches () est tickee autant m en servir

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

                  Tu veux faire quoi en fait, afficher une image ?

                  Site web contenant mes scripts : http://SCAREXgaming.github.io

                  Pas de demandes de support par MP ni par skype SVP.
                  Je n'accepte sur skype que l…

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

                    Salut

                    SCAREX je sais que mon anglais laisse a désirer mais tout de même le nom de ma méthode ne te parle même pas ?!
                    (drawCraftPicture)
                    Et puis dedans y a surtout cette méthode :
                    drawTexturedModalRect

                    Donc oui, je cherche a affiche une image

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

                      Tu peux utiliser le RenderGameOverlayEvent mais tu risque d’avoir quelques problèmes car cet event est appelé pour le rendu du jeu donc si tu as un GUI d’ouvert, la texture apparaîtra en-dessous.

                      Site web contenant mes scripts : http://SCAREXgaming.github.io

                      Pas de demandes de support par MP ni par skype SVP.
                      Je n'accepte sur skype que l…

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

                        Ce n’est pas génant car je ne souhaite pas que mon image soit sur le gui mais en dehors. Mais comment dans cet event ou dans mon TickHandler faire comprendre au jeu que c’est à ce moment que l’image doit êttre affichée. Une condition avec un boolean static dans la classe IRecipe qu’on passe à true, etc…Comment ferais-tu ?

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

                          Comme l’a dit Robin, tu ne peux pas utiliser l’openGL à cet endroit car c’est un événement côté serveur et que du côté client je ne sais pas si tu peux l’utiliser, je ne sais même pas s’il y a quelque chose qui te permette de savoir si l’événement est appelé côté client. Pour le tick handler, tu peux savoir si un gui est ouvert en utilisant player.currentContainer (pas sûr pour le nom, le booléen est peut être dans la classe Minecraft, je ne sais plus).

                          Site web contenant mes scripts : http://SCAREXgaming.github.io

                          Pas de demandes de support par MP ni par skype SVP.
                          Je n'accepte sur skype que l…

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

                            et saurais-tu comment avoir une instance de InventoryCrafting ?
                            Car dans la méthode matches, ce n’est pas un soucis étant donné qu’il est comme argument mais dans un TickHandler comment faire ?

                            Aussi c’est bizarre mais je récupère un NPE en faisant apparaître mon image avec l’event RenderGameOverlay

                            Mon crash-report

                            –-- Minecraft Crash Report ----
                            // Don't be sad, have a hug! <3
                            
                            Time: 04/07/15 17:13
                            Description: Unexpected error
                            
                            java.lang.NullPointerException: Unexpected error
                            at fr.mrplaigon.dyingcraft.client.handler.EventHandlerClient.drawAPicture(EventHandlerClient.java:146)
                            at fr.mrplaigon.dyingcraft.client.handler.EventHandlerClient.onRenderPre(EventHandlerClient.java:190)
                            at cpw.mods.fml.common.eventhandler.ASMEventHandler_8_EventHandlerClient_onRenderPre_Pre.invoke(.dynamic)
                            at cpw.mods.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:54)
                            at cpw.mods.fml.common.eventhandler.EventBus.post(EventBus.java:138)
                            at net.minecraftforge.client.GuiIngameForge.pre(GuiIngameForge.java:901)
                            at net.minecraftforge.client.GuiIngameForge.renderHelmet(GuiIngameForge.java:247)
                            at net.minecraftforge.client.GuiIngameForge.renderGameOverlay(GuiIngameForge.java:120)
                            at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1114)
                            at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1067)
                            at net.minecraft.client.Minecraft.run(Minecraft.java:962)
                            at net.minecraft.client.main.Main.main(Main.java:164)
                            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                            at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                            at java.lang.reflect.Method.invoke(Unknown Source)
                            at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
                            at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
                            at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source)
                            at GradleStart.main(Unknown Source)
                            
                            A detailed walkthrough of the error, its code path and all known details is as follows:
                            ---------------------------------------------------------------------------------------
                            
                            -- Head --
                            Stacktrace:
                            at fr.mrplaigon.dyingcraft.client.handler.EventHandlerClient.drawAPicture(EventHandlerClient.java:146)
                            at fr.mrplaigon.dyingcraft.client.handler.EventHandlerClient.onRenderPre(EventHandlerClient.java:190)
                            at cpw.mods.fml.common.eventhandler.ASMEventHandler_8_EventHandlerClient_onRenderPre_Pre.invoke(.dynamic)
                            at cpw.mods.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:54)
                            at cpw.mods.fml.common.eventhandler.EventBus.post(EventBus.java:138)
                            at net.minecraftforge.client.GuiIngameForge.pre(GuiIngameForge.java:901)
                            at net.minecraftforge.client.GuiIngameForge.renderHelmet(GuiIngameForge.java:247)
                            at net.minecraftforge.client.GuiIngameForge.renderGameOverlay(GuiIngameForge.java:120)
                            
                            -- Affected level --
                            Details:
                            Level name: MpServer
                            All players: 1 total; [EntityClientPlayerMP['Player455'/194, l='MpServer', x=912,77, y=5,62, z=-910,07]]
                            Chunk stats: MultiplayerChunkCache: 60, 60
                            Level seed: 0
                            Level generator: ID 01 - flat, ver 0\. Features enabled: false
                            Level generator options:
                            Level spawn location: World: (941,4,-917), Chunk: (at 13,0,11 in 58,-58; contains blocks 928,0,-928 to 943,255,-913), Region: (1,-2; contains chunks 32,-64 to 63,-33, blocks 512,0,-1024 to 1023,255,-513)
                            Level time: 23216 game time, 7070 day time
                            Level dimension: 0
                            Level storage version: 0x00000 - Unknown?
                            Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)
                            Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false
                            Forced entities: 78 total; [EntitySheep['Mouton'/42, l='MpServer', x=867,81, y=4,00, z=-934,78], EntityPig['Cochon'/43, l='MpServer', x=877,59, y=4,00, z=-930,81], EntitySheep['Mouton'/46, l='MpServer', x=870,25, y=4,00, z=-912,63], EntityPig['Cochon'/47, l='MpServer', x=873,97, y=4,00, z=-918,09], EntityChicken['Poule'/44, l='MpServer', x=865,53, y=4,00, z=-913,81], EntitySheep['Mouton'/45, l='MpServer', x=878,75, y=4,00, z=-922,56], EntitySheep['Mouton'/51, l='MpServer', x=871,66, y=4,00, z=-904,75], EntitySheep['Mouton'/50, l='MpServer', x=870,19, y=4,00, z=-900,28], EntityChicken['Poule'/49, l='MpServer', x=877,63, y=4,00, z=-918,53], EntityCow['Vache'/48, l='MpServer', x=866,06, y=4,00, z=-912,78], EntityPig['Cochon'/55, l='MpServer', x=865,84, y=4,00, z=-909,59], EntityPig['Cochon'/54, l='MpServer', x=868,41, y=4,00, z=-908,19], EntityChicken['Poule'/53, l='MpServer', x=865,53, y=4,00, z=-904,63], EntitySheep['Mouton'/52, l='MpServer', x=865,78, y=4,00, z=-896,84], EntityChicken['Poule'/59, l='MpServer', x=871,53, y=4,00, z=-884,63], EntityPig['Cochon'/58, l='MpServer', x=868,97, y=4,00, z=-899,91], EntityClientPlayerMP['Player455'/194, l='MpServer', x=912,77, y=5,62, z=-910,07], EntitySheep['Mouton'/57, l='MpServer', x=874,25, y=4,00, z=-905,34], EntityCow['Vache'/56, l='MpServer', x=874,22, y=4,00, z=-906,69], EntityChicken['Poule'/63, l='MpServer', x=877,06, y=4,00, z=-878,13], EntityPig['Cochon'/62, l='MpServer', x=878,94, y=4,00, z=-882,97], EntitySheep['Mouton'/61, l='MpServer', x=864,03, y=4,00, z=-885,97], EntityCow['Vache'/60, l='MpServer', x=871,06, y=4,00, z=-881,50], EntityPig['Cochon'/68, l='MpServer', x=871,88, y=4,00, z=-862,78], EntityPig['Cochon'/69, l='MpServer', x=875,03, y=4,00, z=-862,94], EntityChicken['Poule'/64, l='MpServer', x=864,47, y=4,00, z=-870,47], EntitySheep['Mouton'/65, l='MpServer', x=879,06, y=4,00, z=-879,06], EntityPig['Cochon'/66, l='MpServer', x=873,34, y=4,00, z=-854,31], EntityCow['Vache'/67, l='MpServer', x=866,09, y=4,00, z=-857,94], EntitySheep['Mouton'/76, l='MpServer', x=892,25, y=4,00, z=-937,94], EntitySheep['Mouton'/77, l='MpServer', x=883,34, y=4,00, z=-941,34], EntityHorse['Cheval'/78, l='MpServer', x=892,56, y=4,00, z=-940,19], EntityCow['Vache'/79, l='MpServer', x=891,75, y=4,00, z=-929,63], EntityIronGolem['Golem de fer'/75, l='MpServer', x=889,19, y=4,00, z=-951,56], EntityCow['Vache'/85, l='MpServer', x=883,50, y=4,00, z=-923,63], EntityHorse['Cheval'/84, l='MpServer', x=882,78, y=4,00, z=-920,50], EntitySheep['Mouton'/87, l='MpServer', x=885,88, y=4,00, z=-907,84], EntityChicken['Poule'/86, l='MpServer', x=889,47, y=4,00, z=-925,56], EntitySheep['Mouton'/81, l='MpServer', x=884,84, y=4,00, z=-938,66], EntityCow['Vache'/80, l='MpServer', x=887,75, y=4,00, z=-928,59], EntityHorse['Cheval'/83, l='MpServer', x=880,41, y=4,00, z=-927,84], EntityCow['Vache'/82, l='MpServer', x=884,22, y=4,00, z=-926,22], EntityPig['Cochon'/92, l='MpServer', x=884,91, y=4,00, z=-850,19], EntityHorse['Cheval'/95, l='MpServer', x=904,78, y=4,00, z=-926,78], EntityPig['Cochon'/89, l='MpServer', x=881,88, y=4,00, z=-904,84], EntityCow['Vache'/88, l='MpServer', x=888,88, y=4,00, z=-908,06], EntitySheep['Mouton'/91, l='MpServer', x=887,81, y=4,00, z=-853,38], EntitySheep['Mouton'/90, l='MpServer', x=886,78, y=4,00, z=-871,09], EntityItem['item.item.ingotIron'/102, l='MpServer', x=927,91, y=4,13, z=-885,59], EntityItem['item.item.leather'/100, l='MpServer', x=914,94, y=4,13, z=-912,00], EntityItem['item.item.beefRaw'/101, l='MpServer', x=915,06, y=4,13, z=-911,97], EntityXPOrb['Orbe d'expérience'/99, l='MpServer', x=917,88, y=4,13, z=-912,25], EntityHorse['Cheval'/96, l='MpServer', x=904,88, y=4,00, z=-914,59], EntityCow['Vache'/97, l='MpServer', x=902,03, y=4,00, z=-895,94], EntityPig['Cochon'/110, l='MpServer', x=929,28, y=4,00, z=-845,69], EntityPig['Cochon'/111, l='MpServer', x=940,28, y=4,00, z=-844,09], EntitySheep['Mouton'/108, l='MpServer', x=940,56, y=4,00, z=-848,94], EntityCow['Vache'/109, l='MpServer', x=943,19, y=4,00, z=-856,06], EntitySheep['Mouton'/106, l='MpServer', x=930,06, y=4,00, z=-854,03], EntityPig['Cochon'/107, l='MpServer', x=941,81, y=4,00, z=-860,38], EntityCow['Vache'/104, l='MpServer', x=938,78, y=4,00, z=-887,75], EntityCow['Vache'/105, l='MpServer', x=937,22, y=4,00, z=-862,53], EntitySheep['Mouton'/119, l='MpServer', x=948,72, y=4,00, z=-835,19], EntityPig['Cochon'/118, l='MpServer', x=950,38, y=4,00, z=-856,16], EntityCow['Vache'/117, l='MpServer', x=955,81, y=4,00, z=-862,94], EntityCow['Vache'/116, l='MpServer', x=947,66, y=4,00, z=-856,72], EntityPig['Cochon'/115, l='MpServer', x=956,19, y=4,00, z=-866,84], EntityCow['Vache'/114, l='MpServer', x=944,16, y=4,00, z=-871,22], EntityCow['Vache'/113, l='MpServer', x=951,63, y=4,00, z=-865,97], EntitySheep['Mouton'/112, l='MpServer', x=937,38, y=4,00, z=-838,19], EntityPig['Cochon'/127, l='MpServer', x=967,16, y=4,00, z=-859,13], EntityCow['Vache'/126, l='MpServer', x=969,06, y=4,00, z=-878,84], EntityCow['Vache'/125, l='MpServer', x=967,56, y=4,00, z=-879,75], EntityCow['Vache'/124, l='MpServer', x=963,97, y=4,00, z=-880,91], EntityCow['Vache'/123, l='MpServer', x=966,22, y=4,00, z=-892,75], EntityPig['Cochon'/122, l='MpServer', x=966,88, y=4,00, z=-884,81], EntityCow['Vache'/121, l='MpServer', x=969,19, y=4,00, z=-917,81], EntityIronGolem['Golem de fer'/120, l='MpServer', x=975,19, y=4,00, z=-941,53]]
                            Retry entities: 0 total; []
                            Server brand: fml,forge
                            Server type: Integrated singleplayer server
                            Stacktrace:
                            at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:415)
                            at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2566)
                            at net.minecraft.client.Minecraft.run(Minecraft.java:991)
                            at net.minecraft.client.main.Main.main(Main.java:164)
                            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                            at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                            at java.lang.reflect.Method.invoke(Unknown Source)
                            at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
                            at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
                            at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source)
                            at GradleStart.main(Unknown Source)
                            
                            – System Details --
                            Details:
                            Minecraft Version: 1.7.10
                            Operating System: Windows 7 (amd64) version 6.1
                            Java Version: 1.7.0_71, Oracle Corporation
                            Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
                            Memory: 759704616 bytes (724 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)
                            JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
                            AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
                            IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
                            FML: MCP v9.05 FML v7.10.99.99 Minecraft Forge 10.13.3.1408 4 mods loaded, 4 mods active
                            mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
                            FML{7.10.99.99} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.3.1408-1.7.10.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
                            Forge{10.13.3.1408} [Minecraft Forge] (forgeSrc-1.7.10-10.13.3.1408-1.7.10.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
                            dyingcraftmod{1.0.0} [DyingCraft Mod] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
                            GL info: ' Vendor: 'ATI Technologies Inc.' Version: '4.4.13283 Compatibility Profile Context 14.501.1003.0' Renderer: 'AMD Radeon HD 8570D'
                            Launched Version: 1.7.10
                            LWJGL: 2.9.1
                            OpenGL: AMD Radeon HD 8570D GL version 4.4.13283 Compatibility Profile Context 14.501.1003.0, ATI Technologies Inc.
                            GL Caps: Using GL 1.3 multitexturing.
                            Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported.
                            Anisotropic filtering is supported and maximum anisotropy is 16.
                            Shaders are available because OpenGL 2.1 is supported.
                            
                            Is Modded: Definitely; Client brand changed to 'fml,forge'
                            Type: Client (map_client.txt)
                            Resource Packs: []
                            Current Language: Français (France)
                            Profiler Position: N/A (disabled)
                            Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
                            Anisotropic Filtering: Off (1)
                            

                            Mon code

                            
                            public void drawAPicture(int posX, int posY, int u, int v, int width, int heigth, ResourceLocation craftTextureFile) 
                            {
                            GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
                            GL11.glDisable(GL11.GL_LIGHTING);
                            Minecraft.getMinecraft().getTextureManager().bindTexture(craftTextureFile);
                            Minecraft.getMinecraft().currentScreen.drawTexturedModalRect(posX, posY, u, v, width, heigth);
                            }
                            
                            @SubscribeEvent
                            public void onRenderPre(RenderGameOverlayEvent.Pre event) 
                            {
                            if(event.type == RenderGameOverlayEvent.ElementType.HELMET)
                            {
                            event.setCanceled(true);
                            drawAPicture(30, 16, 0, 0,157, 121, new ResourceLocation("dyingcraftmod", "textures/gui/improvements/errorsMessages.png"));
                            }
                            }
                            
                            

                            Je précise que je n’ai pas du tout de soucis au niveaux des coordonnées que j’ai donné ; seule chose bizarre quand je load mon mode et qu’il se met direct en menu échap je peux voir mon image mais dès que je reviens en jeu (que je quitte le menu échap) mon jeu crash.

                            Je sais qu’on quitte en ce moment complétement le sujet du bug des NBTTag donc pensez-vous qu’il soit nécessaire de créer un nouveau topic pour parler de ce soucis d’OpenGL / et sûrement de Side ?

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

                              Le crash report est bien, mais il faut donner la classe entière sinon on peut pas savoir à quelle ligne est le problème. Tu peux récupérer une instance du container ouvert grâce à player.currentContainer et donc tu as accès à toutes les variables du container.

                              Site web contenant mes scripts : http://SCAREXgaming.github.io

                              Pas de demandes de support par MP ni par skype SVP.
                              Je n'accepte sur skype que l…

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

                                Bon c’est pas grave toute façon je ne comptais pas me servir de cet event là. Je vais regarde ce que tu m’as dit au niveau du currentContainer 😉

                                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

                                  Le NPE est sûrement sur Minecraft.getMinecraft().currentScreen, currentScreen est null quand tu n’ouvre pas de gui en jeu. (le menu pause est un gui).

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

                                  MINECRAFT FORGE FRANCE © 2024

                                  Powered by NodeBB