2011-06-17 20:48:20 +02:00
|
|
|
package net.minecraft.server;
|
|
|
|
|
|
|
|
import java.util.Random;
|
2011-08-29 17:09:13 +02:00
|
|
|
import org.bukkit.craftbukkit.event.CraftEventFactory;
|
2011-06-17 20:48:20 +02:00
|
|
|
|
|
|
|
public class BlockIce extends BlockBreakable {
|
|
|
|
|
|
|
|
public BlockIce(int i, int j) {
|
|
|
|
super(i, j, Material.ICE, false);
|
|
|
|
this.frictionFactor = 0.98F;
|
|
|
|
this.a(true);
|
|
|
|
}
|
|
|
|
|
2011-07-08 14:25:53 +02:00
|
|
|
public void a(World world, EntityHuman entityhuman, int i, int j, int k, int l) {
|
|
|
|
super.a(world, entityhuman, i, j, k, l);
|
2011-06-17 20:48:20 +02:00
|
|
|
Material material = world.getMaterial(i, j - 1, k);
|
|
|
|
|
|
|
|
if (material.isSolid() || material.isLiquid()) {
|
|
|
|
world.setTypeId(i, j, k, Block.WATER.id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public int a(Random random) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void a(World world, int i, int j, int k, Random random) {
|
|
|
|
if (world.a(EnumSkyBlock.BLOCK, i, j, k) > 11 - Block.q[this.id]) {
|
|
|
|
// CraftBukkit start
|
2011-08-29 17:09:13 +02:00
|
|
|
if (CraftEventFactory.callBlockFadeEvent(world.getWorld().getBlockAt(i, j, k), Block.STATIONARY_WATER.id).isCancelled()) {
|
2011-06-17 20:48:20 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
// CraftBukkit end
|
|
|
|
|
2011-06-30 00:02:25 +02:00
|
|
|
this.g(world, i, j, k, world.getData(i, j, k));
|
2011-06-17 20:48:20 +02:00
|
|
|
world.setTypeId(i, j, k, Block.STATIONARY_WATER.id);
|
|
|
|
}
|
|
|
|
}
|
2011-07-08 14:25:53 +02:00
|
|
|
|
|
|
|
public int e() {
|
|
|
|
return 0;
|
|
|
|
}
|
2011-06-17 20:48:20 +02:00
|
|
|
}
|