Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

---- SOLVED ------ Problem with programming 2 different Armor (Chestplates)


Jean
 Share

Recommended Posts

Hi,

I'm trying to have 2 Chestplates in my Mod.

the first one is part of a normal armor and the second one should be used for a kind of Jetpack

 

I' working with Eclipse Mars nand have in the Path items following 2 Packages.

 

But Minecraft direcly crashed by starting

 

can someone helps me to correct my programm (mod)

 

copy of the crash report can be found at the end

 

 

package com.DomsMod.items;

import com.DomsMod.DomsMod;

import net.minecraft.entity.Entity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;

public class ItemJetpackArmor extends ItemArmor{

public ItemJetpackArmor(ArmorMaterial material, int renderIndex, int armorType) {
	super(material, renderIndex, armorType);

	switch(armorType) {
	case 1: setUnlocalizedName("jetpack"); break;
	}

	setCreativeTab(DomsMod.tabCustomTab);
}

@Override
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
	if(slot == 1) {
		return "DomsMod:textures/models/armor/jetpack_layer_1.png";
	} else{
		return null;
	}
}
}

 

 

package com.DomsMod.items;

import com.DomsMod.DomsMod;

import net.minecraft.entity.Entity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;

public class ItemJadeArmor extends ItemArmor{

public ItemJadeArmor(ArmorMaterial material, int renderIndex, int armorType) {
	super(material, renderIndex, armorType);

	switch(armorType) {
	case 0: setUnlocalizedName("jadeHelmet"); break;
	case 1: setUnlocalizedName("jadeChestplate"); break;
	case 2: setUnlocalizedName("jadeLeggings"); break;
	case 3: setUnlocalizedName("jadeBoots"); break;
	}

	setCreativeTab(DomsMod.tabCustomTab);
}

@Override
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
	if(slot == 0 ||slot == 1 ||  slot == 3) {
		return "DomsMod:textures/models/armor/jade_layer_1.png";
	         } else if (slot == 2) {
		                 return "DomsMod:textures/models/armor/jade_layer_2.png";
	                          } else{
		                        return null;
	                          }
}
}

 

 

---- Minecraft Crash Report ----

// This is a token for 1 free hug. Redeem at your nearest Mojangsta: [~~HUG~~]

 

Time: 02.12.16 16:30

Description: Initializing game

 

java.lang.ExceptionInInitializerError

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Class.java:278)

at net.minecraftforge.fml.common.FMLModContainer.constructMod(FMLModContainer.java:425)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

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

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

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

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

at net.minecraftforge.fml.common.Loader.loadMods(Loader.java:493)

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

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

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

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

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

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.ArrayIndexOutOfBoundsException: 1

at net.minecraft.item.ItemArmor$ArmorMaterial.getDamageReductionAmount(ItemArmor.java:288)

at net.minecraft.item.ItemArmor.<init>(ItemArmor.java:83)

at com.DomsMod.items.ItemJetpackArmor.<init>(ItemJetpackArmor.java:13)

at com.DomsMod.DomsMod.<clinit>(DomsMod.java:99)

... 37 more

 

 

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

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

 

-- Head --

Stacktrace:

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Class.java:278)

at net.minecraftforge.fml.common.FMLModContainer.constructMod(FMLModContainer.java:425)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

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

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

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

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

at net.minecraftforge.fml.common.Loader.loadMods(Loader.java:493)

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

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

 

-- Initialization --

Details:

Stacktrace:

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

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

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

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.8

Operating System: Windows 8.1 (amd64) version 6.3

Java Version: 1.7.0_80, Oracle Corporation

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

Memory: 827842576 bytes (789 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)

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

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

FML: MCP v9.10 FML v8.0.42.1341 Minecraft Forge 11.14.1.1341 4 mods loaded, 4 mods active

mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed

FML{8.0.42.1341} [Forge Mod Loader] (forgeSrc-1.8-11.14.1.1341.jar) Unloaded->Constructed

