diff options
author | sk89q <the.sk89q@gmail.com> | 2011-05-02 01:20:15 -0700 |
---|---|---|
committer | sk89q <the.sk89q@gmail.com> | 2011-05-02 11:31:32 -0700 |
commit | 98cea5cd15912e71913421770da7e7ebc2219384 (patch) | |
tree | 527b76481ab4536994d74e0bc6f21799d2e7c02a | |
parent | 83eecfbd4e3a60f26832a89cc6ff979ceab6dd59 (diff) | |
download | craftbukkit-98cea5cd15912e71913421770da7e7ebc2219384.tar craftbukkit-98cea5cd15912e71913421770da7e7ebc2219384.tar.gz craftbukkit-98cea5cd15912e71913421770da7e7ebc2219384.tar.lz craftbukkit-98cea5cd15912e71913421770da7e7ebc2219384.tar.xz craftbukkit-98cea5cd15912e71913421770da7e7ebc2219384.zip |
Added NoteBlock.play(instrument, note).
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/block/CraftNoteBlock.java | 13 |
1 files changed, 13 insertions, 0 deletions
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; + } + } + } } |