From 12e61efd760daa4a796beca74b6fd84c86998f89 Mon Sep 17 00:00:00 2001 From: SquidDev Date: Wed, 17 May 2017 08:00:14 +0100 Subject: [PATCH] Fixes speakers playing incorrect sounds on the server As a new SoundEvent was being created each time, the actual sound was not in the registry, resulting in the sound -> id mapping yielding incorrect values. --- .../shared/peripheral/speaker/SpeakerPeripheral.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/dan200/computercraft/shared/peripheral/speaker/SpeakerPeripheral.java b/src/main/java/dan200/computercraft/shared/peripheral/speaker/SpeakerPeripheral.java index e3e98fbe4..6ffc4c1b3 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/speaker/SpeakerPeripheral.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/speaker/SpeakerPeripheral.java @@ -238,7 +238,7 @@ public class SpeakerPeripheral implements IPeripheral { @Nullable @Override public Object[] execute() throws LuaException { - world.playSound(null, pos, new SoundEvent(resource), SoundCategory.RECORDS, vol, soundPitch); + world.playSound( null, pos, SoundEvent.REGISTRY.getObject( resource ), SoundCategory.RECORDS, vol, soundPitch ); return null; }