mirror of
https://github.com/TeamMidnightDust/VisualOverhaul.git
synced 2025-12-16 05:55:09 +01:00
Uses a mixin into the sound system to determine the sound played at the position of the jukebox, then tries to get the record item of the sound. If it fails it will fall back to the server side implementation.
24 lines
606 B
Java
24 lines
606 B
Java
package eu.midnightdust.visualoverhaul.util.sound;
|
|
|
|
import com.google.common.collect.Maps;
|
|
import net.minecraft.util.Identifier;
|
|
import net.minecraft.util.math.BlockPos;
|
|
|
|
import java.util.Map;
|
|
|
|
public class SoundTest {
|
|
|
|
public static Map<BlockPos, Identifier> soundPos = Maps.newHashMap();
|
|
|
|
/**
|
|
* Returns the Sound provided in MixinSoundSystem
|
|
* {@link eu.midnightdust.visualoverhaul.mixin.MixinSoundSystem}
|
|
*/
|
|
public static Identifier getSound(BlockPos pos) {
|
|
if (soundPos.containsKey(pos)) {
|
|
return soundPos.get(pos);
|
|
}
|
|
return null;
|
|
}
|
|
}
|