Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
thedocruby committed Dec 5, 2021
2 parents e23862c + b6716a5 commit c666b81
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ minecraft_version=1.18
yarn_mappings=1.18+build.1
loader_version=0.12.5
# Mod Properties
mod_version=3.0
mod_version=3.1
maven_group=com.soniether
archives_base_name=soundphysics
# Dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ private static float getBlockReflectivity(final BlockPos blockPos)
BlockState blockState = mc.world.getBlockState(blockPos);
BlockSoundGroup soundType = blockState.getSoundGroup();

double reflectivity = ConfigManager.getConfig().Material_Properties.reflectivityMap.get(".DEFAULT").getLeft();
double reflectivity = ConfigManager.getConfig().Material_Properties.reflectivityMap.get("DEFAULT").getLeft();

String key = SoundPhysicsMod.blockSoundGroups.get(soundType).getLeft();
reflectivity = ConfigManager.getConfig().Material_Properties.reflectivityMap.getOrDefault(key, new Pair<>(reflectivity, "")).getLeft();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ public static void registerAutoConfig() {
}

holder = AutoConfig.register(SoundPhysicsConfig.class, JanksonConfigSerializer::new);
holder.load();
if (!holder.getConfig().loaded) holder.getConfig().preset = ConfigPresets.Dr_Rubisco_Signature;
holder.getConfig().loaded = true;
reload(false);
}

public static SoundPhysicsConfig getConfig() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public enum ConfigPresets {
1.0, 0.8, 1.0, 0.8,
1.0, 3.0, 1.0, 1.0,

false, 256, 12, false,
false, 256, 16, false,

Map.ofEntries(entry("field_11528", 0.5), entry("field_27199", 0.5), entry("field_27198", 0.5),
entry("field_11529", 1.2), entry("field_27197", 0.5), entry("field_11526", 0.3),
Expand All @@ -80,7 +80,7 @@ public enum ConfigPresets {
entry("field_28697", 0.1), entry("field_22153", 0.6), entry("field_27201", 0.3),
entry("field_27200", 0.3), entry("field_22154", 0.4), entry("field_28696", 0.1),
entry("field_27204", 2.3), entry("field_17734", 0.2), entry("field_17579", 0.3),
entry("field_28060", 1.8), entry(".DEFAULT", 0.6)),
entry("field_28060", 1.8), entry("DEFAULT", 0.6)),

0.5, 10.0, true, true, 0.1, false

Expand All @@ -89,7 +89,7 @@ public enum ConfigPresets {



private final Consumer<SoundPhysicsConfig> configChanger;
public final Consumer<SoundPhysicsConfig> configChanger;
public void setConfig(){ if (configChanger != null) configChanger.accept(ConfigManager.getConfig());}

ConfigPresets(@Nullable Consumer<SoundPhysicsConfig> c) { this.configChanger = c; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public static class Material_Properties {
map.putIfAbsent("SNOW", new Pair<>(0.2, ""));
map.putIfAbsent("LADDER", new Pair<>(0.4, ""));
map.putIfAbsent("ANVIL", new Pair<>(1.0, ""));
map.putIfAbsent(".DEFAULT", new Pair<>(0.5, "")); // TODO more
map.putIfAbsent("DEFAULT", new Pair<>(0.5, "")); // TODO more
reflectivityMap = map;
}
}
Expand Down

0 comments on commit c666b81

Please sign in to comment.