File tree Expand file tree Collapse file tree
src/main/kotlin/de/danielmaile/mpp/block Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,8 +19,10 @@ package de.danielmaile.mpp.block
1919
2020import de.danielmaile.mpp.util.ToolType
2121import org.bukkit.Instrument
22+ import org.bukkit.Material
2223import org.bukkit.Note
2324import org.bukkit.Sound
25+ import org.bukkit.block.data.BlockData
2426import org.bukkit.block.data.type.NoteBlock
2527
2628enum class BlockType (
@@ -148,6 +150,13 @@ enum class BlockType(
148150 val instrument: Instrument
149151 val note: Note
150152 val isPowered: Boolean
153+ val blockData: BlockData
154+ get() = Material .NOTE_BLOCK .createBlockData().apply {
155+ this as NoteBlock
156+ note = this @BlockType.note
157+ isPowered = this @BlockType.isPowered
158+ instrument = this @BlockType.instrument
159+ }
151160
152161 init {
153162 instrument = calculateInstrument()
You can’t perform that action at this time.
0 commit comments