1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-08-27 07:52:18 +00:00

fix: play sounds using Identifier rather than SoundEvent

6dd33f7099
This commit is contained in:
Nikita Savyolov 2021-10-11 22:49:05 +03:00
parent fb274e2ed6
commit 96c80a6549
No known key found for this signature in database
GPG Key ID: 32C1EF023AFC184B
2 changed files with 3 additions and 5 deletions

View File

@ -10,7 +10,7 @@ import net.minecraft.client.sound.AbstractSoundInstance;
import net.minecraft.client.sound.SoundInstance;
import net.minecraft.client.sound.TickableSoundInstance;
import net.minecraft.sound.SoundCategory;
import net.minecraft.sound.SoundEvent;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.Vec3d;
import java.util.HashMap;
@ -21,7 +21,7 @@ public class SoundManager
{
private static final Map<UUID, MoveableSound> sounds = new HashMap<>();
public static void playSound( UUID source, Vec3d position, SoundEvent event, float volume, float pitch )
public static void playSound( UUID source, Vec3d position, Identifier event, float volume, float pitch )
{
var soundManager = MinecraftClient.getInstance().getSoundManager();
@ -54,7 +54,7 @@ public class SoundManager
private static class MoveableSound extends AbstractSoundInstance implements TickableSoundInstance
{
protected MoveableSound( SoundEvent sound, Vec3d position, float volume, float pitch )
protected MoveableSound( Identifier sound, Vec3d position, float volume, float pitch )
{
super( sound, SoundCategory.RECORDS );
setPosition( position );

View File

@ -11,7 +11,6 @@ import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.network.PacketContext;
import net.minecraft.network.PacketByteBuf;
import net.minecraft.sound.SoundEvent;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.Vec3d;
@ -67,7 +66,6 @@ public class SpeakerPlayClientMessage implements NetworkMessage
@Environment( EnvType.CLIENT )
public void handle( PacketContext context )
{
SoundEvent sound = new SoundEvent( this.sound );
SoundManager.playSound( source, pos, sound, volume, pitch );
}
}