mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-24 19:46:21 +01:00
Added NoteBlock.play(instrument, note).
This commit is contained in:
parent
83eecfbd4e
commit
98cea5cd15
@ -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 New Issue
Block a user