Posted July 28, 201312 yr Hi. Whenever I run my mod in my minecraft forge server my server crashes Heres my crash log: ---- Minecraft Crash Report ---- // Why did you do that? Time: 7/28/13 10:21 AM Description: Exception in server tick loop cpw.mods.fml.common.LoaderException: java.lang.NoSuchMethodError: net.minecraft.src.ModLoader.addArmor(Ljava/lang/String;)I at cpw.mods.fml.common.LoadController.transition(LoadController.java:148) at cpw.mods.fml.common.Loader.initializeMods(Loader.java:698) at cpw.mods.fml.server.FMLServerHandler.finishServerLoading(FMLServerHandler.java:94) at cpw.mods.fml.common.FMLCommonHandler.onServerStarted(FMLCommonHandler.java:355) at net.minecraft.server.dedicated.DedicatedServer.func_71197_b(DedicatedServer.java:141) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:443) at net.minecraft.server.ThreadMinecraftServer.run(SourceFile:582) Caused by: java.lang.NoSuchMethodError: net.minecraft.src.ModLoader.addArmor(Ljava/lang/String;)I at Kenoba10.Too_Much_Tools.common.Too_Much_Tools.load(Too_Much_Tools.java:284) 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:540) 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.EventHandler.handleEvent(EventHandler.java:74) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) at com.google.common.eventbus.EventBus.post(EventBus.java:267) at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:193) at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:173) 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.EventHandler.handleEvent(EventHandler.java:74) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) at com.google.common.eventbus.EventBus.post(EventBus.java:267) at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:104) at cpw.mods.fml.common.Loader.initializeMods(Loader.java:697) ... 5 more A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- System Details -- Details: Minecraft Version: 1.6.2 Operating System: Windows 7 (amd64) version 6.1 Java Version: 1.7.0_25, Oracle Corporation Java VM Version: Java HotSpot 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 864370504 bytes (824 MB) / 1029046272 bytes (981 MB) up to 1029046272 bytes (981 MB) JVM Flags: 2 total; -Xmx1024M -Xms1024M AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used Suspicious classes: FML and Forge are installed IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: MCP v8.04 FML v6.2.19.789 Minecraft Forge 9.10.0.789 4 mods loaded, 4 mods active mcp{8.04} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized FML{6.2.19.789} [Forge Mod Loader] (coremods) Unloaded->Constructed->Pre-initialized->Initialized Forge{9.10.0.789} [Minecraft Forge] (coremods) Unloaded->Constructed->Pre-initialized->Initialized ToolCraft{Beta 1.0} [Tool Craft] (ToolCraft Beta 1.0.zip) Unloaded->Constructed->Pre-initialized->Errored Profiler Position: N/A (disabled) Is Modded: Definitely; Server brand changed to 'fml,forge' Type: Dedicated Server (map_server.txt)
July 28, 201312 yr Author I'm using Forge Not really. The crash is from you calling a ModLoader method. well it works just fine in my Minecraft and Eclipse but not on the server And this is what the tutorial i watched a few months ago told me to do to create armor
July 28, 201312 yr Author I'm using Forge Not really. The crash is from you calling a ModLoader method. I initialized the armor and when I did i used for the 3rd parameter ModLoader.addArmor() and it works with forge in eclipse and in client
July 28, 201312 yr Author well it works just fine in my Minecraft and Eclipse but not on the server And this is what the tutorial i watched a few months ago told me to do to create armor it works fine in the client because FML includes a ModLoader legacy layer so that it can run ModLoader mods. But that only exists on the client (since ModLoader it self is only client-side, too). If you got this from a tutorial then go kick the author in the butt. Ok thanks I'll do that but how would I do it otherwise do you know?
July 28, 201312 yr Author Look at Item#getArmorTexture. I did some research and I figured it out otherwise
July 28, 201312 yr Author getArmorTexture in the Item class. Thats how it's done properly. but getArmorTexture returns a string and you need an int. My current code is CoalHelmet = new ItemCoalHelmet(23252, armorCoal, ModLoader.addArmor("Coal"), 0).setUnlocalizedName("Coal Helmet").setCreativeTab(CreativeTabs.tabCombat); [/code
July 28, 201312 yr Author How is the name of a texture an int? no in the code CoalHelmet = new ItemCoalHelmet(23252, armorCoal, addArmor("Coal"), 0).setUnlocalizedName("Coal Helmet").setCreativeTab(CreativeTabs.tabCombat); the 3rd parameter was ModLoader.addArmor("Coal"); but how can i do it without that the 3rd parameter is an int
July 28, 201312 yr Author Just set it to any number between 0 and 4 (inclusive). getArmorTexture gets preference over these. I did soem research and i figured out how to properly do it right and I think its working thanks though
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.