Search in sources :

Example 1 with FertilizerResult

use of crazypants.enderio.base.farming.fertilizer.FertilizerResult in project EnderIO by SleepyTrousers.

the class MagicalFertilizer method apply.

@Override
public IFertilizerResult apply(@Nonnull ItemStack stack, @Nonnull EntityPlayer player, @Nonnull World world, @Nonnull BlockPos bc) {
    BlockPos below = bc.down();
    Block belowBlock = world.getBlockState(below).getBlock();
    if (belowBlock == Blocks.DIRT || belowBlock == Blocks.GRASS) {
        return super.apply(stack, player, world, below);
    }
    return new FertilizerResult(stack, false);
}
Also used : IFertilizerResult(crazypants.enderio.api.farm.IFertilizerResult) FertilizerResult(crazypants.enderio.base.farming.fertilizer.FertilizerResult) Block(net.minecraft.block.Block) BlockPos(net.minecraft.util.math.BlockPos)

Aggregations

IFertilizerResult (crazypants.enderio.api.farm.IFertilizerResult)1 FertilizerResult (crazypants.enderio.base.farming.fertilizer.FertilizerResult)1 Block (net.minecraft.block.Block)1 BlockPos (net.minecraft.util.math.BlockPos)1