/
IFactoryFruit.java
69 lines (61 loc) · 2.33 KB
/
IFactoryFruit.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
package powercrystals.minefactoryreloaded.api;
import java.util.List;
import java.util.Random;
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 ID this fruit has in the world.
*/
public int getSourceBlockId();
/**
* 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);
/**
* Called by the Fruit Picker to determine what block to replace the picked block with. Only ID and meta/damage will be used.
* At the time this method is called, the fruit still exists. Do not pass an item ID as the return value.
* @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 ItemStack getReplacementBlock(World world, int x, int y, int z);
/**
* Called by the Fruit Picker before 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 prePick(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 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);
}