Skip to content

Commit a68965a

Browse files
committed
fix crash
1 parent 42fe46d commit a68965a

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ org.gradle.configuration-cache=true
88

99
minecraft_version=1.21.1
1010

11-
mod_version=1.5.4
11+
mod_version=1.5.5
1212

1313
jei_version=19.21.2.313
1414

src/main/java/com/mrh0/createaddition/sound/CASoundScapes.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.mrh0.createaddition.sound;
22

3+
import com.mrh0.createaddition.CreateAddition;
34
import com.mrh0.createaddition.index.CASounds;
45

56
import com.simibubi.create.infrastructure.config.AllConfigs;
@@ -59,7 +60,6 @@ public enum PitchGroup {
5960

6061
public static void play(AmbienceGroup group, BlockPos pos, float pitch) {
6162
if (!AllConfigs.client().enableAmbientSounds.get()) return;
62-
// if (!Config.AUDIO_ENABLED.get()) return;
6363
if(!CASounds.ELECTRIC_MOTOR_BUZZ.isBound() || !CASounds.ELECTRIC_CHARGE.isBound()) return;
6464

6565
if (!outOfRange(pos)) addSound(group, pos, pitch);
@@ -70,8 +70,13 @@ public static void tick() {
7070
.forEach(CASoundScape::tick);
7171

7272
if (AnimationTickHolder.getTicks() % UPDATE_INTERVAL != 0) return;
73-
74-
boolean disable = !AllConfigs.client().enableAmbientSounds.get();
73+
74+
boolean disable = false;
75+
try {
76+
disable = !AllConfigs.client().enableAmbientSounds.get();
77+
} catch (Exception error) {
78+
CreateAddition.LOGGER.error("Suppressed crash in CASoundScapes");
79+
}
7580
for (Iterator<Map.Entry<Pair<AmbienceGroup, PitchGroup>, CASoundScape>> iterator = activeSounds.entrySet()
7681
.iterator(); iterator.hasNext();) {
7782

0 commit comments

Comments
 (0)