diff --git a/build.gradle b/build.gradle index b167afa0..f2ebb5f1 100644 --- a/build.gradle +++ b/build.gradle @@ -87,11 +87,7 @@ jar { publishMods { file = remapJar.archiveFile changelog = """ - - Updated to 1.20.5 - - There are still a number of issues with this update, namely clientscript issues (to do with item nbt). - As well as networking issues. GameRule syncing between EssentialAddons and EssentialClient will work - however ChunkDebug is not fully supported yet and will be ported later. + - Updated to 1.20.6 """ type = STABLE modLoaders.add("fabric") diff --git a/src/main/java/me/senseiwells/essentialclient/clientscript/definitions/MinecraftClientDef.java b/src/main/java/me/senseiwells/essentialclient/clientscript/definitions/MinecraftClientDef.java index f2b9cc5d..10e6c2d9 100644 --- a/src/main/java/me/senseiwells/essentialclient/clientscript/definitions/MinecraftClientDef.java +++ b/src/main/java/me/senseiwells/essentialclient/clientscript/definitions/MinecraftClientDef.java @@ -687,7 +687,9 @@ private Void playSound(Arguments arguments) { Double volume = arguments.nextPrimitive(NumberDef.class); Double pitch = arguments.nextPrimitive(NumberDef.class); SoundEvent soundEvent = Registries.SOUND_EVENT.get(ClientScriptUtils.stringToIdentifier(soundId)); - player.playSoundToPlayer(soundEvent, SoundCategory.MASTER, volume.floatValue(), pitch.floatValue()); + ClientScriptUtils.ensureMainThread("playSound", arguments.getInterpreter(), () -> { + player.playSoundToPlayer(soundEvent, SoundCategory.MASTER, volume.floatValue(), pitch.floatValue()); + }); return null; }