-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBlockSapling.java
More file actions
47 lines (42 loc) · 1.36 KB
/
BlockSapling.java
File metadata and controls
47 lines (42 loc) · 1.36 KB
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
package net.minecraft.src;
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) braces deadcode
import java.util.Random;
public class BlockSapling extends BlockFlower
{
protected BlockSapling(int i, int j)
{
super(i, j);
float f = 0.4F;
setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f * 2.0F, 0.5F + f);
}
public void updateTick(World world, int i, int j, int k, Random random)
{
super.updateTick(world, i, j, k, random);
if(world.getBlockLightValue(i, j + 1, k) >= 9 && random.nextInt(5) == 0)
{
int l = world.getBlockMetadata(i, j, k);
if(l < 15)
{
world.setBlockMetadataWithNotify(i, j, k, l + 1);
} else
{
func_21028_c(world, i, j, k, random);
}
}
}
public void func_21028_c(World world, int i, int j, int k, Random random)
{
world.setBlock(i, j, k, 0);
Object obj = new WorldGenTrees();
if(random.nextInt(10) == 0)
{
obj = new WorldGenBigTree();
}
if(!((WorldGenerator) (obj)).generate(world, random, i, j, k))
{
world.setBlock(i, j, k, blockID);
}
}
}