Jump to content

Recommended Posts

Posted

For some reason my minecraft is crashing after adding a custom material for my tools, im not sure what is causing it as I have no errors.

 

Crash report

 

 

---- Minecraft Crash Report ----

// On the bright side, I bought you a teddy bear!

Time: 15/08/16 02:47

Description: Initializing game

java.lang.NullPointerException: Initializing game

at net.minecraft.item.ItemSword.<init>(ItemSword.java:27)

at top.mod.init.coppersword.<init>(coppersword.java:8)

at top.mod.init._items.preinit(_items.java:25)

at top.mod.proxy.CommonProxy.preinit(CommonProxy.java:14)

at top.mod.proxy.ClientProxy.preinit(ClientProxy.java:15)

at top.mod.main.topmod.preinit(topmod.java:30)

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.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:597)

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

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

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

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

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

at net.minecraft.client.Minecraft.startGame(Minecraft.java:477)

at net.minecraft.client.Minecraft.run(Minecraft.java:386)

at net.minecraft.client.main.Main.main(Main.java:118)

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 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.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)

at GradleStart.main(GradleStart.java:26)

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

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

-- Head --

Thread: Client thread

Stacktrace:

at net.minecraft.item.ItemSword.<init>(ItemSword.java:27)

at top.mod.init.coppersword.<init>(coppersword.java:8)

at top.mod.init._items.preinit(_items.java:25)

at top.mod.proxy.CommonProxy.preinit(CommonProxy.java:14)

at top.mod.proxy.ClientProxy.preinit(ClientProxy.java:15)

at top.mod.main.topmod.preinit(topmod.java:30)

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.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:597)

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

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

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

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

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

at net.minecraft.client.Minecraft.startGame(Minecraft.java:477)

-- Initialization --

Details:

Stacktrace:

at net.minecraft.client.Minecraft.run(Minecraft.java:386)

at net.minecraft.client.main.Main.main(Main.java:118)

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 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.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)

at GradleStart.main(GradleStart.java:26)

-- System Details --

Details:

Minecraft Version: 1.10.2

Operating System: Windows 8.1 (x86) version 6.3

Java Version: 1.8.0_45, Oracle Corporation

Java VM Version: Java HotSpot Client VM (mixed mode), Oracle Corporation

Memory: 909705992 bytes (867 MB) / 1060372480 bytes (1011 MB) up to 1060372480 bytes (1011 MB)

JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M

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

FML: MCP 9.32 Powered by Forge 12.18.1.2056 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] (forgeSrc-1.10.2-12.18.1.2056.jar)

UCH Forge{12.18.1.2056} [Minecraft Forge] (forgeSrc-1.10.2-12.18.1.2056.jar)

UCE tm{1.10-R1} [Miner's Delight] (bin)

Loaded coremods (and transformers):

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

Launched Version: 1.10.2

LWJGL: 2.9.4

OpenGL: Intel® HD Graphics GL version 3.1.0 - Build 9.17.10.4229, Intel

GL Caps: Using GL 1.3 multitexturing.

Using GL 1.3 texture combiners.

Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported.

Shaders are available because OpenGL 2.1 is supported.

VBOs are available because OpenGL 1.5 is supported.

Using VBOs: No

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)

CPU: 2x Intel® Celeron® CPU G530 @ 2.40GHz

 

 

Here is my Items registry class

 

package top.mod.init;

import net.minecraft.client.Minecraft;

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

import net.minecraft.creativetab.CreativeTabs;

import net.minecraft.item.Item;

import net.minecraft.item.Item.ToolMaterial;

import net.minecraft.util.ResourceLocation;

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

import top.mod.main.reference;

import top.mod.mat._toolmat;

