mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-30 20:03:51 -07:00
Refactored some code from nms to ob for minimal diffs
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user