When setting an item in the inventory of an unplaced furnace, a NullPointerException is thrown due to the world being null.
This exception is throws in method `s()` on line:
`FurnaceRecipe furnacerecipe = (FurnaceRecipe) this.world.D().b(this, this.world);`
in the NMS.TileEntityFurnace class, due to `this.world` being null.
This exception triggers at least on line `this.cookTimeTotal = this.s();` call in the `setItem(int, ItemStack)` method in the NMS.TileEntityFurnace class, which is called when setting an item through the Bukkit/Spigot API.
Reproduce code:
org.bukkit.block.Furnace furnace = (org.bukkit.block.Furnace) ((org.bukkit.inventory.meta.BlockStateMeta) new org.bukkit.inventory.ItemStack(org.bukkit.Material.FURNACE).getItemMeta()).getBlockState();
org.bukkit.inventory.ItemStack itemStack = new org.bukkit.inventory.ItemStack(org.bukkit.Material.STONE);
furnace.getInventory().setSmelting(itemStack);
Proposed solution:
Add a `this.world == null` check in the `s()` method and set `this.cookTimeTotal` on-place instead (if this does not happen already).