Jump to content

Custom tools crash minecraft, post init and init help needed


hhggtg3279

Recommended Posts

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);

 

}

}

 

Link to comment
Share on other sites

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);

 

 

}

}

 

Link to comment
Share on other sites

Different crash mind you, but use ItemAxe(Item.ToolMaterial, float, float) instead of ItemAxe(Item.ToolMaterial)

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • So, lately my modloader (curseforge) has been loading 162 mods instead of the 97 that my modpack only has, appart of that, when I try to join onto my public server the curseforge logs just starts spamming "OpenGL debug message: id=1280, source=API, type=ERROR, severity=HIGH, message='GL error GL_INVALID_ENUM'" and just freezes, my drivers are up to date, I've reinstalled curseforge, same with minecraft launcher, the java is updated, I've got enough ram and I got no viruses, Long after all this happened, my game could enter my online server and it didn't register as many mods, even my game was running at 40 fps, now I can't even play multiplayer, and when I try singleplayer, it goes about 20 fps to 10
    • It does but I'm struggling to see how to make it work in my recipe? (Its structure is the same as OP's, with a serializer subclass)
    • That looks pretty cool, nice!   Sure, so looking at that JSON file I posted, I pretty much made a record class for each "custom" data type in that JSON. The Input is a good example of why ``` "inputs": [ { "ingredient": { "item": "relativedimensions:aberrant_shard" }, "count": 8 } ], ``` So here's the inputs, it's an array, which we can use the Codec builder's builder.listOf to define an array. Each Item is of some arbitrary object with keys "ingredient" (which we know is an Ingredient) and a "count" which is an int. You don't have to have an intermediate class to map this to necessarily but I found that it's just easier to see the data that way, hence the 'ParticleReboundIngredient' represents one of these inputs.   Let me know if that makes sense or not. 
    • Pretty much, although all the recipes im planning to make on it are shapeless. The idea is that the chamber uses energy to "fuse" the items in each of the center slots together, in this case an ingot. The two slots at the sides are fuel. (A special kind of wood in this case). Here is an image of the interface just for reference (The center slot is the output)   As for the code- Can you elaborate a little bit on it? Seeing three different record classes has confused me a lot. (Elaborate as in why make them in three different records. I understand the code itself more or less)
    • Hello im trying to make a mod and the past few days GSON has almost killed me, when i export the mod and then launch it through minecraft launcher i get java.lang.NoSuchMethodError: com.google.gson.JsonParser.parseString(Ljava/lang/String;)Lcom/google/gson/JsonElement; i have literally tried everything here is my build config   dependencies { minecraft("com.mojang:minecraft:1.8.9") mappings("de.oceanlabs.mcp:mcp_stable:22-1.8.9") forge("net.minecraftforge:forge:1.8.9-11.15.1.2318-1.8.9") compileOnly("cc.polyfrost:oneconfig-1.8.9-forge:0.2.2-alpha+") shadowImpl("cc.polyfrost:oneconfig-wrapper-launchwrapper:1.0.0-beta+") { isTransitive = false exclude(module = "gson") } shadowImpl("org.spongepowered:mixin:0.7.11-SNAPSHOT") { isTransitive = false exclude(module = "gson") } annotationProcessor("org.spongepowered:mixin:0.8.5-SNAPSHOT") shadowImpl("org.javassist:javassist:3.15.0-GA") { isTransitive = false exclude(module = "gson") } shadowImpl("com.neovisionaries:nv-i18n:1.28") { isTransitive = false exclude(module = "gson") } shadowImpl("org.apache.commons:commons-lang3:3.4") { isTransitive = false exclude(module = "gson") } shadowImpl("org.apache.httpcomponents:httpcore:4.4.5") { isTransitive = false exclude(module = "gson") } compileOnly("com.google.code.gson:gson:2.8.6") { isTransitive = false } configurations.all { resolutionStrategy { force("com.google.code.gson:gson:2.8.6") } } shadowImpl(fileTree( mapOf( "dir" to "libs", "include" to listOf("*.jar"), "exclude" to listOf( "asm", "asm-commons", "asm-tree", "gson", "unspecified", "nv-i18n" ) ) )) }  
  • Topics

×
×
  • Create New...

Important Information

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