Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.halestormxv.item;
- import com.halestormxv.Main.MainRegistry;
- import com.halestormxv.inventory.ContainerCelestialKeypouch;
- import com.halestormxv.inventory.InventoryKeyPouch;
- import cpw.mods.fml.relauncher.SideOnly;
- import net.minecraft.entity.Entity;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.inventory.ContainerPlayer;
- import net.minecraft.item.Item;
- import net.minecraft.item.ItemStack;
- import net.minecraft.world.World;
- public class keyPouch extends Item
- {
- public keyPouch()
- {
- super();
- setMaxStackSize(1);
- }
- // Without this method, your inventory will NOT work!!!
- @Override
- public int getMaxItemUseDuration(ItemStack stack) {
- return 1; // return any value greater than zero
- }
- @Override
- public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player)
- {
- if (!world.isRemote)
- {
- // If player not sneaking, open the inventory gui
- if (!player.isSneaking()) {
- player.openGui(MainRegistry.instance, CelestialCraft_items.guiIDKeyPouch, world, 0, 0, 0);
- }
- // Otherwise, stealthily place some diamonds in there for a nice surprise next time you open it up :)
- //else {
- // new InventoryKeyPouch(player.getHeldItem()).setInventorySlotContents(0, new ItemStack(Item.,4));
- //}
- }
- return itemstack;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement