3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-24 15:20:11 +01:00
Paper/src/main/java/net/minecraft/server/BlockIce.java

66 Zeilen
1.9 KiB
Java

package net.minecraft.server;
import java.util.Random;
public class BlockIce extends BlockHalfTransparant {
2013-03-13 23:33:27 +01:00
public BlockIce(int i) {
super(i, "ice", Material.ICE, false);
this.frictionFactor = 0.98F;
2012-07-29 09:33:13 +02:00
this.b(true);
this.a(CreativeModeTab.b);
}
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);
2013-07-01 13:03:00 +02:00
entityhuman.a(0.025F);
2013-03-13 23:33:27 +01:00
if (this.r_() && EnchantmentManager.hasSilkTouchEnchantment(entityhuman)) {
2013-07-01 13:03:00 +02:00
ItemStack itemstack = this.d_(l);
2012-07-29 09:33:13 +02:00
if (itemstack != null) {
2012-11-06 13:05:28 +01:00
this.b(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;
}
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()) {
2013-03-13 23:33:27 +01:00
world.setTypeIdUpdate(i, j, k, Block.WATER.id);
2012-07-29 09:33:13 +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) {
2012-07-29 09:33:13 +02:00
if (world.b(EnumSkyBlock.BLOCK, i, j, k) > 11 - Block.lightBlock[this.id]) {
// CraftBukkit start
if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(world.getWorld().getBlockAt(i, j, k), Block.STATIONARY_WATER.id).isCancelled()) {
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;
}
this.c(world, i, j, k, world.getData(i, j, k), 0);
2013-03-13 23:33:27 +01:00
world.setTypeIdUpdate(i, j, k, Block.STATIONARY_WATER.id);
}
}
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;
}
}