Skip to content

Commit

Permalink
fix hash not found
Browse files Browse the repository at this point in the history
  • Loading branch information
thojo0 committed Jul 30, 2024
1 parent 075791f commit 97de27b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/java/de/thojo0/moreheadsounds/EventListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,10 @@ public void onPlayerInteract(PlayerInteractEvent event) {
Skull skull = (Skull) usedHead.getState();
String[] textureUrl = skull.getOwnerProfile().getTextures().getSkin().toString().split("/");
String textureHash = textureUrl[textureUrl.length - 1];

// Check if textureHash is defined
if (!textureToSounds.containsKey(textureHash)) {
return;
};
// Get the possible sounds for the texture hash
ArrayList<NamespacedKey> possibleSounds = textureToSounds.get(textureHash);
// Set the note block sound based on the note value
Expand Down

0 comments on commit 97de27b

Please sign in to comment.