Fix bergamutes silencing ambient and record sounds, remove them from the set more eagerly

This commit is contained in:
Vincent Lee committed 2020-07-17 10:12:52 -05:00
1 parent bdde235bf9
commit 34956960b6
2 files changed
+8

No files matched your search

@@ -58,6 +58,8 @@ public class BergamuteEventHandler {
private static boolean shouldSilence(ISound sound) {
return sound.getCategory() != SoundCategory.VOICE
&& sound.getCategory() != SoundCategory.MUSIC
&& sound.getCategory() != SoundCategory.RECORDS
&& sound.getCategory() != SoundCategory.AMBIENT
&& sound.getClass().getName().startsWith("net.minecraft.client.audio");
}
@@ -35,6 +35,12 @@ public class SubTileBergamute extends TileEntityFunctionalFlower {
}
}
@Override
public void remove() {
super.remove();
existingFlowers.remove(this);
}
// todo seems expensive when we have lots of sounds cache maybe?
protected static SubTileBergamute getBergamuteNearby(double x, double y, double z) {
return existingFlowers.stream()