Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class OrangeSeed extends ItemBase {
- public OrangeSeed(String name, CreativeTabs tab) {
- super(name, tab);
- setCreativeTab(tab);
- setUnlocalizedName(name);
- setMaxStackSize(16);
- }
- @Override
- public int getMetadata(ItemStack stack) {
- return stack.hasTagCompound() ? 1 : 0;
- }
- @Override
- @Nonnull
- public EnumActionResult onItemUse(EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
- ItemStack stack = player.getHeldItem(hand);
- if (!(stack.getItem() instanceof OrangeSeed))
- return EnumActionResult.PASS;
- if (!stack.hasTagCompound())
- return EnumActionResult.PASS;
- if (world.getBlockState(pos).getBlock() == Blocks.GRASS)
- {
- ????
- }
- return EnumActionResult.SUCCESS;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement