mirror of
https://code.chipmunk.land/ChomeNS/chipmunkmod.git
synced 2026-03-31 02:02:04 +00:00
fix: allow playing long songs
This is actually an unsigned short, not a short. See https://noteblock.world/song/b91BWfUTnH for an example
This commit is contained in:
parent
84df266240
commit
c2253055a0
1 changed files with 3 additions and 2 deletions
|
|
@ -78,9 +78,9 @@ public class NBSConverter {
|
||||||
}
|
}
|
||||||
|
|
||||||
final ArrayList<NBSNote> nbsNotes = new ArrayList<>();
|
final ArrayList<NBSNote> nbsNotes = new ArrayList<>();
|
||||||
short tick = -1;
|
int tick = -1;
|
||||||
while (true) {
|
while (true) {
|
||||||
final int tickJumps = buffer.getShort();
|
final int tickJumps = Short.toUnsignedInt(buffer.getShort());
|
||||||
if (tickJumps == 0) break;
|
if (tickJumps == 0) break;
|
||||||
tick += tickJumps;
|
tick += tickJumps;
|
||||||
|
|
||||||
|
|
@ -231,6 +231,7 @@ public class NBSConverter {
|
||||||
String sound = Util.sanitizeName(path, Identifier::isAllowedInIdentifier)
|
String sound = Util.sanitizeName(path, Identifier::isAllowedInIdentifier)
|
||||||
.replaceFirst("\\.ogg$", "")
|
.replaceFirst("\\.ogg$", "")
|
||||||
.replaceFirst("^minecraft/", "")
|
.replaceFirst("^minecraft/", "")
|
||||||
|
.replaceFirst("\\d+$", "")
|
||||||
.replace('/', '.');
|
.replace('/', '.');
|
||||||
|
|
||||||
// if there's no path, it's probably a note block sound
|
// if there's no path, it's probably a note block sound
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue