Créer un item container (type backpack / sac à dos)
-
package com.mod.exonia; import java.io.File; import org.lwjgl.opengl.Display; import com.google.common.base.Throwables; import com.mod.exonia.backpack.ItemBackPack; import com.mod.exonia.backpack.ModBlocks; import com.mod.exonia.backpack.ModItems; import com.mod.exonia.dynamite.EntityDynamite; import com.mod.exonia.gui.GuiCustomMainMenu; import com.mod.exonia.init.BlockMod; import com.mod.exonia.init.ItemMod; import com.mod.exonia.proxy.CommonProxy; import com.mod.exonia.world.WorldRegister; import cpw.mods.fml.client.FMLClientHandler; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.Mod.Instance; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.TickEvent; import cpw.mods.fml.common.network.IGuiHandler; import cpw.mods.fml.common.network.NetworkRegistry; import cpw.mods.fml.common.registry.EntityRegistry; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiIngameMenu; import net.minecraft.client.gui.GuiMainMenu; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraftforge.client.event.GuiOpenEvent; import net.minecraftforge.client.event.GuiScreenEvent; @Mod(modid = Reference.MOD_NAME, version = Reference.VERSION) public class Exonia { @SidedProxy(clientSide = Reference.CLIENT_PROXY, serverSide = Reference.SERVER_PROXY) public static CommonProxy proxy; public static final String MODID = "Exonia"; @Mod.Instance(Exonia.MODID) public static Exonia instance; @EventHandler public void preInit(FMLPreInitializationEvent event) { BlockMod.init(); BlockMod.register(); ItemMod.init(); ItemMod.register(); WorldRegister.mainRegistry(); if(event.getSide().isClient()) { if(!Minecraft.getMinecraft().mcDataDir.getAbsolutePath().contains("Exonia") && !Minecraft.getMinecraft().mcDataDir.equals(new File("."))) { Throwables.propagate(new Exception("Launcher non autorisé")); } } } @SidedProxy(clientSide = "com.mod.exonia.proxy.ClientProxy", serverSide = "com.mod.exonia.proxy.CommonProxy") public static CommonProxy PROXY; @EventHandler public void Init(FMLInitializationEvent event) { proxy.registerRenders(); EntityRegistry.registerModEntity(EntityDynamite.class, "EntityDynamite", 420, Exonia.instance, 32, 20, false); ModItems.registerItemsCrafts(); ModBlocks.registerBlocksCrafts(); GameRegistry.addRecipe(new ItemStack(ModItems.ITEM_BACKPACK), new Object[]{"###", "# #", "###", '#', Items.leather}); NetworkRegistry.INSTANCE.registerGuiHandler(INSTANCE, PROXY); } @EventHandler public void postInit(FMLPostInitializationEvent event) { ModItems.registerItems(); ModBlocks.registerBlocks(); } @Instance(Reference.MOD_NAME) public static Object INSTANCE; }
Jdois faire ccomment ?
-
c’est dans le preinit non ? que tu doit register ton craft
-
Non les crafts peuvent être mis dans l’init sans problème.
Par contre tu peux m’expliquer pourquoi tu as “BlockMod”, “ItemMod” ET “ModItems”, “ModBlocks” ?
Et tous cas ton problème vient du fait que t’enregistre des items et blocks dans le postInit, ce qu’il ne faut JAMAIS faire. -
@‘Yanis (MrLeBest)’:
c’est dans le preinit non ? que tu doit register ton craft
sa marche tjr pas
-
Bonjour, j’ai utilisé ce tutoriel (qui m’a éte fort utile), mais un problème surviens quand j’ouvre mon backpack, mon launcher crash.
tenez mes lignes de log au moment du crash.[23:05:46] [Client thread/INFO] [STDOUT]: [net.minecraft.client.Minecraft:displayCrashReport:388]: –-- Minecraft Crash Report ---- // Don't be sad, have a hug! <3 Time: 28/07/17 23:05 Description: Unexpected error java.lang.NullPointerException: Unexpected error at cpw.mods.fml.common.network.NetworkRegistry.getLocalGuiContainer(NetworkRegistry.java:265) at cpw.mods.fml.common.network.internal.FMLNetworkHandler.openGui(FMLNetworkHandler.java:93) at net.minecraft.entity.player.EntityPlayer.openGui(EntityPlayer.java:2501) at com.mod.drakania.items.ItemBackPack.onItemRightClick(ItemBackPack.java:44) at net.minecraft.item.ItemStack.useItemRightClick(ItemStack.java:164) at net.minecraft.client.multiplayer.PlayerControllerMP.sendUseItem(PlayerControllerMP.java:430) at net.minecraft.client.Minecraft.func_147121_ag(Minecraft.java:1557) at net.minecraft.client.Minecraft.runTick(Minecraft.java:2044) at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1039) 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 cpw.mods.fml.common.network.NetworkRegistry.getLocalGuiContainer(NetworkRegistry.java:265) at cpw.mods.fml.common.network.internal.FMLNetworkHandler.openGui(FMLNetworkHandler.java:93) at net.minecraft.entity.player.EntityPlayer.openGui(EntityPlayer.java:2501) at com.mod.drakania.items.ItemBackPack.onItemRightClick(ItemBackPack.java:44) at net.minecraft.item.ItemStack.useItemRightClick(ItemStack.java:164) at net.minecraft.client.multiplayer.PlayerControllerMP.sendUseItem(PlayerControllerMP.java:430) at net.minecraft.client.Minecraft.func_147121_ag(Minecraft.java:1557) -- Affected level -- Details: Level name: MpServer All players: 1 total; [EntityClientPlayerMP['Player237'/346, l='MpServer', x=36,50, y=65,62, z=275,50]] Chunk stats: MultiplayerChunkCache: 602, 602 Level seed: 0 Level generator: ID 00 - default, ver 1\. Features enabled: false Level generator options: Level spawn location: World: (35,64,274), Chunk: (at 3,4,2 in 2,17; contains blocks 32,0,272 to 47,255,287), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511) Level time: 26429 game time, 26429 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: 63 total; [EntityBat['Bat'/259, l='MpServer', x=-38,22, y=14,66, z=197,85], EntityBat['Bat'/260, l='MpServer', x=-38,88, y=23,90, z=200,38], EntityXPOrb['Experience Orb'/262, l='MpServer', x=-46,25, y=71,25, z=234,88], EntityXPOrb['Experience Orb'/263, l='MpServer', x=-40,03, y=70,25, z=227,34], EntitySkeleton['Skeleton'/278, l='MpServer', x=-20,38, y=59,00, z=214,00], EntityChicken['Chicken'/279, l='MpServer', x=-26,38, y=65,00, z=210,41], EntityChicken['Chicken'/280, l='MpServer', x=-22,88, y=65,00, z=208,59], EntityCreeper['Creeper'/281, l='MpServer', x=-21,38, y=67,11, z=253,28], EntitySquid['Squid'/282, l='MpServer', x=-22,94, y=49,22, z=309,09], EntitySquid['Squid'/284, l='MpServer', x=-29,56, y=48,91, z=308,53], EntitySquid['Squid'/285, l='MpServer', x=-22,28, y=48,34, z=305,25], EntityZombie['Zombie'/413, l='MpServer', x=-40,50, y=54,00, z=232,50], EntitySquid['Squid'/286, l='MpServer', x=-21,66, y=50,31, z=310,34], EntityZombie['Zombie'/414, l='MpServer', x=-41,50, y=54,00, z=233,50], EntityChicken['Chicken'/293, l='MpServer', x=-7,44, y=73,00, z=249,97], EntityItem['item.item.egg'/294, l='MpServer', x=-0,72, y=66,13, z=273,22], EntityZombie['Zombie'/295, l='MpServer', x=-15,50, y=31,00, z=295,50], EntityZombie['Zombie'/296, l='MpServer', x=-4,97, y=18,00, z=308,53], EntityItem['item.item.rottenFlesh'/302, l='MpServer', x=14,25, y=64,13, z=212,72], EntityChicken['Chicken'/303, l='MpServer', x=2,44, y=65,00, z=213,38], EntityChicken['Chicken'/304, l='MpServer', x=9,38, y=65,00, z=215,59], EntityChicken['Chicken'/305, l='MpServer', x=10,56, y=67,00, z=229,56], EntityChicken['Chicken'/306, l='MpServer', x=12,47, y=64,00, z=227,63], EntityEnderman['Enderman'/307, l='MpServer', x=13,25, y=20,00, z=251,28], EntitySkeleton['Skeleton'/308, l='MpServer', x=11,06, y=19,00, z=285,56], EntityZombie['Zombie'/309, l='MpServer', x=0,84, y=35,00, z=293,72], EntitySkeleton['Skeleton'/565, l='MpServer', x=-38,50, y=17,00, z=297,50], EntityWitch['Witch'/310, l='MpServer', x=15,50, y=30,00, z=301,94], EntityZombie['Zombie'/438, l='MpServer', x=59,47, y=36,00, z=333,97], EntityCreeper['Creeper'/321, l='MpServer', x=18,06, y=63,00, z=231,72], EntityItem['item.item.arrow'/322, l='MpServer', x=20,13, y=68,13, z=246,66], EntityZombie['Zombie'/323, l='MpServer', x=26,31, y=20,00, z=269,97], EntityChicken['Chicken'/324, l='MpServer', x=23,04, y=68,00, z=269,10], EntityZombie['Zombie'/325, l='MpServer', x=30,03, y=23,00, z=276,47], EntityCreeper['Creeper'/326, l='MpServer', x=31,97, y=25,00, z=287,31], EntityCreeper['Creeper'/585, l='MpServer', x=28,66, y=25,00, z=284,69], EntitySpider['Spider'/586, l='MpServer', x=26,72, y=25,00, z=284,72], EntityZombie['Zombie'/333, l='MpServer', x=39,47, y=24,00, z=284,41], EntityZombie['Zombie'/334, l='MpServer', x=39,62, y=26,00, z=274,28], EntityBat['Bat'/462, l='MpServer', x=12,86, y=23,75, z=259,40], EntityCreeper['Creeper'/335, l='MpServer', x=34,59, y=26,00, z=290,00], EntityCreeper['Creeper'/336, l='MpServer', x=40,50, y=25,00, z=288,50], EntityBat['Bat'/464, l='MpServer', x=1,72, y=20,44, z=269,54], EntityZombie['Zombie'/337, l='MpServer', x=62,06, y=14,00, z=228,59], EntityBat['Bat'/466, l='MpServer', x=1,84, y=22,83, z=272,84], EntityZombie['Zombie'/338, l='MpServer', x=56,50, y=15,00, z=227,22], EntityChicken['Chicken'/339, l='MpServer', x=58,72, y=67,00, z=278,41], EntityChicken['Chicken'/340, l='MpServer', x=69,47, y=70,00, z=251,53], EntityChicken['Chicken'/341, l='MpServer', x=68,59, y=68,00, z=270,44], EntityBat['Bat'/469, l='MpServer', x=5,50, y=23,90, z=270,75], EntityBat['Bat'/470, l='MpServer', x=13,54, y=22,85, z=246,70], EntityBat['Bat'/471, l='MpServer', x=3,63, y=21,74, z=272,46], EntityXPOrb['Experience Orb'/215, l='MpServer', x=-65,94, y=64,25, z=186,75], EntityBat['Bat'/472, l='MpServer', x=-1,53, y=17,00, z=272,28], EntityXPOrb['Experience Orb'/216, l='MpServer', x=-67,34, y=64,25, z=181,81], EntityXPOrb['Experience Orb'/217, l='MpServer', x=-68,31, y=64,25, z=181,88], EntityCreeper['Creeper'/350, l='MpServer', x=114,50, y=21,00, z=338,50], EntityZombie['Zombie'/489, l='MpServer', x=0,50, y=36,00, z=288,50], EntitySkeleton['Skeleton'/490, l='MpServer', x=18,50, y=27,00, z=221,50], EntitySkeleton['Skeleton'/491, l='MpServer', x=95,50, y=16,00, z=304,50], EntitySkeleton['Skeleton'/492, l='MpServer', x=97,50, y=16,00, z=300,97], EntityCreeper['Creeper'/503, l='MpServer', x=32,36, y=24,96, z=351,50], EntityClientPlayerMP['Player237'/346, l='MpServer', x=36,50, y=65,62, z=275,50]] 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 10 (amd64) version 10.0 Java Version: 1.8.0_141, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 629570816 bytes (600 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: 12, tallocated: 94 FML: MCP v9.05 FML v7.10.99.99 Minecraft Forge 10.13.4.1614 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 UCHIJAAAAAAAAA mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) UCHIJAAAAAAAAA FML{7.10.99.99} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.4.1614-1.7.10.jar) UCHIJAAAAAAAAA Forge{10.13.4.1614} [Minecraft Forge] (forgeSrc-1.7.10-10.13.4.1614-1.7.10.jar) UCHIJAAAAAAAAA drakamod{1.0.0} [DrakaMod] (bin) GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.5.0 NVIDIA 375.63' Renderer: 'GeForce GT 620/PCIe/SSE2' Launched Version: 1.7.10 LWJGL: 2.9.1 OpenGL: GeForce GT 620/PCIe/SSE2 GL version 4.5.0 NVIDIA 375.63, 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: 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) [23:05:46] [Client thread/INFO] [STDOUT]: [net.minecraft.client.Minecraft:displayCrashReport:398]: #@!@# Game crashed! Crash report saved to: #@!@# C:\Users\florian\Desktop\forge-1.7.10-10.13.4.1614-1.7.10-src\eclipse\.\crash-reports\crash-2017-07-28_23.05.46-client.txt AL lib: (EE) alc_cleanup: 1 device not closed Java HotSpot(TM) 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release
j’aimerais si cela est possible de recevoir l’aide de qulqu’un
merci d’avance. -
Salut,
Il y a soit un soucis avec la variable instance de ton mod, soit tu n’as pas enregistré de gui handler. -
Bonjour au niveau du guiHandler http://prntscr.com/g1ng7k
et au niveau de l’instance je viens de remarquer cela http://prntscr.com/g1nk53
[EDIT 1]: si tu peux m’aider cela serait juste géniale parce que je galère depuis hier soir -
Il faut créer une classe nommé EmotionGuiHandler et mettre ce que tu as mis dans le commonproxy dedans.
-
maintenant ca me mets ca:
[12:39:32] [Client thread/INFO] [STDOUT]: [net.minecraft.client.Minecraft:displayCrashReport:388]: –-- Minecraft Crash Report ---- // There are four lights! Time: 29/07/17 12:39 Description: Initializing game java.lang.NullPointerException: Initializing game at cpw.mods.fml.common.network.NetworkRegistry.registerGuiHandler(NetworkRegistry.java:219) at com.mod.drakania.DrakaMod.Init(DrakaMod.java:83) 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.initializeMods(Loader.java:737) at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:311) at net.minecraft.client.Minecraft.startGame(Minecraft.java:597) 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.network.NetworkRegistry.registerGuiHandler(NetworkRegistry.java:219) at com.mod.drakania.DrakaMod.Init(DrakaMod.java:83) 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.initializeMods(Loader.java:737) at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:311) at net.minecraft.client.Minecraft.startGame(Minecraft.java:597) -- 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 10 (amd64) version 10.0 Java Version: 1.8.0_141, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 673757312 bytes (642 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.1614 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 UCHI mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) UCHI FML{7.10.99.99} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.4.1614-1.7.10.jar) UCHI Forge{10.13.4.1614} [Minecraft Forge] (forgeSrc-1.7.10-10.13.4.1614-1.7.10.jar) UCHE drakamod{1.0.0} [DrakaMod] (bin) GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.5.0 NVIDIA 375.63' Renderer: 'GeForce GT 620/PCIe/SSE2' Launched Version: 1.7.10 LWJGL: 2.9.1 OpenGL: GeForce GT 620/PCIe/SSE2 GL version 4.5.0 NVIDIA 375.63, 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: 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) [12:39:32] [Client thread/INFO] [STDOUT]: [net.minecraft.client.Minecraft:displayCrashReport:398]: #@!@# Game crashed! Crash report saved to: #@!@# C:\Users\florian\Desktop\forge-1.7.10-10.13.4.1614-1.7.10-src\eclipse\.\crash-reports\crash-2017-07-29_12.39.32-client.txt AL lib: (EE) alc_cleanup: 1 device not closed Java HotSpot(TM) 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release
-
Toujours la même erreur.
Une fois de plus vérifies la déclaration de ta variable instance.
Il doit avoir l’annotation @Instance au dessus avec ton modid. -
@‘robin4002’:
Toujours la même erreur.
Une fois de plus vérifies la déclaration de ta variable instance.
Il doit avoir l’annotation @Instance au dessus avec ton modid.justement je me perds dans le code et je ne sais plus dans quelle classe est déclarer la variable instance
-
Dans la classe principale.
-
-
Fais un ctrl+clic sur le mot INSTANCE juste avant le new EmotionGuiHandler et tu sera au bon endroit.
-
vraiment désole de te deranger mais ca me mets encore une erreur que je ne comprends pas.
A detailed walkthrough of the error, its code path and all known details is as follows: –------------------------------------------------------------------------------------- -- System Details -- Details: Minecraft Version: 1.7.10 Operating System: Windows 10 (amd64) version 10.0 Java Version: 1.8.0_141, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 777526544 bytes (741 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: GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.5.0 NVIDIA 375.63' Renderer: 'GeForce GT 620/PCIe/SSE2' [14:56:56] [Client thread/INFO] [MinecraftForge]: Attempting early MinecraftForge initialization [14:56:56] [Client thread/INFO] [FML]: MinecraftForge v10.13.4.1614 Initialized [14:56:56] [Client thread/INFO] [FML]: Replaced 183 ore recipies [14:56:56] [Client thread/INFO] [MinecraftForge]: Completed early MinecraftForge initialization [14:56:57] [Client thread/INFO] [FML]: Found 0 mods from the command line. Injecting into mod discoverer [14:56:57] [Client thread/INFO] [FML]: Searching C:\Users\florian\Desktop\forge-1.7.10-10.13.4.1614-1.7.10-src\eclipse\mods for mods [14:57:05] [Client thread/INFO] [FML]: Forge Mod Loader has identified 4 mods to load [14:57:05] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, drakamod] at CLIENT [14:57:05] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, drakamod] at SERVER [14:57:06] [Client thread/ERROR] [FML]: Fatal errors were detected during the transition from CONSTRUCTING to PREINITIALIZATION. Loading cannot continue [14:57:06] [Client thread/ERROR] [FML]: States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored UC mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) UC FML{7.10.99.99} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.4.1614-1.7.10.jar) UC Forge{10.13.4.1614} [Minecraft Forge] (forgeSrc-1.7.10-10.13.4.1614-1.7.10.jar) UE drakamod{1.0.0} [DrakaMod] (bin) [14:57:06] [Client thread/ERROR] [FML]: The following problems were captured during this phase [14:57:06] [Client thread/ERROR] [FML]: Caught exception from drakamod java.lang.IllegalAccessException: Can not set static final java.lang.Object field com.mod.drakania.DrakaMod.INSTANCE to com.mod.drakania.DrakaMod at sun.reflect.UnsafeFieldAccessorImpl.throwFinalFieldIllegalAccessException(Unknown Source) ~[?:1.8.0_141] at sun.reflect.UnsafeFieldAccessorImpl.throwFinalFieldIllegalAccessException(Unknown Source) ~[?:1.8.0_141] at sun.reflect.UnsafeQualifiedStaticObjectFieldAccessorImpl.set(Unknown Source) ~[?:1.8.0_141] at java.lang.reflect.Field.set(Unknown Source) ~[?:1.8.0_141] at cpw.mods.fml.common.FMLModContainer.parseSimpleFieldAnnotation(FMLModContainer.java:427) ~[forgeSrc-1.7.10-10.13.4.1614-1.7.10.jar:?] at cpw.mods.fml.common.FMLModContainer.processFieldAnnotations(FMLModContainer.java:358) ~[forgeSrc-1.7.10-10.13.4.1614-1.7.10.jar:?] at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:513) ~[forgeSrc-1.7.10-10.13.4.1614-1.7.10.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_141] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_141] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_141] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_141] at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) ~[guava-17.0.jar:?] at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) ~[guava-17.0.jar:?] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[guava-17.0.jar:?] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) ~[guava-17.0.jar:?] at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[guava-17.0.jar:?] at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:212) ~[forgeSrc-1.7.10-10.13.4.1614-1.7.10.jar:?] at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:190) ~[forgeSrc-1.7.10-10.13.4.1614-1.7.10.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_141] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_141] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_141] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_141] at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) ~[guava-17.0.jar:?] at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) ~[guava-17.0.jar:?] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[guava-17.0.jar:?] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) ~[guava-17.0.jar:?] at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[guava-17.0.jar:?] at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:119) [LoadController.class:?] at cpw.mods.fml.common.Loader.loadMods(Loader.java:513) [Loader.class:?] at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:208) [FMLClientHandler.class:?] at net.minecraft.client.Minecraft.startGame(Minecraft.java:522) [Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:942) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:164) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_141] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_141] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_141] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_141] 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 net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) [start/:?] at GradleStart.main(Unknown Source) [start/:?] [14:57:06] [Client thread/INFO] [STDOUT]: [net.minecraft.client.Minecraft:displayCrashReport:388]: –-- Minecraft Crash Report ---- // Daisy, daisy... Time: 29/07/17 14:57 Description: There was a severe problem during mod loading that has caused the game to fail cpw.mods.fml.common.LoaderException: java.lang.IllegalAccessException: Can not set static final java.lang.Object field com.mod.drakania.DrakaMod.INSTANCE to com.mod.drakania.DrakaMod at cpw.mods.fml.common.LoadController.transition(LoadController.java:163) at cpw.mods.fml.common.Loader.loadMods(Loader.java:544) at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:208) 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) Caused by: java.lang.IllegalAccessException: Can not set static final java.lang.Object field com.mod.drakania.DrakaMod.INSTANCE to com.mod.drakania.DrakaMod at sun.reflect.UnsafeFieldAccessorImpl.throwFinalFieldIllegalAccessException(Unknown Source) at sun.reflect.UnsafeFieldAccessorImpl.throwFinalFieldIllegalAccessException(Unknown Source) at sun.reflect.UnsafeQualifiedStaticObjectFieldAccessorImpl.set(Unknown Source) at java.lang.reflect.Field.set(Unknown Source) at cpw.mods.fml.common.FMLModContainer.parseSimpleFieldAnnotation(FMLModContainer.java:427) at cpw.mods.fml.common.FMLModContainer.processFieldAnnotations(FMLModContainer.java:358) at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:513) 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.loadMods(Loader.java:513) ... 12 more A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- System Details -- Details: Minecraft Version: 1.7.10 Operating System: Windows 10 (amd64) version 10.0 Java Version: 1.8.0_141, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 849390608 bytes (810 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.1614 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 UC mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) UC FML{7.10.99.99} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.4.1614-1.7.10.jar) UC Forge{10.13.4.1614} [Minecraft Forge] (forgeSrc-1.7.10-10.13.4.1614-1.7.10.jar) UE drakamod{1.0.0} [DrakaMod] (bin) GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.5.0 NVIDIA 375.63' Renderer: 'GeForce GT 620/PCIe/SSE2' [14:57:06] [Client thread/INFO] [STDOUT]: [net.minecraft.client.Minecraft:displayCrashReport:398]: #@!@# Game crashed! Crash report saved to: #@!@# C:\Users\florian\Desktop\forge-1.7.10-10.13.4.1614-1.7.10-src\eclipse\.\crash-reports\crash-2017-07-29_14.57.06-client.txt Java HotSpot(TM) 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release
-
L’instance ne doit pas être final.
-
Merci beaucoup ! je t’adore x)
Edit: par contre maintenant mes items se drop
http://prntscr.com/g1sq0f et ca aussi x) -
Merci beaucoup ! je t’adore x)
Edit: par contre maintenant mes items se drop
http://prntscr.com/g1sq0f et ca aussi x)
re, est-il possible d’interdire deux backpack dans l’inventaire ?
genre avec un public void (ItemStack itemStack, EntityPlayer player, List list, boolean par4)
{
if (itemStack.= null)
{
String owner = itemStack. (“Interdit”);
list.add(EnumChatFormatting.RED + owner);
}
}?
-
Merci beaucoup ! je t’adore x)
Edit: par contre maintenant mes items se drop
http://prntscr.com/g1sq0f et ca aussi x)
re, est-il possible d’interdire deux backpack dans l’inventaire ?
genre avec un public void (ItemStack itemStack, EntityPlayer player, List list, boolean par4)
{
if (itemStack.= null)
{
String owner = itemStack. (“Interdit”);
list.add(EnumChatFormatting.RED + owner);
}
}?
-
Merci beaucoup ! je t’adore x)
Edit: par contre maintenant mes items se drop
http://prntscr.com/g1sq0f et ca aussi x)
re, est-il possible d’interdire deux backpack dans l’inventaire ?
genre avec un public void (ItemStack itemStack, EntityPlayer player, List list, boolean par4)
{
if (itemStack.= null)
{
String owner = itemStack. (“Interdit”);
list.add(EnumChatFormatting.RED + owner);
}
}?
C’est assez compliqué à faire car il faudrait soit modifier le code de minecraft soit empêcher à plein d’endroits qu’un nouvel item soit ajouté. En revanche ce qui est plus simple c’est de sauvegarder le backpack sur le joueur et ainsi peu importe quel backpack le joueur ouvrira ce sera le même (c’est le fonctionnement du coffre de l’end)