From 5a16cb501e8931ec9abbe6972317285393188c5b Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Mon, 2 May 2011 01:20:15 -0700 Subject: [PATCH] Added NoteBlock.play(instrument, note). By: sk89q --- .../bukkit/craftbukkit/block/CraftNoteBlock.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftNoteBlock.java b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftNoteBlock.java index f2c1615a6c..cbc153bedf 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftNoteBlock.java +++ b/paper-server/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; + } + } + } }