Fork of Poseidon providing Bukkit #1060 to older Beta versions (b1.0-b1.7.3)
1package net.minecraft.server;
2
3import org.bukkit.craftbukkit.event.CraftEventFactory;
4
5import java.util.Random;
6
7public class BlockIce extends BlockBreakable {
8
9 public BlockIce(int i, int j) {
10 super(i, j, Material.ICE, false);
11 this.frictionFactor = 0.98F;
12 this.a(true);
13 }
14
15 public void a(World world, EntityHuman entityhuman, int i, int j, int k, int l) {
16 super.a(world, entityhuman, i, j, k, l);
17 Material material = world.getMaterial(i, j - 1, k);
18
19 if (material.isSolid() || material.isLiquid()) {
20 world.setTypeId(i, j, k, Block.WATER.id);
21 }
22 }
23
24 public int a(Random random) {
25 return 0;
26 }
27
28 public void a(World world, int i, int j, int k, Random random) {
29 if (world.a(EnumSkyBlock.BLOCK, i, j, k) > 11 - Block.q[this.id]) {
30 // CraftBukkit start
31 if (CraftEventFactory.callBlockFadeEvent(world.getWorld().getBlockAt(i, j, k), Block.STATIONARY_WATER.id).isCancelled()) {
32 return;
33 }
34 // CraftBukkit end
35
36 this.g(world, i, j, k, world.getData(i, j, k));
37 world.setTypeId(i, j, k, Block.STATIONARY_WATER.id);
38 }
39 }
40
41 public int e() {
42 return 0;
43 }
44}