Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class ItemSmallBackPack extends Item{
- public ItemSmallBackPack(String unlocalizedName, String registryName)
- {
- super();
- this.setUnlocalizedName(unlocalizedName);
- this.setRegistryName(registryName);
- this.setMaxStackSize(1);
- setCreativeTab(WalkingDeadMod.WalkingDead);
- }
- @Override
- public int getMaxItemUseDuration(ItemStack stack) {
- return 1;
- }
- @Override
- public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer player, EnumHand handIn) {
- if (!worldIn.isRemote)
- {
- // If player not sneaking, open the inventory gui
- if (!player.isSneaking()) {
- player.openGui(WalkingDeadMod.instance, WalkingDeadMod.GUI_ITEM_INV, worldIn, 0, 0, 0);
- }
- }
- return null;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement