Jump to content

[1.7.2] Strange Gui Bug


Kloonder

Recommended Posts

Hey Guys,

I have a strange gui bug, that means, that if you put for example an iron pickaxe into my gui, it is copied to the slot in my gui, but it is also in your hand. if you now take the item out of the gui, it disappears. I hope you understood what I'm meaning.

 

Thanks for help!

 

Main class

package com.kloon.periodicsystem;

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.Item.ToolMaterial;
import net.minecraft.item.ItemArmor.ArmorMaterial;
import net.minecraft.item.ItemStack;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraftforge.common.util.EnumHelper;


@Mod(modid = Periodicsystem.MODID, version = Periodicsystem.VERSION)

public class Periodicsystem
{


public static final String MODID = "Periodicsystem";
public static final String VERSION = "1.0";

//Utilityplus CreativTabs

public static final CreativeTabs PeriodicsystemBlocks = new CreativeTabs("Periodicsystem Blocks")
    {
        private static final String __OBFID = "CL_00000010";
        @SideOnly(Side.CLIENT)
        public Item getTabIconItem()
        {
            return Item.getItemFromBlock(Periodicsystem.blockIridiumOre);
        }
    };

    public static final CreativeTabs PeriodicsystemItems = new CreativeTabs("Periodicsystem Items")
    {
        private static final String __OBFID = "CL_00000012";
        @SideOnly(Side.CLIENT)
        public Item getTabIconItem()
        {
            return Periodicsystem.itemOsidiumIngot;
        }
    };
    
    public static final CreativeTabs PeriodicsystemArmor = new CreativeTabs("Periodicsystem Armor")
    {
        private static final String __OBFID = "CL_00000012";
        @SideOnly(Side.CLIENT)
        public Item getTabIconItem()
        {
            return Periodicsystem.itemArmorOsidiumHelmet;
        }
    };
    public static final CreativeTabs PeriodicsystemTools = new CreativeTabs("Periodicsystem Tools")
    {
        private static final String __OBFID = "CL_00000012";
        @SideOnly(Side.CLIENT)
        public Item getTabIconItem()
        {
            return Periodicsystem.OsidiumSword;
        }
    };
    public static Periodicsystem instance;
    //Gui
    public static final int GuiIDElementMixer = 0;
    //World Generator
    public static UtilityPlusGenerationClass UtilityPlusGen = new UtilityPlusGenerationClass();
//Blocks
    public static Block blockElementMixer;
    //Ores
public static Block blockIridiumOre;
public static Block blockOsmiumOre;
public static Block blockPlatinumOre;
public static Block blockTitanOre;
//Blocks
public static Block blockIridiumBlock;
public static Block blockOsmiumBlock;
public static Block blockPlatinumBlock;
public static Block blockTitanBlock;
public static Block blockOsidiumBlock;
//Ingots 
public static Item itemIridiumIngot;
public static Item itemOsmiumIngot;
public static Item itemOsidiumIngot;
public static Item itemPlatinumIngot;
public static Item itemTitanIngot;
//Armors
public static ArmorMaterial Osidiumarmor;
public static ArmorMaterial Osmiumarmor;
public static ArmorMaterial Iridiumarmor;
public static ArmorMaterial Platinumarmor;
public static ArmorMaterial Titanarmor;
public static Item itemArmorOsidiumHelmet;
public static Item itemArmorOsidiumchestplate;
public static Item itemArmorOsidiumleggings;
public static Item itemArmorOsidiumboots;
public static Item itemArmorOsmiumHelmet;
public static Item itemArmorOsmiumchestplate;
public static Item itemArmorOsmiumleggings;
public static Item itemArmorOsmiumboots;
public static Item itemArmorIridiumHelmet;
public static Item itemArmorIridiumchestplate;
public static Item itemArmorIridiumleggings;
public static Item itemArmorIridiumboots;
public static Item itemArmorPlatinumHelmet;
public static Item itemArmorPlatinumchestplate;
public static Item itemArmorPlatinumleggings;
public static Item itemArmorPlatinumboots;
public static Item itemArmorTitanHelmet;
public static Item itemArmorTitanchestplate;
public static Item itemArmorTitanleggings;
public static Item itemArmorTitanboots;
//Tools
public static ToolMaterial OsidiumMaterial;
public static ToolMaterial OsmiumMaterial;
public static ToolMaterial IridiumMaterial;
public static ToolMaterial PlatinumMaterial;
public static ToolMaterial TitanMaterial;
public static Item OsidiumSword;
public static Item OsidiumPickaxe;
public static Item OsidiumAxe;
public static Item OsidiumShovel;
public static Item OsmiumSword;
public static Item OsmiumPickaxe;
public static Item OsmiumAxe;
public static Item OsmiumShovel;
public static Item IridiumSword;
public static Item IridiumPickaxe;
public static Item IridiumAxe;
public static Item IridiumShovel;
public static Item PlatinumSword;
public static Item PlatinumPickaxe;
public static Item PlatinumAxe;
public static Item PlatinumShovel;
public static Item TitanSword;
public static Item TitanPickaxe;
public static Item TitanAxe;
public static Item TitanShovel;

//Staffs
public static Item itemTeleportstaff;
public static Item itemSunStaff;





@EventHandler
public void preinit(FMLInitializationEvent event)
{
	instance = this;
//		 = new ().setBlockName("").setBlockTextureName(MODID + ":" + "");
//		registerBlock(, "");
	//Blocks


	blockElementMixer = new BlockElementMixer().setBlockName("Element Mixer").setBlockTextureName(MODID + ":" + "blockElementMixer");
	registerBlock(blockElementMixer, "Element Mixer");
	//Ores

	blockIridiumOre = new BlockIridiumOre().setBlockName("Iridium Ore").setBlockTextureName(MODID + ":" + "blockIridiumOre");
	registerBlock(blockIridiumOre, "Iridium Ore");

	blockOsmiumOre = new BlockOsmiumOre().setBlockName("Osmium Ore").setBlockTextureName(MODID + ":" + "blockOsmiumOre");
	registerBlock(blockOsmiumOre, "Osmium Ore");

	blockPlatinumOre = new BlockPlatinumOre().setBlockName("Platinum Ore").setBlockTextureName(MODID + ":" + "blockPlatinumOre");
	registerBlock(blockPlatinumOre, "Platinum Ore");

	blockTitanOre = new BlockTitanOre().setBlockName("Titan Ore").setBlockTextureName(MODID + ":" + "blockTitanOre");
	registerBlock(blockTitanOre, "Titan Ore");

	blockIridiumBlock = new BlockIridiumBlock().setBlockName("Iridium Block").setBlockTextureName(MODID + ":" + "blockIridiumBlock");
	registerBlock(blockIridiumBlock, "Iridium Block");

	blockOsmiumBlock = new BlockOsmiumBlock().setBlockName("Osmium Block").setBlockTextureName(MODID + ":" + "blockOsmiumBlock");
	registerBlock(blockOsmiumBlock, "Osmium Block");

	blockPlatinumBlock = new BlockPlatinumBlock().setBlockName("Platinum Block").setBlockTextureName(MODID + ":" + "blockPlatinumBlock");
	registerBlock(blockPlatinumBlock, "Platinum Block");

	blockTitanBlock = new BlockTitanBlock().setBlockName("Titan Block").setBlockTextureName(MODID + ":" + "blockTitanBlock");
	registerBlock(blockTitanBlock, "Titan Block");

	blockOsidiumBlock = new BlockOsidiumBlock().setBlockName("Osidium Block").setBlockTextureName(MODID + ":" + "blockOsidiumBlock");
	registerBlock(blockOsidiumBlock, "Osidium Block");
	//Ingots
	// = new ().setTextureName(MODID + ":" + "").setUnlocalizedName("");
	//registerItem(, "");

	itemIridiumIngot = new ItemIridiumItem().setTextureName(MODID + ":" + "IridiumItem").setUnlocalizedName("Iridium Ingot");
	registerItem(itemIridiumIngot, "Iridium");

	itemOsmiumIngot = new ItemOsmiumItem().setTextureName(MODID + ":" + "OsmiumItem").setUnlocalizedName("Osmium Ingot");
	registerItem(itemOsmiumIngot, "Osmium");

	itemOsidiumIngot = new ItemOsidiumItem().setTextureName(MODID + ":" + "OsidiumItem").setUnlocalizedName("Osidium Ingot");
	registerItem(itemOsidiumIngot, "Osidium");

	itemPlatinumIngot = new ItemPlatinumIngot().setTextureName(MODID + ":" + "PlatinumItem").setUnlocalizedName("Platinum Ingot");
	registerItem(itemPlatinumIngot, "Platinum");

	itemTitanIngot = new ItemTitanIngot().setTextureName(MODID + ":" + "TitanItem").setUnlocalizedName("Titan Ingot");
	registerItem(itemTitanIngot, "Titan");

	//Armors
//		 = new  (701, , 0, 0, "").setUnlocalizedName("");
//    	registerItem(, "");
	Osidiumarmor = EnumHelper.addArmorMaterial("OsidiumArmor",33, new int[]{4, 9, 7, 4}, 25);
	Osmiumarmor = EnumHelper.addArmorMaterial("OsmiumArmor",33, new int[]{3, 8, 6, 3}, 25);
	Iridiumarmor = EnumHelper.addArmorMaterial("IridiumArmor",33, new int[]{3, 8, 6, 3}, 25);
	Platinumarmor = EnumHelper.addArmorMaterial("PlatinumArmor",33, new int[]{2, 7, 6, 3}, 25);
	Titanarmor = EnumHelper.addArmorMaterial("TitanArmor",33, new int[]{2, 7, 6, 3}, 25);

	itemArmorOsidiumHelmet = new itemAmorOsidiumArmor (7012, Osidiumarmor, 0, 0, "Odsidium Helmet").setUnlocalizedName("Osidium Helmet");
    	registerItem(itemArmorOsidiumHelmet, "Osidium Helmet");
    	
    	itemArmorOsidiumchestplate = new itemAmorOsidiumArmor (7013, Osidiumarmor, 0, 1, "Osidium Chestplate").setUnlocalizedName("Osidium Chestplate");
    	registerItem(itemArmorOsidiumchestplate, "Osidium Chestplate");
    	
    	itemArmorOsidiumleggings = new itemAmorOsidiumArmor (7014, Osidiumarmor, 0, 2, "Osidium Leggings").setUnlocalizedName("Osidium Leggings");
    	registerItem(itemArmorOsidiumleggings, "Osidium Leggings");
    	
    	itemArmorOsidiumboots = new itemAmorOsidiumArmor (7015, Osidiumarmor, 0, 3, "Osidium Boots").setUnlocalizedName("Osidium Boots");
    	registerItem(itemArmorOsidiumboots, "Osidium Boots");
    	
    	itemArmorOsmiumHelmet= new ItemArmorOsmiumArmor (7016, Osmiumarmor, 0, 0, "Osmium Helmet").setUnlocalizedName("Osmium Helmet");
    	registerItem(itemArmorOsmiumHelmet, "Osmium Helmet");

    	itemArmorOsmiumchestplate= new ItemArmorOsmiumArmor (7017, Osmiumarmor, 0, 1, "Osmium Chestplate").setUnlocalizedName("Osmium Chestplate");
    	registerItem(itemArmorOsmiumchestplate, "Osmium Chestplate");
    
    	itemArmorOsmiumboots= new ItemArmorOsmiumArmor (7018, Osmiumarmor, 0, 2, "Osmium Leggings").setUnlocalizedName("Osmium Leggings");
    	registerItem(itemArmorOsmiumboots, "Osmium Leggings");

    	itemArmorOsmiumboots= new ItemArmorOsmiumArmor (7019, Osmiumarmor, 0, 3, "Osmium Boots").setUnlocalizedName("Osmium Boots");
    	registerItem(itemArmorOsmiumboots, "Osmium Boots");
    	
    	itemArmorIridiumHelmet= new ItemArmorIridiumArmor (7020, Iridiumarmor, 0, 0, "Iridium Helmet").setUnlocalizedName("Iridium Helmet");
    	registerItem(itemArmorIridiumHelmet, "Iridium Helmet");

    	itemArmorIridiumchestplate= new ItemArmorIridiumArmor (7021, Iridiumarmor, 0, 1, "Irdidum Chestplate").setUnlocalizedName("Iridium Chestplate");
    	registerItem(itemArmorIridiumchestplate, "Iridium Chestplate");
    
    	itemArmorIridiumleggings= new ItemArmorIridiumArmor (7022, Iridiumarmor, 0, 2, "Iridium Leggings").setUnlocalizedName("Iridium Leggings");
    	registerItem(itemArmorIridiumleggings, "Iridium Leggings");

    	itemArmorIridiumboots= new ItemArmorIridiumArmor (7023, Iridiumarmor, 0, 3, "Iridium Boots").setUnlocalizedName("Iridium Boots");
    	registerItem(itemArmorIridiumboots, "Iridium Boots");
    	
    	itemArmorPlatinumHelmet = new ItemArmorPlatinumArmor (7024, Platinumarmor, 0, 0, "Platinum Helmet").setUnlocalizedName("Platinum Helmet");
    	registerItem(itemArmorPlatinumHelmet, "Platinum Helmet");

    	itemArmorPlatinumchestplate= new ItemArmorPlatinumArmor (7025, Platinumarmor, 0, 1, "Platinum Chestplate").setUnlocalizedName("Platinum Chestplate");
    	registerItem(itemArmorPlatinumchestplate, "Platinum Chestplate");
    
    	itemArmorPlatinumleggings= new ItemArmorPlatinumArmor (7026, Platinumarmor, 0, 2, "Platinum Leggings").setUnlocalizedName("PLatinum Leggings");
    	registerItem(itemArmorPlatinumleggings, "Platinum Leggings");

    	itemArmorPlatinumboots= new ItemArmorPlatinumArmor (7027, Platinumarmor, 0, 3, "Platinum Boots").setUnlocalizedName("Platinum Boots");
    	registerItem(itemArmorPlatinumboots, "Platinum Boots");
    	
    	itemArmorTitanHelmet = new ItemArmorTitanArmor (7024, Titanarmor, 0, 0, "Titan Helmet").setUnlocalizedName("Titan Helmet");
    	registerItem(itemArmorTitanHelmet, "Titan Helmet");

    	itemArmorTitanchestplate= new ItemArmorTitanArmor (7025, Titanarmor, 0, 1, "Titan Chestplate").setUnlocalizedName("Titan Chestplate");
    	registerItem(itemArmorTitanchestplate, "Titan Chestplate");
    
    	itemArmorTitanleggings= new ItemArmorTitanArmor (7026,Titanarmor, 0, 2, "Titan Leggings").setUnlocalizedName("Titan Leggings");
    	registerItem(itemArmorTitanleggings, "Titan Leggings");

    	itemArmorTitanboots= new ItemArmorTitanArmor (7027, Titanarmor, 0, 3, "Titan Boots").setUnlocalizedName("Titan Boots");
    	registerItem(itemArmorTitanboots, "Titan Boots");
    	
    	//Staffs
    	itemTeleportstaff = new ItemTeleportstaff().setTextureName(MODID + ":" + "TeleportItem").setUnlocalizedName("Teleport Staff").setCreativeTab(PeriodicsystemTools);
	registerItem(itemTeleportstaff, "Teleport Staff");
	itemSunStaff = new ItemSunstaff().setTextureName(MODID + ":" + "SunStaff").setUnlocalizedName("Sun Staff").setCreativeTab(PeriodicsystemTools);
	registerItem(itemSunStaff, "Sun Staff");

	//Tools
//    	 = new (700, ).setTextureName(MODID + ":" + "").setUnlocalizedName("").setCreativeTab(PeriodicsystemTools);
//		registerItem(, "");
    	OsidiumMaterial = EnumHelper.addToolMaterial("OsidiumMaterial", 3, 1601, 9.0F, 5.0F, 16);
    	OsmiumMaterial = EnumHelper.addToolMaterial("OsmaniumMaterial", 3, 1501, 9.0F, 5.0F, 16);
    	IridiumMaterial = EnumHelper.addToolMaterial("IridiumMaterial", 3, 1501, 9.0F, 4.0F, 16);
    	PlatinumMaterial = EnumHelper.addToolMaterial("PlatinumMaterial", 3, 1301, 9.0F, 2.5F, 16);
    	TitanMaterial = EnumHelper.addToolMaterial("TitanMaterial", 3, 2001, 7.0F, 2.5F, 16);

    	OsidiumSword = new OsidiumSword(7001, OsidiumMaterial).setTextureName(MODID + ":" + "Osidiumsword").setUnlocalizedName("Osidium Sword").setCreativeTab(Periodicsystem.PeriodicsystemTools);
	registerItem(OsidiumSword, "Osidium Sword");
	OsidiumPickaxe = new OsidiumPickaxe(7002, OsidiumMaterial).setTextureName(MODID + ":" + "Osidiumpickaxe").setUnlocalizedName("Osidium Pickaxe").setCreativeTab(PeriodicsystemTools);
	registerItem(OsidiumPickaxe, "Osidium Pickaxe");
	OsidiumAxe = new OsidiumAxe(7001, OsidiumMaterial).setTextureName(MODID + ":" + "Osidiumaxe").setUnlocalizedName("Osidium Axe").setCreativeTab(PeriodicsystemTools);
	registerItem(OsidiumAxe, "Osidium Axe");
	OsidiumShovel = new OsidiumShovel(7001, OsidiumMaterial).setTextureName(MODID + ":" + "Osidiumshovel").setUnlocalizedName("Osidium Shovel").setCreativeTab(PeriodicsystemTools);
	registerItem(OsidiumShovel, "Osidium Shovel");


	OsmiumSword = new OsmaniumSword (7003, OsmiumMaterial).setTextureName(MODID + ":" + "OsmiumSword").setUnlocalizedName("Osmium Sword").setCreativeTab(PeriodicsystemTools);
	registerItem(OsmiumSword, "Osmium Sword");
	OsmiumPickaxe = new OsmaniumPickaxe (7003, OsmiumMaterial).setTextureName(MODID + ":" + "OsmiumPickaxe").setUnlocalizedName("Osmium Pickaxe").setCreativeTab(PeriodicsystemTools);
	registerItem(OsmiumPickaxe, "Osmium Pickaxe");
	OsmiumAxe = new OsmaniumAxe (7003, OsmiumMaterial).setTextureName(MODID + ":" + "OsmiumAxe").setUnlocalizedName("Osmium Axe").setCreativeTab(PeriodicsystemTools);
	registerItem(OsmiumAxe, "Osmium Axe");
	OsmiumShovel = new OsmaniumShovel (7003, OsmiumMaterial).setTextureName(MODID + ":" + "OsmiumShovel").setUnlocalizedName("Osmium Shovel").setCreativeTab(PeriodicsystemTools);
	registerItem(OsmiumShovel, "Osmium Shovel");
	IridiumSword = new IridiumSword (7003, IridiumMaterial).setTextureName(MODID + ":" + "IridiumSword").setUnlocalizedName("Iridium Sword").setCreativeTab(PeriodicsystemTools);
	registerItem(IridiumSword, "Iridium Sword");
	IridiumPickaxe = new IridiumPickaxe (7003, IridiumMaterial).setTextureName(MODID + ":" + "IridiumPickaxe").setUnlocalizedName("Iridium Pickaxe").setCreativeTab(PeriodicsystemTools);
	registerItem(IridiumPickaxe, "Iridium Pickaxe");
	IridiumAxe = new IridiumAxe (7003, IridiumMaterial).setTextureName(MODID + ":" + "IridiumAxe").setUnlocalizedName("iridium Axe").setCreativeTab(PeriodicsystemTools);
	registerItem(IridiumAxe, "Iridium Axe");
	IridiumShovel = new IridiumShovel (7003, IridiumMaterial).setTextureName(MODID + ":" + "IridiumShovel").setUnlocalizedName("Iridium Shovel").setCreativeTab(PeriodicsystemTools);
	registerItem(IridiumShovel, "Iridium Shovel");
	PlatinumSword = new PlatinumSword (7003, PlatinumMaterial).setTextureName(MODID + ":" + "PlatinumSword").setUnlocalizedName("Platinum Sword").setCreativeTab(PeriodicsystemTools);
	registerItem(PlatinumSword, "Platinum Sword");
	PlatinumPickaxe = new PlatinumPickaxe (7003, PlatinumMaterial).setTextureName(MODID + ":" + "PlatinumPickaxe").setUnlocalizedName("Platinum Pickaxe").setCreativeTab(PeriodicsystemTools);
	registerItem(PlatinumPickaxe, "Platinum Pickaxe");
	PlatinumAxe = new PlatniumAxe (7003, PlatinumMaterial).setTextureName(MODID + ":" + "PlatinumAxe").setUnlocalizedName("Platnium Axe").setCreativeTab(PeriodicsystemTools);
	registerItem(PlatinumAxe, "Platinum Axe");
	PlatinumShovel = new PlatinumShovel (7003, PlatinumMaterial).setTextureName(MODID + ":" + "PlatinumShovel").setUnlocalizedName("Platinum Shovel").setCreativeTab(PeriodicsystemTools);
	registerItem(PlatinumShovel, "Platinum Shovel");
	TitanSword = new TitanSword (7003, TitanMaterial).setTextureName(MODID + ":" + "TitanSword").setUnlocalizedName("Titan Sword").setCreativeTab(PeriodicsystemTools);
	registerItem(TitanSword, "Titan Sword");
	TitanPickaxe = new TitanPickaxe (7003, TitanMaterial).setTextureName(MODID + ":" + "TitanPickaxe").setUnlocalizedName("Titan Pickaxe").setCreativeTab(PeriodicsystemTools);
	registerItem(TitanPickaxe, "Titan Pickaxe");
	TitanAxe = new TitanAxe (7003, TitanMaterial).setTextureName(MODID + ":" + "TitanAxe").setUnlocalizedName("Titan Axe").setCreativeTab(PeriodicsystemTools);
	registerItem(TitanAxe, "Titan Axe");
	TitanShovel = new TitanShovel (7003, TitanMaterial).setTextureName(MODID + ":" + "TitanShovel").setUnlocalizedName("Titan Shovel").setCreativeTab(PeriodicsystemTools);
	registerItem(TitanShovel, "Titan Shovel");
	//WorldGenerator
	GameRegistry.registerWorldGenerator(UtilityPlusGen, 1);




//		Smelting Recipies
	GameRegistry.addSmelting(blockIridiumOre, new ItemStack(Periodicsystem.itemIridiumIngot, 1), 2.50F);

	GameRegistry.addSmelting(blockPlatinumOre, new ItemStack(itemPlatinumIngot, 1), 2.50F);
	GameRegistry.addSmelting(blockOsmiumOre, new ItemStack(itemOsmiumIngot, 1), 2.50F);
	GameRegistry.addSmelting(blockTitanOre, new ItemStack(itemTitanIngot, 1), 2.50F);
//		Crafting Recepies
	GameRegistry.addShapelessRecipe(new ItemStack(Periodicsystem.itemOsidiumIngot), new ItemStack(Items.diamond),new ItemStack(Periodicsystem.itemOsmiumIngot), new ItemStack(Periodicsystem.itemIridiumIngot));
//		GameRegistry.addRecipe(new ItemStack(Periodicsystem.),new Object[]{"","","",'', Periodicsystem., '', Periodicsystem., '', Periodicsystem.]);
	//Blocks
	GameRegistry.addRecipe(new ItemStack(Periodicsystem.blockOsidiumBlock),new Object[]{"OOO","OOO","OOO",'O', Periodicsystem.itemOsidiumIngot});
	GameRegistry.addRecipe(new ItemStack(Periodicsystem.blockIridiumBlock),new Object[]{"III","III","III",'I', Periodicsystem.itemIridiumIngot});
	GameRegistry.addRecipe(new ItemStack(Periodicsystem.blockTitanBlock),new Object[]{"TTT","TTT","TTT",'T', Periodicsystem.itemTitanIngot});
	GameRegistry.addRecipe(new ItemStack(Periodicsystem.blockOsmiumBlock),new Object[]{"OOO","OOO","OOO",'O', Periodicsystem.itemOsmiumIngot});
	GameRegistry.addRecipe(new ItemStack(Periodicsystem.blockPlatinumBlock),new Object[]{"PPP","PPP","PPP",'P', Periodicsystem.itemPlatinumIngot});
	//Armor
	GameRegistry.addRecipe(new ItemStack(Periodicsystem.itemArmorOsidiumHelmet),new Object[]{"OOO","ONO","NNN",'O', Periodicsystem.itemOsidiumIngot});
	GameRegistry.addRecipe(new ItemStack(Periodicsystem.itemArmorOsidiumchestplate),new Object[]{"ONO","OOO","OOO",'O', Periodicsystem.itemOsidiumIngot});
    	GameRegistry.addRecipe(new ItemStack(Periodicsystem.itemArmorOsidiumleggings),new Object[]{"OOO","ONO","ONO",'O', Periodicsystem.itemOsidiumIngot});
    	GameRegistry.addRecipe(new ItemStack(Periodicsystem.itemArmorOsidiumboots),new Object[]{"NNN","ONO","ONO",'O', Periodicsystem.itemOsmiumIngot});
    	GameRegistry.addRecipe(new ItemStack(Periodicsystem.itemArmorOsmiumHelmet),new Object[]{"OOO","ONO","NNN",'O', Periodicsystem.itemOsmiumIngot});
	GameRegistry.addRecipe(new ItemStack(Periodicsystem.itemArmorOsmiumchestplate),new Object[]{"ONO","OOO","OOO",'O', Periodicsystem.itemOsmiumIngot});
    	GameRegistry.addRecipe(new ItemStack(Periodicsystem.itemArmorOsmiumleggings),new Object[]{"OOO","ONO","ONO",'O', Periodicsystem.itemOsmiumIngot});
    	GameRegistry.addRecipe(new ItemStack(Periodicsystem.itemArmorOsmiumboots),new Object[]{"NNN","ONO","ONO",'O', Periodicsystem.itemOsmiumIngot});
    	GameRegistry.addRecipe(new ItemStack(Periodicsystem.itemArmorTitanHelmet),new Object[]{"OOO","ONO","NNN",'O', Periodicsystem.itemTitanIngot});
	GameRegistry.addRecipe(new ItemStack(Periodicsystem.itemArmorTitanchestplate),new Object[]{"ONO","OOO","OOO",'O', Periodicsystem.itemTitanIngot});
    	GameRegistry.addRecipe(new ItemStack(Periodicsystem.itemArmorTitanleggings),new Object[]{"OOO","ONO","ONO",'O', Periodicsystem.itemTitanIngot});
    	GameRegistry.addRecipe(new ItemStack(Periodicsystem.itemArmorPlatinumboots),new Object[]{"NNN","ONO","ONO",'O', Periodicsystem.itemTitanIngot});
    	GameRegistry.addRecipe(new ItemStack(Periodicsystem.itemArmorPlatinumHelmet),new Object[]{"OOO","ONO","NNN",'O', Periodicsystem.itemPlatinumIngot});
	GameRegistry.addRecipe(new ItemStack(Periodicsystem.itemArmorPlatinumchestplate),new Object[]{"ONO","OOO","OOO",'O', Periodicsystem.itemPlatinumIngot});
    	GameRegistry.addRecipe(new ItemStack(Periodicsystem.itemArmorPlatinumleggings),new Object[]{"OOO","ONO","ONO",'O', Periodicsystem.itemPlatinumIngot});
    	GameRegistry.addRecipe(new ItemStack(Periodicsystem.itemArmorPlatinumboots),new Object[]{"NNN","ONO","ONO",'O', Periodicsystem.itemPlatinumIngot});
    	GameRegistry.addRecipe(new ItemStack(Periodicsystem.itemArmorIridiumHelmet),new Object[]{"OOO","ONO","NNN",'O', Periodicsystem.itemIridiumIngot});
	GameRegistry.addRecipe(new ItemStack(Periodicsystem.itemArmorIridiumchestplate),new Object[]{"ONO","OOO","OOO",'O', Periodicsystem.itemIridiumIngot});
    	GameRegistry.addRecipe(new ItemStack(Periodicsystem.itemArmorIridiumleggings),new Object[]{"OOO","ONO","ONO",'O', Periodicsystem.itemIridiumIngot});
    	GameRegistry.addRecipe(new ItemStack(Periodicsystem.itemArmorIridiumboots),new Object[]{"NNN","ONO","ONO",'O', Periodicsystem.itemIridiumIngot});
    	//Tools
    	GameRegistry.addRecipe(new ItemStack(Periodicsystem.IridiumSword),new Object[]{"NIN","OIO","OSO",'I', Periodicsystem.itemIridiumIngot, 'S', Items.stick});
    	GameRegistry.addRecipe(new ItemStack(Periodicsystem.OsidiumSword),new Object[]{"NIN","OIO","OSO",'I', Periodicsystem.itemOsidiumIngot, 'S', Items.stick});
    	GameRegistry.addRecipe(new ItemStack(Periodicsystem.PlatinumSword),new Object[]{"NIN","OIO","OSO",'I', Periodicsystem.itemPlatinumIngot, 'S', Items.stick});
    	GameRegistry.addRecipe(new ItemStack(Periodicsystem.TitanSword),new Object[]{"NIN","OIO","OSO",'I', Periodicsystem.itemTitanIngot, 'S', Items.stick});
    	GameRegistry.addRecipe(new ItemStack(Periodicsystem.OsmiumSword),new Object[]{"NIN","OIO","OSO",'I', Periodicsystem.itemOsmiumIngot, 'S', Items.stick});
    	GameRegistry.addRecipe(new ItemStack(Periodicsystem.IridiumPickaxe),new Object[]{"III","OSO","OSO",'I', Periodicsystem.itemIridiumIngot, 'S', Items.stick});
    	GameRegistry.addRecipe(new ItemStack(Periodicsystem.OsidiumPickaxe),new Object[]{"III","OSO","OSO",'I', Periodicsystem.itemOsidiumIngot, 'S', Items.stick});
    	GameRegistry.addRecipe(new ItemStack(Periodicsystem.PlatinumPickaxe),new Object[]{"III","OSO","OSO",'I', Periodicsystem.itemPlatinumIngot, 'S', Items.stick});
    	GameRegistry.addRecipe(new ItemStack(Periodicsystem.TitanPickaxe),new Object[]{"III","OSO","OSO",'I', Periodicsystem.itemTitanIngot, 'S', Items.stick});
    	GameRegistry.addRecipe(new ItemStack(Periodicsystem.OsmiumPickaxe),new Object[]{"III","OSO","OSO",'I', Periodicsystem.itemOsmiumIngot, 'S', Items.stick});
    	GameRegistry.addRecipe(new ItemStack(Periodicsystem.IridiumAxe),new Object[]{"IIO","ISO","OSO",'I', Periodicsystem.itemIridiumIngot, 'S', Items.stick});
    	GameRegistry.addRecipe(new ItemStack(Periodicsystem.OsidiumAxe),new Object[]{"IIO","ISO","OSO",'I', Periodicsystem.itemOsidiumIngot, 'S', Items.stick});
    	GameRegistry.addRecipe(new ItemStack(Periodicsystem.PlatinumAxe),new Object[]{"IIO","ISO","OSO",'I', Periodicsystem.itemPlatinumIngot, 'S', Items.stick});
    	GameRegistry.addRecipe(new ItemStack(Periodicsystem.TitanAxe),new Object[]{"IIO","ISO","OSO",'I', Periodicsystem.itemTitanIngot, 'S', Items.stick});
    	GameRegistry.addRecipe(new ItemStack(Periodicsystem.OsmiumAxe),new Object[]{"IIO","ISO","OSO",'I', Periodicsystem.itemOsmiumIngot, 'S', Items.stick});
    	GameRegistry.addRecipe(new ItemStack(Periodicsystem.IridiumShovel),new Object[]{"OIO","OSO","OSO",'I', Periodicsystem.itemIridiumIngot, 'S', Items.stick});
    	GameRegistry.addRecipe(new ItemStack(Periodicsystem.OsidiumShovel),new Object[]{"OIO","OSO","OSO",'I', Periodicsystem.itemOsidiumIngot, 'S', Items.stick});
    	GameRegistry.addRecipe(new ItemStack(Periodicsystem.PlatinumShovel),new Object[]{"OIO","OSO","OSO",'I', Periodicsystem.itemPlatinumIngot, 'S', Items.stick});
    	GameRegistry.addRecipe(new ItemStack(Periodicsystem.TitanShovel),new Object[]{"OIO","OSO","OSO",'I', Periodicsystem.itemTitanIngot, 'S', Items.stick});
    	GameRegistry.addRecipe(new ItemStack(Periodicsystem.OsmiumShovel),new Object[]{"OIO","OSO","OSO",'I', Periodicsystem.itemOsmiumIngot, 'S', Items.stick});
    	//Staffs
    	GameRegistry.addRecipe(new ItemStack(Periodicsystem.itemTeleportstaff),new Object[]{"OOB","OSO","SOO",'B', Periodicsystem.blockOsidiumBlock, 'S', Items.stick});
    	GameRegistry.addRecipe(new ItemStack(Periodicsystem.itemSunStaff),new Object[]{"OFB","OSO","SOO",'B', Periodicsystem.blockOsidiumBlock, 'S', Items.stick, 'F', Items.clock});
    	NetworkRegistry.INSTANCE.registerGuiHandler(this, new PeriodicsystemGuiHandler());
}






@EventHandler
    public void registerItem(Item item, String name)
    { 
    	GameRegistry.registerItem(item, item.getUnlocalizedName());
    	LanguageRegistry.addName(item, name);
    }
public void registerBlock(Block block, String name)
    { 
    	GameRegistry.registerBlock(block, block.getUnlocalizedName());
    	LanguageRegistry.addName(block, name);
    }
public void init(FMLInitializationEvent event)
{

}


}

 

BlockElementMixer

 

package com.kloon.periodicsystem;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

public class BlockElementMixer extends Block implements ISidedInventory
{
public BlockElementMixer() {

	super(Material.rock);


	this.setCreativeTab(Periodicsystem.PeriodicsystemBlocks);

	this.canSilkHarvest();


	this.setHardness(1.1F);

	this.setStepSound(soundTypeStone);

	this.setBlockTextureName("blockElementMixer");

}
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ)
{
	if(!world.isRemote)
	{
		FMLNetworkHandler.openGui(player,  Periodicsystem.instance, Periodicsystem.GuiIDElementMixer, world, x, y, z);
		return true;
	}

	return false;
}
@SideOnly(Side.CLIENT)
    public void registerBlockIcons(IIconRegister BlockElementMixer)
    {
        this.blockIcon = BlockElementMixer.registerIcon(this.getTextureName() + "_top");
       
    }
private ItemStack[] slots = new ItemStack[6];
public void readfromNBT(NBTTagCompound nbt)
{

}

public void writetoNBT(NBTTagCompound nbt)
{

}
public int getSizeInventory() {

	return this.slots.length;
}

public ItemStack getStackInSlot(int i) {

	return this.slots[i];
}

public ItemStack decrStackSize(int i, int j) {
	if(this.slots[i] != null){
		ItemStack itemstack;

		if(this.slots[i].stackSize <= j){
			itemstack = this.slots[i];
			this.slots[i] = null;
		}else{
			itemstack = this.slots[i].splitStack(j);

			if(this.slots[i].stackSize == 0){
				this.slots[i] = null;


			}
		}

		return itemstack;
	}

	return null;
}


