From 5eed2140bc365d6efb94dd78ab2262e685aa6a3b Mon Sep 17 00:00:00 2001 From: vlad2305m Date: Sun, 5 Dec 2021 16:43:32 +0100 Subject: [PATCH 1/2] ft. Dr Rubisco config update --- gradle.properties | 2 +- .../java/com/sonicether/soundphysics/SoundPhysics.java | 2 +- .../sonicether/soundphysics/config/ConfigPresets.java | 10 +++++----- .../soundphysics/config/SoundPhysicsConfig.java | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/gradle.properties b/gradle.properties index 60495db3..a7b09e7f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -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 diff --git a/src/main/java/com/sonicether/soundphysics/SoundPhysics.java b/src/main/java/com/sonicether/soundphysics/SoundPhysics.java index 5c7abf90..0b4ac970 100644 --- a/src/main/java/com/sonicether/soundphysics/SoundPhysics.java +++ b/src/main/java/com/sonicether/soundphysics/SoundPhysics.java @@ -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(); diff --git a/src/main/java/com/sonicether/soundphysics/config/ConfigPresets.java b/src/main/java/com/sonicether/soundphysics/config/ConfigPresets.java index 6ab8524c..7a0bd484 100644 --- a/src/main/java/com/sonicether/soundphysics/config/ConfigPresets.java +++ b/src/main/java/com/sonicether/soundphysics/config/ConfigPresets.java @@ -48,12 +48,12 @@ public enum ConfigPresets { null, 10.0, null, null, null, null )), - Thedocrubys_Fine_Tuned((SoundPhysicsConfig c) -> changeConfig(c, true, + Dr_Rubisco_Signature((SoundPhysicsConfig c) -> changeConfig(c, true, - 0.7, 1.0, 1.0, 0.8, + 0.7, 1.1, 1.0, 0.8, 1.2, 4.2, 1.1, 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), @@ -80,9 +80,9 @@ 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.3, 10.0, true, true, 1.0, false + 0.3, 10.0, true, true, 0.1, false )); diff --git a/src/main/java/com/sonicether/soundphysics/config/SoundPhysicsConfig.java b/src/main/java/com/sonicether/soundphysics/config/SoundPhysicsConfig.java index f62c20b9..fe846ad4 100644 --- a/src/main/java/com/sonicether/soundphysics/config/SoundPhysicsConfig.java +++ b/src/main/java/com/sonicether/soundphysics/config/SoundPhysicsConfig.java @@ -84,7 +84,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; } } @@ -118,7 +118,7 @@ public static class Misc { } @ConfigEntry.Gui.EnumHandler(option = ConfigEntry.Gui.EnumHandler.EnumDisplayOption.DROPDOWN) - @Comment("Soft presets (preserve some settings). Press reloadReverb to apply. Presets: [DEFAULT, RESET_MATERIALS, SP1_0_SOUND_OCCLUSION, Thedocrubys_Fine_Tuned]. (LOAD_SUCCESS = null)") - public ConfigPresets preset = ConfigPresets.Thedocrubys_Fine_Tuned; + @Comment("Soft presets (preserve some settings). Press reloadReverb to apply. Presets: [DEFAULT, RESET_MATERIALS, SP1_0_SOUND_OCCLUSION, Dr_Rubisco_Signature]. (LOAD_SUCCESS = null)") + public ConfigPresets preset = ConfigPresets.Dr_Rubisco_Signature; } \ No newline at end of file From b6716a5da5067ba4ed6741616545f8d74cbf8b80 Mon Sep 17 00:00:00 2001 From: vlad2305m Date: Sun, 5 Dec 2021 17:12:14 +0100 Subject: [PATCH 2/2] fixed? relog config faliure --- .../com/sonicether/soundphysics/config/ConfigManager.java | 4 ++++ .../com/sonicether/soundphysics/config/ConfigPresets.java | 2 +- .../sonicether/soundphysics/config/SoundPhysicsConfig.java | 5 ++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/sonicether/soundphysics/config/ConfigManager.java b/src/main/java/com/sonicether/soundphysics/config/ConfigManager.java index e1e3be5b..e5e6f23b 100644 --- a/src/main/java/com/sonicether/soundphysics/config/ConfigManager.java +++ b/src/main/java/com/sonicether/soundphysics/config/ConfigManager.java @@ -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() { diff --git a/src/main/java/com/sonicether/soundphysics/config/ConfigPresets.java b/src/main/java/com/sonicether/soundphysics/config/ConfigPresets.java index 7a0bd484..986d9a31 100644 --- a/src/main/java/com/sonicether/soundphysics/config/ConfigPresets.java +++ b/src/main/java/com/sonicether/soundphysics/config/ConfigPresets.java @@ -89,7 +89,7 @@ public enum ConfigPresets { - private final Consumer configChanger; + public final Consumer configChanger; public void setConfig(){ if (configChanger != null) configChanger.accept(ConfigManager.getConfig());} ConfigPresets(@Nullable Consumer c) { this.configChanger = c; } diff --git a/src/main/java/com/sonicether/soundphysics/config/SoundPhysicsConfig.java b/src/main/java/com/sonicether/soundphysics/config/SoundPhysicsConfig.java index fe846ad4..3ddaa913 100644 --- a/src/main/java/com/sonicether/soundphysics/config/SoundPhysicsConfig.java +++ b/src/main/java/com/sonicether/soundphysics/config/SoundPhysicsConfig.java @@ -119,6 +119,9 @@ public static class Misc { @ConfigEntry.Gui.EnumHandler(option = ConfigEntry.Gui.EnumHandler.EnumDisplayOption.DROPDOWN) @Comment("Soft presets (preserve some settings). Press reloadReverb to apply. Presets: [DEFAULT, RESET_MATERIALS, SP1_0_SOUND_OCCLUSION, Dr_Rubisco_Signature]. (LOAD_SUCCESS = null)") - public ConfigPresets preset = ConfigPresets.Dr_Rubisco_Signature; + public ConfigPresets preset = ConfigPresets.LOAD_SUCCESS; + + @ConfigEntry.Gui.Excluded + public boolean loaded = false; } \ No newline at end of file