Non résolu Erreur NullPointerException : Can't use a null-name for the registry, object Block{null}.
-
Tout est dans le titre, le crash report :
[13:14:45] [main/ERROR] [FML]: Exception caught during firing event net.minecraftforge.event.RegistryEvent$Register@4f3eddc0: java.lang.NullPointerException: Can't use a null-name for the registry, object Block{null}. at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:864) ~[guava-21.0.jar:?] at net.minecraftforge.registries.ForgeRegistry.add(ForgeRegistry.java:295) ~[ForgeRegistry.class:?] at net.minecraftforge.registries.ForgeRegistry.add(ForgeRegistry.java:289) ~[ForgeRegistry.class:?] at net.minecraftforge.registries.ForgeRegistry.register(ForgeRegistry.java:122) ~[ForgeRegistry.class:?] at net.minecraftforge.registries.ForgeRegistry.registerAll(ForgeRegistry.java:163) ~[ForgeRegistry.class:?] at com.g2bk.geneticalprogresses.RegisteringHandler.registerBlocks(RegisteringHandler.java:17) ~[RegisteringHandler.class:?] at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_4_RegisteringHandler_registerBlocks_Register.invoke(.dynamic) ~[?:?] at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90) ~[ASMEventHandler.class:?] at net.minecraftforge.fml.common.eventhandler.EventBus$1.invoke(EventBus.java:144) ~[EventBus$1.class:?] at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:182) [EventBus.class:?] at net.minecraftforge.registries.GameData.fireRegistryEvents(GameData.java:777) [GameData.class:?] at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:628) [Loader.class:?] at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:252) [FMLClientHandler.class:?] at net.minecraft.client.Minecraft.init(Minecraft.java:513) [Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:421) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_211] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_211] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_211] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_211] at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_211] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_211] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_211] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_211] at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?] at GradleStart.main(GradleStart.java:25) [start/:?]
La classe RegisteringHandler :
package com.g2bk.geneticalprogresses; import com.g2bk.geneticalprogresses.items.GeneticalProgressesBlocks; import com.g2bk.geneticalprogresses.items.GeneticalProgressesItems; import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraftforge.event.RegistryEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; public class RegisteringHandler { @SubscribeEvent public void registerBlocks(RegistryEvent.Register <Block>event) { event.getRegistry().registerAll(GeneticalProgressesBlocks.LAPIS_MANIPULATOR); event.getRegistry().registerAll(GeneticalProgressesBlocks.DNA_MACHINE); } @SubscribeEvent public void registerItems(RegistryEvent.Register<Item> event) { event.getRegistry().registerAll(GeneticalProgressesItems.LAPIS_POWDER, GeneticalProgressesItems.BLOCK_LAPIS_MANIPULATOR_ITEM, GeneticalProgressesItems.BASE_ONE, GeneticalProgressesItems.BASE_TWO, GeneticalProgressesItems.BASE_THREE); event.getRegistry().registerAll(GeneticalProgressesItems.JEGG_ONE, GeneticalProgressesItems.JEGG_TWO, GeneticalProgressesItems.JEGG_THREE); event.getRegistry().registerAll(GeneticalProgressesItems.BLOCK_DNA_MACHINE_ITEM); } }
Voilà.
-
Salut,
Tu as surement oublié de donner un nom de registre à ton bloc.
-
Hello, un de tes block n’a pas eu de nom de registre assigné via la fonction
Block#setRegsitryName(String)
-
Salut, si tu a mis Java à résament il se peut que sa viens de la, car robin le s’ent rappelle peut être car il ma aider mais une fois j’ai juste relancé mon mod après une mise à jour et j’avais juste des crash et personne ne savait c’est quoi, j’ai baisser la version de Java et pouf, est tout régler.
-
@Voltorise Non mais n’importe quoi …
-
Oui Oui je te jure c’est vrai regard : https://www.minecraftforgefrance.fr/topic/574/créer-un-mob-basique/161?page=9
-
Peut être c’est juste java qui c’est mal installé sur mon ordi mais le fait est que c’est la mise à jour qui ma fait ce problème.
-
nan mais la c’est clairement un oubli dans son code c’est indiquer dans le crash log, un de ses blocks n’a pas eu de nom de registre d’assigné