mirror of
https://github.com/PaperMC/Paper.git
synced 2026-11-25 10:29:41 -05:00
Refactored some code from nms to ob for minimal diffs
This commit is contained in:
1 parent
1e8bbbfbd5
commit
f165d4082d
3 files changed
+19
-28
No files matched your search
@@ -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 BlockSnow extends Block {
|
||||
|
||||
@@ -78,13 +77,7 @@ public class BlockSnow extends Block {
|
||||
public void a(World world, int i, int j, int k, Random random) {
|
||||
if (world.a(EnumSkyBlock.BLOCK, i, j, k) > 11) {
|
||||
// CraftBukkit start
|
||||
org.bukkit.block.BlockState blockState = world.getWorld().getBlockAt(i, j, k).getState();
|
||||
blockState.setTypeId(0);
|
||||
|
||||
BlockFadeEvent event = new BlockFadeEvent(blockState.getBlock(), blockState);
|
||||
world.getServer().getPluginManager().callEvent(event);
|
||||
|
||||
if (event.isCancelled()) {
|
||||
if (CraftEventFactory.callBlockFadeEvent(world.getWorld().getBlockAt(i, j, k), 0).isCancelled()) {
|
||||
return;
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
Reference in new issue
Block a user