diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java index e44eb37721..a9030a5d83 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java @@ -231,6 +231,8 @@ public class CraftBlock implements Block { return new CraftNoteBlock(this); case JUKEBOX: return new CraftJukebox(this); + case BREWING_STAND: + return new CraftBrewingStand(this); default: return new CraftBlockState(this); } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBrewingStand.java b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBrewingStand.java new file mode 100644 index 0000000000..55b2d49efd --- /dev/null +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBrewingStand.java @@ -0,0 +1,43 @@ +package org.bukkit.craftbukkit.block; + +import net.minecraft.server.TileEntityBrewingStand; +import org.bukkit.block.Block; +import org.bukkit.block.BrewingStand; +import org.bukkit.craftbukkit.CraftWorld; +import org.bukkit.craftbukkit.inventory.CraftInventory; +import org.bukkit.inventory.Inventory; + +public class CraftBrewingStand extends CraftBlockState implements BrewingStand { + private final CraftWorld world; + private final TileEntityBrewingStand brewingStand; + + public CraftBrewingStand(Block block) { + super(block); + + world = (CraftWorld) block.getWorld(); + brewingStand = (TileEntityBrewingStand) world.getTileEntityAt(getX(), getY(), getZ()); + } + + public Inventory getInventory() { + return new CraftInventory(brewingStand); + } + + @Override + public boolean update(boolean force) { + boolean result = super.update(force); + + if (result) { + brewingStand.update(); + } + + return result; + } + + public int getBrewingTime() { + return brewingStand.b; + } + + public void setBrewingTime(int brewTime) { + brewingStand.b = brewTime; + } +}