From 55e9522955db65ff2a30b989b77efa407576517b Mon Sep 17 00:00:00 2001 From: Dinnerbone Date: Fri, 7 Jan 2011 16:53:16 +0000 Subject: [PATCH] Start of update() + added sign --- .../craftbukkit/block/CraftBlockState.java | 16 +++++++++++ .../bukkit/craftbukkit/block/CraftSign.java | 27 +++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 src/main/java/org/bukkit/craftbukkit/block/CraftSign.java diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java index b5320468c5..0b216be149 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java @@ -143,4 +143,20 @@ public class CraftBlockState implements BlockState { public Block getBlock() { return world.getBlockAt(x, y, z); } + + public boolean update() { + return update(false); + } + + public boolean update(boolean force) { // TODO + Block block = getBlock(); + + synchronized (block) { + if (block.getType() != this.getType()) { + return false; + } + } + + return true; + } } diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java b/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java new file mode 100644 index 0000000000..ec606a7572 --- /dev/null +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java @@ -0,0 +1,27 @@ + +package org.bukkit.craftbukkit.block; + +import org.bukkit.Block; +import org.bukkit.Chunk; +import org.bukkit.Material; +import org.bukkit.World; +import org.bukkit.block.Sign; +import org.bukkit.craftbukkit.CraftWorld; + +public class CraftSign extends CraftBlockState implements Sign { + public CraftSign(final CraftWorld world, final int x, final int y, final int z, final int type, final byte data) { + super(world, x, y, z, type, data); + } + + public String[] getLines() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public String getLine(int index) throws IndexOutOfBoundsException { + throw new UnsupportedOperationException("Not supported yet."); + } + + public void setLine(int index, String line) throws IndexOutOfBoundsException { + throw new UnsupportedOperationException("Not supported yet."); + } +}