aboutsummaryrefslogtreecommitdiff
path: root/src/Java/powercrystals/minefactoryreloaded/api/IFactoryFruit.java
diff options
context:
space:
mode:
authorDraknyte1 <Draknyte1@hotmail.com>2017-01-17 19:41:46 +1000
committerDraknyte1 <Draknyte1@hotmail.com>2017-01-17 19:41:46 +1000
commit5834a266fdf425ad56558db71691f9b3b0df5e31 (patch)
treeeb2123fde62da27795417fbe9b6afcd31b383adf /src/Java/powercrystals/minefactoryreloaded/api/IFactoryFruit.java
parent289e41515842ec89d01bfa593504163f75d0950c (diff)
downloadGT5-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/IFactoryFruit.java')
-rw-r--r--src/Java/powercrystals/minefactoryreloaded/api/IFactoryFruit.java106
1 files changed, 106 insertions, 0 deletions
diff --git a/src/Java/powercrystals/minefactoryreloaded/api/IFactoryFruit.java b/src/Java/powercrystals/minefactoryreloaded/api/IFactoryFruit.java
new file mode 100644
index 0000000000..3f956422c0
--- /dev/null
+++ b/src/Java/powercrystals/minefactoryreloaded/api/IFactoryFruit.java
@@ -0,0 +1,106 @@
+package powercrystals.minefactoryreloaded.api;
+
+import java.util.List;
+import java.util.Random;
+
+import net.minecraft.block.Block;
+import net.minecraft.item.ItemStack;
+import net.minecraft.world.World;
+
+/**
+ * Defines a fruit entry for the Fruit Picker.
+ *
+ * @author powercrystals
+ *
+ */
+public interface IFactoryFruit {
+
+ /**
+ * @return The block this fruit has in the world.
+ */
+ public Block getPlant();
+
+ /**
+ * Used to determine if this fruit can be picked (is it ripe yet, etc)
+ *
+ * @param world
+ * The world where the fruit is being picked
+ * @param x
+ * The x-coordinate of the fruit
+ * @param y
+ * The y-coordinate of the fruit
+ * @param z
+ * The z-coordinate of the fruit
+ *
+ * @return True if the fruit can be picked
+ */
+ public boolean canBePicked(World world, int x, int y, int z);
+
+ /**
+ * @deprecated This method is no longer called. ReplacementBlock now handles
+ * interaction.
+ */
+ @Deprecated
+ public boolean breakBlock();
+
+ /**
+ * Called by the Fruit Picker to determine what block to replace the picked
+ * block with. At the time this method is called, the fruit still exists.
+ *
+ * @param world
+ * The world where the fruit is being picked
+ * @param x
+ * The x-coordinate of the fruit
+ * @param y
+ * The y-coordinate of the fruit
+ * @param z
+ * The z-coordinate of the fruit
+ *
+ * @return The block to replace the fruit block with, or null for air.
+ */
+ public ReplacementBlock getReplacementBlock(World world, int x, int y, int z);
+
+ /**
+ * Called by the Fruit Picker to determine what drops to generate. At the
+ * time this method is called, the fruit still exists.
+ *
+ * @param world
+ * The world where the fruit is being picked
+ * @param x
+ * The x-coordinate of the fruit
+ * @param y
+ * The y-coordinate of the fruit
+ * @param z
+ * The z-coordinate of the fruit
+ */
+ public List<ItemStack> getDrops(World world, Random rand, int x, int y, int z);
+
+ /**
+ * Called by the Fruit Picker after getDrops, prior to the block being
+ * replaced/removed.
+ *
+ * @param world
+ * The world where the fruit is being picked
+ * @param x
+ * The x-coordinate of the fruit
+ * @param y
+ * The y-coordinate of the fruit
+ * @param z
+ * The z-coordinate of the fruit
+ */
+ public void prePick(World world, int x, int y, int z);
+
+ /**
+ * Called by the Fruit Picker after the fruit is picked.
+ *
+ * @param world
+ * The world where the fruit is being picked
+ * @param x
+ * The x-coordinate of the fruit
+ * @param y
+ * The y-coordinate of the fruit
+ * @param z
+ * The z-coordinate of the fruit
+ */
+ public void postPick(World world, int x, int y, int z);
+}