Fork of Poseidon providing Bukkit #1060 to older Beta versions (b1.0-b1.7.3)
1package net.minecraft.server;
2
3import java.util.Random;
4
5public class BlockStep extends Block {
6
7 public static final String[] a = new String[] { "stone", "sand", "wood", "cobble" };
8 private boolean b;
9
10 public BlockStep(int i, boolean flag) {
11 super(i, 6, Material.STONE);
12 this.b = flag;
13 if (!flag) {
14 this.a(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F);
15 }
16
17 this.f(255);
18 }
19
20 public int a(int i, int j) {
21 return j == 0 ? (i <= 1 ? 6 : 5) : (j == 1 ? (i == 0 ? 208 : (i == 1 ? 176 : 192)) : (j == 2 ? 4 : (j == 3 ? 16 : 6)));
22 }
23
24 public int a(int i) {
25 return this.a(i, 0);
26 }
27
28 public boolean a() {
29 return this.b;
30 }
31
32 public void c(World world, int i, int j, int k) {
33 if (this != Block.STEP) {
34 super.c(world, i, j, k);
35 }
36
37 int l = world.getTypeId(i, j - 1, k);
38 int i1 = world.getData(i, j, k);
39 int j1 = world.getData(i, j - 1, k);
40
41 if (i1 == j1) {
42 if (l == STEP.id) {
43 world.setTypeId(i, j, k, 0);
44 world.setTypeIdAndData(i, j - 1, k, Block.DOUBLE_STEP.id, i1);
45 }
46 }
47 }
48
49 public int a(int i, Random random) {
50 return Block.STEP.id;
51 }
52
53 public int a(Random random) {
54 return this.b ? 2 : 1;
55 }
56
57 protected int a_(int i) {
58 return i;
59 }
60
61 public boolean b() {
62 return this.b;
63 }
64}