diff options
Diffstat (limited to 'src/Java/powercrystals/minefactoryreloaded/farmables/harvestables')
3 files changed, 0 insertions, 154 deletions
diff --git a/src/Java/powercrystals/minefactoryreloaded/farmables/harvestables/HarvestableShearable.java b/src/Java/powercrystals/minefactoryreloaded/farmables/harvestables/HarvestableShearable.java deleted file mode 100644 index 1719ae2486..0000000000 --- a/src/Java/powercrystals/minefactoryreloaded/farmables/harvestables/HarvestableShearable.java +++ /dev/null @@ -1,50 +0,0 @@ -package powercrystals.minefactoryreloaded.farmables.harvestables; - -import java.util.*; - -import net.minecraft.block.Block; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import net.minecraftforge.common.IShearable; -import powercrystals.minefactoryreloaded.api.HarvestType; - -public class HarvestableShearable extends HarvestableStandard -{ - public HarvestableShearable(Block block, HarvestType harvestType) - { - super(block, harvestType); - } - - public HarvestableShearable(Block block) - { - super(block); - } - - @Override - public List<ItemStack> getDrops(World world, Random rand, Map<String, Boolean> settings, int x, int y, int z) - { - Block block = world.getBlock(x, y, z); - if (settings.get("silkTouch") == Boolean.TRUE) - { - if (block instanceof IShearable) - { - ItemStack stack = new ItemStack(Items.shears, 1, 0); - if (((IShearable)block).isShearable(stack, world, x, y, z)) - { - return ((IShearable)block).onSheared(stack, world, x, y, z, 0); - } - } - if (Item.getItemFromBlock(block) != null) - { - ArrayList<ItemStack> drops = new ArrayList<ItemStack>(); - int meta = block.getDamageValue(world, x, y, z); - drops.add(new ItemStack(block, 1, meta)); - return drops; - } - } - - return block.getDrops(world, x, y, z, world.getBlockMetadata(x, y, z), 0); - } -} diff --git a/src/Java/powercrystals/minefactoryreloaded/farmables/harvestables/HarvestableStandard.java b/src/Java/powercrystals/minefactoryreloaded/farmables/harvestables/HarvestableStandard.java deleted file mode 100644 index eeab615ed8..0000000000 --- a/src/Java/powercrystals/minefactoryreloaded/farmables/harvestables/HarvestableStandard.java +++ /dev/null @@ -1,71 +0,0 @@ -package powercrystals.minefactoryreloaded.farmables.harvestables; - -import java.util.*; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import powercrystals.minefactoryreloaded.api.HarvestType; -import powercrystals.minefactoryreloaded.api.IFactoryHarvestable; - -public class HarvestableStandard implements IFactoryHarvestable -{ - private Block _block; - private HarvestType _harvestType; - - public HarvestableStandard(Block block, HarvestType harvestType) - { - if (block == Blocks.air) - throw new IllegalArgumentException("Passed air FactoryHarvestableStandard"); - - _block = block; - _harvestType = harvestType; - } - - public HarvestableStandard(Block block) - { - this(block, HarvestType.Normal); - } - - @Override - public Block getPlant() - { - return _block; - } - - @Override - public HarvestType getHarvestType() - { - return _harvestType; - } - - @Override - public boolean breakBlock() - { - return true; - } - - @Override - public boolean canBeHarvested(World world, Map<String, Boolean> harvesterSettings, int x, int y, int z) - { - return true; - } - - @Override - public List<ItemStack> getDrops(World world, Random rand, Map<String, Boolean> harvesterSettings, int x, int y, int z) - { - return world.getBlock(x, y, z).getDrops(world, x, y, z, world.getBlockMetadata(x, y, z), 0); - } - - @Override - public void preHarvest(World world, int x, int y, int z) - { - } - - @Override - public void postHarvest(World world, int x, int y, int z) - { - world.notifyBlocksOfNeighborChange(x, y, z, getPlant()); - } -} diff --git a/src/Java/powercrystals/minefactoryreloaded/farmables/harvestables/HarvestableTreeLeaves.java b/src/Java/powercrystals/minefactoryreloaded/farmables/harvestables/HarvestableTreeLeaves.java deleted file mode 100644 index eaa23bd847..0000000000 --- a/src/Java/powercrystals/minefactoryreloaded/farmables/harvestables/HarvestableTreeLeaves.java +++ /dev/null @@ -1,33 +0,0 @@ -package powercrystals.minefactoryreloaded.farmables.harvestables; - -import net.minecraft.block.Block; -import net.minecraft.world.World; -import powercrystals.minefactoryreloaded.api.HarvestType; - -public class HarvestableTreeLeaves extends HarvestableShearable -{ - public HarvestableTreeLeaves(Block block) - { - super(block, HarvestType.TreeLeaf); - } - - @Override - public void postHarvest(World world, int x, int y, int z) - { - Block id = getPlant(); - - notifyBlock(world, x, y - 1, z, id); - notifyBlock(world, x - 1, y, z, id); - notifyBlock(world, x + 1, y, z, id); - notifyBlock(world, x, y, z - 1, id); - notifyBlock(world, x, y, z + 1, id); - notifyBlock(world, x, y + 1, z, id); - } - - protected void notifyBlock(World world, int x, int y, int z, Block id) - { - Block block = world.getBlock(x, y, z); - if (!block.isLeaves(world, x, y, z)) - world.notifyBlockOfNeighborChange(x, y, z, id); - } -} |