--- a/net/minecraft/world/level/block/entity/TileEntityBrewingStand.java
+++ b/net/minecraft/world/level/block/entity/TileEntityBrewingStand.java
@@ -25,6 +25,18 @@
 import net.minecraft.world.level.block.BlockBrewingStand;
 import net.minecraft.world.level.block.state.IBlockData;
 
+// CraftBukkit start
+import java.util.List;
+import net.minecraft.server.MinecraftServer;
+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.event.inventory.BrewEvent;
+import org.bukkit.event.inventory.BrewingStandFuelEvent;
+import org.bukkit.inventory.InventoryHolder;
+// CraftBukkit end
+
 public class TileEntityBrewingStand extends TileEntityContainer implements IWorldInventory {
 
     private static final int INGREDIENT_SLOT = 3;
@@ -42,6 +54,36 @@
     private Item ingredient;
     public int fuel;
     protected final IContainerProperties dataAccess;
+    // CraftBukkit start - add fields and methods
+    private int lastTick = MinecraftServer.currentTick;
+    public List<HumanEntity> transaction = new java.util.ArrayList<HumanEntity>();
+    private int maxStack = 64;
+
+    public void onOpen(CraftHumanEntity who) {
+        transaction.add(who);
+    }
+
+    public void onClose(CraftHumanEntity who) {
+        transaction.remove(who);
+    }
+
+    public List<HumanEntity> getViewers() {
+        return transaction;
+    }
+
+    public List<ItemStack> getContents() {
+        return this.items;
+    }
+
+    @Override
+    public int getMaxStackSize() {
+        return maxStack;
+    }
+
+    public void setMaxStackSize(int size) {
+        maxStack = size;
+    }
+    // CraftBukkit end
 
     public TileEntityBrewingStand(BlockPosition blockposition, IBlockData iblockdata) {
         super(TileEntityTypes.BREWING_STAND, blockposition, iblockdata);
@@ -109,8 +151,19 @@
         ItemStack itemstack = (ItemStack) tileentitybrewingstand.items.get(4);
 
         if (tileentitybrewingstand.fuel <= 0 && itemstack.a(Items.BLAZE_POWDER)) {
-            tileentitybrewingstand.fuel = 20;
-            itemstack.subtract(1);
+            // CraftBukkit start
+            BrewingStandFuelEvent event = new BrewingStandFuelEvent(CraftBlock.at(world, blockposition), CraftItemStack.asCraftMirror(itemstack), 20);
+            world.getCraftServer().getPluginManager().callEvent(event);
+
+            if (event.isCancelled()) {
+                return;
+            }
+
+            tileentitybrewingstand.fuel = event.getFuelPower();
+            if (tileentitybrewingstand.fuel > 0 && event.isConsuming()) {
+                itemstack.subtract(1);
+            }
+            // CraftBukkit end
             a(world, blockposition, iblockdata);
         }
 
@@ -118,12 +171,17 @@
         boolean flag1 = tileentitybrewingstand.brewTime > 0;
         ItemStack itemstack1 = (ItemStack) tileentitybrewingstand.items.get(3);
 
+        // CraftBukkit start - Use wall time instead of ticks for brewing
+        int elapsedTicks = MinecraftServer.currentTick - tileentitybrewingstand.lastTick;
+        tileentitybrewingstand.lastTick = MinecraftServer.currentTick;
+
         if (flag1) {
-            --tileentitybrewingstand.brewTime;
-            boolean flag2 = tileentitybrewingstand.brewTime == 0;
+            tileentitybrewingstand.brewTime -= elapsedTicks;
+            boolean flag2 = tileentitybrewingstand.brewTime <= 0; // == -> <=
+            // CraftBukkit end
 
             if (flag2 && flag) {
-                a(world, blockposition, tileentitybrewingstand.items);
+                a(world, blockposition, tileentitybrewingstand.items, tileentitybrewingstand); // CraftBukkit
                 a(world, blockposition, iblockdata);
             } else if (!flag || !itemstack1.a(tileentitybrewingstand.ingredient)) {
                 tileentitybrewingstand.brewTime = 0;
@@ -187,8 +245,18 @@
         }
     }
 
-    private static void a(World world, BlockPosition blockposition, NonNullList<ItemStack> nonnulllist) {
+    // CraftBukkit start
+    private static void a(World world, BlockPosition blockposition, NonNullList<ItemStack> nonnulllist, TileEntityBrewingStand tileentitybrewingstand) {
         ItemStack itemstack = (ItemStack) nonnulllist.get(3);
+        InventoryHolder owner = tileentitybrewingstand.getOwner();
+        if (owner != null) {
+            BrewEvent event = new BrewEvent(CraftBlock.at(world, blockposition), (org.bukkit.inventory.BrewerInventory) owner.getInventory(), tileentitybrewingstand.fuel);
+            org.bukkit.Bukkit.getPluginManager().callEvent(event);
+            if (event.isCancelled()) {
+                return;
+            }
+        }
+        // CraftBukkit end
 
         for (int i = 0; i < 3; ++i) {
             nonnulllist.set(i, PotionBrewer.d(itemstack, (ItemStack) nonnulllist.get(i)));
