59 lines
2.7 KiB
Diff
59 lines
2.7 KiB
Diff
--- a/net/minecraft/client/audio/SoundHandler.java
|
|
+++ b/net/minecraft/client/audio/SoundHandler.java
|
|
@@ -63,6 +63,7 @@
|
|
public void func_195410_a(IResourceManager p_195410_1_) {
|
|
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_195410_1_.func_199001_a()) {
|
|
try {
|
|
for(IResource iresource : p_195410_1_.func_199004_b(new ResourceLocation(s, "sounds.json"))) {
|
|
@@ -70,7 +71,7 @@
|
|
Map<String, SoundList> map = this.func_175085_a(iresource.func_199027_b());
|
|
|
|
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) {
|
|
field_147698_b.warn("Invalid sounds.json in resourcepack: '{}'", iresource.func_199026_d(), runtimeexception);
|
|
@@ -81,6 +82,17 @@
|
|
}
|
|
}
|
|
|
|
+ try (net.minecraftforge.fml.common.progress.ProgressBar resourcesBar = net.minecraftforge.fml.common.progress.StartupProgressManager.start("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);
|
|
+ }
|
|
+ });
|
|
+ }; // Forge: end progress bar
|
|
+
|
|
for(ResourceLocation resourcelocation : this.field_147697_e.func_148742_b()) {
|
|
SoundEventAccessor soundeventaccessor = (SoundEventAccessor)this.field_147697_e.func_82594_a(resourcelocation);
|
|
if (soundeventaccessor.func_188712_c() instanceof TextComponentTranslation) {
|
|
@@ -210,6 +222,10 @@
|
|
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();
|
|
}
|
|
@@ -257,4 +273,9 @@
|
|
public void func_195478_a(@Nullable ResourceLocation p_195478_1_, @Nullable SoundCategory p_195478_2_) {
|
|
this.field_147694_f.func_195855_a(p_195478_1_, p_195478_2_);
|
|
}
|
|
+
|
|
+ @Override
|
|
+ public net.minecraftforge.resource.IResourceType getResourceType() {
|
|
+ return net.minecraftforge.resource.VanillaResourceType.SOUNDS;
|
|
+ }
|
|
}
|