Advertisement
Guest User

Untitled

a guest
Jul 21st, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. public class OrangeSeed extends ItemBase {
  2.  
  3. public OrangeSeed(String name, CreativeTabs tab) {
  4. super(name, tab);
  5. setCreativeTab(tab);
  6. setUnlocalizedName(name);
  7. setMaxStackSize(16);
  8. }
  9.  
  10. @Override
  11. public int getMetadata(ItemStack stack) {
  12. return stack.hasTagCompound() ? 1 : 0;
  13. }
  14.  
  15. @Override
  16. @Nonnull
  17. public EnumActionResult onItemUse(EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
  18. ItemStack stack = player.getHeldItem(hand);
  19. if (!(stack.getItem() instanceof OrangeSeed))
  20. return EnumActionResult.PASS;
  21.  
  22. if (!stack.hasTagCompound())
  23. return EnumActionResult.PASS;
  24.  
  25. if (world.getBlockState(pos).getBlock() == Blocks.GRASS)
  26. {
  27.  
  28. ????
  29.  
  30. }
  31. return EnumActionResult.SUCCESS;
  32. }
  33.  
  34.  
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement