Package mods.natura.plugins.minefactoryreloaded.plantables

Source Code of mods.natura.plugins.minefactoryreloaded.plantables.PlantableNaturaBerry

package mods.natura.plugins.minefactoryreloaded.plantables;

import mods.natura.common.NContent;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.common.IPlantable;

public class PlantableNaturaBerry extends PlantableStandard
{

    public PlantableNaturaBerry(Item sourceId, Block plantedBlockId)
    {
        super(sourceId, plantedBlockId);
    }

    @Override
    public boolean canBePlantedHere (World world, int x, int y, int z, ItemStack stack)
    {
        Block groundBlock = world.getBlock(x, y - 1, z);

        return (groundBlock != null && groundBlock.canSustainPlant(world, x, y - 1, z, ForgeDirection.UP, (IPlantable) NContent.berryBush) && world.isAirBlock(x, y, z));
    }

    @Override
    public int getMeta (ItemStack i)
    {

        return i.getItemDamage() % 4;
    }

}
TOP

Related Classes of mods.natura.plugins.minefactoryreloaded.plantables.PlantableNaturaBerry

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.