36 lines
1.5 KiB
Diff
36 lines
1.5 KiB
Diff
--- a/net/minecraft/world/level/block/entity/BrushableBlockEntity.java
|
|
+++ b/net/minecraft/world/level/block/entity/BrushableBlockEntity.java
|
|
@@ -28,6 +28,12 @@
|
|
import net.minecraft.world.phys.Vec3D;
|
|
import org.slf4j.Logger;
|
|
|
|
+// CraftBukkit start
|
|
+import java.util.Arrays;
|
|
+import org.bukkit.craftbukkit.block.CraftBlock;
|
|
+import org.bukkit.craftbukkit.event.CraftEventFactory;
|
|
+// CraftBukkit end
|
|
+
|
|
public class BrushableBlockEntity extends TileEntity {
|
|
|
|
private static final Logger LOGGER = LogUtils.getLogger();
|
|
@@ -153,7 +159,10 @@
|
|
EntityItem entityitem = new EntityItem(this.level, d3, d4, d5, this.item.split(this.level.random.nextInt(21) + 10));
|
|
|
|
entityitem.setDeltaMovement(Vec3D.ZERO);
|
|
- this.level.addFreshEntity(entityitem);
|
|
+ // CraftBukkit start
|
|
+ org.bukkit.block.Block bblock = CraftBlock.at(this.level, this.worldPosition);
|
|
+ CraftEventFactory.handleBlockDropItemEvent(bblock, bblock.getState(), (EntityPlayer) entityhuman, Arrays.asList(entityitem));
|
|
+ // CraftBukkit end
|
|
this.item = ItemStack.EMPTY;
|
|
}
|
|
|
|
@@ -230,6 +239,7 @@
|
|
|
|
@Override
|
|
public void load(NBTTagCompound nbttagcompound) {
|
|
+ super.load(nbttagcompound); // CraftBukkit - SPIGOT-7393: Load super Bukkit data
|
|
if (!this.tryLoadLootTable(nbttagcompound) && nbttagcompound.contains("item")) {
|
|
this.item = ItemStack.of(nbttagcompound.getCompound("item"));
|
|
}
|