Client side implementation of the jukebox overhaul

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.
This commit is contained in:
Motschen
2021-03-28 12:07:47 +02:00
parent f802e803b9
commit afac024e9e
5 changed files with 88 additions and 2 deletions

View File

@@ -0,0 +1,23 @@
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;
}
}