Forge{11.14.1.1341} [Minecraft Forge] (forgeSrc-1.8-11.14.1.1341.jar) Unloaded->Constructed

domsmod{1.0} [domsmod] (bin) Unloaded

Loaded coremods (and transformers):

Launched Version: 1.8

LWJGL: 2.9.1

OpenGL: Intel® HD Graphics 4000 GL version 4.0.0 - Build 10.18.10.4358, 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)

 

 

Link to comment
Share on other sites

hereunder the main part of the Mod.

 

 

package com.DomsMod;


/*Import Domsmod*/
/*Blocks*/
import com.DomsMod.blocks.BlockJadeBlock;
import com.DomsMod.blocks.BlockJadeOre;
import com.DomsMod.blocks.BlockMinze;
import com.DomsMod.dom.CustomCreativeTab;
import com.DomsMod.dom.OreGenerator;

/*Items*/
import com.DomsMod.items.ItemJade;
import com.DomsMod.items.ItemJadeArmor;
import com.DomsMod.items.ItemJadeAxe;
import com.DomsMod.items.ItemJadeBow;
import com.DomsMod.items.ItemJadeHoe;
import com.DomsMod.items.ItemJadePickaxe;
import com.DomsMod.items.ItemJadeSpade;
import com.DomsMod.items.ItemJadeSword;
import com.DomsMod.items.ItemJetpackArmor;
import com.DomsMod.items.ItemMuesli;
import com.DomsModUtils.Events;
import com.sun.org.apache.xpath.internal.operations.Variable;

/*Import Minecraft*/
/*Blocks*/
import net.minecraft.block.Block;

import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.model.ModelBakery;
import net.minecraft.client.resources.model.ModelResourceLocation;

import net.minecraft.creativetab.CreativeTabs;

import net.minecraft.init.Blocks;
import net.minecraft.init.Items;

/*Items*/
import net.minecraft.item.Item;
import net.minecraft.item.Item.ToolMaterial;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemArmor.ArmorMaterial;
import net.minecraft.item.ItemBow;
import net.minecraft.item.ItemDye;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemSeeds;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraftforge.common.MinecraftForge;
/*Import Forge*/
import net.minecraftforge.common.util.EnumHelper;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.ModMetadata;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.registry.GameRegistry;


@Mod(modid = "domsmod")

