mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-10 17:52:02 -07:00
Update to Minecraft 1.13-pre7
This commit is contained in:
@@ -1,26 +1,26 @@
|
||||
--- a/net/minecraft/server/BlockLeaves.java
|
||||
+++ b/net/minecraft/server/BlockLeaves.java
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
import java.util.Random;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
+import org.bukkit.event.block.LeavesDecayEvent; // CraftBukkit
|
||||
+
|
||||
public abstract class BlockLeaves extends Block {
|
||||
public class BlockLeaves extends Block {
|
||||
|
||||
public static final BlockStateBoolean DECAYABLE = BlockStateBoolean.of("decayable");
|
||||
@@ -132,6 +134,14 @@
|
||||
}
|
||||
public static final BlockStateInteger DISTANCE = BlockProperties.aa;
|
||||
@@ -20,6 +22,14 @@
|
||||
|
||||
private void b(World world, BlockPosition blockposition) {
|
||||
+ // CraftBukkit start
|
||||
+ LeavesDecayEvent event = new LeavesDecayEvent(world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()));
|
||||
+ world.getServer().getPluginManager().callEvent(event);
|
||||
public void b(IBlockData iblockdata, World world, BlockPosition blockposition, Random random) {
|
||||
if (!((Boolean) iblockdata.get(BlockLeaves.PERSISTENT)).booleanValue() && ((Integer) iblockdata.get(BlockLeaves.DISTANCE)).intValue() == 7) {
|
||||
+ // CraftBukkit start
|
||||
+ LeavesDecayEvent event = new LeavesDecayEvent(world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()));
|
||||
+ world.getServer().getPluginManager().callEvent(event);
|
||||
+
|
||||
+ if (event.isCancelled() || world.getType(blockposition).getBlock() != this) {
|
||||
+ return;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
this.b(world, blockposition, world.getType(blockposition), 0);
|
||||
world.setAir(blockposition);
|
||||
}
|
||||
+ if (event.isCancelled() || world.getType(blockposition).getBlock() != this) {
|
||||
+ return;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
iblockdata.a(world, blockposition, 0);
|
||||
world.setAir(blockposition);
|
||||
}
|
||||
|
Reference in New Issue
Block a user