37 lines
1.8 KiB
Diff
37 lines
1.8 KiB
Diff
--- a/net/minecraft/world/level/block/entity/TileEntityCampfire.java
|
|
+++ b/net/minecraft/world/level/block/entity/TileEntityCampfire.java
|
|
@@ -20,6 +20,12 @@
|
|
import net.minecraft.world.level.block.BlockCampfire;
|
|
import net.minecraft.world.level.block.state.IBlockData;
|
|
|
|
+// 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 {
|
|
|
|
private static final int BURN_COOL_SPEED = 2;
|
|
@@ -51,6 +57,20 @@
|
|
return recipecampfire.assemble(inventorysubcontainer);
|
|
}).orElse(itemstack);
|
|
|
|
+ // CraftBukkit start - fire BlockCookEvent
|
|
+ CraftItemStack source = CraftItemStack.asCraftMirror(itemstack);
|
|
+ org.bukkit.inventory.ItemStack result = CraftItemStack.asBukkitCopy(itemstack1);
|
|
+
|
|
+ BlockCookEvent blockCookEvent = new BlockCookEvent(CraftBlock.at(world, blockposition), source, result);
|
|
+ world.getCraftServer().getPluginManager().callEvent(blockCookEvent);
|
|
+
|
|
+ if (blockCookEvent.isCancelled()) {
|
|
+ return;
|
|
+ }
|
|
+
|
|
+ result = blockCookEvent.getResult();
|
|
+ itemstack1 = CraftItemStack.asNMSCopy(result);
|
|
+ // CraftBukkit end
|
|
InventoryUtils.dropItemStack(world, (double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ(), itemstack1);
|
|
tileentitycampfire.items.set(i, ItemStack.EMPTY);
|
|
world.sendBlockUpdated(blockposition, iblockdata, iblockdata, 3);
|