public class DomsMod {

public static final String MODID = "domsmod";

/*Tool-Materials*/
public static ToolMaterial jadeToolMaterial = EnumHelper.addToolMaterial("jadeToolMaterial", 4, 60, 5, 20, 4);

/*Armor-Materials*/
public static ArmorMaterial jadeArmorMaterial = EnumHelper.addArmorMaterial("jadeArmorMaterial", "..", 60, new int[] {2, 6, 4, 2}, 4);

/*Jetpack*/
public static ArmorMaterial jetpackArmorMaterial = EnumHelper.addArmorMaterial("jetpackArmorMaterial", "..", 64, new int[] {6}, 1);

/*Creative-tabs*/
public static CreativeTabs tabCustomTab = new CustomCreativeTab();

/* Items*/
public static Item jade = new ItemJade ();

public static BlockMinze minze = new BlockMinze ();
public static ItemSeeds minzeSeeds = new ItemSeeds(minze, null);

public static Item jadeSword = new ItemJadeSword ();

public static ItemJadeAxe jadeAxe = new ItemJadeAxe ();
public static ItemJadePickaxe jadePickaxe = new ItemJadePickaxe ();
public static ItemJadeHoe jadeHoe = new ItemJadeHoe ();
public static ItemJadeSpade jadeSpade = new ItemJadeSpade ();

public static ItemArmor jadeHelmet = new ItemJadeArmor (jadeArmorMaterial, 0, 0);
public static ItemArmor jadeChestplate = new ItemJadeArmor (jadeArmorMaterial, 0, 1);
public static ItemArmor jadeBoots = new ItemJadeArmor (jadeArmorMaterial, 0, 3);
public static ItemArmor jadeLeggings = new ItemJadeArmor (jadeArmorMaterial, 0, 2);

public static ItemArmor jetpack = new ItemJetpackArmor(jetpackArmorMaterial, 0, 1);

public static ItemBow jadeBow = new ItemJadeBow ();

public static ItemFood muesli = new ItemMuesli ();

/*Blocks*/
public static Block jadeOre = new BlockJadeOre ();
public static Block jadeBlock = new BlockJadeBlock ();


@EventHandler
public void PreInit(FMLPreInitializationEvent event) {
	ModMetadata data = event.getModMetadata();
	data.autogenerated = false;
	data.name = EnumChatFormatting.DARK_GREEN + "DomsMod";
	data.description = EnumChatFormatting.YELLOW + "" + EnumChatFormatting.BOLD  +"Ermöglicht das Benutzen von Jade als Werkstoff";
	data.credits = EnumChatFormatting.RED + "" + EnumChatFormatting.ITALIC + "Dom1900 + Jean1900";
	data.logoFile = "assets/domsmod/textures/logo/server-icon.png";


	/*Items-Registry*/
	GameRegistry.registerItem(jade, "jade");
	GameRegistry.registerItem(jadeSword, "jade_sword");
	GameRegistry.registerItem(jadeAxe, "jade_axe");
	GameRegistry.registerItem(jadePickaxe, "jade_pickaxe");
	GameRegistry.registerItem(jadeHoe, "jade_hoe");
	GameRegistry.registerItem(jadeSpade, "jade_spade");
	GameRegistry.registerItem(muesli, "muesli");
	GameRegistry.registerItem(minzeSeeds, "minze_seeds");	
	GameRegistry.registerItem(jadeBow, "jade_bow");
	ModelBakery.addVariantName(jadeBow, "domsmod:jade_bow", "domsmod:jade_bow_pull0", "domsmod:jade_bow_pull1", "domsmod:jade_bow_pull2");



	/*Block-Registry*/
	GameRegistry.registerBlock(jadeOre, "jade_ore");
   	GameRegistry.registerBlock(jadeBlock, "jade_block");
   	GameRegistry.registerBlock(minze, "minze");
   	
    /*Worl-Generator*/
    GameRegistry.registerWorldGenerator(new OreGenerator(jadeOre), 0);
    
	}


@EventHandler
public void init(FMLInitializationEvent event) {

	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(minzeSeeds, 0, new ModelResourceLocation("domsmod:minze_seeds","Inventory"));
	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(minze), 0, new ModelResourceLocation("domsmod:minze_seeds","Inventory"));
	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(jade, 0, new ModelResourceLocation ("domsmod:jade", "Inventory"));
    Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(jadeOre), 0, new ModelResourceLocation("domsmod:jade_ore", "Inventory"));
    Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(jadeBlock), 0, new ModelResourceLocation("domsmod:jade_block", "Inventory"));
	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(jadeSword, 0, new ModelResourceLocation ("domsmod:jade_sword", "Inventory"));
	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(jadeAxe, 0, new ModelResourceLocation ("domsmod:jade_axe", "Inventory"));
	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(jadePickaxe, 0, new ModelResourceLocation ("domsmod:jade_pickaxe", "Inventory"));
	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(jadeHoe, 0, new ModelResourceLocation ("domsmod:jade_hoe", "Inventory"));
	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(jadeSpade, 0, new ModelResourceLocation ("domsmod:jade_spade", "Inventory"));
	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(muesli, 0, new ModelResourceLocation ("domsmod:muesli", "Inventory"));
	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(jadeBow, 0, new ModelResourceLocation ("domsmod:jade_bow", "Inventory"));

	MinecraftForge.addGrassSeed(new ItemStack(minzeSeeds), 10);
	/*Crafting*/

	ItemStack stackJade = new ItemStack (jade);		
	ItemStack stackJadeBlock = new ItemStack (jadeBlock);
	ItemStack stackJadeOre = new ItemStack (jadeOre);

	ItemStack stackJadeSword = new ItemStack (jadeSword);
	ItemStack stackRedstoneBlock = new ItemStack (Blocks.redstone_block);

	ItemStack stackStick= new ItemStack (Items.stick);
	ItemStack stackJadeAxe = new ItemStack (jadeAxe);
	ItemStack stackJadePickaxe = new ItemStack (jadePickaxe);
	ItemStack stackJadeHoe = new ItemStack (jadeHoe);
	ItemStack stackJadeSpade = new ItemStack (jadeSpade);

	ItemStack stackJadeHelmet = new ItemStack (jadeHelmet);
	ItemStack stackJadeChestplate = new ItemStack (jadeChestplate);
	ItemStack stackJadeLeggings = new ItemStack (jadeLeggings);
	ItemStack stackJadeBoots = new ItemStack (jadeBoots);

	ItemStack stackMuesli = new ItemStack (muesli);
	ItemStack stackBowl = new ItemStack (Items.bowl);
	ItemStack stackCocoaBeans = new ItemStack (Items.dye, 0, 3);
	ItemStack stackApple = new ItemStack (Items.apple);
				      
    GameRegistry.addRecipe(stackJadeBlock, "ccc","ccc","ccc",'c',stackJade);
    GameRegistry.addRecipe(stackJade, "ccc","c c","ccc",'c',stackJadeOre);
    
    GameRegistry.addRecipe(stackJadeSword, " c "," c "," X ",'c',stackJade, 'X',stackRedstoneBlock);
    
    GameRegistry.addRecipe(stackJadeAxe, "cc ","cx "," x ",'c',stackJade, 'x',stackStick);
    GameRegistry.addRecipe(stackJadePickaxe, "ccc"," x "," x ",'c',stackJade, 'x',stackStick);
    GameRegistry.addRecipe(stackJadeHoe, "cc "," x "," x ",'c',stackJade, 'x',stackStick);
    GameRegistry.addRecipe(stackJadeSpade, " c "," x "," x ",'c',stackJade, 'x',stackStick);
    
    GameRegistry.addRecipe(stackJadeHelmet, "ccc","c c","   ",'c',stackJade);
    GameRegistry.addRecipe(stackJadeChestplate, "c c","ccc","ccc",'c',stackJade);
    GameRegistry.addRecipe(stackJadeLeggings, "ccc","c c","c c",'c',stackJade);
    GameRegistry.addRecipe(stackJadeBoots, "   ","c c","c c",'c',stackJade);
    
    GameRegistry.addRecipe(stackMuesli, "   ","dcd"," x ",'c',stackCocoaBeans,'d',stackApple, 'x',stackBowl);
    
    registerArmorItems(jadeHelmet, "jade_helmet");
    registerArmorItems(jadeChestplate, "jade_chestplate");
    registerArmorItems(jadeLeggings, "jade_leggings");
    registerArmorItems(jadeBoots, "jade_boots");	
    
  MinecraftForge.EVENT_BUS.register(new Events());

}
    	

