MFF

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

    Voir la projection d'un item (Snowball)

    Planifier Épinglé Verrouillé Déplacé Résolu 1.7.x
    1.7.x
    25 Messages 4 Publieurs 4.0k 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.
    • XkeinX Hors-ligne
      Xkein
      dernière édition par

      t’es sur que on le place dans la classe principale car quand le place dans mon modCobalt (classe principale) donc j’ai essaye de le mettre dans Preinit = crash apres j’ai essaye partout sa me le souligner
      Aussi dans le INIT
      Le crash

      –-- Minecraft Crash Report ----
      // You should try our sister game, Minceraft!
      
      Time: 01/11/16 15:31
      Description: Initializing game
      
      java.lang.NullPointerException: Initializing game
      at cpw.mods.fml.common.registry.EntityRegistry.doModEntityRegistration(EntityRegistry.java:164)
      at cpw.mods.fml.common.registry.EntityRegistry.registerModEntity(EntityRegistry.java:150)
      at xkein.cobalt.tuto.common.ModCobalt.preInit(ModCobalt.java:49)
      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 cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:532)
      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 com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
      at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
      at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
      at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
      at com.google.common.eventbus.EventBus.post(EventBus.java:275)
      at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:212)
      at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:190)
      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 com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
      at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
      at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
      at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
      at com.google.common.eventbus.EventBus.post(EventBus.java:275)
      at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:119)
      at cpw.mods.fml.common.Loader.preinitializeMods(Loader.java:556)
      at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:243)
      at net.minecraft.client.Minecraft.startGame(Minecraft.java:522)
      at net.minecraft.client.Minecraft.run(Minecraft.java:942)
      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 cpw.mods.fml.common.registry.EntityRegistry.doModEntityRegistration(EntityRegistry.java:164)
      at cpw.mods.fml.common.registry.EntityRegistry.registerModEntity(EntityRegistry.java:150)
      at xkein.cobalt.tuto.common.ModCobalt.preInit(ModCobalt.java:49)
      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 cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:532)
      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 com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
      at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
      at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
      at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
      at com.google.common.eventbus.EventBus.post(EventBus.java:275)
      at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:212)
      at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:190)
      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 com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
      at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
      at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
      at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
      at com.google.common.eventbus.EventBus.post(EventBus.java:275)
      at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:119)
      at cpw.mods.fml.common.Loader.preinitializeMods(Loader.java:556)
      at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:243)
      at net.minecraft.client.Minecraft.startGame(Minecraft.java:522)
      
      -- Initialization --
      Details:
      Stacktrace:
      at net.minecraft.client.Minecraft.run(Minecraft.java:942)
      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.8.0_111, Oracle Corporation
      Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
      Memory: 825473976 bytes (787 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.4.1558 4 mods loaded, 4 mods active
      States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored
      UCH mcp{9.05} [Minecraft Coder Pack] (minecraft.jar)
      UCH FML{7.10.99.99} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.4.1558-1.7.10.jar)
      UCH Forge{10.13.4.1558} [Minecraft Forge] (forgeSrc-1.7.10-10.13.4.1558-1.7.10.jar)
      UCE ModCobalt{1.0.0} [Mod Cobalt] (bin)
      GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.5.0 NVIDIA 373.06' Renderer: 'GeForce GTX 960/PCIe/SSE2'
      Launched Version: 1.7.10
      LWJGL: 2.9.1
      OpenGL: GeForce GTX 960/PCIe/SSE2 GL version 4.5.0 NVIDIA 373.06, NVIDIA Corporation
      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 canadien (Canada)
      Profiler Position: N/A (disabled)
      Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
      Anisotropic Filtering: Off (1)
      
      
      1 réponse Dernière réponse Répondre Citer 0
      • robin4002R En ligne
        robin4002 Moddeurs confirmés Rédacteurs Administrateurs
        dernière édition par

        L’instance de ton est null.

        @Instance(“MODID”)
        devrait être :
        @Instance(“ModCobalt”)
        (vers le début de ta classe principale).

        Et si ça ne crashait pas avant, ça veut dire que ta fonction registerEntityRenderingHandler qui est juste au dessus de la où était doModEntityRegistration avant n’est pas appelé non plus, donc il y a un autre soucis à ce niveau.
        Envoies ton client proxy.

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

          package xkein.cobalt.tuto.client;
          
          import cpw.mods.fml.client.registry.RenderingRegistry;
          import cpw.mods.fml.common.registry.EntityRegistry;
          import xkein.cobalt.tuto.common.EntityDynamite;
          import xkein.cobalt.tuto.common.ModCobalt;
          import xkein.cobalt.tuto.common.RenderDynamite;
          import xkein.cobalt.tuto.proxy.CommonProxy;
          
          public class ClientProxy extends CommonProxy
          {
          
          @Override
          public void registerRenders()
          {
          RenderingRegistry.registerEntityRenderingHandler(EntityDynamite.class, new RenderDynamite(ModCobalt.dynamite));
          }
          }
          
          
          1 réponse Dernière réponse Répondre Citer 0
          • XkeinX Hors-ligne
            Xkein
            dernière édition par

            C’est bon mon jeux crash plus mais maintenant c’est que le projectile n’apparait pas il fait un carré blanc

            http://prntscr.com/d1r0sa

            1 réponse Dernière réponse Répondre Citer 0
            • robin4002R En ligne
              robin4002 Moddeurs confirmés Rédacteurs Administrateurs
              dernière édition par

              Tu peux aussi envoyer ta classe CommonProxy et RenderDynamite si elle a changé depuis ?

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

                CommonProxy

                package xkein.cobalt.tuto.proxy;
                
                public class CommonProxy
                {
                public void registerRender()
                {
                System.out.println("\n méthode coté serveur");
                }
                
                public void registerRenders()
                {
                // TODO Auto-generated method stub
                
                }
                }
                
                

                renderDynamite

                package xkein.cobalt.tuto.common;
                
                import net.minecraft.client.renderer.entity.Render;
                import net.minecraft.entity.Entity;
                import net.minecraft.item.Item;
                import net.minecraft.util.ResourceLocation;
                
                public class RenderDynamite extends Render
                {
                private Item dynamite;
                private int RenderDynamite;
                private static final String __OBFID = "CL_00001008";
                
                public RenderDynamite(Item dynamite, int RenderDynamite)
                {
                this.dynamite = dynamite;
                this.RenderDynamite = RenderDynamite;
                }
                
                public RenderDynamite(Item dynamite)
                {
                this(dynamite, 0);
                }
                
                @Override
                public void doRender(Entity dynamite, double x, double y, double z, float dynamite1, float RenderDynamite)
                {
                // TODO Auto-generated method stub
                
                }
                
                @Override
                protected ResourceLocation getEntityTexture(Entity dynamite)
                {
                // TODO Auto-generated method stub
                return null;
                }
                }
                
                1 réponse Dernière réponse Répondre Citer 0
                • robin4002R En ligne
                  robin4002 Moddeurs confirmés Rédacteurs Administrateurs
                  dernière édition par

                  Dans ta classe principale tu as :
                  proxy.registerRender();
                  Dans ton proxy commun tu as registerRender et registerRenders.
                  Et dans ton proxy client tu as juste registerRenders.

                  Du-coup registerRenders de ton client proxy n’est jamais appelé.
                  Corriges ça en gardant seulement une des deux fonctions.

                  Et dans le proxyclient tu peux ensuite remplacer :
                  RenderingRegistry.registerEntityRenderingHandler(EntityDynamite.class, new RenderDynamite(ModCobalt.dynamite));
                  par :
                  RenderingRegistry.registerEntityRenderingHandler(EntityDynamite.class, new RenderSnowball(ModCobalt.dynamite));

                  La classe RenderSnowball permet de rendre un item au cordonnée d’une entité, donc tu peux aussi l’utiliser pour ta dynamite, pas besoin de faire une nouvelle classe.

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

                    j’ai tout modifier comme tu me la dit mais c’est toujours blanc je vois bien

                    http://prntscr.com/d1rly7___Mais c’est normal que je ne vois pas tout le trajet comme une snowball je vois bien la texture mais je vois des que je la balance est des quelle touche le sol mais pas entre deux

                    1 réponse Dernière réponse Répondre Citer 0
                    • robin4002R En ligne
                      robin4002 Moddeurs confirmés Rédacteurs Administrateurs
                      dernière édition par

                      Tu peux me renvoyer la ligne où tu enregistres l’entité ?

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

                        celle la ?

                        @EventHandler
                        public void Init(FMLInitializationEvent event)
                        {
                        proxy.registerRenders();
                        EntityRegistry.registerModEntity(EntityDynamite.class, "EntityDynamite", 0, ModCobalt.instance, 32, 20, false);
                        }
                        
                        
                        1 réponse Dernière réponse Répondre Citer 0
                        • DeletedD Hors-ligne
                          Deleted
                          dernière édition par

                          Remplace le 0 par 420

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

                            Ok c’est bon il fallais juste modifier false par true___Merci a vous a tout le monde qui m’ont aidé ! vous pouvez lock le topic merci a toi robin ^^

                            1 réponse Dernière réponse Répondre Citer 0
                            • robin4002R En ligne
                              robin4002 Moddeurs confirmés Rédacteurs Administrateurs
                              dernière édition par

                              Heureusement que je l’avais dit …
                              @‘robin4002’:

                              registerModEntity doit être dans la classe principale. Et remplaces sendsVelocityUpdates directement par **true **au lieu de créer une variable inutile.

                              🙂
                              sendsVelocityUpdates = envoyer un paquet pour signaler quand ça bouge.
                              Pour les projectiles il faut mettre true.

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

                                oui je sais plus pourquoi que j’ai mis true x) en tout cas merci ^^ j’esepere que je vous embêterais plus pour savoir aussi pourquoi la snowball est les autres items p_i14325 (exemple)

                                1 réponse Dernière réponse Répondre Citer 0
                                • robin4002R En ligne
                                  robin4002 Moddeurs confirmés Rédacteurs Administrateurs
                                  dernière édition par

                                  Comme déjà dit RenderSnowball est une classe qui peut être utilisé pour n’importe quel rendu d’item en tant qu’entité.

                                  Et les p_xxxx ce sont des paramètres non mappés. Le mieux est de les remplacer par un nom anglais qui a plus de sens.

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

                                    Ok merci beaucoup ^^

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

                                    MINECRAFT FORGE FRANCE © 2024

                                    Powered by NodeBB