Refactored some code from nms to ob for minimal diffs

This commit is contained in:
Dinnerbone
2011-08-29 16:09:13 +01:00
parent 1e8bbbfbd5
commit f165d4082d
3 changed files with 19 additions and 28 deletions

View File

@@ -1,8 +1,7 @@
package net.minecraft.server;
import java.util.Random;
import org.bukkit.event.block.BlockFadeEvent; // CraftBukkit
import org.bukkit.craftbukkit.event.CraftEventFactory;
public class BlockIce extends BlockBreakable {
@@ -28,13 +27,7 @@ public class BlockIce extends BlockBreakable {
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
org.bukkit.block.BlockState blockState = world.getWorld().getBlockAt(i, j, k).getState();
blockState.setTypeId(Block.STATIONARY_WATER.id);
BlockFadeEvent event = new BlockFadeEvent(blockState.getBlock(), blockState);
world.getServer().getPluginManager().callEvent(event);
if (event.isCancelled()) {
if (CraftEventFactory.callBlockFadeEvent(world.getWorld().getBlockAt(i, j, k), Block.STATIONARY_WATER.id).isCancelled()) {
return;
}
// CraftBukkit end