From 98cea5cd15912e71913421770da7e7ebc2219384 Mon Sep 17 00:00:00 2001 From: sk89q Date: Mon, 2 May 2011 01:20:15 -0700 Subject: Added NoteBlock.play(instrument, note). --- .../java/org/bukkit/craftbukkit/block/CraftNoteBlock.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/main/java/org/bukkit') diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftNoteBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftNoteBlock.java index f2c1615a..cbc153be 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftNoteBlock.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftNoteBlock.java @@ -42,4 +42,17 @@ public class CraftNoteBlock extends CraftBlockState implements NoteBlock { } } } + + public boolean play(byte instrument, byte note) { + Block block = getBlock(); + + synchronized (block) { + if (block.getType() == Material.NOTE_BLOCK) { + world.getHandle().d(getX(), getY(), getZ(), instrument, note); + return true; + } else { + return false; + } + } + } } -- cgit v1.2.3