mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-02 13:07:06 +01:00
Added NoteBlock.play(instrument, note).
This commit is contained in:
parent
83eecfbd4e
commit
98cea5cd15
1 changed files with 13 additions and 0 deletions
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue