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

import java.util.ArrayList; // CraftBukkit
import java.util.Random;

public class BlockDeadBush extends BlockFlower {

    protected BlockDeadBush(int i, int j) {
        super(i, j, Material.REPLACEABLE_PLANT);
        float f = 0.4F;

        this.a(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.8F, 0.5F + f);
    }

    protected boolean d(int i) {
        return i == Block.SAND.id;
    }

    public int a(int i, int j) {
        return this.textureId;
    }

    public int getDropType(int i, Random random, int j) {
        return -1;
    }

    public void a(World world, EntityHuman entityhuman, int i, int j, int k, int l) {
        if (!world.isStatic && entityhuman.T() != null && entityhuman.T().id == Item.SHEARS.id) {
            entityhuman.a(StatisticList.C[this.id], 1);
            /* CraftBukkit start - moved this line into calculateDrops
            this.a(world, i, j, k, new ItemStack(Block.DEAD_BUSH, 1, l));
            */
            this.doActualDrop(world, entityhuman, i, j, k, l);
            // CraftBukkit end
        } else {
            super.a(world, entityhuman, i, j, k, l);
        }
    }

    // CraftBukkit start - Calculate drops
    public ArrayList<ItemStack> calculateDrops(World world, EntityHuman entityhuman, int i, int j, int k, int l) {
        if (!world.isStatic && entityhuman.T() != null && entityhuman.T().id == Item.SHEARS.id) {
            super.dropList = new ArrayList<ItemStack>();
            this.a(world, i, j, k, new ItemStack(Block.DEAD_BUSH, 1, l));
            return super.dropList;
        } else {
            return super.calculateDrops(world, entityhuman, i, j, k, l);
        }
    }
    // CraftBukkit end
}