public class _items {

 

public static Item copper;

 

public static Item coppersword;

public static Item copperpick;

public static Item coppershovel;

public static Item copperaxe;

public static Item copperhoe;

 

public static final void preinit(){

copper = registerItem(new copper(), "copper");

coppersword = registerItem(new coppersword(_toolmat.coppermaterial), "coppersword");

copperpick = registerItem(new copperpick(_toolmat.coppermaterial), "copperpick");

coppershovel = registerItem(new coppershovel(_toolmat.coppermaterial), "coppershovel");

copperaxe = registerItem(new copperaxe(_toolmat.coppermaterial), "copperaxe");

copperhoe = registerItem(new copperhoe(_toolmat.coppermaterial), "copperhoe");

}

public static final void registerRenders() {

registerRender(copper);

registerRender(coppersword);

registerRender(copperpick);

registerRender(coppershovel);

registerRender(copperaxe);

registerRender(copperhoe);

 

}

 

public static final void registerRender(Item i){

Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(i,0,

new ModelResourceLocation(reference.MODID + ":" + i.getRegistryName().getResourcePath(), "inventory"));

 

}

 

public static final Item registerItem(Item i, String n){

ResourceLocation r = new ResourceLocation(reference.MODID, n);

 

i.setUnlocalizedName(n);

i.setRegistryName®;

i.setCreativeTab(CreativeTabs.MATERIALS);

 

GameRegistry.register(i);

return i;

 

}

 

}

 

 

Custom material class

 

package top.mod.mat;

import net.minecraft.item.Item.ToolMaterial;

import net.minecraftforge.common.util.EnumHelper;

public class _toolmat {

 

public static ToolMaterial coppermaterial;

 

public static final void preinit(){

coppermaterial = EnumHelper.addToolMaterial("coppermaterial", 1, 181, 6.0F, 2.0F, 14);

 

 

 

}

}

 

 

 

Copper sword class

 

package top.mod.init;

import net.minecraft.item.ItemSword;

public class coppersword extends ItemSword{

public coppersword(ToolMaterial mat) {

super(mat);

 

}

}

 

Posted

Still getting crash

 

Look im just confused why its crashing, I restarted again here are my classes now

 

New crash report

 

 

---- Minecraft Crash Report ----

// Hey, that tickles! Hehehe!

Time: 15/08/16 03:49

Description: Initializing game

java.lang.ArrayIndexOutOfBoundsException: 5

at net.minecraft.item.ItemAxe.<init>(ItemAxe.java:19)

at top.mod.init.copperaxe.<init>(copperaxe.java:9)

at top.mod.init._items.preinit(_items.java:34)

at top.mod.proxy.CommonProxy.preinit(CommonProxy.java:14)

at top.mod.proxy.ClientProxy.preinit(ClientProxy.java:15)

at top.mod.main.topmod.preinit(topmod.java:30)

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.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:597)

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

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

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

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

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

at net.minecraft.client.Minecraft.startGame(Minecraft.java:477)

at net.minecraft.client.Minecraft.run(Minecraft.java:386)

at net.minecraft.client.main.Main.main(Main.java:118)

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 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.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)

at GradleStart.main(GradleStart.java:26)

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

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

-- Head --

Thread: Client thread

Stacktrace:

at net.minecraft.item.ItemAxe.<init>(ItemAxe.java:19)

at top.mod.init.copperaxe.<init>(copperaxe.java:9)

at top.mod.init._items.preinit(_items.java:34)

at top.mod.proxy.CommonProxy.preinit(CommonProxy.java:14)

at top.mod.proxy.ClientProxy.preinit(ClientProxy.java:15)

at top.mod.main.topmod.preinit(topmod.java:30)

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.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:597)

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

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

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

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

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

at net.minecraft.client.Minecraft.startGame(Minecraft.java:477)

-- Initialization --

Details:

Stacktrace:

at net.minecraft.client.Minecraft.run(Minecraft.java:386)

at net.minecraft.client.main.Main.main(Main.java:118)

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 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.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)

at GradleStart.main(GradleStart.java:26)

-- System Details --

Details:

Minecraft Version: 1.10.2

Operating System: Windows 8.1 (x86) version 6.3

Java Version: 1.8.0_45, Oracle Corporation

Java VM Version: Java HotSpot Client VM (mixed mode), Oracle Corporation

Memory: 906933136 bytes (864 MB) / 1060372480 bytes (1011 MB) up to 1060372480 bytes (1011 MB)

JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M

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

FML: MCP 9.32 Powered by Forge 12.18.1.2056 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] (forgeSrc-1.10.2-12.18.1.2056.jar)

UCH Forge{12.18.1.2056} [Minecraft Forge] (forgeSrc-1.10.2-12.18.1.2056.jar)

UCE tm{1.10-R1} [Miner's Delight] (bin)

Loaded coremods (and transformers):

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

Launched Version: 1.10.2

LWJGL: 2.9.4

OpenGL: Intel® HD Graphics GL version 3.1.0 - Build 9.17.10.4229, Intel

GL Caps: Using GL 1.3 multitexturing.

Using GL 1.3 texture combiners.

Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported.

Shaders are available because OpenGL 2.1 is supported.

VBOs are available because OpenGL 1.5 is supported.

Using VBOs: No

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)

CPU: 2x Intel® Celeron® CPU G530 @ 2.40GHz

 

 

Items

 

package top.mod.init;

import net.minecraft.client.Minecraft;

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

import net.minecraft.creativetab.CreativeTabs;

import net.minecraft.item.Item;

import net.minecraft.item.Item.ToolMaterial;

import net.minecraft.item.ItemSword;

import net.minecraft.util.ResourceLocation;

import net.minecraftforge.common.util.EnumHelper;

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

import top.mod.main.reference;

public class _items {

 

public static Item copper;

 

public static Item coppersword;

public static Item copperpick;

public static Item coppershovel;

public static Item copperaxe;

public static Item copperhoe;

 

public static final void preinit(){

coppersword = registerItem(new coppersword(toolmat.COPPER), "coppersword");

copperpick = registerItem(new copperpick(toolmat.COPPER), "copperpick");

coppershovel = registerItem(new coppershovel(toolmat.COPPER), "coppershovel");

copperaxe = registerItem(new copperaxe(toolmat.COPPER), "copperaxe");

copperhoe = registerItem(new copperhoe(toolmat.COPPER), "copperhoe");

copper = registerItem(new copper(), "copper");

 

 

 

}

public static final void registerRenders() {

registerRender(copper);

registerRender(coppersword);

registerRender(copperpick);

registerRender(coppershovel);

registerRender(copperaxe);

registerRender(copperhoe);

 

}

 

public static final void registerRender(Item i){

Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(i,0,

new ModelResourceLocation(reference.MODID + ":" + i.getRegistryName().getResourcePath(), "inventory"));

 

}

 

public static final Item registerItem(Item i, String n){

ResourceLocation r = new ResourceLocation(reference.MODID, n);

 

i.setUnlocalizedName(n);

i.setRegistryName®;

i.setCreativeTab(CreativeTabs.MATERIALS);

 

GameRegistry.register(i);

return i;

 

}

}

 

Tool mat

package top.mod.init;

import net.minecraft.item.Item.ToolMaterial;

import net.minecraftforge.common.util.EnumHelper;

public class toolmat

{

public static ToolMaterial COPPER = EnumHelper.addToolMaterial("COPPER", 1, 181, 6.0F, 2.0F, 14);

}

 

CommonProxy

 

package top.mod.proxy;

import net.minecraftforge.fml.common.event.FMLInitializationEvent;

import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;

import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;

import top.mod.block._blocks;

import top.mod.init._items;

public class ClientProxy extends CommonProxy{

@Override

public void preinit(FMLPreInitializationEvent event)

 

{

super.preinit(event);

 

}

@Override

public void init(FMLInitializationEvent event)

{

super.init(event);

_items.registerRenders();

_blocks.registerRenders();

}

@Override

public void postinit(FMLPostInitializationEvent event)

{

super.postinit(event);

 

 

}

}

 

Posted

This is my axe class, so how would it look, to stop the crash?

 

 

package top.mod.init;

 

import net.minecraft.item.ItemAxe;

 

public class copperaxe extends ItemAxe{

 

protected copperaxe(ToolMaterial mat) {

super(mat);

 

}

 

}

 

 

 

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.