Java 类net.minecraft.item.ItemSeedFood 实例源码

项目:Culinary-Cultivation    文件:SeedBagInventory.java   
@Override
public boolean isItemValidForSlot(int index, @Nonnull ItemStack stack) {
    Item item = stack.getItem();
    ItemCropProduct.ProductType cropProduct = ItemCropProduct.ProductType.byItemStack(stack);
    return (item instanceof ItemSeeds || item instanceof ItemSeedFood || item == ModItems.CROP_SEEDS || item == ModItems.CROP_FOOD && cropProduct.canPlantCrop()) && item instanceof IPlantable;
}