Jump to content

Recommended Posts

Posted

I am adding an Item to my mod, but when the client starts I get a NoSuchMethodError from setUnlocalizedName.

Crash

 

---- Minecraft Crash Report ----

 

WARNING: coremods are present:

Contact their authors BEFORE contacting forge

 

// Sorry :(

 

Time: 12/13/16 4:54 PM

Description: There was a severe problem during mod loading that has caused the game to fail

 

net.minecraftforge.fml.common.LoaderExceptionModCrash: Caught exception from Mo' Cake Mod (mocakemod)

Caused by: java.lang.NoSuchMethodError: com.computerdude.cake.items.ItemDough.setUnlocalizedName(Ljava/lang/String;)Lnet/minecraft/item/Item;

at com.computerdude.cake.items.ItemDough.<init>(ItemDough.java:12)

at com.computerdude.cake.init.ModItems.init(ModItems.java:18)

at com.computerdude.cake.Main.PreInit(Main.java:27)

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:483)

at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:600)

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:483)

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 net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:243)

at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:221)

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:483)

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 net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:145)

at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:614)

at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:257)

at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:439)

at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:351)

at net.minecraft.client.main.Main.main(SourceFile:124)

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:483)

at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)

at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

 

 

A detailed walkthrough of the error, its code path and all known details is as follows:

---------------------------------------------------------------------------------------

 

-- System Details --

Details:

Minecraft Version: 1.10.2

Operating System: Windows 10 (amd64) version 10.0

Java Version: 1.8.0_25, Oracle Corporation

Java VM Version: Java HotSpot 64-Bit Server VM (mixed mode), Oracle Corporation

Memory: 118808504 bytes (113 MB) / 397025280 bytes (378 MB) up to 1060372480 bytes (1011 MB)

JVM Flags: 6 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xmx1G -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:-UseAdaptiveSizePolicy -Xmn128M

IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0

FML: MCP 9.32 Powered by Forge 12.18.3.2185 Optifine OptiFine_1.10.2_HD_U_D4 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

UCH mcp{9.19} [Minecraft Coder Pack] (minecraft.jar)

UCH FML{8.0.99.99} [Forge Mod Loader] (forge-1.10.2-12.18.3.2185.jar)

UCH Forge{12.18.3.2185} [Minecraft Forge] (forge-1.10.2-12.18.3.2185.jar)

UCE mocakemod{1.0.0} [Mo' Cake Mod] (Mod Test.jar)

Loaded coremods (and transformers):

GL info: ' Vendor: 'Intel' Version: '3.1.0 - Build 9.17.10.4229' Renderer: 'Intel® HD Graphics 3000'

OptiFine Version: OptiFine_1.10.2_HD_U_D4

Render Distance Chunks: 2

Mipmaps: 4

Anisotropic Filtering: 1

Antialiasing: 0

Multitexture: false

Shaders: null

OpenGlVersion: 3.1.0 - Build 9.17.10.4229

OpenGlRenderer: Intel® HD Graphics 3000

OpenGlVendor: Intel

CpuCount: 4

 

 

Item Class

 

package com.computerdude.cake.items;

 

import com.computerdude.cake.CakeMod;

 

import net.minecraft.item.Item;

import net.minecraft.util.ResourceLocation;

 

public class ItemDough extends Item {

 

public ItemDough(String unlocalizedName, String registryName) {

 

this.setUnlocalizedName(unlocalizedName);

this.setRegistryName(new ResourceLocation(CakeMod.MODID, registryName));

 

}

 

}

 

 

ModItems Class

 

package com.computerdude.cake.init;

 

import com.computerdude.cake.CakeMod;

import com.computerdude.cake.items.ItemDough;

import com.computerdude.cake.util.Utils;

 

import net.minecraft.client.renderer.block.model.ModelResourceLocation;

import net.minecraft.item.Item;

import net.minecraft.util.ResourceLocation;

import net.minecraftforge.client.model.ModelLoader;

import net.minecraftforge.fml.common.registry.GameRegistry;

 

public class ModItems {

 

public static Item dough;

 

public static void init() {

dough = new ItemDough("dough", "dough");

}

 

public static void register() {

registerItem(dough);

}

 

public static void registerRenders() {

registerRender(dough);

}

 

public static void registerItem(Item item) {

GameRegistry.register(item);

Utils.getLogger().info("Registered Models: " + item.getUnlocalizedName().substring(5));

}

 

public static void registerRender(Item item) {

ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(

new ResourceLocation(CakeMod.MODID, item.getUnlocalizedName().substring(5)), "inventory"));

 

Utils.getLogger().info("Registered Render: " + item.getUnlocalizedName().substring(5));

 

}

 

}

 

 

Posted

How did you export your mod?

 

Theres the thing. Some reason I can't run a minecraft instance through eclipse (http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/modification-development/2771426-pixel-format-not-accelerated-only-in-eclipse)

 

Also I am not exactly sure how to export correctly, so I Right Click > Export > Jar File and make sure that only src and Resources are selected (and everything inside)

Posted

Disabled the loading screen as described in the EAQ. This should fix the not being able to run Minecraft.

 

To build your mod, run

gradlew build

from the command line, the sam way you setup you workspace.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Posted

Disabled the loading screen as described in the EAQ. This should fix the not being able to run Minecraft.

 

To build your mod, run

gradlew build

from the command line, the sam way you setup you workspace.

 

Where is Splash.Properties? Not in config/run where mods is, not in eclipse, not where I would expect it. I searched the whole folder and didn't see it.

 

Also I will try gradlew build.

Posted

Disabled the loading screen as described in the EAQ. This should fix the not being able to run Minecraft.

 

To build your mod, run

gradlew build

from the command line, the sam way you setup you workspace.

 

Okay so gradlew build worked, Thanks. One last thing: I can't find splash.properties as said in the EAQ. Running from eclipse would make it incredibly easier for me.

Posted

It is in your run directory, then in

config/splash.properties

.

 

It doesnt exist so I will just make it in there using the config from my forge client.

 

UPDATE - I am still getting "Pixel Format not Accelerated" when running. I am not sure if this is helpful or not but this message is spamming console before the crash: "2016-12-14 12:19:35,606 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream"

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.