ForgePatch/patches/minecraft/net/minecraft/client/audio/SoundHandler.java.patch

53 lines
2.1 KiB
Diff

--- ../src-base/minecraft/net/minecraft/client/audio/SoundHandler.java
+++ ../src-work/minecraft/net/minecraft/client/audio/SoundHandler.java
@@ -67,6 +67,7 @@
{
this.field_147697_e.func_148763_c();
+ java.util.List<net.minecraft.util.Tuple<ResourceLocation, SoundList>> resources = new java.util.LinkedList<>();
for (String s : p_110549_1_.func_135055_a())
{
try
@@ -79,7 +80,7 @@
for (Entry<String, SoundList> entry : map.entrySet())
{
- this.func_147693_a(new ResourceLocation(s, entry.getKey()), entry.getValue());
+ resources.add(new net.minecraft.util.Tuple<>(new ResourceLocation(s, entry.getKey()), entry.getValue()));
}
}
catch (RuntimeException runtimeexception)
@@ -94,6 +95,20 @@
}
}
+ net.minecraftforge.fml.common.ProgressManager.ProgressBar resourcesBar = net.minecraftforge.fml.common.ProgressManager.push("Loading sounds", resources.size());
+ resources.forEach(entry ->
+ {
+ resourcesBar.step(entry.func_76341_a().toString());
+ try
+ {
+ this.func_147693_a(entry.func_76341_a(), entry.func_76340_b());
+ }
+ catch (RuntimeException e)
+ {
+ field_147698_b.warn("Invalid sounds.json", e);
+ }
+ });
+ net.minecraftforge.fml.common.ProgressManager.pop(resourcesBar);
for (ResourceLocation resourcelocation : this.field_147697_e.func_148742_b())
{
SoundEventAccessor soundeventaccessor = (SoundEventAccessor)this.field_147697_e.func_82594_a(resourcelocation);
@@ -253,6 +268,11 @@
this.field_147694_f.func_148615_a(p_147691_1_, p_147691_2_);
}
+ public void setListener(net.minecraft.entity.Entity entity, float partialTicks)
+ {
+ this.field_147694_f.setListener(entity, partialTicks);
+ }
+
public void func_147689_b()
{
this.field_147694_f.func_148610_e();