Fork of Poseidon providing Bukkit #1060 to older Beta versions (b1.0-b1.7.3)
1package net.minecraft.server;
2
3import java.util.Random;
4
5public class BlockFlower extends Block {
6
7 protected BlockFlower(int i, int j) {
8 super(i, Material.PLANT);
9 this.textureId = j;
10 this.a(true);
11 float f = 0.2F;
12
13 this.a(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f * 3.0F, 0.5F + f);
14 }
15
16 public boolean canPlace(World world, int i, int j, int k) {
17 return super.canPlace(world, i, j, k) && this.c(world.getTypeId(i, j - 1, k));
18 }
19
20 protected boolean c(int i) {
21 return i == Block.GRASS.id || i == Block.DIRT.id || i == Block.SOIL.id;
22 }
23
24 public void doPhysics(World world, int i, int j, int k, int l) {
25 super.doPhysics(world, i, j, k, l);
26 this.g(world, i, j, k);
27 }
28
29 public void a(World world, int i, int j, int k, Random random) {
30 this.g(world, i, j, k);
31 }
32
33 protected final void g(World world, int i, int j, int k) {
34 if (!this.f(world, i, j, k)) {
35 this.g(world, i, j, k, world.getData(i, j, k));
36 world.setTypeId(i, j, k, 0);
37 }
38 }
39
40 public boolean f(World world, int i, int j, int k) {
41 return (world.k(i, j, k) >= 8 || world.isChunkLoaded(i, j, k)) && this.c(world.getTypeId(i, j - 1, k));
42 }
43
44 public AxisAlignedBB e(World world, int i, int j, int k) {
45 return null;
46 }
47
48 public boolean a() {
49 return false;
50 }
51
52 public boolean b() {
53 return false;
54 }
55}