--- a/net/minecraft/world/level/block/entity/TileEntityFurnace.java
+++ b/net/minecraft/world/level/block/entity/TileEntityFurnace.java
@@ -43,6 +43,17 @@
 import net.minecraft.world.level.block.state.IBlockData;
 import net.minecraft.world.phys.Vec3D;
 
+// CraftBukkit start
+import org.bukkit.craftbukkit.block.CraftBlock;
+import org.bukkit.craftbukkit.entity.CraftHumanEntity;
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
+import org.bukkit.entity.HumanEntity;
+import org.bukkit.entity.Player;
+import org.bukkit.event.inventory.FurnaceBurnEvent;
+import org.bukkit.event.inventory.FurnaceExtractEvent;
+import org.bukkit.event.inventory.FurnaceSmeltEvent;
+// CraftBukkit end
+
 public abstract class TileEntityFurnace extends TileEntityContainer implements IWorldInventory, RecipeHolder, AutoRecipeOutput {
 
     protected static final int SLOT_INPUT = 0;
@@ -182,6 +193,36 @@
         return map;
     }
 
+    // CraftBukkit start - add fields and methods
+    private int maxStack = MAX_STACK;
+    public List<HumanEntity> transaction = new java.util.ArrayList<HumanEntity>();
+
+    public List<ItemStack> getContents() {
+        return this.items;
+    }
+
+    public void onOpen(CraftHumanEntity who) {
+        transaction.add(who);
+    }
+
+    public void onClose(CraftHumanEntity who) {
+        transaction.remove(who);
+    }
+
+    public List<HumanEntity> getViewers() {
+        return transaction;
+    }
+
+    @Override
+    public int getMaxStackSize() {
+        return maxStack;
+    }
+
+    public void setMaxStackSize(int size) {
+        maxStack = size;
+    }
+    // CraftBukkit end
+
     private static boolean b(Item item) {
         return TagsItem.NON_FLAMMABLE_WOOD.isTagged(item);
     }
