Guest User

Untitled

a guest
Jul 29th, 2017
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. package com.mod.drakania.items;
  2.  
  3. import net.minecraft.creativetab.CreativeTabs;
  4. import net.minecraft.entity.Entity;
  5. import net.minecraft.entity.player.EntityPlayer;
  6. import net.minecraft.item.Item;
  7. import net.minecraft.item.ItemStack;
  8. import net.minecraft.nbt.NBTTagCompound;
  9. import net.minecraft.world.World;
  10.  
  11. import com.mod.drakania.DrakaMod;
  12. import com.mod.drakania.References;
  13.  
  14. import cpw.mods.fml.common.registry.GameRegistry;
  15.  
  16. /**
  17. * @author SCAREX
  18. *
  19. */
  20. public class ItemBackPack extends Item
  21. {
  22. public static final String NAME = "backpack";
  23.  
  24. public ItemBackPack() {
  25. this.setUnlocalizedName(References.MOD_ID + ":backpack");
  26. this.setTextureName(References.MOD_ID + ":backpack");
  27. this.setCreativeTab(DrakaMod.DrakaMod);
  28. this.maxStackSize = 1; // N'oubliez pas ceci, çà empêche l'item d'être stackable
  29.  
  30. this.register();
  31. }
  32.  
  33. /**
  34. * Used to add the item to the game registry
  35. */
  36. public final void register() {
  37. GameRegistry.registerItem(this, NAME);
  38. }
  39.  
  40. /**
  41. * Used to open the gui
  42. */
  43. @Override
  44. public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
  45. player.openGui(DrakaMod.INSTANCE, 0, world, (int) player.posX, (int) player.posY, (int) player.posZ);
  46. return stack;
  47.  
  48.  
  49. }
  50. }
Add Comment
Please, Sign In to add comment