Jump to content

[1.7.10] i want to know "when i craft item, how to it doesn't disappear item?"


PuKom

Recommended Posts

Hello.

when i craft item, how to it doesn't disappear item?

Ex)

[crafting table]

(ITEM A) (ITEM B) (NONE)

(NONE)  (NONE)  (NONE)     [None]

(NONE)  (NONE)  (NONE)

craft 

(ITEM A) (NONE) (NONE)

(NONE) (NONE) (NONE)     [Item C]

(NONE) (NONE) (NONE)

 

Here My mod source:

Item A = CoffeeGr

Item B = BakedCoffeeSeeds

Item C = MisCoffee

package impress.pukom;

import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.registry.GameRegistry;
import impress.pukom.blocks.ImpCrop;
import net.minecraft.block.Block;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
//임포트 끝 
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemSeeds;
import net.minecraft.item.ItemStack;

@Mod(modid=ImpressMOD.MODID, name=ImpressMOD.MODNAME, version=ImpressMOD.MODVER)
public class ImpressMOD
{
	public static final String MODID = "Impress"; // 모드 아이디
	public static final String MODNAME = "Impress Coffee"; // 모드 이름
	public static final String MODVER = "1.1.4"; // 모드 버전
	
	@Instance(value = ImpressMOD.MODID)
	public static ImpressMOD instance;
	int maxDamage = 64;

	/* 농작물 */
	ItemStack emptyItem = null;
	public static Item cropCoffee;
	public static Item cropCoffeeSeeds;
	public static Block cropCoffeePlant;
	public static Item BakedCoffeeSeeds; // 구워진 커피
	
	/* 아이템 추가 */
	public static Item Basecoffee;
	public static Item Heyz;
	public static Item CoffeeGr;
	public static Item Water;
	public static Item BoilWater;
	public static Item Moca;
	public static Item Cup;
	public static Item Latte;
	public static Item Maki;
	public static Item HeyzC;
	public static Item Capu;
	public static Item PulaPu;
	public static Item MisCoffee;
	public static Item As;
	public static Item Heart;
	public static Item Man;
	public static Item Five;
	public static Item Cun;
	public static Item CoffeeCan;

	@EventHandler
	public void preInit(FMLPreInitializationEvent event)
	{
		
		CoffeeGr = new ImpressItem(1, tabMyFirstMod, "CoffeeGr").setTextureName("Impress:CoffeeGr").setUnlocalizedName("CoffeeGr").setMaxDamage (128);
		CoffeeGr.setNoRepair ();
		Cup = new ImpressItem(1, tabMyFirstMod, "Cup").setTextureName("Impress:Cup");
		/* 아이템 추가 정보입력 */
		Basecoffee = new ImpressItem(16, tabMyFirstMod, "BaseCoffee").setUnlocalizedName("BaseCoffee").setTextureName("Impress:BaseCoffee").setCreativeTab(tabMyFirstMod);; 
		Water = new ImpressItem(16, tabMyFirstMod,"Water").setUnlocalizedName("Water").setTextureName("Impress:Water");
		BoilWater = new ImpressItem(16, tabMyFirstMod, "BoilWater").setTextureName("Impress:BoilWater");
		Moca = new ImpressItem(16, tabMyFirstMod, "Moca").setTextureName("Impress:CoffeeMoca");
		CoffeeCan = new ImpressItem(64, tabMyFirstMod, "CoffeeCan").setTextureName("Impress:CoffeeCan");
		Latte = new ImpressItem(16, tabMyFirstMod, "Latte").setTextureName("Impress:Latte");
		Maki = new ImpressItem(16, tabMyFirstMod, "Maki").setTextureName("Impress:Maki");
		Capu = new ImpressItem(16, tabMyFirstMod, "Capu").setTextureName("Impress:Capu");
		PulaPu = new ImpressItem(16, tabMyFirstMod, "PulaPu").setTextureName("Impress:PulaPu");
		MisCoffee = new ImpressItem(64, tabMyFirstMod, "MisCoffee").setTextureName("Impress:MisCoffee");
		As = new ImpressItem(16, tabMyFirstMod, "As").setTextureName("Impress:As");
		Heart = new ImpressItem(1, tabMyFirstMod, "Heart").setTextureName("Impress:Heart");
		Man = new ImpressItem(64, tabMyFirstMod, "Man").setTextureName("Impress:Man");
		Five = new ImpressItem(64, tabMyFirstMod, "Five").setTextureName("Impress:five");
		Cun = new ImpressItem(64, tabMyFirstMod, "Cun").setTextureName("Impress:Cun");
		GameRegistry.registerItem(Basecoffee, Basecoffee.getUnlocalizedName().substring(5));
		GameRegistry.registerItem(BoilWater, BoilWater.getUnlocalizedName().substring(5));
		GameRegistry.registerItem(Water, Water.getUnlocalizedName().substring(5));
		GameRegistry.registerItem(Cup, Cup.getUnlocalizedName().substring(5));
		GameRegistry.registerItem(Latte, Latte.getUnlocalizedName().substring(5));
		GameRegistry.registerItem(Maki, Maki.getUnlocalizedName().substring(5));
		GameRegistry.registerItem(Capu, Capu.getUnlocalizedName().substring(5));
		GameRegistry.registerItem(PulaPu, PulaPu.getUnlocalizedName().substring(5));
		GameRegistry.registerItem(MisCoffee, MisCoffee.getUnlocalizedName().substring(5));
		GameRegistry.registerItem(As, As.getUnlocalizedName().substring(5));
		GameRegistry.registerItem(Heart, Heart.getUnlocalizedName().substring(5));
		GameRegistry.registerItem(Man, Man.getUnlocalizedName().substring(5));
		GameRegistry.registerItem(Five, Five.getUnlocalizedName().substring(5));
		GameRegistry.registerItem(Cun, Cun.getUnlocalizedName().substring(5));
		GameRegistry.registerItem(CoffeeCan, CoffeeCan.getUnlocalizedName().substring(5));
		GameRegistry.registerItem(Moca, Moca.getUnlocalizedName().substring(5));
		GameRegistry.registerItem(CoffeeGr, CoffeeGr.getUnlocalizedName().substring(5));
		/* 농작물 */
		cropCoffee = new ItemFood(1, 0.5F, false).setUnlocalizedName("Coffee").setTextureName("Impress:Coffee").setCreativeTab(tabMyFirstMod);
		cropCoffeePlant = new ImpCrop().setBlockName("CoffeePlant");
		cropCoffeeSeeds = new ItemSeeds(cropCoffeePlant, Blocks.farmland).setUnlocalizedName("CoffeeSeeds").setTextureName("Impress:CoffeeSeed").setCreativeTab(tabMyFirstMod);
		BakedCoffeeSeeds = new ItemFood(2, 1.0F, false).setUnlocalizedName("BakedCoffee").setTextureName("Impress:BCoffee").setCreativeTab(tabMyFirstMod);
		
		GameRegistry.registerItem(cropCoffeeSeeds, cropCoffeeSeeds.getUnlocalizedName().substring(5));
		GameRegistry.registerItem(cropCoffee, cropCoffee.getUnlocalizedName().substring(5));
		GameRegistry.registerBlock(cropCoffeePlant, cropCoffeePlant.getUnlocalizedName().substring(5));
		GameRegistry.registerItem(BakedCoffeeSeeds, BakedCoffeeSeeds.getUnlocalizedName().substring(5));
		
		/* 조합법 */
		GameRegistry.addSmelting(Water, new ItemStack(BoilWater, 1), 1.0F);
		GameRegistry.addSmelting(cropCoffeeSeeds, new ItemStack(BakedCoffeeSeeds, 1), 1.0F); // 화로 조합
	}
	@EventHandler
	public void load(FMLInitializationEvent event)
	{
		
		
	}
	@EventHandler
	public void postInit(FMLPostInitializationEvent event)
	{
		
	}

	public static CreativeTabs tabMyFirstMod = new CreativeTabs("tabMyFirstMod") 
	{
	
	
	public void init(FMLInitializationEvent event) {
	}
		@Override
		public Item getTabIconItem() {
			return new ItemStack(Basecoffee).getItem();
		}
	};
}

 

Please Help me! T_T

 

Edited by PuKom
Link to comment
Share on other sites

  • Guest locked this topic
Guest
This topic is now closed to further replies.


×
×
  • Create New...

Important Information

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