2011-06-17 20:48:20 +02:00
|
|
|
package net.minecraft.server;
|
|
|
|
|
|
|
|
import java.util.Random;
|
|
|
|
|
2011-11-30 00:17:43 +01:00
|
|
|
public class BlockIce extends BlockHalfTransparant {
|
2011-06-17 20:48:20 +02:00
|
|
|
|
|
|
|
public BlockIce(int i, int j) {
|
|
|
|
super(i, j, Material.ICE, false);
|
|
|
|
this.frictionFactor = 0.98F;
|
2012-07-29 09:33:13 +02:00
|
|
|
this.b(true);
|
|
|
|
this.a(CreativeModeTab.b);
|
2011-06-17 20:48:20 +02:00
|
|
|
}
|
|
|
|
|
2011-07-08 14:25:53 +02:00
|
|
|
public void a(World world, EntityHuman entityhuman, int i, int j, int k, int l) {
|
2012-07-29 09:33:13 +02:00
|
|
|
entityhuman.a(StatisticList.C[this.id], 1);
|
|
|
|
entityhuman.j(0.025F);
|
2012-10-25 05:53:23 +02:00
|
|
|
if (this.s_() && EnchantmentManager.hasSilkTouchEnchantment(entityhuman)) {
|
|
|
|
ItemStack itemstack = this.f_(l);
|
2011-06-17 20:48:20 +02:00
|
|
|
|
2012-07-29 09:33:13 +02:00
|
|
|
if (itemstack != null) {
|
|
|
|
this.a(world, i, j, k, itemstack);
|
|
|
|
}
|
|
|
|
} else {
|
2012-10-25 05:53:23 +02:00
|
|
|
if (world.worldProvider.e) {
|
2012-07-29 09:33:13 +02:00
|
|
|
world.setTypeId(i, j, k, 0);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2012-10-25 05:53:23 +02:00
|
|
|
int i1 = EnchantmentManager.getBonusBlockLootEnchantmentLevel(entityhuman);
|
2012-07-29 09:33:13 +02:00
|
|
|
|
|
|
|
this.c(world, i, j, k, l, i1);
|
|
|
|
Material material = world.getMaterial(i, j - 1, k);
|
|
|
|
|
|
|
|
if (material.isSolid() || material.isLiquid()) {
|
|
|
|
world.setTypeId(i, j, k, Block.WATER.id);
|
|
|
|
}
|
2011-06-17 20:48:20 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public int a(Random random) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2012-07-29 09:33:13 +02:00
|
|
|
public void b(World world, int i, int j, int k, Random random) {
|
|
|
|
if (world.b(EnumSkyBlock.BLOCK, i, j, k) > 11 - Block.lightBlock[this.id]) {
|
2011-06-17 20:48:20 +02:00
|
|
|
// CraftBukkit start
|
2012-07-22 08:18:00 +02:00
|
|
|
if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(world.getWorld().getBlockAt(i, j, k), Block.STATIONARY_WATER.id).isCancelled()) {
|
2011-06-17 20:48:20 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
// CraftBukkit end
|
|
|
|
|
2012-10-25 05:53:23 +02:00
|
|
|
if (world.worldProvider.e) {
|
2012-07-29 09:33:13 +02:00
|
|
|
world.setTypeId(i, j, k, 0);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
this.c(world, i, j, k, world.getData(i, j, k), 0);
|
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
|
|
|
|
2012-10-25 05:53:23 +02:00
|
|
|
public int q_() {
|
2011-07-08 14:25:53 +02:00
|
|
|
return 0;
|
|
|
|
}
|
2011-06-17 20:48:20 +02:00
|
|
|
}
|