@EventHandler
public void postInit(FMLPostInitializationEvent event) {
}

/*Routine*/
public static void registerArmorItems(Item item, String itemName) {
			GameRegistry.registerItem(item, itemName);
			Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation ("domsmod:" + itemName, "Inventory"));
	  }

}



Link to comment
Share on other sites

This is not allowed

public static ArmorMaterial jetpackArmorMaterial = EnumHelper.addArmorMaterial("jetpackArmorMaterial", "..", 64, new int[] {6}, 1);

It has to be the full length IE 4 numbers.

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

I solved the problem

I forgot following lines in the main class

 

 

public static ArmorMaterial jetpackArmorMaterial = EnumHelper.addArmorMaterial("jetpackArmorMaterial", "..", 64, new int[] {0, 6, 0, 2}, 1);

public static ItemArmor jetpack = new ItemJetpackArmor(jetpackArmorMaterial, 0, 1);

ItemStack stackJetpack = new ItemStack (jetpack); 

GameRegistry.addRecipe(stackJetpack, "c c","cxc","cxc",'c',stackJade,'X',stackRedstoneBlock);

registerArmorItems(jetpack, "jetpack");

 

 

the full main code should like as follow:

 

package com.DomsMod;


/*Import Domsmod*/
/*Blocks*/
import com.DomsMod.blocks.BlockJadeBlock;
import com.DomsMod.blocks.BlockJadeOre;
import com.DomsMod.blocks.BlockMinze;
import com.DomsMod.dom.CustomCreativeTab;
import com.DomsMod.dom.OreGenerator;