public ItemStack getStackInSlotOnClosing(int i) {
	if(this.slots[i] != null)
	{
		ItemStack itemstack = this.slots[i];
		this.slots[i] = null;
		return itemstack;
	}
	return null;
}

public void setInventorySlotContents(int i, ItemStack itemstack) {
	this.slots[i] = itemstack;

	if(itemstack != null && itemstack.stackSize > this.getInventoryStackLimit())
	{
	itemstack.stackSize = this.getInventoryStackLimit();
	}


}

public String getInventoryName() {

	return null;
}

public boolean hasCustomInventoryName() {

	return false;
}

public int getInventoryStackLimit() {

	return 1;
}

public boolean isUseableByPlayer(EntityPlayer var1) {

	return false;
}

public void openInventory() {


}

public void closeInventory() {


}

public boolean isItemValidForSlot(int var1, ItemStack var2) {

	return false;
}

public int[] getAccessibleSlotsFromSide(int var1) {

	return null;
}

public boolean canInsertItem(int var1, ItemStack var2, int var3) {

	return false;
}

public boolean canExtractItem(int var1, ItemStack var2, int var3) {

	return false;
}

public void markDirty() {
	return;

}


}

Gui helper

package com.kloon.periodicsystem;

import com.kloon.periodicsystem.container.ContainerElementMixer;
import com.kloon.periodicsystem.gui.GuiElementMixer;

import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import cpw.mods.fml.common.network.IGuiHandler;

public class PeriodicsystemGuiHandler implements IGuiHandler {

@Override
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
	Block block = world.getBlock(x,  y,  z);

	switch(ID)
	{
	case Periodicsystem.GuiIDElementMixer:
		if (block instanceof BlockElementMixer) 
		{
			return new GuiElementMixer(player.inventory, (BlockElementMixer)block);
		}
	}


	return null;
}

@Override
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
	Block block = world.getBlock(x,  y,  z);

	switch(ID)
	{
	case Periodicsystem.GuiIDElementMixer:
		if (block instanceof BlockElementMixer) 
		{
			return new ContainerElementMixer(player.inventory, (BlockElementMixer)block);
		}
	}


	return null;
}

}

 

Gui element Mixer

package com.kloon.periodicsystem.gui;

import com.kloon.periodicsystem.BlockElementMixer;
import com.kloon.periodicsystem.Periodicsystem;
import com.kloon.periodicsystem.container.ContainerElementMixer;

import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.util.ResourceLocation;

public class GuiElementMixer extends GuiContainer {

public final ResourceLocation texture = new ResourceLocation(Periodicsystem.MODID + ":textures/gui/blockmixergui.png");

public GuiElementMixer(InventoryPlayer inventoryPlayer, BlockElementMixer elementmixer) {
	super(new ContainerElementMixer(inventoryPlayer, elementmixer));

	this.xSize = 176;
	this.ySize = 165;
}

@Override
protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) {
	Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
	drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);

}

}

 

