2011-06-17 20:48:20 +02:00
|
|
|
package net.minecraft.server;
|
|
|
|
|
|
|
|
import java.util.Random;
|
|
|
|
|
2013-11-04 14:07:38 +01:00
|
|
|
public class BlockIce extends BlockHalfTransparent {
|
2011-06-17 20:48:20 +02:00
|
|
|
|
2013-11-04 14:07:38 +01:00
|
|
|
public BlockIce() {
|
|
|
|
super("ice", Material.ICE, false);
|
2011-06-17 20:48:20 +02:00
|
|
|
this.frictionFactor = 0.98F;
|
2013-11-04 14:07:38 +01:00
|
|
|
this.a(true);
|
2012-07-29 09:33:13 +02:00
|
|
|
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) {
|
2013-11-04 14:07:38 +01:00
|
|
|
entityhuman.a(StatisticList.C[Block.b((Block) this)], 1);
|
2013-07-01 13:03:00 +02:00
|
|
|
entityhuman.a(0.025F);
|
2013-11-04 14:07:38 +01:00
|
|
|
if (this.E() && EnchantmentManager.hasSilkTouchEnchantment(entityhuman)) {
|
|
|
|
ItemStack itemstack = this.j(l);
|
2011-06-17 20:48:20 +02:00
|
|
|
|
2012-07-29 09:33:13 +02:00
|
|
|
if (itemstack != null) {
|
2013-11-04 14:07:38 +01:00
|
|
|
this.a(world, i, j, k, itemstack);
|
2012-07-29 09:33:13 +02:00
|
|
|
}
|
|
|
|
} else {
|
2013-07-01 13:03:00 +02:00
|
|
|
if (world.worldProvider.f) {
|
2013-03-13 23:33:27 +01:00
|
|
|
world.setAir(i, j, k);
|
2012-07-29 09:33:13 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2012-10-25 05:53:23 +02:00
|
|
|
int i1 = EnchantmentManager.getBonusBlockLootEnchantmentLevel(entityhuman);
|
2012-07-29 09:33:13 +02:00
|
|
|
|
2013-11-04 14:07:38 +01:00
|
|
|
this.b(world, i, j, k, l, i1);
|
|
|
|
Material material = world.getType(i, j - 1, k).getMaterial();
|
2012-07-29 09:33:13 +02:00
|
|
|
|
|
|
|
if (material.isSolid() || material.isLiquid()) {
|
2013-11-04 14:07:38 +01:00
|
|
|
world.setTypeUpdate(i, j, k, Blocks.WATER);
|
2012-07-29 09:33:13 +02:00
|
|
|
}
|
2011-06-17 20:48:20 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public int a(Random random) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2013-03-13 23:33:27 +01:00
|
|
|
public void a(World world, int i, int j, int k, Random random) {
|
2013-11-04 14:07:38 +01:00
|
|
|
if (world.b(EnumSkyBlock.BLOCK, i, j, k) > 11 - this.k()) {
|
2011-06-17 20:48:20 +02:00
|
|
|
// CraftBukkit start
|
2013-11-04 14:07:38 +01:00
|
|
|
if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(world.getWorld().getBlockAt(i, j, k), Blocks.STATIONARY_WATER).isCancelled()) {
|
2011-06-17 20:48:20 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
// CraftBukkit end
|
|
|
|
|
2013-07-01 13:03:00 +02:00
|
|
|
if (world.worldProvider.f) {
|
2013-03-13 23:33:27 +01:00
|
|
|
world.setAir(i, j, k);
|
2012-07-29 09:33:13 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2013-11-04 14:07:38 +01:00
|
|
|
this.b(world, i, j, k, world.getData(i, j, k), 0);
|
|
|
|
world.setTypeUpdate(i, j, k, Blocks.STATIONARY_WATER);
|
2011-06-17 20:48:20 +02:00
|
|
|
}
|
|
|
|
}
|
2011-07-08 14:25:53 +02:00
|
|
|
|
2013-03-13 23:33:27 +01:00
|
|
|
public int h() {
|
2011-07-08 14:25:53 +02:00
|
|
|
return 0;
|
|
|
|
}
|
2011-06-17 20:48:20 +02:00
|
|
|
}
|