Résolu [1.7.10]Crash plantation
-
J’ai créé une nouvelle plantation de céleri, avec des graines et du céleri. Lorsque je place le bloc de plantation, tout va bien, mais si c’est la graine qui est planté, ça crash. J’ai observé le problème de MrAzErTy31, plutôt semblable au mien, et corrigé ma classe CustomBlockCrop, mais minecraft crash encore.
Je ne sais pas si c’est parce que je n’ai pas de texture ( je les dessine lorsque j’ai terminé ), mais je ne crois pas puisque poser la plantation fonctionne. Peut-être est-ce au niveau des graines ( j’ai utilisé la classe ItemSeeds, pas une classe personnalisée ). Quel est le problème ?
Classe CustomBlockCrop :
public class CustomBlockCrop extends BlockCarrot { public static String[] type = new String[] {"1", "2", "3", "4", "5", "6", "7"}; private IIcon[] IconArray; public IIcon getIcon(int side, int metadata) { return metadata < type.length && metadata >= 0 ? IconArray[metadata] : IconArray[0]; } public void registerBlockIcons(IIconRegister iconregister) { IconArray = new IIcon[type.length]; for(int i = 0; i < type.length; i++) { IconArray* = iconregister.registerIcon(Main.MODID + ":celery_crop_" + type*); } } protected Item getSeedItem() { return Main.celerySeeds; } protected Item getCropItem() { return Main.celery; } public int damageDropped(int metadata) { return metadata; } }
Déclaration des items et des blocs dans la fonction preInit de la classe principale :
celery = new CustomItem().setUnlocalizedName("celery").setTextureName(MODID + ":celery"); celerySeeds = new ItemSeeds(celeryCrop, Blocks.farmland).setUnlocalizedName("celerySeeds").setTextureName(MODID + ":celery_seeds"); celeryCrop = new CustomBlockCrop().setBlockName("celeryCrop").setBlockTextureName(MODID + ":celery_crop"); celeryPlant = new CustomBlockPlant().setBlockName("celeryPlant").setBlockTextureName(MODID + ":celery_plant");
-
Quand ça crash, ça serait bien d’envoyer le rapport de crash…
-
Hors Sujet (de toute manière sans le rapport d’erreur, on ne peut pas t’aider) :
Pourquoi faire un tableau de String qui stock des entiers qui vont de 1 en 1 ? -
:::
–-- Minecraft Crash Report ---- // Don't do that. Time: 14-07-17 18:32 Description: Unexpected error java.lang.NullPointerException: Unexpected error at net.minecraft.world.chunk.storage.ExtendedBlockStorage.func_150818_a(ExtendedBlockStorage.java:96) at net.minecraft.world.chunk.Chunk.func_150807_a(Chunk.java:667) at net.minecraft.world.World.setBlock(World.java:515) at net.minecraft.world.World.setBlock(World.java:663) at net.minecraft.item.ItemSeeds.onItemUse(ItemSeeds.java:41) at net.minecraft.item.ItemStack.tryPlaceItemIntoWorld(ItemStack.java:145) at net.minecraft.client.multiplayer.PlayerControllerMP.onPlayerRightClick(PlayerControllerMP.java:407) at net.minecraft.client.Minecraft.func_147121_ag(Minecraft.java:1528) at net.minecraft.client.Minecraft.runTick(Minecraft.java:2043) at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1038) at net.minecraft.client.Minecraft.run(Minecraft.java:961) 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:134) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) 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 GradleStart.bounce(GradleStart.java:95) at GradleStart.startClient(GradleStart.java:88) at GradleStart.main(GradleStart.java:66) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Stacktrace: at net.minecraft.world.chunk.storage.ExtendedBlockStorage.func_150818_a(ExtendedBlockStorage.java:96) at net.minecraft.world.chunk.Chunk.func_150807_a(Chunk.java:667) at net.minecraft.world.World.setBlock(World.java:515) at net.minecraft.world.World.setBlock(World.java:663) at net.minecraft.item.ItemSeeds.onItemUse(ItemSeeds.java:41) at net.minecraft.item.ItemStack.tryPlaceItemIntoWorld(ItemStack.java:145) at net.minecraft.client.multiplayer.PlayerControllerMP.onPlayerRightClick(PlayerControllerMP.java:407) at net.minecraft.client.Minecraft.func_147121_ag(Minecraft.java:1528) -- Affected level -- Details: Level name: MpServer All players: 1 total; [EntityClientPlayerMP['agabou'/19, l='MpServer', x=-6,53, y=65,62, z=193,34]] Chunk stats: MultiplayerChunkCache: 289, 289 Level seed: 0 Level generator: ID 00 - default, ver 1\. Features enabled: false Level generator options: Level spawn location: World: (-1,64,199), Chunk: (at 15,4,7 in -1,12; contains blocks -16,0,192 to -1,255,207), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511) Level time: 305 game time, 305 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: 109 total; [EntityCow['Cow'/5, l='MpServer', x=-25,22, y=65,00, z=130,78], EntityCow['Cow'/6, l='MpServer', x=-25,38, y=65,00, z=129,03], EntityCow['Cow'/7, l='MpServer', x=-26,50, y=66,00, z=133,50], EntityCow['Cow'/8, l='MpServer', x=-26,53, y=65,00, z=130,53], EntityCow['Cow'/15, l='MpServer', x=29,94, y=64,00, z=201,81], EntityCow['Cow'/16, l='MpServer', x=27,28, y=64,00, z=199,66], EntityCow['Cow'/17, l='MpServer', x=33,50, y=64,00, z=203,50], EntityCow['Cow'/18, l='MpServer', x=33,50, y=64,00, z=203,50], EntityZombie['Zombie'/1051, l='MpServer', x=-10,50, y=21,00, z=123,06], EntityClientPlayerMP['agabou'/19, l='MpServer', x=-6,53, y=65,62, z=193,34], EntityBat['Bat'/48, l='MpServer', x=-37,43, y=43,55, z=212,78], EntityBat['Bat'/49, l='MpServer', x=-50,69, y=40,98, z=230,00], EntitySpider['Spider'/2121, l='MpServer', x=5,66, y=18,00, z=176,00], EntitySkeleton['Skeleton'/2127, l='MpServer', x=61,50, y=34,00, z=205,50], EntitySkeleton['Skeleton'/2142, l='MpServer', x=52,50, y=22,00, z=261,50], EntitySquid['Squid'/155, l='MpServer', x=-72,22, y=46,34, z=231,97], EntitySquid['Squid'/156, l='MpServer', x=-67,28, y=46,06, z=236,41], EntitySquid['Squid'/161, l='MpServer', x=-66,81, y=58,69, z=241,31], EntitySquid['Squid'/162, l='MpServer', x=-60,06, y=59,38, z=237,56], EntitySquid['Squid'/163, l='MpServer', x=-55,09, y=59,38, z=230,09], EntitySquid['Squid'/164, l='MpServer', x=-61,78, y=57,97, z=237,19], EntitySquid['Squid'/165, l='MpServer', x=-60,91, y=59,34, z=239,75], EntitySquid['Squid'/166, l='MpServer', x=-72,06, y=59,28, z=242,25], EntitySquid['Squid'/167, l='MpServer', x=-65,50, y=55,69, z=240,47], EntitySquid['Squid'/168, l='MpServer', x=-63,97, y=59,34, z=236,28], EntitySquid['Squid'/169, l='MpServer', x=-60,41, y=58,38, z=230,63], EntitySquid['Squid'/170, l='MpServer', x=-64,69, y=59,16, z=235,09], EntitySquid['Squid'/183, l='MpServer', x=-42,44, y=58,78, z=226,53], EntitySquid['Squid'/184, l='MpServer', x=-46,28, y=58,94, z=220,91], EntitySquid['Squid'/185, l='MpServer', x=-44,41, y=60,25, z=214,56], EntitySquid['Squid'/186, l='MpServer', x=-32,09, y=59,72, z=221,03], EntitySquid['Squid'/187, l='MpServer', x=-36,59, y=59,97, z=219,94], EntitySquid['Squid'/188, l='MpServer', x=-40,03, y=59,34, z=222,84], EntitySquid['Squid'/189, l='MpServer', x=-36,53, y=60,31, z=227,03], EntitySquid['Squid'/190, l='MpServer', x=-29,66, y=61,28, z=218,34], EntitySquid['Squid'/191, l='MpServer', x=-38,09, y=60,38, z=234,19], EntitySquid['Squid'/192, l='MpServer', x=-44,22, y=59,34, z=233,66], EntitySquid['Squid'/193, l='MpServer', x=-38,94, y=60,09, z=228,09], EntitySquid['Squid'/194, l='MpServer', x=-40,78, y=60,66, z=224,41], EntitySquid['Squid'/207, l='MpServer', x=-9,38, y=54,34, z=160,56], EntitySquid['Squid'/208, l='MpServer', x=1,66, y=53,94, z=162,97], EntitySquid['Squid'/209, l='MpServer', x=-9,22, y=55,84, z=160,19], EntitySquid['Squid'/210, l='MpServer', x=-8,22, y=54,36, z=162,83], EntitySquid['Squid'/211, l='MpServer', x=1,81, y=56,31, z=158,69], EntitySquid['Squid'/212, l='MpServer', x=2,50, y=55,34, z=163,03], EntitySquid['Squid'/213, l='MpServer', x=-2,52, y=56,31, z=170,74], EntitySquid['Squid'/214, l='MpServer', x=8,50, y=56,28, z=160,56], EntitySquid['Squid'/215, l='MpServer', x=-12,16, y=56,99, z=159,51], EntitySquid['Squid'/216, l='MpServer', x=-7,34, y=57,38, z=155,06], EntitySquid['Squid'/217, l='MpServer', x=-5,13, y=54,03, z=159,81], EntitySquid['Squid'/379, l='MpServer', x=-38,50, y=62,00, z=163,50], EntitySquid['Squid'/380, l='MpServer', x=-51,91, y=59,34, z=163,56], EntitySquid['Squid'/381, l='MpServer', x=-54,94, y=62,03, z=165,56], EntitySquid['Squid'/382, l='MpServer', x=-44,97, y=62,31, z=169,47], EntitySquid['Squid'/383, l='MpServer', x=-48,31, y=60,13, z=161,50], EntitySquid['Squid'/384, l='MpServer', x=-50,28, y=62,31, z=165,72], EntitySquid['Squid'/385, l='MpServer', x=-56,50, y=58,75, z=169,69], EntitySquid['Squid'/386, l='MpServer', x=-50,16, y=62,34, z=160,50], EntitySquid['Squid'/387, l='MpServer', x=-47,94, y=62,34, z=162,25], EntitySquid['Squid'/411, l='MpServer', x=21,44, y=60,31, z=165,88], EntitySquid['Squid'/425, l='MpServer', x=-33,06, y=56,25, z=183,66], EntitySquid['Squid'/426, l='MpServer', x=-43,72, y=57,81, z=196,66], EntitySquid['Squid'/428, l='MpServer', x=-42,69, y=59,06, z=195,41], EntitySquid['Squid'/429, l='MpServer', x=-41,53, y=58,81, z=187,16], EntitySquid['Squid'/430, l='MpServer', x=-42,94, y=56,91, z=195,50], EntitySquid['Squid'/431, l='MpServer', x=-44,44, y=58,72, z=193,84], EntitySquid['Squid'/432, l='MpServer', x=-26,82, y=56,20, z=198,93], EntitySquid['Squid'/433, l='MpServer', x=-35,76, y=51,48, z=200,40], EntitySquid['Squid'/434, l='MpServer', x=-14,47, y=52,28, z=199,47], EntitySquid['Squid'/436, l='MpServer', x=-39,78, y=56,31, z=209,44], EntityBat['Bat'/479, l='MpServer', x=11,94, y=13,86, z=177,34], EntityBat['Bat'/480, l='MpServer', x=10,32, y=14,24, z=177,73], EntityBat['Bat'/481, l='MpServer', x=2,18, y=14,85, z=167,47], EntityCreeper['Creeper'/491, l='MpServer', x=-42,50, y=20,00, z=184,50], EntityCreeper['Creeper'/515, l='MpServer', x=54,31, y=24,00, z=266,41], EntitySpider['Spider'/516, l='MpServer', x=53,03, y=25,00, z=270,97], EntitySkeleton['Skeleton'/522, l='MpServer', x=-0,50, y=18,00, z=201,50], EntityBat['Bat'/538, l='MpServer', x=36,75, y=15,85, z=154,75], EntityZombie['Zombie'/593, l='MpServer', x=-13,50, y=21,00, z=146,50], EntityZombie['Zombie'/632, l='MpServer', x=10,41, y=26,00, z=134,00], EntityCreeper['Creeper'/633, l='MpServer', x=-76,50, y=29,00, z=185,50], EntityCreeper['Creeper'/695, l='MpServer', x=-63,50, y=38,00, z=134,50], EntityBat['Bat'/707, l='MpServer', x=-43,61, y=39,86, z=223,63], EntityBat['Bat'/721, l='MpServer', x=-27,16, y=30,89, z=267,63], EntityBat['Bat'/722, l='MpServer', x=-36,38, y=32,00, z=261,84], EntityBat['Bat'/723, l='MpServer', x=-21,53, y=29,00, z=267,94], EntityCreeper['Creeper'/756, l='MpServer', x=-8,50, y=30,00, z=231,50], EntityZombie['Zombie'/773, l='MpServer', x=65,50, y=34,00, z=260,50], EntitySpider['Spider'/800, l='MpServer', x=-63,28, y=18,00, z=256,28], EntitySkeleton['Skeleton'/803, l='MpServer', x=-65,50, y=18,00, z=257,50], EntityZombie['Zombie'/836, l='MpServer', x=-22,13, y=33,00, z=228,25], EntityZombie['Zombie'/837, l='MpServer', x=-28,09, y=33,00, z=232,13], EntityZombie['Zombie'/838, l='MpServer', x=-27,00, y=34,00, z=239,50], EntitySkeleton['Skeleton'/839, l='MpServer', x=-21,34, y=33,00, z=228,03], EntitySkeleton['Skeleton'/840, l='MpServer', x=-23,50, y=33,00, z=226,50], EntitySkeleton['Skeleton'/842, l='MpServer', x=-28,69, y=33,00, z=233,00], EntitySkeleton['Skeleton'/843, l='MpServer', x=-23,03, y=33,00, z=228,69], EntitySkeleton['Skeleton'/844, l='MpServer', x=51,50, y=33,00, z=260,50], EntitySkeleton['Skeleton'/911, l='MpServer', x=-75,50, y=31,00, z=204,50], EntitySkeleton['Skeleton'/912, l='MpServer', x=-72,50, y=31,00, z=202,50], EntityZombie['Zombie'/968, l='MpServer', x=55,50, y=44,00, z=122,50], EntityZombie['Zombie'/969, l='MpServer', x=56,13, y=44,00, z=123,31], EntityZombie['Zombie'/970, l='MpServer', x=55,16, y=44,00, z=124,75], EntitySkeleton['Skeleton'/971, l='MpServer', x=50,84, y=47,00, z=130,47], EntitySpider['Spider'/1007, l='MpServer', x=-73,06, y=19,00, z=254,66], EntityCreeper['Creeper'/1009, l='MpServer', x=-65,19, y=18,00, z=254,34], EntitySpider['Spider'/1011, l='MpServer', x=-32,50, y=12,00, z=177,50], EntitySkeleton['Skeleton'/1014, l='MpServer', x=-35,50, y=12,00, z=179,50], EntitySkeleton['Skeleton'/1015, l='MpServer', x=-34,50, y=12,00, z=178,50]] Retry entities: 0 total; [] Server brand: fml,forge Server type: Integrated singleplayer server Stacktrace: at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:417) at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2567) at net.minecraft.client.Minecraft.run(Minecraft.java:990) 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:134) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) 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 GradleStart.bounce(GradleStart.java:95) at GradleStart.startClient(GradleStart.java:88) at GradleStart.main(GradleStart.java:66) – System Details -- Details: Minecraft Version: 1.7.10 Operating System: Windows 8.1 (x86) version 6.3 Java Version: 1.8.0_05, Oracle Corporation Java VM Version: Java HotSpot(TM) Client VM (mixed mode), Oracle Corporation Memory: 715836920 bytes (682 MB) / 1046937600 bytes (998 MB) up to 1046937600 bytes (998 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: 12, tallocated: 94 FML: MCP v9.05 FML v7.10.18.1180 Minecraft Forge 10.13.0.1180 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.18.1180} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.0.1180.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available Forge{10.13.0.1180} [Minecraft Forge] (forgeSrc-1.7.10-10.13.0.1180.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available castelcraft{1.0.0} [Castel Craft] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available Launched Version: 1.7.10 LWJGL: 2.9.1 OpenGL: GeForce GT 640/PCIe/SSE2 GL version 4.4.0, 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)
:::
Je me le demande moi-même, Blackout. -,-’
-
Les blocs doivent être initialisés ET enregistrés AVANT les items. Sinon, NPE
-
Robin, je te vénère ! Merci !