summaryrefslogtreecommitdiffstats
path: root/src/main/java/org
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org')
-rw-r--r--src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java2
-rw-r--r--src/main/java/org/bukkit/craftbukkit/block/CraftBrewingStand.java43
2 files changed, 45 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
index e44eb377..a9030a5d 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
+++ b/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/src/main/java/org/bukkit/craftbukkit/block/CraftBrewingStand.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBrewingStand.java
new file mode 100644
index 00000000..55b2d49e
--- /dev/null
+++ b/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;
+ }
+}