-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBlockStationary.java
More file actions
73 lines (65 loc) · 2.3 KB
/
BlockStationary.java
File metadata and controls
73 lines (65 loc) · 2.3 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
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 BlockStationary extends BlockFluids
{
protected BlockStationary(int i, Material material)
{
super(i, material);
setTickOnLoad(false);
if(material == Material.lava)
{
setTickOnLoad(true);
}
}
public void onNeighborBlockChange(World world, int i, int j, int k, int l)
{
super.onNeighborBlockChange(world, i, j, k, l);
if(world.getBlockId(i, j, k) == blockID)
{
func_22035_j(world, i, j, k);
}
}
private void func_22035_j(World world, int i, int j, int k)
{
int l = world.getBlockMetadata(i, j, k);
world.field_1043_h = true;
world.setBlockAndMetadata(i, j, k, blockID - 1, l);
world.markBlocksDirty(i, j, k, i, j, k);
world.func_22136_c(i, j, k, blockID - 1, tickRate());
world.field_1043_h = false;
}
public void updateTick(World world, int i, int j, int k, Random random)
{
if(blockMaterial == Material.lava)
{
int l = random.nextInt(3);
for(int i1 = 0; i1 < l; i1++)
{
i += random.nextInt(3) - 1;
j++;
k += random.nextInt(3) - 1;
int j1 = world.getBlockId(i, j, k);
if(j1 == 0)
{
if(func_301_k(world, i - 1, j, k) || func_301_k(world, i + 1, j, k) || func_301_k(world, i, j, k - 1) || func_301_k(world, i, j, k + 1) || func_301_k(world, i, j - 1, k) || func_301_k(world, i, j + 1, k))
{
world.setBlockWithNotify(i, j, k, Block.fire.blockID);
return;
}
continue;
}
if(Block.blocksList[j1].blockMaterial.getIsSolid())
{
return;
}
}
}
}
private boolean func_301_k(World world, int i, int j, int k)
{
return world.getBlockMaterial(i, j, k).getBurning();
}
}