-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBlockTNT.java
More file actions
65 lines (57 loc) · 1.9 KB
/
BlockTNT.java
File metadata and controls
65 lines (57 loc) · 1.9 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
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 BlockTNT extends Block
{
public BlockTNT(int i, int j)
{
super(i, j, Material.tnt);
}
public int getBlockTextureFromSide(int i)
{
if(i == 0)
{
return blockIndexInTexture + 2;
}
if(i == 1)
{
return blockIndexInTexture + 1;
} else
{
return blockIndexInTexture;
}
}
public void onNeighborBlockChange(World world, int i, int j, int k, int l)
{
if(l > 0 && Block.blocksList[l].canProvidePower() && world.isBlockIndirectlyGettingPowered(i, j, k))
{
onBlockDestroyedByPlayer(world, i, j, k, 0);
world.setBlockWithNotify(i, j, k, 0);
}
}
public int quantityDropped(Random random)
{
return 0;
}
public void onBlockDestroyedByExplosion(World world, int i, int j, int k)
{
EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(world, (float)i + 0.5F, (float)j + 0.5F, (float)k + 0.5F);
entitytntprimed.fuse = world.rand.nextInt(entitytntprimed.fuse / 4) + entitytntprimed.fuse / 8;
world.entityJoinedWorld(entitytntprimed);
}
public void onBlockDestroyedByPlayer(World world, int i, int j, int k, int l)
{
if(world.multiplayerWorld)
{
return;
} else
{
EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(world, (float)i + 0.5F, (float)j + 0.5F, (float)k + 0.5F);
world.entityJoinedWorld(entitytntprimed);
world.playSoundAtEntity(entitytntprimed, "random.fuse", 1.0F, 1.0F);
return;
}
}
}