use of net.minecraft.client.sound.WeightedSoundSet in project meteor-client by MeteorDevelopment.
the class Names method getSoundName.
public static String getSoundName(Identifier id) {
return soundNames.computeIfAbsent(id, identifier -> {
WeightedSoundSet soundSet = mc.getSoundManager().get(identifier);
if (soundSet == null)
return identifier.getPath();
Text text = soundSet.getSubtitle();
if (text == null)
return identifier.getPath();
return StringHelper.stripTextFormat(text.getString());
});
}
use of net.minecraft.client.sound.WeightedSoundSet in project LittleMaidModelLoader-Fabric by SistrScarlet.
the class SoundHolder method addSound.
public void addSound(String fileName, Identifier resource) {
WeightedSoundSet soundSet = sounds.computeIfAbsent(fileName.toLowerCase(), k -> new WeightedSoundSet(resource, resource.toString().replace("/", ".")));
soundSet.add(new Sound(resource.toString(), 1F, 1F, 1, Sound.RegistrationType.FILE, false, false, 16) {
@Override
public Identifier getLocation() {
return getIdentifier();
}
});
}
use of net.minecraft.client.sound.WeightedSoundSet in project Client by MatHax.
the class SoundLocator method printSound.
private void printSound(SoundInstance sound) {
WeightedSoundSet soundSet = mc.getSoundManager().get(sound.getId());
MutableText text = soundSet.getSubtitle().copy();
text.append(String.format("%s at ", Formatting.GRAY));
Vec3d pos = new Vec3d(sound.getX(), sound.getY(), sound.getZ());
text.append(ChatUtils.formatCoords(pos));
text.append(String.format("%s.", Formatting.GRAY));
info(text);
}
use of net.minecraft.client.sound.WeightedSoundSet in project meteor-rejects by AntiCope.
the class SoundLocator method printSound.
private void printSound(SoundInstance sound) {
WeightedSoundSet soundSet = mc.getSoundManager().get(sound.getId());
MutableText text = soundSet.getSubtitle().copy();
text.append(String.format("%s at ", Formatting.RESET));
Vec3d pos = new Vec3d(sound.getX(), sound.getY(), sound.getZ());
text.append(ChatUtils.formatCoords(pos));
text.append(String.format("%s.", Formatting.RESET));
info(text);
}
use of net.minecraft.client.sound.WeightedSoundSet in project Client by MatHax.
the class Names method getSoundName.
public static String getSoundName(Identifier id) {
return soundNames.computeIfAbsent(id, identifier -> {
WeightedSoundSet soundSet = mc.getSoundManager().get(identifier);
if (soundSet == null)
return identifier.getPath();
Text text = soundSet.getSubtitle();
if (text == null)
return identifier.getPath();
return StringHelper.stripTextFormat(text.getString());
});
}
Aggregations