summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server/BlockNetherWart.java
blob: ea12b9172405e9bb8e02fb9e1d4ac4c83dfba519 (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
package net.minecraft.server;

import java.util.Random;

public class BlockNetherWart extends BlockPlant {

    protected BlockNetherWart() {
        this.a(true);
        float f = 0.5F;

        this.a(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.25F, 0.5F + f);
        this.a((CreativeModeTab) null);
    }

    protected boolean a(Block block) {
        return block == Blocks.SOUL_SAND;
    }

    public boolean j(World world, int i, int j, int k) {
        return this.a(world.getType(i, j - 1, k));
    }

    public void a(World world, int i, int j, int k, Random random) {
        int l = world.getData(i, j, k);

        if (l < 3 && random.nextInt(10) == 0) {
            ++l;
            org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockGrowEvent(world, i, j, k, this, l); // CraftBukkit
        }

        super.a(world, i, j, k, random);
    }

    public int b() {
        return 6;
    }

    public void dropNaturally(World world, int i, int j, int k, int l, float f, int i1) {
        if (!world.isStatic) {
            int j1 = 1;

            if (l >= 3) {
                j1 = 2 + world.random.nextInt(3);
                if (i1 > 0) {
                    j1 += world.random.nextInt(i1 + 1);
                }
            }

            for (int k1 = 0; k1 < j1; ++k1) {
                this.a(world, i, j, k, new ItemStack(Items.NETHER_STALK));
            }
        }
    }

    public Item getDropType(int i, Random random, int j) {
        return null;
    }

    public int a(Random random) {
        return 0;
    }
}