mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-30 04:01:55 +01:00
Added CraftNoteBlock.play
By: Dinnerbone <dinnerbone@dinnerbone.com>
This commit is contained in:
parent
0c1b5191ad
commit
defe56d4a9
@ -1,6 +1,7 @@
|
|||||||
package org.bukkit.craftbukkit.block;
|
package org.bukkit.craftbukkit.block;
|
||||||
|
|
||||||
import net.minecraft.server.TileEntityNote;
|
import net.minecraft.server.TileEntityNote;
|
||||||
|
import org.bukkit.Material;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.block.NoteBlock;
|
import org.bukkit.block.NoteBlock;
|
||||||
import org.bukkit.craftbukkit.CraftWorld;
|
import org.bukkit.craftbukkit.CraftWorld;
|
||||||
@ -28,4 +29,17 @@ public class CraftNoteBlock extends CraftBlockState implements NoteBlock {
|
|||||||
public void setNote(byte n) {
|
public void setNote(byte n) {
|
||||||
note.e = n;
|
note.e = n;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean play() {
|
||||||
|
Block block = getBlock();
|
||||||
|
|
||||||
|
synchronized (block) {
|
||||||
|
if (block.getType() == Material.NOTE_BLOCK) {
|
||||||
|
note.a(world.getHandle(), getX(), getY(), getZ());
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user