mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-11-17 21:55:12 +00:00
Play sounds using ResourceLocation rather than SoundEvent
The latter is not registered when sounds are added via resource packs. Fixes #938. Probably.
This commit is contained in:
@@ -9,12 +9,10 @@ import dan200.computercraft.client.SoundManager;
|
||||
import dan200.computercraft.shared.network.NetworkMessage;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.SoundEvent;
|
||||
import net.minecraft.util.math.vector.Vector3d;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.fml.network.NetworkEvent;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.UUID;
|
||||
@@ -68,7 +66,6 @@ public class SpeakerPlayClientMessage implements NetworkMessage
|
||||
@OnlyIn( Dist.CLIENT )
|
||||
public void handle( NetworkEvent.Context context )
|
||||
{
|
||||
SoundEvent sound = ForgeRegistries.SOUND_EVENTS.getValue( this.sound );
|
||||
if( sound != null ) SoundManager.playSound( source, pos, sound, volume, pitch );
|
||||
SoundManager.playSound( source, pos, sound, volume, pitch );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user