-
Notifications
You must be signed in to change notification settings - Fork 755
/
IFactoryHarvestable.java
70 lines (61 loc) · 2.68 KB
/
IFactoryHarvestable.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
70
package powercrystals.minefactoryreloaded.api;
import java.util.List;
import java.util.Map;
import java.util.Random;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
/**
* @author PowerCrystals
*
* Defines a harvestable block for the Harvester.
*/
public interface IFactoryHarvestable
{
/**
* @return The block ID this harvestable instance is managing.
*/
public int getPlantId ();
/**
* @return The type of harvest the Harvester should perform on this block.
*/
public HarvestType getHarvestType ();
/**
* @return Whether or not the Harvester should break the block when harvesting. If false, no changes will be performed by the Harvester itself.
*/
public boolean breakBlock ();
/**
* @param world The world this block is in.
* @param harvesterSettings The harvester's current settings. Do not modify these.
* @param x The X coordinate of the block being harvested.
* @param y The Y coordinate of the block being harvested.
* @param z The Z coordinate of the block being harvested.
* @return True if this block can be harvested.
*/
public boolean canBeHarvested (World world, Map<String, Boolean> harvesterSettings, int x, int y, int z);
/**
* @param world The world this block is in.
* @param rand A Random instance to use when generating drops.
* @param harvesterSettings The harvester's current settings. Do not modify these.
* @param x The X coordinate of the block being harvested.
* @param y The Y coordinate of the block being harvested.
* @param z The Z coordinate of the block being harvested.
* @return The drops generated by breaking this block. For a default implementation, calling Block.getBlockDropped() is usually sufficient.
*/
public List<ItemStack> getDrops (World world, Random rand, Map<String, Boolean> harvesterSettings, int x, int y, int z);
/**
* Called before the block is going to be harvested. Usually empty.
* @param world The world this block is in.
* @param x The X coordinate of the block being harvested.
* @param y The Y coordinate of the block being harvested.
* @param z The Z coordinate of the block being harvested.
*/
public void preHarvest (World world, int x, int y, int z);
/**
* Called after the block is going to be harvested. Used to re-till soil, for example.
* @param world The world this block is in.
* @param x The X coordinate of the block being harvested.
* @param y The Y coordinate of the block being harvested.
* @param z The Z coordinate of the block being harvested.
*/
public void postHarvest (World world, int x, int y, int z);
}