-
Notifications
You must be signed in to change notification settings - Fork 755
/
OreberryBushEssence.java
49 lines (42 loc) · 1.31 KB
/
OreberryBushEssence.java
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
package tconstruct.blocks;
import java.util.Random;
import net.minecraft.world.World;
import net.minecraftforge.common.IPlantable;
public class OreberryBushEssence extends OreberryBush implements IPlantable
{
public OreberryBushEssence(int id, String[] textureNames, int meta, int sub, String[] oreTypes)
{
super(id, textureNames, meta, sub, oreTypes);
}
/* Bush growth */
@Override
public void updateTick (World world, int x, int y, int z, Random random1)
{
if (world.isRemote)
{
return;
}
if (random1.nextInt(20) == 0)// && world.getBlockLightValue(x, y, z) <= 8)
{
int meta = world.getBlockMetadata(x, y, z);
if (world.getFullBlockLightValue(x, y, z) < 10 || meta % 4 == 1)
{
if (meta < 12)
{
world.setBlock(x, y, z, blockID, meta + 4, 3);
}
}
/*else if (meta < 8)
{
world.setBlock(x, y, z, blockID, meta + 4, 3);
}*/
}
}
public boolean canPlaceBlockAt (World world, int x, int y, int z)
{
return true;
/*if (world.getFullBlockLightValue(x, y, z) < 13)
return super.canPlaceBlockAt(world, x, y, z);
return false;*/
}
}