--- a/net/minecraft/world/level/block/entity/BarrelBlockEntity.java
+++ b/net/minecraft/world/level/block/entity/BarrelBlockEntity.java
@@ -21,8 +_,42 @@
 import net.minecraft.world.level.block.state.BlockState;
 
 public class BarrelBlockEntity extends RandomizableContainerBlockEntity {
+    // CraftBukkit start - add fields and methods
+    public java.util.List<org.bukkit.entity.HumanEntity> transaction = new java.util.ArrayList<>();
+    private int maxStack = MAX_STACK;
+
+    @Override
+    public java.util.List<ItemStack> getContents() {
+        return this.items;
+    }
+
+    @Override
+    public void onOpen(org.bukkit.craftbukkit.entity.CraftHumanEntity player) {
+        this.transaction.add(player);
+    }
+
+    @Override
+    public void onClose(org.bukkit.craftbukkit.entity.CraftHumanEntity player) {
+        this.transaction.remove(player);
+    }
+
+    @Override
+    public java.util.List<org.bukkit.entity.HumanEntity> getViewers() {
+        return this.transaction;
+    }
+
+    @Override
+    public int getMaxStackSize() {
+        return this.maxStack;
+    }
+
+    @Override
+    public void setMaxStackSize(int i) {
+        this.maxStack = i;
+    }
+    // CraftBukkit end
     private NonNullList<ItemStack> items = NonNullList.withSize(27, ItemStack.EMPTY);
-    private final ContainerOpenersCounter openersCounter = new ContainerOpenersCounter() {
+    public final ContainerOpenersCounter openersCounter = new ContainerOpenersCounter() {
         @Override
         protected void onOpen(Level level, BlockPos pos, BlockState state) {
             BarrelBlockEntity.this.playSound(state, SoundEvents.BARREL_OPEN);
@@ -116,11 +_,11 @@
         }
     }
 
-    void updateBlockState(BlockState state, boolean _open) {
+    public void updateBlockState(BlockState state, boolean _open) {
         this.level.setBlock(this.getBlockPos(), state.setValue(BarrelBlock.OPEN, Boolean.valueOf(_open)), 3);
     }
 
-    void playSound(BlockState state, SoundEvent sound) {
+    public void playSound(BlockState state, SoundEvent sound) {
         Vec3i unitVec3i = state.getValue(BarrelBlock.FACING).getUnitVec3i();
         double d = this.worldPosition.getX() + 0.5 + unitVec3i.getX() / 2.0;
         double d1 = this.worldPosition.getY() + 0.5 + unitVec3i.getY() / 2.0;
