aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gtPlusPlus/xmod/bartcrops/abstracts/BaseHarvestableCrop.java
blob: 3d56bba97965d80a8dd389bd5daea2c2bb2f3ab1 (plain)
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 gtPlusPlus.xmod.bartcrops.abstracts;

import gtPlusPlus.preloader.CORE_Preloader;
import ic2.api.crops.ICropTile;

public abstract class BaseHarvestableCrop extends BaseCrop {

    public int tier() {
        return 2;
    }

    public int stat(int n) {
        switch (n) {
            case 0:
                return 0;
            case 1:
                return 4;
            case 2:
                return 0;
            case 3:
                return 4;
            case 4:
                return 0;
            default:
                return 0;
        }
    }

    public boolean canGrow(ICropTile crop) {
        return crop.getSize() < 3;
    }

    public int getOptimalHavestSize(ICropTile crop) {
        return 3;
    }

    public boolean canBeHarvested(ICropTile crop) {
        return crop.getSize() == 3;
    }

    public int weightInfluences(ICropTile crop, float humidity, float nutrients, float air) {
        return (int) ((double) humidity * 1.2D + (double) nutrients * 0.9D + (double) air * 0.9D);
    }

    public int growthDuration(ICropTile crop) {
        short r;
        if (CORE_Preloader.DEBUG_MODE) {
            r = 1;
        } else if (crop.getSize() == 2) {
            r = 200;
        } else {
            r = 700;
        }

        return r;
    }

    public byte getSizeAfterHarvest(ICropTile crop) {
        return 2;
    }

    public int maxSize() {
        return 3;
    }

    public String discoveredBy() {
        return "Alkalus";
    }
}