Skip to content

Commit

Permalink
fix: incorrect algo for BlockType NOTEBLOCK
Browse files Browse the repository at this point in the history
  • Loading branch information
Boy0000 committed May 15, 2024
1 parent 0c5e4cd commit 120b5e5
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,7 @@ class Block2Prefab {

// Calculates noteblock states
arrayListOf<BlockData>().apply {
// Make the default blockstate the 0'th entry in the array
add(0, Material.NOTE_BLOCK.createBlockData() as NoteBlock)

// Max size is set to total -1 to reserve 1 state (0) for the default vanilla noteblock
val maxSize = Instrument.entries.size * 50 - 1
for (j in 1..<maxSize) {
for (j in 0..Instrument.entries.size * 50) {
val noteBlockData = Material.NOTE_BLOCK.createBlockData() as NoteBlock
noteBlockData.instrument = Instrument.getByType(min(Instrument.entries.size, j / 50).toByte()) ?: continue

Expand Down

0 comments on commit 120b5e5

Please sign in to comment.