/*Items*/
import com.DomsMod.items.ItemJade;
import com.DomsMod.items.ItemJadeArmor;
import com.DomsMod.items.ItemJadeAxe;
import com.DomsMod.items.ItemJadeBow;
import com.DomsMod.items.ItemJadeHoe;
import com.DomsMod.items.ItemJadePickaxe;
import com.DomsMod.items.ItemJadeSpade;
import com.DomsMod.items.ItemJadeSword;
import com.DomsMod.items.ItemJetpackArmor;
import com.DomsMod.items.ItemMuesli;
import com.DomsModUtils.Events;
import com.sun.org.apache.xpath.internal.operations.Variable;

/*Import Minecraft*/
/*Blocks*/
import net.minecraft.block.Block;

import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.model.ModelBakery;
import net.minecraft.client.resources.model.ModelResourceLocation;

import net.minecraft.creativetab.CreativeTabs;

import net.minecraft.init.Blocks;
import net.minecraft.init.Items;

/*Items*/
import net.minecraft.item.Item;
import net.minecraft.item.Item.ToolMaterial;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemArmor.ArmorMaterial;
import net.minecraft.item.ItemBow;
import net.minecraft.item.ItemDye;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemSeeds;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraftforge.common.MinecraftForge;
/*Import Forge*/
import net.minecraftforge.common.util.EnumHelper;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.ModMetadata;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.registry.GameRegistry;


@Mod(modid = "domsmod")

public class DomsMod {

public static final String MODID = "domsmod";

/*Tool-Materials*/
public static ToolMaterial jadeToolMaterial = EnumHelper.addToolMaterial("jadeToolMaterial", 4, 60, 5, 20, 4);

/*Armor-Materials*/
public static ArmorMaterial jadeArmorMaterial = EnumHelper.addArmorMaterial("jadeArmorMaterial", "..", 60, new int[] {2, 6, 4, 2}, 4);

/*Jetpack*/
public static ArmorMaterial jetpackArmorMaterial = EnumHelper.addArmorMaterial("jetpackArmorMaterial", "..", 64, new int[] {0, 6, 0, 2}, 1);

/*Creative-tabs*/
public static CreativeTabs tabCustomTab = new CustomCreativeTab();

/* Items*/
public static Item jade = new ItemJade ();

public static BlockMinze minze = new BlockMinze ();
public static ItemSeeds minzeSeeds = new ItemSeeds(minze, null);

public static Item jadeSword = new ItemJadeSword ();

public static ItemJadeAxe jadeAxe = new ItemJadeAxe ();
public static ItemJadePickaxe jadePickaxe = new ItemJadePickaxe ();
public static ItemJadeHoe jadeHoe = new ItemJadeHoe ();
public static ItemJadeSpade jadeSpade = new ItemJadeSpade ();

public static ItemArmor jadeHelmet = new ItemJadeArmor (jadeArmorMaterial, 0, 0);
public static ItemArmor jadeChestplate = new ItemJadeArmor (jadeArmorMaterial, 0, 1);
public static ItemArmor jadeBoots = new ItemJadeArmor (jadeArmorMaterial, 0, 3);
public static ItemArmor jadeLeggings = new ItemJadeArmor (jadeArmorMaterial, 0, 2);

public static ItemArmor jetpack = new ItemJetpackArmor(jetpackArmorMaterial, 0, 1);

public static ItemBow jadeBow = new ItemJadeBow ();

public static ItemFood muesli = new ItemMuesli ();

/*Blocks*/
public static Block jadeOre = new BlockJadeOre ();
public static Block jadeBlock = new BlockJadeBlock ();


@EventHandler
public void PreInit(FMLPreInitializationEvent event) {
	ModMetadata data = event.getModMetadata();
	data.autogenerated = false;
	data.name = EnumChatFormatting.DARK_GREEN + "DomsMod";
	data.description = EnumChatFormatting.YELLOW + "" + EnumChatFormatting.BOLD  +"Ermöglicht das Benutzen von Jade als Werkstoff";
	data.credits = EnumChatFormatting.RED + "" + EnumChatFormatting.ITALIC + "Dom1900 + Jean1900";
	data.logoFile = "assets/domsmod/textures/logo/server-icon.png";


	/*Items-Registry*/
	GameRegistry.registerItem(jade, "jade");
	GameRegistry.registerItem(jadeSword, "jade_sword");
	GameRegistry.registerItem(jadeAxe, "jade_axe");
	GameRegistry.registerItem(jadePickaxe, "jade_pickaxe");
	GameRegistry.registerItem(jadeHoe, "jade_hoe");
	GameRegistry.registerItem(jadeSpade, "jade_spade");
	GameRegistry.registerItem(muesli, "muesli");
	GameRegistry.registerItem(minzeSeeds, "minze_seeds");	
	GameRegistry.registerItem(jadeBow, "jade_bow");
	ModelBakery.addVariantName(jadeBow, "domsmod:jade_bow", "domsmod:jade_bow_pull0", "domsmod:jade_bow_pull1", "domsmod:jade_bow_pull2");



	/*Block-Registry*/
	GameRegistry.registerBlock(jadeOre, "jade_ore");
   	GameRegistry.registerBlock(jadeBlock, "jade_block");
   	GameRegistry.registerBlock(minze, "minze");
   	
    /*Worl-Generator*/
    GameRegistry.registerWorldGenerator(new OreGenerator(jadeOre), 0);
    
	}


@EventHandler
public void init(FMLInitializationEvent event) {

	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(minzeSeeds, 0, new ModelResourceLocation("domsmod:minze_seeds","Inventory"));
	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(minze), 0, new ModelResourceLocation("domsmod:minze_seeds","Inventory"));
	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(jade, 0, new ModelResourceLocation ("domsmod:jade", "Inventory"));
    Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(jadeOre), 0, new ModelResourceLocation("domsmod:jade_ore", "Inventory"));
    Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(jadeBlock), 0, new ModelResourceLocation("domsmod:jade_block", "Inventory"));
	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(jadeSword, 0, new ModelResourceLocation ("domsmod:jade_sword", "Inventory"));
	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(jadeAxe, 0, new ModelResourceLocation ("domsmod:jade_axe", "Inventory"));
	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(jadePickaxe, 0, new ModelResourceLocation ("domsmod:jade_pickaxe", "Inventory"));
	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(jadeHoe, 0, new ModelResourceLocation ("domsmod:jade_hoe", "Inventory"));
	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(jadeSpade, 0, new ModelResourceLocation ("domsmod:jade_spade", "Inventory"));
	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(muesli, 0, new ModelResourceLocation ("domsmod:muesli", "Inventory"));
	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(jadeBow, 0, new ModelResourceLocation ("domsmod:jade_bow", "Inventory"));

	MinecraftForge.addGrassSeed(new ItemStack(minzeSeeds), 10);
	/*Crafting*/

	ItemStack stackJade = new ItemStack (jade);		
	ItemStack stackJadeBlock = new ItemStack (jadeBlock);
	ItemStack stackJadeOre = new ItemStack (jadeOre);

	ItemStack stackJadeSword = new ItemStack (jadeSword);
	ItemStack stackRedstoneBlock = new ItemStack (Blocks.redstone_block);

	ItemStack stackStick= new ItemStack (Items.stick);
	ItemStack stackJadeAxe = new ItemStack (jadeAxe);
	ItemStack stackJadePickaxe = new ItemStack (jadePickaxe);
	ItemStack stackJadeHoe = new ItemStack (jadeHoe);
	ItemStack stackJadeSpade = new ItemStack (jadeSpade);

	ItemStack stackJadeHelmet = new ItemStack (jadeHelmet);
	ItemStack stackJadeChestplate = new ItemStack (jadeChestplate);
	ItemStack stackJadeLeggings = new ItemStack (jadeLeggings);
	ItemStack stackJadeBoots = new ItemStack (jadeBoots);

	ItemStack stackJetpack = new ItemStack (jetpack); 

	ItemStack stackMuesli = new ItemStack (muesli);
	ItemStack stackBowl = new ItemStack (Items.bowl);
	ItemStack stackCocoaBeans = new ItemStack (Items.dye, 0, 3);
	ItemStack stackApple = new ItemStack (Items.apple);
				      
    GameRegistry.addRecipe(stackJadeBlock, "ccc","ccc","ccc",'c',stackJade);
    GameRegistry.addRecipe(stackJade, "ccc","c c","ccc",'c',stackJadeOre);
    
    GameRegistry.addRecipe(stackJadeSword, " c "," c "," X ",'c',stackJade, 'X',stackRedstoneBlock);
    
    GameRegistry.addRecipe(stackJadeAxe, "cc ","cx "," x ",'c',stackJade, 'x',stackStick);
    GameRegistry.addRecipe(stackJadePickaxe, "ccc"," x "," x ",'c',stackJade, 'x',stackStick);
    GameRegistry.addRecipe(stackJadeHoe, "cc "," x "," x ",'c',stackJade, 'x',stackStick);
    GameRegistry.addRecipe(stackJadeSpade, " c "," x "," x ",'c',stackJade, 'x',stackStick);
    
    GameRegistry.addRecipe(stackJadeHelmet, "ccc","c c","   ",'c',stackJade);
    GameRegistry.addRecipe(stackJadeChestplate, "c c","ccc","ccc",'c',stackJade);
    GameRegistry.addRecipe(stackJadeLeggings, "ccc","c c","c c",'c',stackJade);
    GameRegistry.addRecipe(stackJadeBoots, "   ","c c","c c",'c',stackJade);
    
    GameRegistry.addRecipe(stackJetpack, "c c","cxc","cxc",'c',stackJade,'X',stackRedstoneBlock);
    
    GameRegistry.addRecipe(stackMuesli, "   ","dcd"," x ",'c',stackCocoaBeans,'d',stackApple, 'x',stackBowl);
    
    registerArmorItems(jadeHelmet, "jade_helmet");
    registerArmorItems(jadeChestplate, "jade_chestplate");
    registerArmorItems(jadeLeggings, "jade_leggings");
    registerArmorItems(jadeBoots, "jade_boots");	
    registerArmorItems(jetpack, "jetpack");
    
  MinecraftForge.EVENT_BUS.register(new Events());

}
    	

@EventHandler
public void postInit(FMLPostInitializationEvent event) {
}

/*Routine*/
public static void registerArmorItems(Item item, String itemName) {
			GameRegistry.registerItem(item, itemName);
			Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation ("domsmod:" + itemName, "Inventory"));
	  }

}




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.

Guest
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.

 Share



×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.