Paper/src/main/java/net/minecraft/server/BlockIce.java

48 lines
1.3 KiB
Java
Raw Normal View History

package net.minecraft.server;
import java.util.Random;
import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
public class BlockIce extends BlockHalfTransparant {
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);
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.lightBlock[this.id]) {
// CraftBukkit start
if (CraftEventFactory.callBlockFadeEvent(world.getWorld().getBlockAt(i, j, k), Block.STATIONARY_WATER.id).isCancelled()) {
return;
}
// CraftBukkit end
2011-11-20 09:01:14 +01:00
this.b(world, i, j, k, world.getData(i, j, k), 0);
world.setTypeId(i, j, k, Block.STATIONARY_WATER.id);
}
}
2011-07-08 14:25:53 +02:00
2011-11-20 09:01:14 +01:00
public int g() {
2011-07-08 14:25:53 +02:00
return 0;
}
2011-11-20 09:01:14 +01:00
protected ItemStack a_(int i) {
return null;
}
}