-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBlockStep.java
More file actions
121 lines (107 loc) · 2.79 KB
/
BlockStep.java
File metadata and controls
121 lines (107 loc) · 2.79 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
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 BlockStep extends Block
{
public BlockStep(int i, boolean flag)
{
super(i, 6, Material.rock);
blockType = flag;
if(!flag)
{
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F);
}
setLightOpacity(255);
}
public int getBlockTextureFromSideAndMetadata(int i, int j)
{
if(j == 0)
{
return i > 1 ? 5 : 6;
}
if(j == 1)
{
if(i == 0)
{
return 208;
}
return i != 1 ? 192 : 176;
}
if(j == 2)
{
return 4;
}
return j != 3 ? 6 : 16;
}
public int getBlockTextureFromSide(int i)
{
return getBlockTextureFromSideAndMetadata(i, 0);
}
public boolean isOpaqueCube()
{
return blockType;
}
public void onBlockAdded(World world, int i, int j, int k)
{
if(this != Block.stairSingle)
{
super.onBlockAdded(world, i, j, k);
}
int l = world.getBlockId(i, j - 1, k);
int i1 = world.getBlockMetadata(i, j, k);
int j1 = world.getBlockMetadata(i, j - 1, k);
if(i1 != j1)
{
return;
}
if(l == stairSingle.blockID)
{
world.setBlockWithNotify(i, j, k, 0);
world.setBlockAndMetadataWithNotify(i, j - 1, k, Block.stairDouble.blockID, i1);
}
}
public int idDropped(int i, Random random)
{
return Block.stairSingle.blockID;
}
public int quantityDropped(Random random)
{
return !blockType ? 1 : 2;
}
protected int damageDropped(int i)
{
return i;
}
public boolean renderAsNormalBlock()
{
return blockType;
}
public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l)
{
if(this != Block.stairSingle)
{
super.shouldSideBeRendered(iblockaccess, i, j, k, l);
}
if(l == 1)
{
return true;
}
if(!super.shouldSideBeRendered(iblockaccess, i, j, k, l))
{
return false;
}
if(l == 0)
{
return true;
} else
{
return iblockaccess.getBlockId(i, j, k) != blockID;
}
}
public static final String field_22037_a[] = {
"stone", "sand", "wood", "cobble"
};
private boolean blockType;
}