[1.7.10] Craft Slab erreur crash



  • Bonjour, je suis entrain de faire un mod en 1.7.10 et je ne sais plus comment ont fait les craft pour les demi-dalles, (j'ai chercher partout, je ne comprend pas).

    mon code:

    GameRegistry.addRecipe(new ItemStack(SlabInit.SingleSlab, 6, 1), new Object[]{"###", '#', BlockMod.testblock});
    

    quand mon jeu crash:

    ---- Minecraft Crash Report ----
    // Oh - I know what I did wrong!
    
    Time: 27/01/19 11:40
    Description: Rendering item
    
    java.lang.NullPointerException: Rendering item
    	at net.minecraft.item.ItemStack.getItemDamage(ItemStack.java:265)
    	at net.minecraft.client.renderer.entity.RenderItem.renderItemIntoGUI(RenderItem.java:419)
    	at net.minecraft.client.renderer.entity.RenderItem.renderItemAndEffectIntoGUI(RenderItem.java:585)
    	at net.minecraft.client.gui.inventory.GuiContainer.func_146977_a(GuiContainer.java:289)
    	at net.minecraft.client.gui.inventory.GuiContainer.drawScreen(GuiContainer.java:114)
    	at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1137)
    	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(NativeMethodAccessorImpl.java:62)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:498)
    	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 net.minecraft.item.ItemStack.getItemDamage(ItemStack.java:265)
    	at net.minecraft.client.renderer.entity.RenderItem.renderItemIntoGUI(RenderItem.java:419)
    
    -- Item being rendered --
    Details:
    	Item Type: null
    	Item Aux: ~~ERROR~~ NullPointerException: null
    	Item NBT: null
    	Item Foil: ~~ERROR~~ NullPointerException: null
    Stacktrace:
    	at net.minecraft.client.renderer.entity.RenderItem.renderItemAndEffectIntoGUI(RenderItem.java:585)
    	at net.minecraft.client.gui.inventory.GuiContainer.func_146977_a(GuiContainer.java:289)
    	at net.minecraft.client.gui.inventory.GuiContainer.drawScreen(GuiContainer.java:114)
    
    -- Screen render details --
    Details:
    	Screen name: net.minecraft.client.gui.inventory.GuiCrafting
    	Mouse location: Scaled: (205, 97). Absolute: (410, 285)
    	Screen size: Scaled: (427, 240). Absolute: (854, 480). Scale factor of 2
    
    -- Affected level --
    Details:
    	Level name: MpServer
    	All players: 1 total; [EntityClientPlayerMP['Player254'/297, l='MpServer', x=-41,69, y=65,62, z=283,44]]
    	Chunk stats: MultiplayerChunkCache: 81, 81
    	Level seed: 0
    	Level generator: ID 00 - default, ver 1. Features enabled: false
    	Level generator options: 
    	Level spawn location: World: (-53,64,266), Chunk: (at 11,4,10 in -4,16; contains blocks -64,0,256 to -49,255,271), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511)
    	Level time: 141924 game time, 141924 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: 13 total; [EntityCow['Cow'/40, l='MpServer', x=-85,38, y=67,00, z=266,41], EntityCow['Cow'/41, l='MpServer', x=-85,47, y=76,00, z=274,75], EntityClientPlayerMP['Player254'/297, l='MpServer', x=-41,69, y=65,62, z=283,44], EntityCow['Cow'/42, l='MpServer', x=-88,38, y=70,00, z=270,25], EntityCow['Cow'/45, l='MpServer', x=-77,38, y=66,00, z=304,59], EntityBat['Bat'/54, l='MpServer', x=-64,91, y=50,10, z=277,25], SheepMod['entity.sheep.name'/79, l='MpServer', x=-48,50, y=75,00, z=271,81], EntityCreeper['Creeper'/104, l='MpServer', x=-31,22, y=42,00, z=268,75], EntityCreeper['Creeper'/105, l='MpServer', x=-31,00, y=42,00, z=269,66], EntityBat['Bat'/106, l='MpServer', x=-44,53, y=57,10, z=305,75], EntityBat['Bat'/107, l='MpServer', x=-43,28, y=57,10, z=305,75], EntityBat['Bat'/121, l='MpServer', x=-20,78, y=49,10, z=268,53], EntityBat['Bat'/122, l='MpServer', x=-23,25, y=52,10, z=277,59]]
    	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:984)
    	at net.minecraft.client.main.Main.main(Main.java:164)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:498)
    	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_191, Oracle Corporation
    	Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
    	Memory: 110905288 bytes (105 MB) / 320339968 bytes (305 MB) up to 928514048 bytes (885 MB)
    	JVM Flags: 0 total; 
    	AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
    	IntCache: cache: 1, tcache: 0, allocated: 13, tallocated: 95
    	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
    	UCHIJAAAA	mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) 
    	UCHIJAAAA	FML{7.10.99.99} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.4.1558-1.7.10.jar) 
    	UCHIJAAAA	Forge{10.13.4.1558} [Minecraft Forge] (forgeSrc-1.7.10-10.13.4.1558-1.7.10.jar) 
    	UCHIJAAAA	XeraBlock{1.0} [XeraBlock] (xerablock-1.0.jar) 
    	GL info: ' Vendor: 'Intel' Version: '4.0.0 - Build 10.18.10.4425' Renderer: 'Intel(R) HD Graphics'
    	Launched Version: 1.7.10
    	LWJGL: 2.9.1
    	OpenGL: Intel(R) HD Graphics GL version 4.0.0 - Build 10.18.10.4425, Intel
    	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: [XeraPack, SC16-64 F&MF v27 - Place this in your resourcepacks folder as is WITHOUT extracting.zip]
    	Current Language: English (US)
    	Profiler Position: N/A (disabled)
    	Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
    	Anisotropic Filtering: Off (1)
    

    ps: je ne savais pas dans quel salon le mettre 😕



  • 	GameRegistry.addRecipe(new ItemStack(SlabInit.SingleSlab, 6),
    			new Object[] { "   ", "   ", "###", '#', BlockMod.testblock });
    

    essaie de faire ça



  • ça ne change rien, si je fais ça je force l'utilisateur a mettre tout les items/blocks du craft tout en bas dans la table de craft



  • Alors tu mets la ligne de code 3 fois :

    GameRegistry.addRecipe(new ItemStack(SlabInit.SingleSlab, 6),
    		new Object[] { "   ", "   ", "###", '#', BlockMod.testblock });
    GameRegistry.addRecipe(new ItemStack(SlabInit.SingleSlab, 6),
    		new Object[] { "   ", "###", "   ", '#', BlockMod.testblock });
    GameRegistry.addRecipe(new ItemStack(SlabInit.SingleSlab, 6),
    		new Object[] { "###", "   ", "   ", '#', BlockMod.testblock });
    

    Le joueur peut les mettre ou il veut dans la table de craft et obtenir la même chose


  • Administrateurs

    Ton bloc est probablement null au moment où tu enregistres ta recette.



  • oups erreur de debutant oui j'init les slabs apres mes craft 😕 merci robin !!


Se connecter pour répondre