mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-27 04:55:47 +01:00
36 lines
1.6 KiB
Diff
36 lines
1.6 KiB
Diff
--- a/net/minecraft/server/TileEntityCampfire.java
|
|
+++ b/net/minecraft/server/TileEntityCampfire.java
|
|
@@ -3,6 +3,11 @@
|
|
import java.util.Optional;
|
|
import java.util.Random;
|
|
import javax.annotation.Nullable;
|
|
+// CraftBukkit start
|
|
+import org.bukkit.craftbukkit.block.CraftBlock;
|
|
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
|
|
+import org.bukkit.event.block.BlockCookEvent;
|
|
+// CraftBukkit end
|
|
|
|
public class TileEntityCampfire extends TileEntity implements Clearable, ITickable {
|
|
|
|
@@ -59,6 +64,20 @@
|
|
}).orElse(itemstack);
|
|
BlockPosition blockposition = this.getPosition();
|
|
|
|
+ // CraftBukkit start - fire BlockCookEvent
|
|
+ CraftItemStack source = CraftItemStack.asCraftMirror(itemstack);
|
|
+ org.bukkit.inventory.ItemStack result = CraftItemStack.asBukkitCopy(itemstack1);
|
|
+
|
|
+ BlockCookEvent blockCookEvent = new BlockCookEvent(CraftBlock.at(this.world, this.position), source, result);
|
|
+ this.world.getServer().getPluginManager().callEvent(blockCookEvent);
|
|
+
|
|
+ if (blockCookEvent.isCancelled()) {
|
|
+ return;
|
|
+ }
|
|
+
|
|
+ result = blockCookEvent.getResult();
|
|
+ itemstack1 = CraftItemStack.asNMSCopy(result);
|
|
+ // CraftBukkit end
|
|
InventoryUtils.dropItem(this.world, (double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ(), itemstack1);
|
|
this.items.set(i, ItemStack.a);
|
|
this.s();
|