diff options
author | Draknyte1 <Draknyte1@hotmail.com> | 2017-01-17 19:41:46 +1000 |
---|---|---|
committer | Draknyte1 <Draknyte1@hotmail.com> | 2017-01-17 19:41:46 +1000 |
commit | 5834a266fdf425ad56558db71691f9b3b0df5e31 (patch) | |
tree | eb2123fde62da27795417fbe9b6afcd31b383adf /src/Java/powercrystals/minefactoryreloaded/api/IFactoryPlantable.java | |
parent | 289e41515842ec89d01bfa593504163f75d0950c (diff) | |
download | GT5-Unofficial-5834a266fdf425ad56558db71691f9b3b0df5e31.tar.gz GT5-Unofficial-5834a266fdf425ad56558db71691f9b3b0df5e31.tar.bz2 GT5-Unofficial-5834a266fdf425ad56558db71691f9b3b0df5e31.zip |
% Tried to improve the logic for the Tree Farmer, to support Forestry 4.
% Moved COFH API related files.
+ Added a child mod, for misc handling.
$$ Borrowed some code from MFR, to attempt forestry support. (Credit left, will re-do if I even get it working).
Diffstat (limited to 'src/Java/powercrystals/minefactoryreloaded/api/IFactoryPlantable.java')
-rw-r--r-- | src/Java/powercrystals/minefactoryreloaded/api/IFactoryPlantable.java | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/src/Java/powercrystals/minefactoryreloaded/api/IFactoryPlantable.java b/src/Java/powercrystals/minefactoryreloaded/api/IFactoryPlantable.java new file mode 100644 index 0000000000..1d620b37ed --- /dev/null +++ b/src/Java/powercrystals/minefactoryreloaded/api/IFactoryPlantable.java @@ -0,0 +1,94 @@ +package powercrystals.minefactoryreloaded.api; + +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +/** + * Defines a plantable object for use in the Planter. + * + * @author PowerCrystals + */ +public interface IFactoryPlantable { + + /** + * @return The item this plantable is managing. + */ + public Item getSeed(); + + /** + * @param stack + * The stack being planted. + * @param forFermenting + * True if this stack will be converted to biofuel + * + * @return True if this plantable can be planted (useful for metadata + * items). + */ + public boolean canBePlanted(ItemStack stack, boolean forFermenting); + + /** + * @param world + * The world instance this block or item will be placed into. + * @param x + * The destination X coordinate. + * @param y + * The destination Y coordinate. + * @param z + * The destination Z coordinate. + * @param stack + * The stack being planted. + * + * @return The block that will be placed into the world. + */ + public ReplacementBlock getPlantedBlock(World world, int x, int y, int z, ItemStack stack); + + /** + * @param world + * The world instance this block or item will be placed into. + * @param x + * The destination X coordinate. + * @param y + * The destination Y coordinate. + * @param z + * The destination Z coordinate. + * @param stack + * The stack being planted. + * + * @return True if this plantable can be placed at the provided coordinates. + */ + public boolean canBePlantedHere(World world, int x, int y, int z, ItemStack stack); + + /** + * Called before planting is performed. Used to till soil, for example. + * + * @param world + * The world instance this block or item will be placed into. + * @param x + * The destination X coordinate. + * @param y + * The destination Y coordinate. + * @param z + * The destination Z coordinate. + * @param stack + * The stack being planted. + */ + public void prePlant(World world, int x, int y, int z, ItemStack stack); + + /** + * Called after planting is performed. Usually empty. + * + * @param world + * The world instance this block or item will be placed into. + * @param x + * The destination X coordinate. + * @param y + * The destination Y coordinate. + * @param z + * The destination Z coordinate. + * @param stack + * The stack being planted. + */ + public void postPlant(World world, int x, int y, int z, ItemStack stack); + +} |