Container ElementMixer

 

package com.kloon.periodicsystem.container;

import com.kloon.periodicsystem.BlockElementMixer;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.Slot;

public class ContainerElementMixer extends Container {

private BlockElementMixer ElementMixer;
public ContainerElementMixer(InventoryPlayer inventoryPlayer, BlockElementMixer elementmixer)
{
	this.ElementMixer = elementmixer;

	this.addSlotToContainer(new Slot(elementmixer, 0, 48, 35));
	this.addSlotToContainer(new Slot(elementmixer, 1, 27, 35));
	this.addSlotToContainer(new Slot(elementmixer, 2, 48, 14));
	this.addSlotToContainer(new Slot(elementmixer, 3, 69, 35));
	this.addSlotToContainer(new Slot(elementmixer, 4, 48, 56));
	this.addSlotToContainer(new Slot(elementmixer, 5, 130, 35));



	for (int i = 0; i < 9; i++)
	{
			this.addSlotToContainer(new Slot(inventoryPlayer, i, 8 + i*18, 142));
	}
		for(int i = 0; i < 3; i++)
		{
			for(int j = 0; j < 9; j++)
			{
			this.addSlotToContainer(new Slot(inventoryPlayer, 9+j+i*9, 8+18*j, 84+i*18));
		}
	}
}

public boolean canInteractWith(EntityPlayer var1) {

	return true;
}

}

Creator of Extra Shoes

 

Watch out, I'm total jerk, and I'll troll anybody if it feels like its necessary. Pls report me then

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



×
×
  • Create New...

Important Information

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