@@ -266,13 +307,24 @@
                 tileentityfurnace.cookingProgress = MathHelper.clamp(tileentityfurnace.cookingProgress - 2, 0, tileentityfurnace.cookingTotalTime);
             }
         } else {
-            IRecipe<?> irecipe = (IRecipe) world.getCraftingManager().craft(tileentityfurnace.recipeType, tileentityfurnace, world).orElse((Object) null);
+            IRecipe<?> irecipe = (IRecipe) world.getCraftingManager().craft((Recipes<RecipeCooking>) tileentityfurnace.recipeType, tileentityfurnace, world).orElse(null); // CraftBukkit - decompile error // Eclipse fail
             int i = tileentityfurnace.getMaxStackSize();
 
             if (!tileentityfurnace.isBurning() && canBurn(irecipe, tileentityfurnace.items, i)) {
-                tileentityfurnace.litTime = tileentityfurnace.fuelTime(itemstack);
+                // CraftBukkit start
+                CraftItemStack fuel = CraftItemStack.asCraftMirror(itemstack);
+
+                FurnaceBurnEvent furnaceBurnEvent = new FurnaceBurnEvent(CraftBlock.at(world, blockposition), fuel, tileentityfurnace.fuelTime(itemstack));
+                world.getCraftServer().getPluginManager().callEvent(furnaceBurnEvent);
+
+                if (furnaceBurnEvent.isCancelled()) {
+                    return;
+                }
+
+                tileentityfurnace.litTime = furnaceBurnEvent.getBurnTime();
                 tileentityfurnace.litDuration = tileentityfurnace.litTime;
-                if (tileentityfurnace.isBurning()) {
+                if (tileentityfurnace.isBurning() && furnaceBurnEvent.isBurning()) {
+                    // CraftBukkit end
                     flag1 = true;
                     if (!itemstack.isEmpty()) {
                         Item item = itemstack.getItem();
@@ -292,7 +344,7 @@
                 if (tileentityfurnace.cookingProgress == tileentityfurnace.cookingTotalTime) {
                     tileentityfurnace.cookingProgress = 0;
                     tileentityfurnace.cookingTotalTime = getRecipeCookingTime(world, tileentityfurnace.recipeType, tileentityfurnace);
-                    if (burn(irecipe, tileentityfurnace.items, i)) {
+                    if (burn(tileentityfurnace.level, tileentityfurnace.worldPosition, irecipe, tileentityfurnace.items, i)) { // CraftBukkit
                         tileentityfurnace.setRecipeUsed(irecipe);
                     }
 
@@ -331,17 +383,44 @@
         }
     }
 
-    private static boolean burn(@Nullable IRecipe<?> irecipe, NonNullList<ItemStack> nonnulllist, int i) {
+    private static boolean burn(World world, BlockPosition blockposition, @Nullable IRecipe<?> irecipe, NonNullList<ItemStack> nonnulllist, int i) { // CraftBukkit
         if (irecipe != null && canBurn(irecipe, nonnulllist, i)) {
             ItemStack itemstack = (ItemStack) nonnulllist.get(0);
             ItemStack itemstack1 = irecipe.getResult();
             ItemStack itemstack2 = (ItemStack) nonnulllist.get(2);
 
+            // CraftBukkit start - fire FurnaceSmeltEvent
+            CraftItemStack source = CraftItemStack.asCraftMirror(itemstack);
+            org.bukkit.inventory.ItemStack result = CraftItemStack.asBukkitCopy(itemstack1);
+
+            FurnaceSmeltEvent furnaceSmeltEvent = new FurnaceSmeltEvent(CraftBlock.at(world, blockposition), source, result);
+            world.getCraftServer().getPluginManager().callEvent(furnaceSmeltEvent);
+
+            if (furnaceSmeltEvent.isCancelled()) {
+                return false;
+            }
+
+            result = furnaceSmeltEvent.getResult();
+            itemstack1 = CraftItemStack.asNMSCopy(result);
+
+            if (!itemstack1.isEmpty()) {
+                if (itemstack2.isEmpty()) {
+                    nonnulllist.set(2, itemstack1.cloneItemStack());
+                } else if (CraftItemStack.asCraftMirror(itemstack2).isSimilar(result)) {
+                    itemstack2.add(itemstack1.getCount());
+                } else {
+                    return false;
+                }
+            }
+
+            /*
             if (itemstack2.isEmpty()) {
                 nonnulllist.set(2, itemstack1.cloneItemStack());
             } else if (itemstack2.a(itemstack1.getItem())) {
                 itemstack2.add(1);
             }
+            */
+            // CraftBukkit end
 
             if (itemstack.a(Blocks.WET_SPONGE.getItem()) && !((ItemStack) nonnulllist.get(1)).isEmpty() && ((ItemStack) nonnulllist.get(1)).a(Items.BUCKET)) {
                 nonnulllist.set(1, new ItemStack(Items.WATER_BUCKET));
@@ -365,7 +444,7 @@
     }
 
     private static int getRecipeCookingTime(World world, Recipes<? extends RecipeCooking> recipes, IInventory iinventory) {
-        return (Integer) world.getCraftingManager().craft(recipes, iinventory, world).map(RecipeCooking::getCookingTime).orElse(200);
+        return (world != null) ? (Integer) world.getCraftingManager().craft((Recipes<RecipeCooking>) recipes, iinventory, world).map(RecipeCooking::getCookingTime).orElse(200) : 200; // CraftBukkit - SPIGOT-4302 // Eclipse fail
     }
 
     public static boolean isFuel(ItemStack itemstack) {
@@ -484,14 +563,20 @@
     @Override
     public void awardUsedRecipes(EntityHuman entityhuman) {}
 
-    public void a(EntityPlayer entityplayer) {
-        List<IRecipe<?>> list = this.a(entityplayer.getWorldServer(), entityplayer.getPositionVector());
+    public void a(EntityPlayer entityplayer, ItemStack itemstack, int amount) { // CraftBukkit
+        List<IRecipe<?>> list = this.a(entityplayer.getWorldServer(), entityplayer.getPositionVector(), this.worldPosition, entityplayer, itemstack, amount); // CraftBukkit
 
         entityplayer.discoverRecipes(list);
         this.recipesUsed.clear();
     }
 
     public List<IRecipe<?>> a(WorldServer worldserver, Vec3D vec3d) {
+        // CraftBukkit start
+        return this.a(worldserver, vec3d, this.worldPosition, null, null, 0);
+    }
+
+    public List<IRecipe<?>> a(WorldServer worldserver, Vec3D vec3d, BlockPosition blockposition, EntityPlayer entityplayer, ItemStack itemstack, int amount) {
+        // CraftBukkit end
         List<IRecipe<?>> list = Lists.newArrayList();
         ObjectIterator objectiterator = this.recipesUsed.object2IntEntrySet().iterator();
 
@@ -500,14 +585,14 @@
 
             worldserver.getCraftingManager().getRecipe((MinecraftKey) entry.getKey()).ifPresent((irecipe) -> {
                 list.add(irecipe);
-                a(worldserver, vec3d, entry.getIntValue(), ((RecipeCooking) irecipe).getExperience());
+                a(worldserver, vec3d, entry.getIntValue(), ((RecipeCooking) irecipe).getExperience(), blockposition, entityplayer, itemstack, amount); // CraftBukkit
             });
         }
 
         return list;
     }
 
-    private static void a(WorldServer worldserver, Vec3D vec3d, int i, float f) {
+    private static void a(WorldServer worldserver, Vec3D vec3d, int i, float f, BlockPosition blockposition, EntityHuman entityhuman, ItemStack itemstack, int amount) { // CraftBukkit
         int j = MathHelper.d((float) i * f);
         float f1 = MathHelper.h((float) i * f);
 
@@ -515,6 +600,14 @@
             ++j;
         }
 
+        // CraftBukkit start - fire FurnaceExtractEvent
+        if (amount != 0) {
+            FurnaceExtractEvent event = new FurnaceExtractEvent((Player) entityhuman.getBukkitEntity(), CraftBlock.at(worldserver, blockposition), org.bukkit.craftbukkit.util.CraftMagicNumbers.getMaterial(itemstack.getItem()), amount, j);
+            worldserver.getCraftServer().getPluginManager().callEvent(event);
+            j = event.getExpToDrop();
+        }
+        // CraftBukkit end
+
         EntityExperienceOrb.a(worldserver, vec3d, j);
     }
 
