From 97de27bbd844df442890bd80c86c42fb7eaf895a Mon Sep 17 00:00:00 2001 From: thojo0 <53666000+thojo0@users.noreply.github.com> Date: Tue, 30 Jul 2024 23:37:09 +0200 Subject: [PATCH] fix hash not found --- src/main/java/de/thojo0/moreheadsounds/EventListener.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/thojo0/moreheadsounds/EventListener.java b/src/main/java/de/thojo0/moreheadsounds/EventListener.java index 90d5d90..b627c6b 100644 --- a/src/main/java/de/thojo0/moreheadsounds/EventListener.java +++ b/src/main/java/de/thojo0/moreheadsounds/EventListener.java @@ -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 possibleSounds = textureToSounds.get(textureHash); // Set the note block sound based on the note value