Skip to content

Commit

Permalink
Attempt to fix sounds for newer versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Neocraftr committed Jul 25, 2023
1 parent d26c22a commit c3c9d3b
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions core/src/main/java/de/neocraftr/griefergames/enums/Sounds.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
package de.neocraftr.griefergames.enums;

import net.labymod.api.Laby;

public enum Sounds {
NONE(""),
BASS("note.bass"),
BASSDRUM("note.bd"),
HARP("note.harp"),
HAT("note.hat"),
PLING("note.pling"),
SNARE("note.snare"),
POP("random.pop");
BASS("bass"),
BASSDRUM("bd"),
HARP("harp"),
HAT("hat"),
PLING("pling"),
SNARE("snare"),
POP("pop");

private String path;

Expand All @@ -17,6 +19,16 @@ public enum Sounds {
}

public String path() {
return path;
if(path.isEmpty()) return path;

return getVersionedPrefix()+path;
}

public String getVersionedPrefix() {
return switch (Laby.labyAPI().minecraft().getVersion()) {
case "1.8.9" -> "note.";
case "1.12.2" -> "block.note.";
default -> "block.note_block.";
};
}
}

0 comments on commit c3c9d3b

Please sign in to comment.