From fc3729cd6b984ad9db9bbf0ef0e63ad8a19b42bf Mon Sep 17 00:00:00 2001 From: OreCruncher Date: Sun, 10 Nov 2019 09:37:07 -0800 Subject: [PATCH 1/6] 1.12.2 (#517) * Fix issue with fake worlds during init * Update changelog * Search bar for option screens * Bump min OreLib version * [#514] Change Aurora render handler event priority * Search bar working in release testbed * Option to disable search filter; config lang cleanup * More lang cleanup * Options cleanup * Option comment cleanup * Cleanup * Cleanup material sound mappings * Accessors for sound related things * Fix crash issue when starting up w/missing or outdated mods * Release --- CHANGELOG.md | 59 ++ configuration.gradle | 2 +- .../org/orecruncher/dsurround/ModBase.java | 12 +- .../org/orecruncher/dsurround/ModInfo.java | 2 +- .../org/orecruncher/dsurround/ModOptions.java | 511 ++++++++---------- .../capabilities/CapabilityDimensionInfo.java | 6 + .../client/gui/DynSurroundConfigGui.java | 30 +- .../client/gui/GuiFilteredConfigEntries.java | 179 ++++++ .../client/handlers/AuroraEffectHandler.java | 2 +- .../dsurround/client/hud/GuiHUDHandler.java | 18 +- .../dsurround/client/hud/GuiOverlay.java | 99 ---- .../dsurround/client/hud/IGuiOverlay.java | 51 ++ .../dsurround/client/hud/InspectionHUD.java | 3 +- .../dsurround/client/sound/SoundBuilder.java | 9 +- .../dsurround/client/sound/SoundEngine.java | 75 +-- .../mixins/IPositionedSoundMixin.java | 39 ++ .../dsurround/mixins/ISoundHandlerMixin.java | 42 ++ .../dsurround/mixins/ISoundManagerMixin.java | 46 ++ .../dsurround/mixins/ISoundSystemMixin.java | 38 ++ .../dsurround/mixins/MixinGuiConfig.java | 50 ++ .../dsurround/mixins/MixinSoundManager.java | 23 +- .../orecruncher/dsurround/proxy/IProxy.java | 51 ++ .../orecruncher/dsurround/proxy/Proxy.java | 28 +- .../dsurround/proxy/ProxyClient.java | 4 +- .../registry/acoustics/AcousticRegistry.java | 51 +- .../assets/dsurround/lang/en_us.lang | 105 ++-- .../assets/dsurround/lang/ru_ru.lang | 100 +--- src/main/resources/mixins.dsurround.json | 7 +- version.json | 4 +- 29 files changed, 952 insertions(+), 694 deletions(-) create mode 100644 src/main/java/org/orecruncher/dsurround/client/gui/GuiFilteredConfigEntries.java delete mode 100644 src/main/java/org/orecruncher/dsurround/client/hud/GuiOverlay.java create mode 100644 src/main/java/org/orecruncher/dsurround/client/hud/IGuiOverlay.java create mode 100644 src/main/java/org/orecruncher/dsurround/mixins/IPositionedSoundMixin.java create mode 100644 src/main/java/org/orecruncher/dsurround/mixins/ISoundHandlerMixin.java create mode 100644 src/main/java/org/orecruncher/dsurround/mixins/ISoundManagerMixin.java create mode 100644 src/main/java/org/orecruncher/dsurround/mixins/ISoundSystemMixin.java create mode 100644 src/main/java/org/orecruncher/dsurround/mixins/MixinGuiConfig.java create mode 100644 src/main/java/org/orecruncher/dsurround/proxy/IProxy.java diff --git a/CHANGELOG.md b/CHANGELOG.md index 395e5a2ce..2db84e025 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,62 @@ +### DynamicSurroundings-1.12.2-3.6.0.2 +**Requirements** +* Forge 2779+ +* OreLib-1.12.2-3.6.0.1+; **Do not use the deobf version of OreLib**; it's provided to developers for mod development +* If upgrading from version 3.4.x or earlier: + * Delete your dsurround.cfg and let it regenerate + * Check your mods/1.12.2 folder and ensure there are no Dynamic Surroundings files within + +**What's New** +* Search/Filter bar in config options. This search/filter function is general, meaning it should show up and work for any config page. + * Case insensitive searching + * Matches labels that contain the text you enter + * Option to disable + * Useful on the Individual Sound Configuration page + +**Fixes** +* Fixed issue where Auroras would sometimes render in front of terrain when BetweenLands is installed +* Fixed waterfall cutoff so it can be set to > 10 to disable waterfall sound effect +* Fixed SoundEngine crash when missing mods or outdated dependencies are present + +### DynamicSurroundings-1.12.2-3.6.0.1 +**Requirements** +* Forge 2779+ +* OreLib-1.12.2-3.6.0.0+; **Do not use the deobf version of OreLib**; it's provided to developers for mod development +* If upgrading from version 3.4.x or earlier: + * Delete your dsurround.cfg and let it regenerate + * Check your mods/1.12.2 folder and ensure there are no Dynamic Surroundings files within + +**What's New** +* Changed from having a separate coremod to using the Sponge Mixin framework. (Why didn't I do this sooner?) + * Change should be transparent. If you have a problem open an issue in the tracker. +* Eliminated AT transforms. + * Change should be transparent. If you have a problem open an issue in the tracker. +* Option to turn off the potion icon display to the left of the inventory screen. You will have to enable. Option is under the ASM options in the config. +* Fire Jet effect can be applied to solid blocks. The height of the effect is currently fixed. +* Option to disable the lava particle effect when generating rainsplash on netherrack and magma blocks + +**Fixes** +* NPE when a mod creates a fake world before mod initialization is complete +* Default splash ripple effect on water should be pixelated +* Sound Physics updates from djpadbit. Apparently some stuff got lost along the way. +* Compatibility changes for Cubic Chunks and Nether to help avoid extreme lag spikes on client. +* [OpenEye] Fixed some edge cases in server side network code which caused concurrency issues. +* [OpenEye] Several speculative fixes for NPEs when receiving capability data when client not entirely ready. +* [OpenEye] Speculative fix for concurrency exception initializing biome registry. +* [OpenEye] Speculative fix for Eclipse Open J9 compatibility when processing entity data server side. If anyone uses Open J9 I would appreciate feedback. + +**Changes** +* Changed ASM options no longer require world/client restart. Yay Mixins! +* Cleaned up Animania badging a bit. As a result badges will not display when the animal is sleeping. +* Blocked the following sounds as a default: elephant, gnatt, insectbuzz, hiss, and rattlesnake. These are some of the most disliked sounds in the mod, and most folks aren't aware that they can be blocked in the configuration. If you want these sounds you will need to turn them on. +* Gave auroras some TLC: + * Render optimizations both in code and shader - big improvements. + * Added config option to cap number of bands. The default is max of 3 bands but can be turned down to 1 for potatoes. + * I have a GTX 980 and I can drive a 3 band aurora at 120FPS. +* Updates for biome sounds to clean up some high frequency noise (thanks TechnoMysterio!) + * Savanna Day, Forest, Bog, and Wind +* Adusted footstep volume scaling for non-EntityPlayer mobs so they are not as loud + ### DynamicSurroundings-1.12.2-3.6.0.0 **Requirements** * Forge 2779+ diff --git a/configuration.gradle b/configuration.gradle index 04082d32c..57bca6115 100644 --- a/configuration.gradle +++ b/configuration.gradle @@ -1,7 +1,7 @@ // Basics defined up here to make life easier // Tweak the defs, not the others! def mcVersion = "1.12.2" -def modVersion = "3.6.0.0" +def modVersion = "3.6.0.2" def modDesignator= "" //def forgeVersion = "14.23.5.2779" def forgeVersion = "14.23.5.2847" diff --git a/src/main/java/org/orecruncher/dsurround/ModBase.java b/src/main/java/org/orecruncher/dsurround/ModBase.java index 5c938b5d2..023e2e433 100644 --- a/src/main/java/org/orecruncher/dsurround/ModBase.java +++ b/src/main/java/org/orecruncher/dsurround/ModBase.java @@ -31,7 +31,7 @@ import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.LogManager; -import org.orecruncher.dsurround.proxy.Proxy; +import org.orecruncher.dsurround.proxy.IProxy; import org.orecruncher.lib.VersionChecker; import org.orecruncher.lib.VersionHelper; import org.orecruncher.lib.logging.ModLog; @@ -87,15 +87,16 @@ public static ModBase instance() { } @SidedProxy(clientSide = "org.orecruncher.dsurround.proxy.ProxyClient", serverSide = "org.orecruncher.dsurround.proxy.Proxy") - protected static Proxy proxy; + protected static IProxy proxy; protected static ModLog logger = ModLog.NULL_LOGGER; protected static Configuration config; protected static File dataDirectory; protected static boolean installedOnServer; protected static boolean devMode; + protected static boolean isInitialized = false; @Nonnull - public static Proxy proxy() { + public static IProxy proxy() { return proxy; } @@ -121,6 +122,10 @@ public static boolean isInstalledOnServer() { public static boolean isDeveloperMode() { return devMode; } + + public static boolean isInitialized() { + return isInitialized; + } @SideOnly(Side.CLIENT) public static boolean routePacketToServer() { @@ -171,6 +176,7 @@ public void postInit(@Nonnull final FMLPostInitializationEvent event) { @EventHandler public void loadCompleted(@Nonnull final FMLLoadCompleteEvent event) { proxy.loadCompleted(event); + isInitialized = true; } @EventHandler diff --git a/src/main/java/org/orecruncher/dsurround/ModInfo.java b/src/main/java/org/orecruncher/dsurround/ModInfo.java index f6aea45e0..885262259 100644 --- a/src/main/java/org/orecruncher/dsurround/ModInfo.java +++ b/src/main/java/org/orecruncher/dsurround/ModInfo.java @@ -40,7 +40,7 @@ public final class ModInfo { //@formatter:off public static final String DEPENDENCIES = "required-after:forge@[14.23.5.2779,);" + - "required-after:orelib@[3.6.0.0,);" + + "required-after:orelib@[3.6.0.1,);" + "after:sereneseasons@[1.2.18,);" + "after:animania@[1.7.2,);" + "after:galacticraftcore;" + diff --git a/src/main/java/org/orecruncher/dsurround/ModOptions.java b/src/main/java/org/orecruncher/dsurround/ModOptions.java index 73b97dc5e..98c6374e7 100644 --- a/src/main/java/org/orecruncher/dsurround/ModOptions.java +++ b/src/main/java/org/orecruncher/dsurround/ModOptions.java @@ -47,6 +47,8 @@ // http://www.minecraftforge.net/forum/topic/67260-1122-forge-config-system-and-setconfigentryclass/ public final class ModOptions { + + protected static final String PREFIX = ModInfo.MOD_ID + ".cfg"; public static class Trace { public static final int SOUND_PLAY = 0x1; @@ -54,246 +56,219 @@ public static class Trace { }; public static final String CATEGORY_ASM = "asm"; - public static final String CONFIG_ENABLE_WEATHER = "Enable Weather Control"; - public static final String CONFIG_DISABLE_ARROW_CRITICAL_TRAIL = "Disable Arrow Critical Particle Trail"; - public static final String CONFIG_DISABLE_POTION_ICONS = "Disable Potion Icons in Inventory Display"; @Category(CATEGORY_ASM) - @LangKey("dsurround.cfg.asm.cat.ASM") - @Comment("Controls ASM transforms Dynamic Surroundings performs at startup") + @LangKey(asm.PREFIX) + @Comment("Controls ASM/Mixin transforms at startup") public static class asm { + + protected static final String PREFIX = ModOptions.PREFIX + ".asm"; - public static String PATH = null; - - @Option(CONFIG_ENABLE_WEATHER) + @Option("Enable Weather Control") @DefaultValue("true") - @LangKey("dsurround.cfg.asm.EnableWeather") - @Comment("Enable ASM transformations to permit weather (rain, snow, splash, dust storms, auroras)") + @LangKey(asm.PREFIX + ".EnableWeather") + @Comment("Enable weather rendering and handling") public static boolean enableWeatherASM = true; - @Option(CONFIG_DISABLE_ARROW_CRITICAL_TRAIL) + @Option("Disable Arrow Critical Particle Trail") @DefaultValue("true") - @LangKey("dsurround.cfg.asm.DisableArrow") + @LangKey(asm.PREFIX + ".DisableArrow") @Comment("Disable particle trail left by an arrow when it flies") public static boolean disableArrowParticleTrail = true; - @Option(CONFIG_DISABLE_POTION_ICONS) + @Option("Disable Potion Icons in Inventory Display") @DefaultValue("false") - @LangKey("dsurround.cfg.asm.DisablePotionIcons") + @LangKey(asm.PREFIX + ".DisablePotionIcons") @Comment("Disable Potion Icons in Inventory Display") public static boolean disablePotionIconsInInventory = false; + + @Option("Enable Search Option in Configuration") + @DefaultValue("true") + @LangKey(asm.PREFIX + ".EnableOptionSearch") + @Comment("Enable search field in config option display") + public static boolean enableOptionSearchASM = true; } public static final String CATEGORY_LOGGING_CONTROL = "logging"; - public static final String CONFIG_ENABLE_ONLINE_VERSION_CHECK = "Enable Online Version Check"; - public static final String CONFIG_ENABLE_DEBUG_LOGGING = "Enable Debug Logging"; - public static final String CONFIG_REPORT_SERVER_STATS = "Report Server Stats"; - public static final String CONFIG_DEBUG_FLAG_MASK = "Debug Flag Mask"; @Category(CATEGORY_LOGGING_CONTROL) - @LangKey("dsurround.cfg.logging.cat.Logging") - @Comment("Defines how Dynamic Surroundings logging will behave") + @LangKey(logging.PREFIX) + @Comment("Defines how logging will behave") public static class logging { - public static String PATH = null; + protected static final String PREFIX = ModOptions.PREFIX + ".logging"; - @Option(CONFIG_ENABLE_DEBUG_LOGGING) + @Option("Enable Debug Logging") @DefaultValue("false") - @LangKey("dsurround.cfg.logging.EnableDebug") - @Comment("Enables/disables debug logging of the mod") + @LangKey(logging.PREFIX + ".EnableDebug") + @Comment("Enables/disables debug log tracing") @RestartRequired public static boolean enableDebugLogging = false; - @Option(CONFIG_ENABLE_ONLINE_VERSION_CHECK) + @Option("Enable Online Version Check") @DefaultValue("true") - @LangKey("dsurround.cfg.logging.VersionCheck") + @LangKey(logging.PREFIX + ".VersionCheck") @Comment("Enables/disables display of version check information") @RestartRequired public static boolean enableVersionChecking = true; - @Option(CONFIG_REPORT_SERVER_STATS) + @Option("Report Server Stats") @DefaultValue("false") - @LangKey("dsurround.cfg.logging.ServerStats") - @Comment("Enables/disables reporting of server stats") + @LangKey(logging.PREFIX + ".ServerStats") + @Comment("Enables/disables reporting of server TPS and memory stats (has to be enabled server side as well)") public static boolean reportServerStats = false; - @Option(CONFIG_DEBUG_FLAG_MASK) + @Option("Debug Flag Mask") @DefaultValue("0") - @LangKey("dsurround.cfg.logging.FlagMask") + @LangKey(logging.PREFIX + ".FlagMask") @Comment("Bitmask for toggling various debug traces") @Hidden public static int debugFlagMask = 0; } public static final String CATEGORY_RAIN = "rain"; - public static final String CONFIG_VANILLA_RAIN = "Use Vanilla Algorithms"; - public static final String CONFIG_USE_VANILLA_RAIN_SOUND = "Use Vanilla Rain Sound"; - public static final String CONFIG_ENABLE_BACKGROUND_THUNDER = "Enable Background Thunder"; - public static final String CONFIG_THUNDER_THRESHOLD = "Rain Intensity for Background Thunder"; - public static final String CONFIG_RAIN_RIPPLE_STYLE = "Style of rain water ripple"; - public static final String CONFIG_MIN_RAIN_STRENGTH = "Default Minimum Rain Strength"; - public static final String CONFIG_MAX_RAIN_STRENGTH = "Default Maximum Rain Strength"; - public static final String CONFIG_ENABLE_MAGMA_RACK_SPLASH = "Enable Netherrack and Magma Splash Effect"; @Category(CATEGORY_RAIN) - @LangKey("dsurround.cfg.rain.cat.Rain") + @LangKey(rain.PREFIX) @Comment("Options that control rain effects in the client") public static class rain { - public static String PATH = null; + protected static final String PREFIX = ModOptions.PREFIX + ".rain"; - @Option(CONFIG_VANILLA_RAIN) + @Option("Use Vanilla Algorithms") @DefaultValue("false") - @LangKey("dsurround.cfg.rain.VanillaRain") + @LangKey(rain.PREFIX + ".VanillaRain") @Comment("Let Vanilla handle rain intensity and time windows") @RestartRequired public static boolean doVanillaRain = false; - @Option(CONFIG_USE_VANILLA_RAIN_SOUND) + @Option("Use Vanilla Rain Sound") @DefaultValue("false") - @LangKey("dsurround.cfg.rain.UseVanillaSound") + @LangKey(rain.PREFIX + ".UseVanillaSound") @Comment("Use the Vanilla rain sound rather than the modified one") @RestartRequired(server = true, world = true) public static boolean useVanillaRainSound = false; - @Option(CONFIG_RAIN_RIPPLE_STYLE) + @Option("Style of rain water ripple") @DefaultValue("3") - @LangKey("dsurround.cfg.rain.RippleStyle") + @LangKey(rain.PREFIX + ".RippleStyle") @RangeInt(min = 0, max = 3) @Comment("0: original round, 1: darker round, 2: square, 3: pixelated") public static int rainRippleStyle = 3; - @Option(CONFIG_ENABLE_BACKGROUND_THUNDER) + @Option("Enable Background Thunder") @DefaultValue("true") - @LangKey("dsurround.cfg.rain.EnableThunder") + @LangKey(rain.PREFIX + ".EnableThunder") @Comment("Allow background thunder when storming") public static boolean allowBackgroundThunder = true; - @Option(CONFIG_THUNDER_THRESHOLD) + @Option("Rain Intensity for Background Thunder") @DefaultValue("0.75") - @LangKey("dsurround.cfg.rain.ThunderThreshold") + @LangKey(rain.PREFIX + ".ThunderThreshold") @RangeFloat(min = 0) @Comment("Minimum rain intensity level for background thunder to occur") public static float stormThunderThreshold = 0.75F; - @Option(CONFIG_MIN_RAIN_STRENGTH) + @Option("Default Minimum Rain Strength") @DefaultValue("0.0") - @LangKey("dsurround.cfg.rain.MinRainStrength") + @LangKey(rain.PREFIX + ".MinRainStrength") @RangeFloat(min = 0.0F, max = 1.0F) @Comment("Default minimum rain strength for a dimension") public static float defaultMinRainStrength = 0.0F; - @Option(CONFIG_MAX_RAIN_STRENGTH) + @Option("Default Maximum Rain Strength") @DefaultValue("1.0") - @LangKey("dsurround.cfg.rain.MaxRainStrength") + @LangKey(rain.PREFIX + ".MaxRainStrength") @RangeFloat(min = 0.0F, max = 1.0F) @Comment("Default maximum rain strength for a dimension") public static float defaultMaxRainStrength = 1.0F; - @Option(CONFIG_ENABLE_MAGMA_RACK_SPLASH) + @Option("Enable Netherrack and Magma Splash Effect") @DefaultValue("true") - @LangKey("dsurround.cfg.rain.EnableMagmaNetherrack") + @LangKey(rain.PREFIX + ".EnableMagmaNetherrack") @Comment("Enable lava particle rain splash effect on Netherrack and Magma blocks") public static boolean enableNetherrackMagmaSplashEffect = true; } public static final String CATEGORY_FOG = "fog"; - public static final String CONFIG_ENABLE_FOG_PROCESSING = "Enable Fog Processing"; - public static final String CONFIG_ENABLE_MORNING_FOG = "Morning Fog"; - public static final String CONFIG_MORNING_FOG_CHANCE = "Morning Fog Chance"; - public static final String CONFIG_ENABLE_WEATHER_FOG = "Weather Fog"; - public static final String CONFIG_ENABLE_BEDROCK_FOG = "Bedrock Fog"; - public static final String CONFIG_ALLOW_DESERT_FOG = "Desert Fog"; - public static final String CONFIG_ENABLE_ELEVATION_HAZE = "Elevation Haze"; - public static final String CONFIG_ENABLE_BIOME_FOG = "Biomes Fog"; @Category(CATEGORY_FOG) - @LangKey("dsurround.cfg.fog.cat.Fog") + @LangKey(fog.PREFIX) @Comment("Options that control the various fog effects in the client") public static class fog { - public static String PATH = null; + protected static final String PREFIX = ModOptions.PREFIX + ".fog"; - @Option(CONFIG_ENABLE_FOG_PROCESSING) + @Option("Enable Fog Processing") @DefaultValue("true") - @LangKey("dsurround.cfg.fog.Enable") + @LangKey(fog.PREFIX + ".Enable") @Comment("Enable/disable fog processing") public static boolean enableFogProcessing = true; - @Option(CONFIG_ENABLE_MORNING_FOG) + @Option("Morning Fog") @DefaultValue("true") - @LangKey("dsurround.cfg.fog.EnableMorning") + @LangKey(fog.PREFIX + ".EnableMorning") @Comment("Show morning fog that eventually burns off") public static boolean enableMorningFog = true; - @Option(CONFIG_ENABLE_WEATHER_FOG) + @Option("Weather Fog") @DefaultValue("true") - @LangKey("dsurround.cfg.fog.EnableWeather") + @LangKey(fog.PREFIX + ".EnableWeather") @Comment("Increase fog based on the strength of rain") public static boolean enableWeatherFog = true; - @Option(CONFIG_ENABLE_BEDROCK_FOG) + @Option("Bedrock Fog") @DefaultValue("true") - @LangKey("dsurround.cfg.fog.EnableBedrock") + @LangKey(fog.PREFIX + ".EnableBedrock") @Comment("Increase fog at bedrock layers") public static boolean enableBedrockFog = true; - @Option(CONFIG_ALLOW_DESERT_FOG) + @Option("Desert Fog") @DefaultValue("true") - @LangKey("dsurround.cfg.fog.DesertFog") + @LangKey(fog.PREFIX + ".DesertFog") @Comment("Enable/disable desert fog when raining") public static boolean allowDesertFog = true; - @Option(CONFIG_ENABLE_ELEVATION_HAZE) + @Option("Elevation Haze") @DefaultValue("true") - @LangKey("dsurround.cfg.fog.ElevationHaze") + @LangKey(fog.PREFIX + ".ElevationHaze") @Comment("Higher the player elevation the more haze that is experienced") public static boolean enableElevationHaze = true; - @Option(CONFIG_ENABLE_BIOME_FOG) + @Option("Biomes Fog") @DefaultValue("true") - @LangKey("dsurround.cfg.fog.BiomeFog") + @LangKey(fog.PREFIX + ".BiomeFog") @Comment("Enable biome specific fog density and color") public static boolean enableBiomeFog = true; - @Option(CONFIG_MORNING_FOG_CHANCE) + @Option("Morning Fog Chance") @DefaultValue("1") @RangeInt(min = 1, max = 10) - @LangKey("dsurround.cfg.fog.MorningFogChance") - @Comment("Chance morning fog will occurs expressed as 1 in N") + @LangKey(fog.PREFIX + ".MorningFogChance") + @Comment("Chance morning fog will occurs expressed as 1 in N (1 means always)") public static int morningFogChance = 1; } public static final String CATEGORY_GENERAL = "general"; - public static final String CONFIG_EXTERNAL_SCRIPTS = "External Configuration Files"; - public static final String CONFIG_STARTUP_SOUND_LIST = "Startup Sound List"; - public static final String CONFIG_HIDE_CHAT_NOTICES = "Hide Chat Notices"; - public static final String CONFIG_ENABLE_CLIENT_CHUNK_CACHING = "Enable Client Chunk Caching"; @Category(CATEGORY_GENERAL) - @LangKey("dsurround.cfg.general.cat.General") + @LangKey(general.PREFIX) @Comment("Miscellaneous settings") public static class general { - public static String PATH = null; - - @Option(CONFIG_HIDE_CHAT_NOTICES) - @DefaultValue("false") - @LangKey("dsurround.cfg.general.HideChat") - @Comment("Toggles display of Dynamic Surroundings chat notices") - public static boolean hideChatNotices = false; + protected static final String PREFIX = ModOptions.PREFIX + ".general"; - @Option(CONFIG_EXTERNAL_SCRIPTS) + @Option("External Configuration Files") @DefaultValue("") - @LangKey("dsurround.cfg.general.ExternalScripts") + @LangKey(general.PREFIX + ".ExternalScripts") @Comment("Configuration files for customization") public static String[] externalScriptFiles = {}; - @Option(CONFIG_STARTUP_SOUND_LIST) + @Option("Startup Sound List") @DefaultValue("minecraft:entity.experience_orb.pickup,minecraft:entity.chicken.egg") - @LangKey("dsurround.cfg.general.StartupSounds") - @Comment("Possible sounds to play when client reaches main game menu") + @LangKey(general.PREFIX + ".StartupSounds") + @Comment("Possible sounds to play when client finishes loading and reaches the main game menu") //@formatter:off public static String[] startupSoundList = { "minecraft:entity.experience_orb.pickup", @@ -301,348 +276,308 @@ public static class general { }; //@formatter:on - @Option(CONFIG_ENABLE_CLIENT_CHUNK_CACHING) + @Option("Enable Client Chunk Caching") @DefaultValue("true") - @Comment("Enable/disable client side chunk caching for performance") - @LangKey("dsurround.cfg.general.ChunkCaching") + @LangKey(general.PREFIX + ".ChunkCaching") + @Comment("Enable/disable client side chunk caching (performance)") public static boolean enableClientChunkCaching = true; } public static final String CATEGORY_AURORA = "aurora"; - public static final String CONFIG_AURORA_ENABLED = "Enabled"; - public static final String CONFIG_AURORA_SHADER = "Use Shaders"; - public static final String CONFIG_AURORA_MAX_BANDS = "Maximum Bands"; @Category(CATEGORY_AURORA) - @LangKey("dsurround.cfg.aurora.cat.Aurora") + @LangKey(aurora.PREFIX) @Comment("Options that control Aurora behavior and rendering") public static class aurora { - public static String PATH = null; + protected static final String PREFIX = ModOptions.PREFIX + ".aurora"; - @Option(CONFIG_AURORA_ENABLED) + @Option("Enabled") @DefaultValue("true") - @LangKey("dsurround.cfg.aurora.EnableAurora") - @Comment("Enable/disable Aurora processing on server/client") + @LangKey(aurora.PREFIX + ".EnableAurora") + @Comment("Enable/disable aurora processing and rendering") public static boolean auroraEnable = true; - @Option(CONFIG_AURORA_SHADER) + @Option("Use Shaders") @DefaultValue("true") - @LangKey("dsurround.cfg.aurora.EnableShader") + @LangKey(aurora.PREFIX + ".EnableShader") @Comment("Use shader when rendering aurora") @RestartRequired(world = true) public static boolean auroraUseShader = true; - @Option(CONFIG_AURORA_MAX_BANDS) + @Option("Maximum Bands") @DefaultValue("3") - @LangKey("dsurround.cfg.aurora.MaxBands") + @LangKey(aurora.PREFIX + ".MaxBands") + @Comment("Maximum number of bands to render") @RangeInt(min = 1, max = 3) public static int maxBands = 3; } public static final String CATEGORY_BIOMES = "biomes"; - public static final String CONFIG_BIOME_SEALEVEL = "Overworld Sealevel Override"; - public static final String CONFIG_BIOME_ALIASES = "Biomes Alias"; - public static final String CONFIG_BIOME_DIM_BLACKLIST = "Dimension Blacklist"; @Category(CATEGORY_BIOMES) - @LangKey("dsurround.cfg.biomes.cat.Biomes") + @LangKey(biomes.PREFIX) @Comment("Options for controlling biome sound/effects") public static class biomes { - public static String PATH = null; + protected static final String PREFIX = ModOptions.PREFIX + ".biomes"; - @Option(CONFIG_BIOME_SEALEVEL) + @Option("Overworld Sealevel Override") @DefaultValue("0") - @LangKey("dsurround.cfg.biomes.Sealevel") + @LangKey(biomes.PREFIX + ".Sealevel") @RangeInt(min = 0, max = 255) @Comment("Sealevel to set for Overworld (0 use default for World)") public static int worldSealevelOverride = 0; - @Option(CONFIG_BIOME_ALIASES) + @Option("Biomes Alias") @DefaultValue("") - @LangKey("dsurround.cfg.biomes.Aliases") + @LangKey(biomes.PREFIX + ".Aliases") @Comment("Biomes alias list") public static String[] biomeAliases = {}; - @Option(CONFIG_BIOME_DIM_BLACKLIST) + @Option("Dimension Blacklist") @DefaultValue("") - @LangKey("dsurround.cfg.biomes.DimBlacklist") + @LangKey(biomes.PREFIX + ".DimBlacklist") @Comment("Dimension IDs where biome sounds will not be played") public static String[] dimensionBlacklist = {}; } public static final String CATEGORY_EFFECTS = "effects"; - public static final String CONFIG_FX_RANGE = "Special Effect Range"; - public static final String CONFIG_DISABLE_SUSPEND = "Disable Water Suspend Particles"; - public static final String CONFIG_WATERFALL_CUTOFF = "Waterfall Cutoff"; - public static final String CONFIG_BLOCK_EFFECT_STEAM = "Enable Steam"; - public static final String CONFIG_BLOCK_EFFECT_FIRE = "Enable FireJetEffect Jets"; - public static final String CONFIG_BLOCK_EFFECT_BUBBLE = "Enable Bubbles"; - public static final String CONFIG_BLOCK_EFFECT_DUST = "Enable DustJetEffect Motes"; - public static final String CONFIG_BLOCK_EFFECT_FOUNTAIN = "Enable FountainJetEffect"; - public static final String CONFIG_BLOCK_EFFECT_FIREFLY = "Enable Fireflies"; - public static final String CONFIG_BLOCK_EFFECT_SPLASH = "Enable Water Splash"; - public static final String CONFIG_ENABLE_POPOFFS = "Damage Popoffs"; - public static final String CONFIG_SHOW_CRIT_WORDS = "Show Crit Words"; - public static final String CONFIG_ENABLE_FOOTPRINTS = "Footprints"; - public static final String CONFIG_FOOTPRINT_STYLE = "Footprint Style"; - public static final String CONFIG_SHOW_BREATH = "Show Frost Breath"; @Category(CATEGORY_EFFECTS) - @LangKey("dsurround.cfg.effects.cat.Effects") + @LangKey(effects.PREFIX) @Comment("Options for controlling various effects") public static class effects { - public static String PATH = null; + protected static final String PREFIX = ModOptions.PREFIX + ".effects"; - @Option(CONFIG_FX_RANGE) + @Option("Special Effect Range") @DefaultValue("24") - @LangKey("dsurround.cfg.effects.FXRange") + @LangKey(effects.PREFIX + ".FXRange") @RangeInt(min = 16, max = 64) @Comment("Block radius/range around player for special effect application") public static int specialEffectRange = 24; - @Option(CONFIG_DISABLE_SUSPEND) + @Option("Disable Water Suspend Particles") @DefaultValue("false") - @LangKey("dsurround.cfg.effects.Suspend") + @LangKey(effects.PREFIX + ".Suspend") @Comment("Enable/disable water depth particle effect") @RestartRequired(server = true) public static boolean disableWaterSuspendParticle = false; - @Option(CONFIG_WATERFALL_CUTOFF) + @Option("Waterfall Cutoff") @DefaultValue("0") - @LangKey("dsurround.cfg.effects.WaterfallCutoff") - @RangeInt(min = 0, max = 10) - @Comment("Waterfall strength below which sounds will not play") + @LangKey(effects.PREFIX + ".WaterfallCutoff") + @RangeInt(min = 0, max = 16) + @Comment("Waterfall strength below which sounds will not play (> 10 to turn off)") public static int waterfallCutoff = 0; - @Option(CONFIG_BLOCK_EFFECT_STEAM) + @Option("Enable Steam") @DefaultValue("true") - @LangKey("dsurround.cfg.effects.Steam") + @LangKey(effects.PREFIX + ".Steam") @Comment("Enable Steam Jets where lava meets water") public static boolean enableSteamJets = true; - @Option(CONFIG_BLOCK_EFFECT_FIRE) + @Option("Enable FireJetEffect Jets") @DefaultValue("true") - @LangKey("dsurround.cfg.effects.Fire") + @LangKey(effects.PREFIX + ".Fire") @Comment("Enable FireJetEffect Jets in lava") public static boolean enableFireJets = true; - @Option(CONFIG_BLOCK_EFFECT_BUBBLE) + @Option("Enable Bubbles") @DefaultValue("true") - @LangKey("dsurround.cfg.effects.Bubble") + @LangKey(effects.PREFIX + ".Bubble") @Comment("Enable BubbleJetEffect Jets under water") public static boolean enableBubbleJets = true; - @Option(CONFIG_BLOCK_EFFECT_DUST) + @Option("Enable DustJetEffect Motes") @DefaultValue("true") - @LangKey("dsurround.cfg.effects.Dust") + @LangKey(effects.PREFIX + ".Dust") @Comment("Enable DustJetEffect motes dropping from blocks") public static boolean enableDustJets = true; - @Option(CONFIG_BLOCK_EFFECT_FOUNTAIN) + @Option("Enable FountainJetEffect") @DefaultValue("true") - @LangKey("dsurround.cfg.effects.Fountain") + @LangKey(effects.PREFIX + ".Fountain") @Comment("Enable FountainJetEffect jets") public static boolean enableFountainJets = true; - @Option(CONFIG_BLOCK_EFFECT_FIREFLY) + @Option("Enable Fireflies") @DefaultValue("true") - @LangKey("dsurround.cfg.effects.Fireflies") + @LangKey(effects.PREFIX + ".Fireflies") @Comment("Enable Firefly effect around plants") public static boolean enableFireflies = true; - @Option(CONFIG_BLOCK_EFFECT_SPLASH) + @Option("Enable Water Splash") @DefaultValue("true") - @LangKey("dsurround.cfg.effects.Splash") + @LangKey(effects.PREFIX + ".Splash") @Comment("Enable Water Splash effects when water spills down") public static boolean enableWaterSplash = true; - @Option(CONFIG_ENABLE_POPOFFS) + @Option("Damage Popoffs") @DefaultValue("true") - @LangKey("dsurround.cfg.effects.Popoffs") - @Comment("Controls display of damage pop-offs when an entity is damaged") + @LangKey(effects.PREFIX + ".Popoffs") + @Comment("Controls display of damage pop-offs when an entity is damaged/healed") public static boolean enableDamagePopoffs = true; - @Option(CONFIG_SHOW_CRIT_WORDS) + @Option("Show Crit Words") @DefaultValue("true") - @LangKey("dsurround.cfg.effects.CritWords") + @LangKey(effects.PREFIX + ".CritWords") @Comment("Display random power word on critical hit") public static boolean showCritWords = true; - @Option(CONFIG_ENABLE_FOOTPRINTS) + @Option("Footprints") @DefaultValue("true") - @LangKey("dsurround.cfg.effects.Footprints") + @LangKey(effects.PREFIX + ".Footprints") @Comment("Enable player footprints") public static boolean enableFootprints = true; - @Option(CONFIG_FOOTPRINT_STYLE) + @Option("Footprint Style") @DefaultValue("6") - @LangKey("dsurround.cfg.effects.FootprintStyle") + @LangKey(effects.PREFIX + ".FootprintStyle") @Comment("0: shoe print, 1: square print, 2: horse hoof, 3: bird, 4: paw, 5: solid square, 6: lowres square") @RangeInt(min = 0, max = 6) public static int footprintStyle = 6; - @Option(CONFIG_SHOW_BREATH) + @Option("Show Frost Breath") @DefaultValue("true") - @LangKey("dsurround.cfg.effects.ShowBreath") - @Comment("Show player frost breath in cold weather") + @LangKey(effects.PREFIX + ".ShowBreath") + @Comment("Show player breath in cold weather and underwater") public static boolean showBreath = true; } public static final String CATEGORY_SOUND = "sound"; - public static final String CONFIG_ENABLE_BATTLEMUSIC = "Battle Music"; - public static final String CONFIG_ENABLE_BIOME_SOUNDS = "Enable Biomes Sounds"; - public static final String CONFIG_MASTER_SOUND_FACTOR = "Master Sound Scale Factor"; - public static final String CONFIG_AUTO_CONFIG_CHANNELS = "Autoconfigure Channels"; - public static final String CONFIG_NORMAL_CHANNEL_COUNT = "Number Normal Channels"; - public static final String CONFIG_STREAMING_CHANNEL_COUNT = "Number Streaming Channels"; - public static final String CONFIG_STREAM_BUFFER_SIZE = "Stream Buffer Size"; - public static final String CONFIG_STREAM_BUFFER_COUNT = "Number of Stream Buffers per Channel"; - public static final String CONFIG_MUTE_WHEN_BACKGROUND = "Mute when Background"; - public static final String CONFIG_ENABLE_JUMP_SOUND = "Jump Sound"; - public static final String CONFIG_ENABLE_EQUIP_SOUND = "Equip Sound"; - public static final String CONFIG_SWORD_AS_TOOL_EQUIP_SOUND = "Sword Equip as Tool"; - public static final String CONFIG_ENABLE_CRAFTING_SOUND = "Crafting Sound"; - public static final String CONFIG_FOOTSTEPS_QUAD = "Footsteps as Quadruped"; - public static final String CONFIG_FOOTSTEPS_CADENCE = "First Person Footstep Cadence"; - public static final String CONFIG_ENABLE_ARMOR_SOUND = "Armor Sound"; - public static final String CONFIG_ENABLE_SWING_SOUND = "Swing Sound"; - public static final String CONFIG_ENABLE_PUDDLE_SOUND = "Rain Puddle Sound"; - public static final String CONFIG_SOUND_CULL_THRESHOLD = "Sound Culling Threshold"; - public static final String CONFIG_THUNDER_VOLUME = "Thunder Volume"; public static final String CONFIG_SOUND_SETTINGS = "Sound Settings"; @Category(CATEGORY_SOUND) - @LangKey("dsurround.cfg.sound.cat.Sound") + @LangKey(sound.PREFIX) @Comment("General options for defining sound effects") public static class sound { - public static String PATH = null; + protected static final String PREFIX = ModOptions.PREFIX + ".sound"; - @Option(CONFIG_ENABLE_BATTLEMUSIC) + @Option("Battle Music") @DefaultValue("false") - @LangKey("dsurround.cfg.sound.BattleMusic") - @Comment("Enable/disable Battle Music") + @LangKey(sound.PREFIX + ".BattleMusic") + @Comment("Enable/disable Battle Music (must also have BattleMusic resource pack installed to hear)") public static boolean enableBattleMusic = false; - @Option(CONFIG_ENABLE_BIOME_SOUNDS) + @Option("Enable Biomes Sounds") @DefaultValue("true") - @LangKey("dsurround.cfg.sound.BiomeSounds") + @LangKey(sound.PREFIX + ".BiomeSounds") @Comment("Enable biome background and spot sounds") public static boolean enableBiomeSounds = true; - @Option(CONFIG_AUTO_CONFIG_CHANNELS) + @Option("Autoconfigure Channels") @DefaultValue("true") - @LangKey("dsurround.cfg.sound.AutoConfig") + @LangKey(sound.PREFIX + ".AutoConfig") @Comment("Automatically configure sound channels") @RestartRequired(server = true) public static boolean autoConfigureChannels = true; - @Option(CONFIG_NORMAL_CHANNEL_COUNT) + @Option("Number Normal Channels") @DefaultValue("28") - @LangKey("dsurround.cfg.sound.NormalChannels") + @LangKey(sound.PREFIX + ".NormalChannels") @RangeInt(min = 28, max = 255) @Comment("Number of normal sound channels to configure in the sound system (manual)") @RestartRequired(server = true) public static int normalSoundChannelCount = 28; - @Option(CONFIG_STREAMING_CHANNEL_COUNT) + @Option("Number Streaming Channels") @DefaultValue("4") - @LangKey("dsurround.cfg.sound.StreamingChannels") + @LangKey(sound.PREFIX + ".StreamingChannels") @RangeInt(min = 4, max = 255) @Comment("Number of streaming sound channels to configure in the sound system (manual)") @RestartRequired(server = true) public static int streamingSoundChannelCount = 4; - @Option(CONFIG_STREAM_BUFFER_SIZE) - @DefaultValue("16") - @LangKey("dsurround.cfg.sound.StreamBufferSize") + @Option("Stream Buffer Size") + @DefaultValue("32") + @LangKey(sound.PREFIX + ".StreamBufferSize") @RangeInt(min = 0) @Comment("Size of a stream buffer in kilobytes (0: system default - usually 128K bytes)") @RestartRequired(server = true) - public static int streamBufferSize = 16; + public static int streamBufferSize = 32; - @Option(CONFIG_STREAM_BUFFER_COUNT) + @Option("Number of Stream Buffers per Channel") @DefaultValue("0") - @LangKey("dsurround.cfg.sound.StreamBufferCount") + @LangKey(sound.PREFIX + ".StreamBufferCount") @RangeInt(min = 0, max = 8) @Comment("Number of stream buffers per channel (0: system default - usually 3 buffers)") @RestartRequired(server = true) public static int streamBufferCount = 0; - @Option(CONFIG_MUTE_WHEN_BACKGROUND) + @Option("Mute when Background") @DefaultValue("true") - @LangKey("dsurround.cfg.sound.Mute") + @LangKey(sound.PREFIX + ".Mute") @Comment("Mute sound when Minecraft is in the background") public static boolean muteWhenBackground = true; - @Option(CONFIG_THUNDER_VOLUME) + @Option("Thunder Volume") @DefaultValue("10000") - @LangKey("dsurround.cfg.sound.ThunderVolume") + @LangKey(sound.PREFIX + ".ThunderVolume") @Comment("Sound Volume of Thunder") @RangeFloat(min = 15F, max = 10000F) public static float thunderVolume = 10000F; - @Option(CONFIG_ENABLE_JUMP_SOUND) + @Option("Jump Sound") @DefaultValue("false") - @LangKey("dsurround.cfg.sound.Jump") + @LangKey(sound.PREFIX + ".Jump") @Comment("Enable player Jump sound effect") public static boolean enableJumpSound = false; - @Option(CONFIG_ENABLE_EQUIP_SOUND) + @Option("Equip Sound") @DefaultValue("true") - @LangKey("dsurround.cfg.sound.Equip") + @LangKey(sound.PREFIX + ".Equip") @Comment("Enable Weapon/Tool Equip sound effect") public static boolean enableEquipSound = true; - @Option(CONFIG_SWORD_AS_TOOL_EQUIP_SOUND) + @Option("Sword Equip as Tool") @DefaultValue("false") - @LangKey("dsurround.cfg.sound.SwordEquipAsTool") + @LangKey(sound.PREFIX + ".SwordEquipAsTool") @Comment("Enable Sword Equip sound as Tool") @RestartRequired(world = true, server = true) public static boolean swordEquipAsTool = false; - @Option(CONFIG_ENABLE_CRAFTING_SOUND) + @Option("Crafting Sound") @DefaultValue("true") - @LangKey("dsurround.cfg.sound.Craft") + @LangKey(sound.PREFIX + ".Craft") @Comment("Enable Item Crafted sound effect") public static boolean enableCraftingSound = true; - @Option(CONFIG_FOOTSTEPS_QUAD) + @Option("Footsteps as Quadruped") @DefaultValue("false") - @LangKey("dsurround.cfg.sound.FootstepQuad") + @LangKey(sound.PREFIX + ".FootstepQuad") @Comment("Simulate quadruped with Footstep effects (horse)") public static boolean foostepsQuadruped = false; - @Option(CONFIG_FOOTSTEPS_CADENCE) + @Option("First Person Footstep Cadence") @DefaultValue("true") - @LangKey("dsurround.cfg.sound.FootstepCadence") + @LangKey(sound.PREFIX + ".FootstepCadence") @Comment("true to match first person arm swing; false to match 3rd person leg animation") public static boolean firstPersonFootstepCadence = true; - @Option(CONFIG_ENABLE_ARMOR_SOUND) + @Option("Armor Sound") @DefaultValue("true") - @LangKey("dsurround.cfg.sound.Armor") + @LangKey(sound.PREFIX + ".Armor") @Comment("Enable/disable armor sounds when moving") public static boolean enableArmorSounds = true; - @Option(CONFIG_ENABLE_SWING_SOUND) + @Option("Swing Sound") @DefaultValue("true") - @LangKey("dsurround.cfg.sound.Swing") + @LangKey(sound.PREFIX + ".Swing") @Comment("Enable/disable item swing sounds") public static boolean enableSwingSounds = true; - @Option(CONFIG_ENABLE_PUDDLE_SOUND) + @Option("Rain Puddle Sound") @DefaultValue("true") - @LangKey("dsurround.cfg.sound.Puddle") + @LangKey(sound.PREFIX + ".Puddle") @Comment("Enable/disable rain puddle sound when moving in the rain") public static boolean enablePuddleSound = true; - @Option(CONFIG_SOUND_CULL_THRESHOLD) + @Option("Sound Culling Threshold") @DefaultValue("20") - @LangKey("dsurround.cfg.sound.CullInterval") + @LangKey(sound.PREFIX + ".CullInterval") @RangeInt(min = 0) @Comment("Ticks between culled sound events (0 to disable culling)") public static int soundCullingThreshold = 20; @@ -650,8 +585,8 @@ public static class sound { @Option(CONFIG_SOUND_SETTINGS) @Hidden @DefaultValue("minecraft:block.water.ambient cull,minecraft:block.lava.ambient cull,minecraft:entity.sheep.ambient cull,minecraft:entity.chicken.ambient cull,minecraft:entity.cow.ambient cull,minecraft:entity.pig.ambient cull,dsurround:bison block,dsurround:elephant block,dsurround:gnatt block,dsurround:insectbuzz block,dsurround:hiss block,dsurround:rattlesnake block") - @LangKey("dsurround.cfg.sound.SoundSettings") - @Comment("Configure how each individual sound will be handled") + @LangKey(sound.PREFIX + ".SoundSettings") + @Comment("Configure how each individual sound will be handled (block, cull, and volume scale)") //@formatter:off public static String[] soundSettings = { "minecraft:block.water.ambient cull", @@ -671,132 +606,120 @@ public static class sound { } public static final String CATEGORY_PLAYER = "player"; - public static final String CONFIG_SUPPRESS_POTION_PARTICLES = "Suppress Potion Particles"; - public static final String CONFIG_HURT_THRESHOLD = "Hurt Threshold"; - public static final String CONFIG_HUNGER_THRESHOLD = "Hunger Threshold"; @Category(CATEGORY_PLAYER) - @LangKey("dsurround.cfg.player.cat.Player") + @LangKey(player.PREFIX) @Comment("General options for defining sound and effects the player entity") public static class player { - public static String PATH = null; + protected static final String PREFIX = ModOptions.PREFIX + ".player"; - @Option(CONFIG_SUPPRESS_POTION_PARTICLES) + @Option("Suppress Potion Particles") @DefaultValue("false") - @LangKey("dsurround.cfg.player.PotionParticles") - @Comment("Suppress player's potion particles from rendering") + @LangKey(player.PREFIX + ".PotionParticles") + @Comment("Suppress rendering of player's potion particles") public static boolean suppressPotionParticles = false; - @Option(CONFIG_HURT_THRESHOLD) + @Option("Hurt Threshold") @DefaultValue("0.25") - @LangKey("dsurround.cfg.player.HurtThreshold") + @LangKey(player.PREFIX + ".HurtThreshold") @Comment("Percentage of player health bar remaining to trigger player hurt sound (0 disable)") @RangeFloat(min = 0, max = 0.5F) public static float playerHurtThreshold = 0.25F; - @Option(CONFIG_HUNGER_THRESHOLD) + @Option("Hunger Threshold") @DefaultValue("8") - @LangKey("dsurround.cfg.player.HungerThreshold") + @LangKey(player.PREFIX + ".HungerThreshold") @Comment("Amount of food bar remaining to trigger player hunger sound (0 disable)") @RangeInt(min = 0, max = 10) public static int playerHungerThreshold = 8; } public static final String CATEGORY_SPEECHBUBBLES = "speechbubbles"; - public static final String CONFIG_OPTION_ENABLE_SPEECHBUBBLES = "Enable SpeechBubbles"; - public static final String CONFIG_OPTION_ENABLE_ENTITY_CHAT = "Enable Entity Chat"; - public static final String CONFIG_OPTION_SPEECHBUBBLE_DURATION = "Display Duration"; - public static final String CONFIG_OPTION_SPEECHBUBBLE_RANGE = "Visibility Range"; - public static final String CONFIG_OPTION_ANIMANIA_BADGES = "Animania Badges"; @Category(CATEGORY_SPEECHBUBBLES) - @LangKey("dsurround.cfg.speech.cat.Speech") + @LangKey(speechbubbles.PREFIX) @Comment("Options for configuring SpeechBubbles") public static class speechbubbles { - public static String PATH = null; + protected static final String PREFIX = ModOptions.PREFIX + ".speech"; - @Option(CONFIG_OPTION_ENABLE_SPEECHBUBBLES) + @Option("Enable SpeechBubbles") @DefaultValue("false") - @LangKey("dsurround.cfg.speech.EnableSpeechBubbles") - @Comment("Enables/disables speech bubbles above player heads") + @LangKey(speechbubbles.PREFIX + ".EnableSpeechBubbles") + @Comment("Enables/disables speech bubbles above player heads (needs to be enabled server side as well)") public static boolean enableSpeechBubbles = false; - @Option(CONFIG_OPTION_ENABLE_ENTITY_CHAT) + @Option("Enable Entity Chat") @DefaultValue("false") - @LangKey("dsurround.cfg.speech.EnableEntityChat") + @LangKey(speechbubbles.PREFIX + ".EnableEntityChat") @Comment("Enables/disables entity chat bubbles") public static boolean enableEntityChat = false; - @Option(CONFIG_OPTION_SPEECHBUBBLE_DURATION) + @Option("Display Duration") @DefaultValue("7") - @LangKey("dsurround.cfg.speech.Duration") + @LangKey(speechbubbles.PREFIX + ".Duration") @RangeFloat(min = 5.0F, max = 15.0F) @Comment("Number of seconds to display speech before removing") public static float speechBubbleDuration = 7.0F; - @Option(CONFIG_OPTION_SPEECHBUBBLE_RANGE) + @Option("Visibility Range") @DefaultValue("16") - @LangKey("dsurround.cfg.speech.Range") + @LangKey(speechbubbles.PREFIX + ".Range") @RangeInt(min = 16, max = 32) - @Comment("Range at which a SpeechBubble is visible. Filtering occurs server side.") + @Comment("Range at which a SpeechBubble is visible (filtering occurs server side)") public static float speechBubbleRange = 16; - @Option(CONFIG_OPTION_ANIMANIA_BADGES) + @Option("Animania Badges") @DefaultValue("true") - @LangKey("dsurround.cfg.speech.AnimaniaBadges") + @LangKey(speechbubbles.PREFIX + ".AnimaniaBadges") @Comment("Enable/disable display of food/water badges over Animania mobs") @RestartRequired(world = true, server = true) public static boolean enableAnimaniaBadges = true; } public static final String CATEGORY_COMMANDS = "commands"; - public static final String CONFIG_COMMANDS_DS = "/ds"; - public static final String CONFIG_COMMANDS_CALC = "/calc"; - public static final String CONFIG_COMMAND_NAME = "name"; - public static final String CONFIG_COMMAND_ALIAS = "alias"; @Category(CATEGORY_COMMANDS) - @LangKey("dsurround.cfg.commands.cat.Commands") + @LangKey(commands.PREFIX) @Comment("Options for configuring commands") @RestartRequired(server = true, world = true) public static class commands { - public static String PATH = null; + protected static final String PREFIX = ModOptions.PREFIX + ".commands"; - @Category(CONFIG_COMMANDS_DS) + @Category("/ds") public static class ds { - public static String PATH = null; + protected static final String PREFIX = commands.PREFIX + ".DS"; - @Option(CONFIG_COMMAND_NAME) + @Option("name") @DefaultValue("ds") - @LangKey("dsurround.cfg.commands.DS.Name") + @LangKey(ds.PREFIX + ".Name") @Comment("Name of the command") public static String commandNameDS = "ds"; - @Option(CONFIG_COMMAND_ALIAS) + @Option("alias") @DefaultValue("dsurround rain") - @LangKey("dsurround.cfg.commands.DS.Alias") + @LangKey(ds.PREFIX + ".Alias") @Comment("Alias for the command") public static String commandAliasDS = "dsurround rain"; } - @Category(CONFIG_COMMANDS_CALC) + @Category("/calc") public static class calc { - public static String PATH = null; + protected static final String PREFIX = commands.PREFIX + ".Calc"; - @Option(CONFIG_COMMAND_NAME) + @Option("name") @DefaultValue("calc") - @LangKey("dsurround.cfg.commands.Calc.Name") + @LangKey(calc.PREFIX + ".Name") @Comment("Name of the command") public static String commandNameCalc = "calc"; - @Option(CONFIG_COMMAND_ALIAS) + @Option("alias") @DefaultValue("c math") - @LangKey("dsurround.cfg.commands.Calc.Alias") + @LangKey(calc.PREFIX + ".Alias") @Comment("Alias for the command") public static String commandAliasCalc = "c math"; } @@ -805,11 +728,11 @@ public static class calc { public static final String CATEGORY_PROFILES = "profiles"; @Category(CATEGORY_PROFILES) - @LangKey("dsurround.cfg.profiles.cat.Profiles") + @LangKey(profiles.PREFIX) @Comment("Enable/disable application of built in profiles") public static class profiles { - public static String PATH = null; + protected static final String PREFIX = ModOptions.PREFIX + ".profiles"; // Dynamically created during initialization } diff --git a/src/main/java/org/orecruncher/dsurround/capabilities/CapabilityDimensionInfo.java b/src/main/java/org/orecruncher/dsurround/capabilities/CapabilityDimensionInfo.java index b1e831e56..9444b9806 100644 --- a/src/main/java/org/orecruncher/dsurround/capabilities/CapabilityDimensionInfo.java +++ b/src/main/java/org/orecruncher/dsurround/capabilities/CapabilityDimensionInfo.java @@ -71,6 +71,12 @@ public static ICapabilityProvider createProvider(final IDimensionInfo data) { public static class EventHandler { @SubscribeEvent public static void attachCapabilities(@Nonnull final AttachCapabilitiesEvent event) { + + if (!ModBase.isInitialized()) { + ModBase.log().info("Attempt to attach world capability before mod is inititalized - silly fake worlds."); + return; + } + final World world = event.getObject(); if (world != null) { final String side = ModBase.proxy().effectiveSide().toString(); diff --git a/src/main/java/org/orecruncher/dsurround/client/gui/DynSurroundConfigGui.java b/src/main/java/org/orecruncher/dsurround/client/gui/DynSurroundConfigGui.java index cb7aa1c34..ab44c0bef 100644 --- a/src/main/java/org/orecruncher/dsurround/client/gui/DynSurroundConfigGui.java +++ b/src/main/java/org/orecruncher/dsurround/client/gui/DynSurroundConfigGui.java @@ -65,25 +65,25 @@ public DynSurroundConfigGui(final GuiScreen parentScreen) { // Synthetic options for handling sound blocking and volume this.soundCategory = new ConfigCategory("Individual Sound Configuration") - .setLanguageKey("dsurround.cfg.sound.SoundConfig"); + .setLanguageKey("dsurround.cfg.individual"); this.soundElement = new ConfigElement(this.soundCategory); generateSoundList(this.soundCategory); this.configElements.add(this.soundElement); // Tack on the rest of the categories for configuration - addConfigCategory(ModOptions.general.PATH); - addConfigCategory(ModOptions.player.PATH); - addConfigCategory(ModOptions.rain.PATH); - addConfigCategory(ModOptions.fog.PATH); - addConfigCategory(ModOptions.aurora.PATH); - addConfigCategory(ModOptions.effects.PATH); - addConfigCategory(ModOptions.biomes.PATH); - addConfigCategory(ModOptions.sound.PATH); - addConfigCategory(ModOptions.profiles.PATH); - addConfigCategory(ModOptions.speechbubbles.PATH); - addConfigCategory(ModOptions.commands.PATH); - addConfigCategory(ModOptions.asm.PATH); - addConfigCategory(ModOptions.logging.PATH); + addConfigCategory(ModOptions.CATEGORY_GENERAL); + addConfigCategory(ModOptions.CATEGORY_PLAYER); + addConfigCategory(ModOptions.CATEGORY_RAIN); + addConfigCategory(ModOptions.CATEGORY_FOG); + addConfigCategory(ModOptions.CATEGORY_AURORA); + addConfigCategory(ModOptions.CATEGORY_EFFECTS); + addConfigCategory(ModOptions.CATEGORY_BIOMES); + addConfigCategory(ModOptions.CATEGORY_SOUND); + addConfigCategory(ModOptions.CATEGORY_PROFILES); + addConfigCategory(ModOptions.CATEGORY_SPEECHBUBBLES); + addConfigCategory(ModOptions.CATEGORY_COMMANDS); + addConfigCategory(ModOptions.CATEGORY_ASM); + addConfigCategory(ModOptions.CATEGORY_LOGGING_CONTROL); } private void addConfigCategory(@Nonnull final String category) { @@ -109,7 +109,7 @@ protected void saveSoundList() { } final String[] results = soundVolumes.toArray(new String[soundVolumes.size()]); - this.config.getCategory(ModOptions.sound.PATH).get(ModOptions.CONFIG_SOUND_SETTINGS).set(results); + this.config.getCategory(ModOptions.CATEGORY_SOUND).get(ModOptions.CONFIG_SOUND_SETTINGS).set(results); } protected void generateSoundList(final ConfigCategory cat) { diff --git a/src/main/java/org/orecruncher/dsurround/client/gui/GuiFilteredConfigEntries.java b/src/main/java/org/orecruncher/dsurround/client/gui/GuiFilteredConfigEntries.java new file mode 100644 index 000000000..b2070d121 --- /dev/null +++ b/src/main/java/org/orecruncher/dsurround/client/gui/GuiFilteredConfigEntries.java @@ -0,0 +1,179 @@ +/* + * This file is part of Dynamic Surroundings, licensed under the MIT License (MIT). + * + * Copyright (c) OreCruncher + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package org.orecruncher.dsurround.client.gui; + +import java.util.ArrayList; +import java.util.List; + +import org.apache.commons.lang3.StringUtils; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.GuiTextField; +import net.minecraft.client.resources.I18n; +import net.minecraftforge.fml.client.config.GuiConfig; +import net.minecraftforge.fml.client.config.GuiConfigEntries; +import net.minecraftforge.fml.client.config.IConfigElement; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class GuiFilteredConfigEntries extends GuiConfigEntries { + + + private static final FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer; + private static final String searchLabel = I18n.format("fml.menu.mods.search"); + private static final int searchLabelWidth = fontRenderer.getStringWidth(searchLabel); + private static final int renderColor = 0xFFDD00; + + private GuiTextField search; + private String lastFilterText = StringUtils.EMPTY; + private List filteredList; + + private final GuiConfig parent; + + public GuiFilteredConfigEntries(GuiConfig parent, Minecraft mc) { + super(parent, mc); + + this.parent = parent; + this.filteredList = this.listEntries; + } + + @Override + public void initGui() { + super.initGui(); + + final int w = 240; + final int y = (this.parent.width - w - searchLabelWidth - 10) / 2 + searchLabelWidth + 5; + this.search = new GuiTextField(0, fontRenderer, y, this.top, w, 14); + this.search.setText(this.lastFilterText); + this.search.setFocused(false); + this.search.setCanLoseFocus(true); + + this.top = this.owningScreen.titleLine2 != null ? 53 : 43; + } + + protected void filterText() { + this.lastFilterText = this.search.getText(); + + if (StringUtils.isEmpty(this.lastFilterText)) { + this.filteredList = this.listEntries; + } else { + this.filteredList = new ArrayList<>(); + final String filter = this.lastFilterText.toLowerCase(); + for (final IConfigEntry e : this.listEntries) { + final IConfigElement ce = e.getConfigElement(); + String trans = I18n.format(ce.getLanguageKey()); + if (trans.equals(ce.getLanguageKey())) + trans = ce.getName(); + if (trans.toLowerCase().contains(filter)) + this.filteredList.add(e); + } + } + } + + /** + * Called when the mouse is clicked. Args : mouseX, mouseY, clickedButton + * + * @return + */ + @Override + public boolean mouseClicked(int x, int y, int button) { + boolean result = super.mouseClicked(x, y, button); + result |= this.search.mouseClicked(x, y, button); + if (button == 1 && x >= this.search.x && x < this.search.x + this.search.width && y >= this.search.y + && y < this.search.y + this.search.height) { + this.search.setText(""); + } + + return result; + } + + @Override + public void mouseClickedPassThru(int mouseX, int mouseY, int mouseEvent) { + for (final IConfigEntry entry : this.filteredList) + entry.mouseClicked(mouseX, mouseY, mouseEvent); + } + + /** + * Fired when a key is typed (except F11 which toggles full screen). This is the + * equivalent of KeyListener.keyTyped(KeyEvent e). Args : character (character + * on the key), keyCode (lwjgl Keyboard key code) + */ + @Override + public void keyTyped(char c, int keyCode) { + for (final IConfigEntry entry : this.filteredList) + entry.keyTyped(c, keyCode); + + this.search.textboxKeyTyped(c, keyCode); + } + + /** + * Called from the main game loop to update the screen. + */ + @Override + public void updateScreen() { + for (final IConfigEntry entry : this.filteredList) + entry.updateCursorCounter(); + + this.search.updateCursorCounter(); + + if (!this.search.getText().equals(this.lastFilterText)) { + filterText(); + } + } + + @Override + public int getSize() { + return this.filteredList.size(); + } + + /** + * Gets the IGuiListEntry object for the given index + */ + /** + * Gets the IGuiListEntry object for the given index + */ + @Override + public IConfigEntry getListEntry(int index) { + return this.filteredList.get(index); + } + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + super.drawScreen(mouseX, mouseY, partialTicks); + + final int w = 240; + final int x = (this.parent.width - w - searchLabelWidth - 10) / 2; + fontRenderer.drawString(searchLabel, x, this.top - 18, renderColor); + this.search.drawTextBox(); + } + + @Override + public void drawScreenPost(int mouseX, int mouseY, float partialTicks) { + for (final IConfigEntry entry : this.filteredList) + entry.drawToolTip(mouseX, mouseY); + } + +} diff --git a/src/main/java/org/orecruncher/dsurround/client/handlers/AuroraEffectHandler.java b/src/main/java/org/orecruncher/dsurround/client/handlers/AuroraEffectHandler.java index ddde5b4f7..6c180ab29 100644 --- a/src/main/java/org/orecruncher/dsurround/client/handlers/AuroraEffectHandler.java +++ b/src/main/java/org/orecruncher/dsurround/client/handlers/AuroraEffectHandler.java @@ -124,7 +124,7 @@ public void process(@Nonnull final EntityPlayer player) { this.nanos = 0; } - @SubscribeEvent(priority = EventPriority.LOWEST) + @SubscribeEvent(priority = EventPriority.HIGH) public void doRender(@Nonnull final RenderWorldLastEvent event) { if (this.current != null) { final long start = System.nanoTime(); diff --git a/src/main/java/org/orecruncher/dsurround/client/hud/GuiHUDHandler.java b/src/main/java/org/orecruncher/dsurround/client/hud/GuiHUDHandler.java index 20eec0ceb..a780b0145 100644 --- a/src/main/java/org/orecruncher/dsurround/client/hud/GuiHUDHandler.java +++ b/src/main/java/org/orecruncher/dsurround/client/hud/GuiHUDHandler.java @@ -24,10 +24,8 @@ package org.orecruncher.dsurround.client.hud; -import java.util.ArrayList; -import java.util.List; - import org.orecruncher.dsurround.client.handlers.EnvironStateHandler.EnvironState; +import org.orecruncher.lib.collections.ObjectArray; import net.minecraft.client.Minecraft; import net.minecraftforge.client.event.RenderGameOverlayEvent; @@ -48,9 +46,9 @@ private GuiHUDHandler() { register(new InspectionHUD()); } - private final List overlays = new ArrayList<>(); + private final ObjectArray overlays = new ObjectArray<>(1); - public void register(final GuiOverlay overlay) { + public void register(final IGuiOverlay overlay) { this.overlays.add(overlay); } @@ -68,14 +66,12 @@ public static void unregister() { @SubscribeEvent(priority = EventPriority.HIGH) public void onRenderGameOverlayEvent(final RenderGameOverlayEvent.Pre event) { - for (int i = 0; i < this.overlays.size(); i++) - this.overlays.get(i).doRender(event); + this.overlays.forEach(o -> o.doRender(event)); } @SubscribeEvent(priority = EventPriority.HIGH) public void onRenderGameOverlayEvent(final RenderGameOverlayEvent.Post event) { - for (int i = 0; i < this.overlays.size(); i++) - this.overlays.get(i).doRender(event); + this.overlays.forEach(o -> o.doRender(event)); } @SubscribeEvent @@ -90,8 +86,6 @@ public void playerTick(final TickEvent.PlayerTickEvent event) { return; final int tickRef = EnvironState.getTickCounter(); - for (int i = 0; i < this.overlays.size(); i++) - this.overlays.get(i).doTick(tickRef); - + this.overlays.forEach(o -> o.doTick(tickRef)); } } diff --git a/src/main/java/org/orecruncher/dsurround/client/hud/GuiOverlay.java b/src/main/java/org/orecruncher/dsurround/client/hud/GuiOverlay.java deleted file mode 100644 index 0cf5ad9d1..000000000 --- a/src/main/java/org/orecruncher/dsurround/client/hud/GuiOverlay.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * This file is part of Dynamic Surroundings, licensed under the MIT License (MIT). - * - * Copyright (c) OreCruncher - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -package org.orecruncher.dsurround.client.hud; - -import net.minecraft.client.gui.Gui; -import net.minecraft.client.renderer.BufferBuilder; -import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.vertex.DefaultVertexFormats; -import net.minecraftforge.client.event.RenderGameOverlayEvent; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public abstract class GuiOverlay extends Gui { - - /* - * Override to provide pre render logic. - */ - public void doRender(final RenderGameOverlayEvent.Pre event) { - } - - /* - * Override to provide post render logic - */ - public void doRender(final RenderGameOverlayEvent.Post event) { - } - - /* - * Override if the overlay needs to be ticked during the client tick phase. - */ - public void doTick(final int tickRef) { - - } - - @Override - protected void drawGradientRect(int left, int top, int right, int bottom, int startColor, int endColor) { - final float zLevel = 0.0F; - - final float f = (startColor >> 24 & 255) / 255.0F; - final float f1 = (startColor >> 16 & 255) / 255.0F; - final float f2 = (startColor >> 8 & 255) / 255.0F; - final float f3 = (startColor & 255) / 255.0F; - final float f4 = (endColor >> 24 & 255) / 255.0F; - final float f5 = (endColor >> 16 & 255) / 255.0F; - final float f6 = (endColor >> 8 & 255) / 255.0F; - final float f7 = (endColor & 255) / 255.0F; - GlStateManager.disableTexture2D(); - GlStateManager.enableBlend(); - GlStateManager.disableAlpha(); - GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); - GlStateManager.shadeModel(7425); - final Tessellator tessellator = Tessellator.getInstance(); - final BufferBuilder t = tessellator.getBuffer(); - t.begin(7, DefaultVertexFormats.POSITION_COLOR); - t.pos(left + right, top, zLevel).color(f1, f2, f3, f).endVertex(); - t.pos(left, top, zLevel).color(f1, f2, f3, f).endVertex(); - t.pos(left, top + bottom, zLevel).color(f5, f6, f7, f4).endVertex(); - t.pos(left + right, top + bottom, zLevel).color(f5, f6, f7, f4).endVertex(); - tessellator.draw(); - GlStateManager.shadeModel(7424); - GlStateManager.disableBlend(); - GlStateManager.enableAlpha(); - GlStateManager.enableTexture2D(); - } - - protected void drawTooltipBox(int x, int y, int w, int h, int bg, int grad1, int grad2) { - drawGradientRect(x + 1, y, w - 1, 1, bg, bg); - drawGradientRect(x + 1, y + h, w - 1, 1, bg, bg); - drawGradientRect(x, y + 1, 1, h - 1, bg, bg); - drawGradientRect(x + w, y + 1, 1, h - 1, bg, bg); - drawGradientRect(x + 1, y + 2, 1, h - 3, grad1, grad2); - drawGradientRect(x + w - 1, y + 2, 1, h - 3, grad1, grad2); - drawGradientRect(x + 1, y + 1, w - 1, 1, grad1, grad1); - drawGradientRect(x + 1, y + h - 1, w - 1, 1, grad2, grad2); - } -} \ No newline at end of file diff --git a/src/main/java/org/orecruncher/dsurround/client/hud/IGuiOverlay.java b/src/main/java/org/orecruncher/dsurround/client/hud/IGuiOverlay.java new file mode 100644 index 000000000..33cd62537 --- /dev/null +++ b/src/main/java/org/orecruncher/dsurround/client/hud/IGuiOverlay.java @@ -0,0 +1,51 @@ +/* + * This file is part of Dynamic Surroundings, licensed under the MIT License (MIT). + * + * Copyright (c) OreCruncher + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +package org.orecruncher.dsurround.client.hud; + +import net.minecraftforge.client.event.RenderGameOverlayEvent; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public interface IGuiOverlay { + + /* + * Override to provide pre render logic. + */ + default void doRender(final RenderGameOverlayEvent.Pre event) { + } + + /* + * Override to provide post render logic + */ + default public void doRender(final RenderGameOverlayEvent.Post event) { + } + + /* + * Override if the overlay needs to be ticked during the client tick phase. + */ + default public void doTick(final int tickRef) { + } +} \ No newline at end of file diff --git a/src/main/java/org/orecruncher/dsurround/client/hud/InspectionHUD.java b/src/main/java/org/orecruncher/dsurround/client/hud/InspectionHUD.java index 92e0cef68..19cb86b34 100644 --- a/src/main/java/org/orecruncher/dsurround/client/hud/InspectionHUD.java +++ b/src/main/java/org/orecruncher/dsurround/client/hud/InspectionHUD.java @@ -52,6 +52,7 @@ import net.minecraft.block.SoundType; import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Gui; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityList; import net.minecraft.init.Items; @@ -70,7 +71,7 @@ import net.minecraftforge.oredict.OreDictionary; @SideOnly(Side.CLIENT) -public class InspectionHUD extends GuiOverlay { +public class InspectionHUD extends Gui implements IGuiOverlay { private static final String TEXT_BLOCKSTATE = TextFormatting.DARK_PURPLE + ""; private static final String TEXT_FOOTSTEP_ACOUSTICS = TextFormatting.DARK_PURPLE + ""; diff --git a/src/main/java/org/orecruncher/dsurround/client/sound/SoundBuilder.java b/src/main/java/org/orecruncher/dsurround/client/sound/SoundBuilder.java index 6f644bbb0..b81a4397e 100644 --- a/src/main/java/org/orecruncher/dsurround/client/sound/SoundBuilder.java +++ b/src/main/java/org/orecruncher/dsurround/client/sound/SoundBuilder.java @@ -24,8 +24,7 @@ import javax.annotation.Nonnull; -import org.orecruncher.lib.compat.PositionedSoundUtil; - +import org.orecruncher.dsurround.mixins.IPositionedSoundMixin; import net.minecraft.client.audio.PositionedSound; import net.minecraft.util.SoundCategory; import net.minecraft.util.SoundEvent; @@ -47,8 +46,10 @@ public SoundBuilder from(@Nonnull final PositionedSound ps) { this.sound.setCategory(ps.getCategory()); this.sound.setPosition(ps.getXPosF(), ps.getYPosF(), ps.getZPosF()); this.sound.setAttenuationType(ps.getAttenuationType()); - this.sound.setVolume(PositionedSoundUtil.getVolume(ps)); - this.sound.setPitch(PositionedSoundUtil.getPitch(ps)); + + final IPositionedSoundMixin sound = (IPositionedSoundMixin) ps; + this.sound.setVolume(sound.getVolumeRaw()); + this.sound.setPitch(sound.getPitchRaw()); return this; } diff --git a/src/main/java/org/orecruncher/dsurround/client/sound/SoundEngine.java b/src/main/java/org/orecruncher/dsurround/client/sound/SoundEngine.java index 928f7098e..9ab9676c9 100644 --- a/src/main/java/org/orecruncher/dsurround/client/sound/SoundEngine.java +++ b/src/main/java/org/orecruncher/dsurround/client/sound/SoundEngine.java @@ -54,7 +54,6 @@ import it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet; import net.minecraft.client.Minecraft; import net.minecraft.client.audio.ISound; -import net.minecraft.client.audio.SoundHandler; import net.minecraft.client.audio.SoundManager; import net.minecraft.client.audio.SoundRegistry; import net.minecraft.client.settings.GameSettings; @@ -74,58 +73,28 @@ import paulscode.sound.SoundSystemConfig; import paulscode.sound.Source; + +import org.orecruncher.dsurround.mixins.ISoundHandlerMixin; +import org.orecruncher.dsurround.mixins.ISoundManagerMixin; +import org.orecruncher.dsurround.mixins.ISoundSystemMixin; + @EventBusSubscriber(value = Side.CLIENT, modid = ModInfo.MOD_ID) public final class SoundEngine { //@formatter:off - private static final ObjectField getSoundManager = - new ObjectField<>( - SoundHandler.class, - "sndManager", - "field_147694_f" - ); - private static final ObjectField getSoundRegistry = - new ObjectField<>( - SoundHandler.class, - "soundRegistry", - "field_147697_e" - ); + // Can't mixin for now due to private class usage private static final ObjectField getSoundSystem = - new ObjectField<>( - SoundManager.class, - "sndSystem", - "field_148620_e" - ); - private static final ObjectField> getPlayingSounds = - new ObjectField<>( - SoundManager.class, - "playingSounds", - "field_148629_h" - ); - private static final ObjectField> getPlayingSoundsInv = - new ObjectField<>( - SoundManager.class, - "invPlayingSounds", - "field_148630_i" - ); - private static final ObjectField> getDelayedSounds = - new ObjectField<>( - SoundManager.class, - "delayedSounds", - "field_148626_m" - ); - private static final ObjectField getSoundLibrary = - new ObjectField<>( - SoundSystem.class, - "soundLibrary", - null - ); + new ObjectField<>( + SoundManager.class, + "sndSystem", + "field_148620_e" + ); private static final BooleanField removed = - new BooleanField<>( - Source.class, - "removed", - null - ); + new BooleanField<>( + Source.class, + "removed", + null + ); private static final FloatField soundPhysicsGlobalVolume = new FloatField<>( "com.sonicether.soundphysics.SoundPhysics", @@ -166,7 +135,7 @@ private SoundEngine() { */ @Nonnull public SoundRegistry getSoundRegistry() { - return getSoundRegistry.get(Minecraft.getMinecraft().getSoundHandler()); + return ((ISoundHandlerMixin)(Minecraft.getMinecraft().getSoundHandler())).getSoundRegistry(); } /** @@ -176,7 +145,7 @@ public SoundRegistry getSoundRegistry() { */ @Nonnull public SoundManager getSoundManager() { - return getSoundManager.get(Minecraft.getMinecraft().getSoundHandler()); + return ((ISoundHandlerMixin)(Minecraft.getMinecraft().getSoundHandler())).getSoundManager(); } private int currentSoundCount() { @@ -196,19 +165,19 @@ private SoundSystem getSoundSystem() { } private Library getSoundLibrary() { - return getSoundLibrary.get(getSoundSystem()); + return ((ISoundSystemMixin)getSoundSystem()).getSoundLibrary(); } private Map getPlayingSounds() { - return getPlayingSounds.get(getSoundManager()); + return ((ISoundManagerMixin)getSoundManager()).getPlayingSounds(); } private Map getPlayingSoundsInv() { - return getPlayingSoundsInv.get(getSoundManager()); + return ((ISoundManagerMixin)getSoundManager()).getPlayingSoundsInv(); } private Map getDelayedSounds() { - return getDelayedSounds.get(getSoundManager()); + return ((ISoundManagerMixin)getSoundManager()).getDelayedSounds(); } /** diff --git a/src/main/java/org/orecruncher/dsurround/mixins/IPositionedSoundMixin.java b/src/main/java/org/orecruncher/dsurround/mixins/IPositionedSoundMixin.java new file mode 100644 index 000000000..1a557e22c --- /dev/null +++ b/src/main/java/org/orecruncher/dsurround/mixins/IPositionedSoundMixin.java @@ -0,0 +1,39 @@ +/* + * This file is part of Dynamic Surroundings, licensed under the MIT License (MIT). + * + * Copyright (c) OreCruncher + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package org.orecruncher.dsurround.mixins; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.gen.Accessor; + +import net.minecraft.client.audio.PositionedSound; + +@Mixin(PositionedSound.class) +public interface IPositionedSoundMixin { + + @Accessor("volume") + float getVolumeRaw(); + + @Accessor("pitch") + float getPitchRaw(); +} diff --git a/src/main/java/org/orecruncher/dsurround/mixins/ISoundHandlerMixin.java b/src/main/java/org/orecruncher/dsurround/mixins/ISoundHandlerMixin.java new file mode 100644 index 000000000..ef61cd8df --- /dev/null +++ b/src/main/java/org/orecruncher/dsurround/mixins/ISoundHandlerMixin.java @@ -0,0 +1,42 @@ +/* + * This file is part of Dynamic Surroundings, licensed under the MIT License (MIT). + * + * Copyright (c) OreCruncher + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package org.orecruncher.dsurround.mixins; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.gen.Accessor; + +import net.minecraft.client.audio.SoundHandler; +import net.minecraft.client.audio.SoundManager; +import net.minecraft.client.audio.SoundRegistry; + +@Mixin(SoundHandler.class) +public interface ISoundHandlerMixin { + + @Accessor("sndManager") + SoundManager getSoundManager(); + + @Accessor("soundRegistry") + SoundRegistry getSoundRegistry(); + +} diff --git a/src/main/java/org/orecruncher/dsurround/mixins/ISoundManagerMixin.java b/src/main/java/org/orecruncher/dsurround/mixins/ISoundManagerMixin.java new file mode 100644 index 000000000..8c3d79c56 --- /dev/null +++ b/src/main/java/org/orecruncher/dsurround/mixins/ISoundManagerMixin.java @@ -0,0 +1,46 @@ +/* + * This file is part of Dynamic Surroundings, licensed under the MIT License (MIT). + * + * Copyright (c) OreCruncher + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package org.orecruncher.dsurround.mixins; + +import java.util.Map; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.gen.Accessor; + +import net.minecraft.client.audio.ISound; +import net.minecraft.client.audio.SoundManager; + +@Mixin(SoundManager.class) +public interface ISoundManagerMixin { + + @Accessor("playingSounds") + Map getPlayingSounds(); + + @Accessor("invPlayingSounds") + Map getPlayingSoundsInv(); + + @Accessor("delayedSounds") + Map getDelayedSounds(); + +} diff --git a/src/main/java/org/orecruncher/dsurround/mixins/ISoundSystemMixin.java b/src/main/java/org/orecruncher/dsurround/mixins/ISoundSystemMixin.java new file mode 100644 index 000000000..cc9e9b2ae --- /dev/null +++ b/src/main/java/org/orecruncher/dsurround/mixins/ISoundSystemMixin.java @@ -0,0 +1,38 @@ +/* + * This file is part of Dynamic Surroundings, licensed under the MIT License (MIT). + * + * Copyright (c) OreCruncher + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package org.orecruncher.dsurround.mixins; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.gen.Accessor; + +import paulscode.sound.Library; +import paulscode.sound.SoundSystem; + +@Mixin(SoundSystem.class) +public interface ISoundSystemMixin { + + @Accessor(value = "soundLibrary", remap = false) + Library getSoundLibrary(); + +} diff --git a/src/main/java/org/orecruncher/dsurround/mixins/MixinGuiConfig.java b/src/main/java/org/orecruncher/dsurround/mixins/MixinGuiConfig.java new file mode 100644 index 000000000..db7410f98 --- /dev/null +++ b/src/main/java/org/orecruncher/dsurround/mixins/MixinGuiConfig.java @@ -0,0 +1,50 @@ +/* + * This file is part of Dynamic Surroundings, licensed under the MIT License (MIT). + * + * Copyright (c) OreCruncher + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package org.orecruncher.dsurround.mixins; + +import org.orecruncher.dsurround.ModOptions; +import org.orecruncher.dsurround.client.gui.GuiFilteredConfigEntries; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Redirect; + +import net.minecraft.client.Minecraft; +import net.minecraftforge.fml.client.config.GuiConfig; +import net.minecraftforge.fml.client.config.GuiConfigEntries; + +@Mixin(GuiConfig.class) +public class MixinGuiConfig { + + //@formatter:off + @Redirect( + method = "*", + at = @At(value = "NEW", target = "(Lnet/minecraftforge/fml/client/config/GuiConfig;Lnet/minecraft/client/Minecraft;)Lnet/minecraftforge/fml/client/config/GuiConfigEntries;") + ) + //@formatter:on + public GuiConfigEntries constructEntries(GuiConfig parent, Minecraft mc) { + if (ModOptions.asm.enableOptionSearchASM) + return new GuiFilteredConfigEntries(parent, mc); + return new GuiConfigEntries(parent, mc); + } +} diff --git a/src/main/java/org/orecruncher/dsurround/mixins/MixinSoundManager.java b/src/main/java/org/orecruncher/dsurround/mixins/MixinSoundManager.java index 4d4e1ff88..252fe333a 100644 --- a/src/main/java/org/orecruncher/dsurround/mixins/MixinSoundManager.java +++ b/src/main/java/org/orecruncher/dsurround/mixins/MixinSoundManager.java @@ -25,21 +25,28 @@ import org.orecruncher.dsurround.client.sound.SoundEngine; import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Overwrite; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; +import net.minecraft.client.Minecraft; import net.minecraft.client.audio.ISound; import net.minecraft.client.audio.SoundManager; +import net.minecraft.client.gui.GuiScreen; +import net.minecraftforge.fml.client.GuiErrorBase; @Mixin(SoundManager.class) public abstract class MixinSoundManager { - @Overwrite - private float getClampedVolume(ISound sound) { - try { - return SoundEngine.getClampedVolume(sound); - } catch (final Exception ex) { - + @Inject(method = "getClampedVolume(Lnet/minecraft/client/audio/ISound;)F", at = @At("HEAD"), cancellable = true) + private void getClampedVolume(ISound sound, CallbackInfoReturnable ci) { + final GuiScreen current = Minecraft.getMinecraft().currentScreen; + if (!(current instanceof GuiErrorBase)) { + try { + ci.setReturnValue(SoundEngine.getClampedVolume(sound)); + } catch (final Exception ex) { + + } } - return 1.0F; } } diff --git a/src/main/java/org/orecruncher/dsurround/proxy/IProxy.java b/src/main/java/org/orecruncher/dsurround/proxy/IProxy.java new file mode 100644 index 000000000..b55333d41 --- /dev/null +++ b/src/main/java/org/orecruncher/dsurround/proxy/IProxy.java @@ -0,0 +1,51 @@ +package org.orecruncher.dsurround.proxy; + +import javax.annotation.Nonnull; + +import net.minecraft.util.IThreadListener; +import net.minecraftforge.fml.common.event.FMLInitializationEvent; +import net.minecraftforge.fml.common.event.FMLLoadCompleteEvent; +import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; +import net.minecraftforge.fml.common.event.FMLServerAboutToStartEvent; +import net.minecraftforge.fml.common.event.FMLServerStartingEvent; +import net.minecraftforge.fml.common.event.FMLServerStoppedEvent; +import net.minecraftforge.fml.common.event.FMLServerStoppingEvent; +import net.minecraftforge.fml.common.network.FMLNetworkEvent.ClientConnectedToServerEvent; +import net.minecraftforge.fml.common.network.FMLNetworkEvent.ClientDisconnectionFromServerEvent; +import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; +import net.minecraftforge.fml.relauncher.Side; + +public interface IProxy { + + boolean isRunningAsServer(); + + Side effectiveSide(); + + // General methods that are side agnostic + default void preInit(@Nonnull final FMLPreInitializationEvent event) { } + + default void init(@Nonnull final FMLInitializationEvent event) { } + + default void postInit(@Nonnull final FMLPostInitializationEvent event) { } + + default void loadCompleted(@Nonnull final FMLLoadCompleteEvent event) { } + + // Client side specific event handlers + default void clientConnect(@Nonnull final ClientConnectedToServerEvent event) { } + + default void clientDisconnect(@Nonnull final ClientDisconnectionFromServerEvent event) { } + + // Server side specific event handlers + default void serverAboutToStart(@Nonnull final FMLServerAboutToStartEvent event) { } + + default void serverStarting(@Nonnull final FMLServerStartingEvent event) { } + + default void serverStopping(@Nonnull final FMLServerStoppingEvent event) { } + + default void serverStopped(@Nonnull final FMLServerStoppedEvent event) { } + + // Get the correct worker queue for the side + IThreadListener getThreadListener(@Nonnull final MessageContext context); + +} diff --git a/src/main/java/org/orecruncher/dsurround/proxy/Proxy.java b/src/main/java/org/orecruncher/dsurround/proxy/Proxy.java index 27e98f919..fff982ecf 100644 --- a/src/main/java/org/orecruncher/dsurround/proxy/Proxy.java +++ b/src/main/java/org/orecruncher/dsurround/proxy/Proxy.java @@ -44,18 +44,14 @@ import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLLoadCompleteEvent; -import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.event.FMLServerAboutToStartEvent; import net.minecraftforge.fml.common.event.FMLServerStartingEvent; import net.minecraftforge.fml.common.event.FMLServerStoppedEvent; -import net.minecraftforge.fml.common.event.FMLServerStoppingEvent; -import net.minecraftforge.fml.common.network.FMLNetworkEvent.ClientConnectedToServerEvent; -import net.minecraftforge.fml.common.network.FMLNetworkEvent.ClientDisconnectionFromServerEvent; import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; import net.minecraftforge.fml.relauncher.Side; -public class Proxy { +public class Proxy implements IProxy { protected void registerLanguage() { Localization.initialize(Side.SERVER, ModInfo.MOD_ID); @@ -92,22 +88,10 @@ public void init(@Nonnull final FMLInitializationEvent event) { Network.initialize(); } - public void postInit(@Nonnull final FMLPostInitializationEvent event) { - // Intentionally left blank - } - public void loadCompleted(@Nonnull final FMLLoadCompleteEvent event) { RegistryManager.initialize(); } - public void clientConnect(@Nonnull final ClientConnectedToServerEvent event) { - // NOTHING SHOULD BE HERE - OVERRIDE IN ProxyClient! - } - - public void clientDisconnect(@Nonnull final ClientDisconnectionFromServerEvent event) { - // NOTHING SHOULD BE HERE - OVERRIDE IN ProxyClient! - } - public void serverAboutToStart(@Nonnull final FMLServerAboutToStartEvent event) { ServiceManager.initialize(); } @@ -119,20 +103,10 @@ public void serverStarting(@Nonnull final FMLServerStartingEvent event) { serverCommand.registerCommand(new CommandDS()); } - public void serverStopping(@Nonnull final FMLServerStoppingEvent event) { - // Intentionally left blank - } - public void serverStopped(@Nonnull final FMLServerStoppedEvent event) { ServiceManager.deinitialize(); } - /** - * Force a proxy to pick a side in this fight - * - * @param context - * @return - */ public IThreadListener getThreadListener(@Nonnull final MessageContext context) { if (context.side.isServer()) { return context.getServerHandler().player.getServer(); diff --git a/src/main/java/org/orecruncher/dsurround/proxy/ProxyClient.java b/src/main/java/org/orecruncher/dsurround/proxy/ProxyClient.java index 9d70d058f..a8710de78 100644 --- a/src/main/java/org/orecruncher/dsurround/proxy/ProxyClient.java +++ b/src/main/java/org/orecruncher/dsurround/proxy/ProxyClient.java @@ -79,7 +79,7 @@ import net.minecraftforge.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) -public class ProxyClient extends Proxy implements ISelectiveResourceReloadListener { +public class ProxyClient extends Proxy implements IProxy, ISelectiveResourceReloadListener { @Override protected void registerLanguage() { @@ -98,8 +98,6 @@ protected void eventBusRegistrations() { register(Weather.class); register(WorldEventDetector.class); register(ParticleCollections.class); - - MinecraftForge.EVENT_BUS.register(this); } @Override diff --git a/src/main/java/org/orecruncher/dsurround/registry/acoustics/AcousticRegistry.java b/src/main/java/org/orecruncher/dsurround/registry/acoustics/AcousticRegistry.java index 4179198e7..5d6b59d75 100644 --- a/src/main/java/org/orecruncher/dsurround/registry/acoustics/AcousticRegistry.java +++ b/src/main/java/org/orecruncher/dsurround/registry/acoustics/AcousticRegistry.java @@ -77,33 +77,42 @@ public class AcousticRegistry extends Registry { static { // No macros in this list! - materialProfiles.put(Material.ANVIL, "metalcompressed,hardmetal"); - materialProfiles.put(Material.CACTUS, "grass"); - materialProfiles.put(Material.CAKE, "organic"); - materialProfiles.put(Material.CARPET, "rug"); - materialProfiles.put(Material.CIRCUITS, "stoneutility"); - materialProfiles.put(Material.CLAY, "dirt"); - materialProfiles.put(Material.CLOTH, "rug"); - materialProfiles.put(Material.CRAFTED_SNOW, "snow"); - materialProfiles.put(Material.GLASS, "glass"); - materialProfiles.put(Material.GOURD, "organic_dry"); + materialProfiles.put(Material.AIR, "NOT_EMITTER"); materialProfiles.put(Material.GRASS, "grass"); materialProfiles.put(Material.GROUND, "dirt"); - materialProfiles.put(Material.ICE, "ice"); + materialProfiles.put(Material.WOOD, "wood"); + materialProfiles.put(Material.ROCK, "stone"); materialProfiles.put(Material.IRON, "hardmetal"); + materialProfiles.put(Material.ANVIL, "metalcompressed,hardmetal"); + materialProfiles.put(Material.WATER, "NOT_EMITTER"); + materialProfiles.put(Material.LAVA, "NOT_EMITTER"); materialProfiles.put(Material.LEAVES, "leaves"); - materialProfiles.put(Material.PACKED_ICE, "ice"); - materialProfiles.put(Material.PISTON, "stonemachine"); - materialProfiles.put(Material.REDSTONE_LIGHT, "NOT_EMITTER"); - materialProfiles.put(Material.ROCK, "stone"); - materialProfiles.put(Material.SAND, "sand"); - materialProfiles.put(Material.SNOW, "snow"); + materialProfiles.put(Material.PLANTS, "brush"); + materialProfiles.put(Material.VINE, "leaves"); materialProfiles.put(Material.SPONGE, "organic_dry"); + materialProfiles.put(Material.CLOTH, "rug"); + materialProfiles.put(Material.FIRE, "NOT_EMITTER"); + materialProfiles.put(Material.SAND, "sand"); + materialProfiles.put(Material.CIRCUITS, "stoneutility"); + materialProfiles.put(Material.CARPET, "rug"); + materialProfiles.put(Material.GLASS, "glass"); + materialProfiles.put(Material.REDSTONE_LIGHT, "NOT_EMITTER"); materialProfiles.put(Material.TNT, "equipment"); - materialProfiles.put(Material.VINE, "leaves"); + materialProfiles.put(Material.CORAL, "NOT_EMITTER"); + materialProfiles.put(Material.ICE, "ice"); + materialProfiles.put(Material.PACKED_ICE, "ice"); + materialProfiles.put(Material.SNOW, "snow"); + materialProfiles.put(Material.CRAFTED_SNOW, "snow"); + materialProfiles.put(Material.CACTUS, "grass"); + materialProfiles.put(Material.CLAY, "dirt"); + materialProfiles.put(Material.GOURD, "organic_dry"); + materialProfiles.put(Material.DRAGON_EGG, "obsidian"); + materialProfiles.put(Material.PORTAL, "NOT_EMITTER"); + materialProfiles.put(Material.CAKE, "organic"); materialProfiles.put(Material.WEB, "NOT_EMITTER"); - materialProfiles.put(Material.WOOD, "wood"); - materialProfiles.put(Material.FIRE, "NOT_EMITTER"); + materialProfiles.put(Material.PISTON, "stonemachine"); + materialProfiles.put(Material.BARRIER, "glass"); + materialProfiles.put(Material.STRUCTURE_VOID, "NOT_EMITTER"); } /* @@ -197,7 +206,7 @@ public IAcoustic[] resolvePrimitive(@Nonnull final IBlockState state) { IAcoustic[] acoustics = null; - // If we don't have a step sound, or the sound belongs to Minecraft + // If we don't have a step sound, or the sound belongs to Minecraft, // resolve based on material. This lets modded sounds through, like // for Chisel's Laboratory blocks. // diff --git a/src/main/resources/assets/dsurround/lang/en_us.lang b/src/main/resources/assets/dsurround/lang/en_us.lang index dfce39328..d34d3248d 100644 --- a/src/main/resources/assets/dsurround/lang/en_us.lang +++ b/src/main/resources/assets/dsurround/lang/en_us.lang @@ -54,17 +54,22 @@ dsurround.msg.ThunderThresholdSet=§9Thunder threshold set to %1$s dsurround.msg.NewVersion=["§6Update Available: §9[",{"text":"§2%1$s §ev%2$s§f","color":"gold","hoverEvent":{"action":"show_text","value":{"text":"Click for CurseForge Project Page","color":"aqua"}},"clickEvent":{"action":"open_url","value":"%3$s"}},"§9]"] # Configuration option strings -dsurround.cfg.asm.cat.ASM=ASM Transformer Options -dsurround.cfg.asm.cat.ASM.tooltip=Controls ASM transforms Dynamic Surroundings performs at startup +dsurround.cfg.individual=Individual Sound Configuration +dsurround.cfg.individual.tooltip=Options to configure sounds on an individual basis + +dsurround.cfg.asm=ASM Transformer Options +dsurround.cfg.asm.tooltip=Controls ASM transforms Dynamic Surroundings performs at startup dsurround.cfg.asm.EnableWeather=Weather Control dsurround.cfg.asm.EnableWeather.tooltip=Enable/disable ASM transformations to permit weather (rain, snow, splash, dust storms, auroras) dsurround.cfg.asm.DisableArrow=Arrow Particle Trail dsurround.cfg.asm.DisableArrow.tooltip=Disable particle trail left by an arrow when it flies dsurround.cfg.asm.DisablePotionIcons=Disable Inventory Potion Icons dsurround.cfg.asm.DisablePotionIcons.tooltip=Disables the rendering of potion effects in the inventory GUI +dsurround.cfg.asm.EnableOptionSearch=Enable Search Option in Configuration +dsurround.cfg.asm.EnableOptionSearch.tooltip=Enables the search filter textbox in mod configuration options -dsurround.cfg.logging.cat.Logging=Logging Options -dsurround.cfg.logging.cat.Logging.tooltip=Defines how Dynamic Surroundings logging will behave +dsurround.cfg.logging=Logging Options +dsurround.cfg.logging.tooltip=Defines how Dynamic Surroundings logging will behave dsurround.cfg.logging.EnableDebug=Debug Logging dsurround.cfg.logging.EnableDebug.tooltip=Enables/disables debug logging of the mod dsurround.cfg.logging.VersionCheck=Online Version Check Result @@ -74,8 +79,8 @@ dsurround.cfg.logging.ServerStats.tooltip=Enables/disables reporting of server s dsurround.cfg.logging.FlagMask=Debug Flag Mask dsurround.cfg.logging.FlagMask.tooltip=Bitmask for toggling various debug traces -dsurround.cfg.rain.cat.Rain=Rain Options -dsurround.cfg.rain.cat.Rain.tooltip=Options that control rain effects in the client +dsurround.cfg.rain=Rain Options +dsurround.cfg.rain.tooltip=Options that control rain effects in the client dsurround.cfg.rain.RippleStyle=Style of rain water ripple dsurround.cfg.rain.RippleStyle.tooltip=0: original round, 1: darker round, 2: square, 3: pixelated dsurround.cfg.rain.RainVolume=Rain Sound Level @@ -95,8 +100,8 @@ dsurround.cfg.rain.UseVanillaSound.tooltip=Use the Vanilla rain sound rather tha dsurround.cfg.rain.EnableMagmaNetherrack=Enable Netherrack and Magma Splash Effect dsurround.cfg.rain.EnableMagmaNetherrack.tooltip=Enables/disables the lava particle effect on Netherrack and Magma blocks when raining -dsurround.cfg.fog.cat.Fog=Fog Options -dsurround.cfg.fog.cat.Fog.tooltip=Options that control the various fog effects in the client +dsurround.cfg.fog=Fog Options +dsurround.cfg.fog.tooltip=Options that control the various fog effects in the client dsurround.cfg.fog.Enable=Enable Fog Processing dsurround.cfg.fog.Enable.tooltip=Enable/disable fog processing dsurround.cfg.fog.EnableMorning=Morning Fog @@ -114,8 +119,8 @@ dsurround.cfg.fog.ElevationHaze.tooltip=Higher the player elevation the more haz dsurround.cfg.fog.BiomeFog=Biome Fog dsurround.cfg.fog.BiomeFog.tooltip=Enable biome specific fog density and color -dsurround.cfg.general.cat.General=General Options -dsurround.cfg.general.cat.General.tooltip=Miscellaneous settings +dsurround.cfg.general=General Options +dsurround.cfg.general.tooltip=Miscellaneous settings dsurround.cfg.general.HideChat=Hide Chat Notices dsurround.cfg.general.HideChat.tooltip=Toggles display of Dynamic Surroundings chat notices dsurround.cfg.general.ExternalScripts=External Configuration Files @@ -125,8 +130,8 @@ dsurround.cfg.general.StartupSounds.tooltip=Possible sounds to play when client dsurround.cfg.general.ChunkCaching=Enable Client Chunk Caching dsurround.cfg.general.ChunkCaching.tooltip=Enable/disable client side chunk caching for performance -dsurround.cfg.aurora.cat.Aurora=Aurora Options -dsurround.cfg.aurora.cat.Aurora.tooltip=Options that control Aurora behavior and rendering +dsurround.cfg.aurora=Aurora Options +dsurround.cfg.aurora.tooltip=Options that control Aurora behavior and rendering dsurround.cfg.aurora.EnableAurora=Auroras dsurround.cfg.aurora.EnableAurora.tooltip=Enable/disable Aurora processing on server/client dsurround.cfg.aurora.EnableShader=Use Shaders @@ -134,8 +139,8 @@ dsurround.cfg.aurora.EnableShader.tooltip=Use shader when rendering aurora dsurround.cfg.aurora.MaxBands=Maximum Bands dsurround.cfg.aurora.MaxBands.tooltip=Cap the maximum bands that will be rendered -dsurround.cfg.biomes.cat.Biomes=Biome Options -dsurround.cfg.biomes.cat.Biomes.tooltip=Options for controlling biome sound/effects +dsurround.cfg.biomes=Biome Options +dsurround.cfg.biomes.tooltip=Options for controlling biome sound/effects dsurround.cfg.biomes.Sealevel=Overworld Sealevel Override dsurround.cfg.biomes.Sealevel.tooltip=Sealevel to set for Overworld (0 use default for World) dsurround.cfg.biomes.Aliases=Biomes Alias @@ -143,8 +148,8 @@ dsurround.cfg.biomes.Aliases.tooltip=Biomes alias list dsurround.cfg.biomes.DimBlacklist=Dimension Blacklist dsurround.cfg.biomes.DimBlacklist.tooltip=Dimension IDs where biome sounds will not be played -dsurround.cfg.effects.cat.Effects=Effect Options -dsurround.cfg.effects.cat.Effects.tooltip=Options for controlling various effects +dsurround.cfg.effects=Effect Options +dsurround.cfg.effects.tooltip=Options for controlling various effects dsurround.cfg.effects.WaterfallCutoff=Waterfall Cutoff dsurround.cfg.effects.WaterfallCutoff.tooltip=Waterfall strength below which sounds will not play dsurround.cfg.effects.FXRange=Special Effect Range @@ -176,8 +181,8 @@ dsurround.cfg.effects.FootprintStyle.tooltip=0: shoe print, 1: square print, 2: dsurround.cfg.effects.ShowBreath=Show Frost Breath dsurround.cfg.effects.ShowBreath.tooltip=Show entity frost breath in cold weather -dsurround.cfg.sound.cat.Sound=Sound Options -dsurround.cfg.sound.cat.Sound.tooltip=General options for defining sound effects +dsurround.cfg.sound=Sound Options +dsurround.cfg.sound.tooltip=General options for defining sound effects dsurround.cfg.sound.BiomeSounds=Biome Sounds dsurround.cfg.sound.BiomeSounds.tooltip=Enable/disable biome background and spot sounds dsurround.cfg.sound.AutoConfig=Auto-configure Sound Channels @@ -219,8 +224,8 @@ dsurround.cfg.sound.SoundSettings.tooltip=Configure how each sound will be handl dsurround.cfg.sound.BattleMusic=Battle Music dsurround.cfg.sound.BattleMusic.tooltip=Enable/disable playing of Battle Music when in combat -dsurround.cfg.player.cat.Player=Player Options -dsurround.cfg.player.cat.Player.tooltip=General options for defining sound and effects the player entity +dsurround.cfg.player=Player Options +dsurround.cfg.player.tooltip=General options for defining sound and effects the player entity dsurround.cfg.player.PotionParticles=Suppress Potion Particles dsurround.cfg.player.PotionParticles.tooltip=Suppress player's potion particles from rendering dsurround.cfg.player.HurtThreshold=Hurt Threshold @@ -228,56 +233,8 @@ dsurround.cfg.player.HurtThreshold.tooltip=Percentage of player health bar remai dsurround.cfg.player.HungerThreshold=Hunger Threshold dsurround.cfg.player.HungerThreshold.tooltip=Amount of food bar remaining to trigger player hunger sound (0 disable) -dsurround.cfg.huds.cat.Huds=HUDs and Overlays -dsurround.cfg.huds.cat.Huds.tooltip=Options to control various heads up displays and overlays - -dsurround.cfg.huds.potionHud.cat.PotionHud=Potion HUD Options -dsurround.cfg.huds.potionHud.cat.PotionHud.tooltip=Options for the Potion HUD overlay -dsurround.cfg.huds.potionHud.NoHUD=No Potion HUD -dsurround.cfg.huds.potionHud.NoHUD.tooltip=Disables Vanilla and Dynamic Surroundings potion HUD -dsurround.cfg.huds.potionHud.Enable=Potion HUD -dsurround.cfg.huds.potionHud.tooltip=Enable/disable display of potion icons in display -dsurround.cfg.huds.potionHud.Transparency=Transparency -dsurround.cfg.huds.potionHud.Transparency.tooltip=Transparency factor for icons (higher more solid) -dsurround.cfg.huds.potionHud.LeftOffset=Horizontal Offset -dsurround.cfg.huds.potionHud.LeftOffset.tooltip=Offset from left side of screen -dsurround.cfg.huds.potionHud.TopOffset=Vertical Offset -dsurround.cfg.huds.potionHud.TopOffset.tooltip=Offset from top of screen -dsurround.cfg.huds.potionHud.Scale=Display Scale -dsurround.cfg.huds.potionHud.Scale.tooltip=Size scale of icons (lower is smaller) -dsurround.cfg.huds.potionHud.Location=HUD Location -dsurround.cfg.huds.potionHud.Location.tooltip=Area of the display the Potion HUD is displayed (0 upper left, 1 upper right) - -dsurround.cfg.huds.lightlevel.cat.LightLevel=Light Level HUD Options -dsurround.cfg.huds.lightlevel.cat.LightLevel.tooltip=Options for configuring the Light Level HUD -dsurround.cfg.huds.lightlevel.Range=Block Range -dsurround.cfg.huds.lightlevel.Range.tooltip=Block range for light level analysis -dsurround.cfg.huds.lightlevel.MobSpawnThreshold=Mob Spawn Light Threshold -dsurround.cfg.huds.lightlevel.MobSpawnThreshold.tooltip=Light level at which mobs can spawn -dsurround.cfg.huds.lightlevel.HideSafe=Hide Safe Blocks -dsurround.cfg.huds.lightlevel.HideSafe.tooltip=Do not show light level for blocks where mobs will not spawn -dsurround.cfg.huds.lightlevel.IndicateCaution=Indicate Caution -dsurround.cfg.huds.lightlevel.IndicateCaution.tooltip=Indicate current light levels that will change at night which could result in mob spawns -dsurround.cfg.huds.lightlevel.Colors=Color Set -dsurround.cfg.huds.lightlevel.Colors.tooltip=0 bright, 1 dark -dsurround.cfg.huds.lightlevel.DisplayMode=Display Mode -dsurround.cfg.huds.lightlevel.DisplayMode.tooltip=0: block light, 1: block light + skylight - -dsurround.cfg.huds.compass.cat.Compass=Compass/Clock Options -dsurround.cfg.huds.compass.cat.Compass.tooltip=Options for configuring the Compass/Clock HUD -dsurround.cfg.huds.compass.Enable=Enable Compass HUD -dsurround.cfg.huds.compass.Enable.tooltip=Enable/disable the Compass HUD display -dsurround.cfg.huds.compass.ClockEnable=Enable Clock HUD -dsurround.cfg.huds.compass.ClockEnable.tooltip=Enable/disable the Clock HUD display -dsurround.cfg.huds.compass.Style=Compass Style -dsurround.cfg.huds.compass.Style.tooltip=The style of compass rendering -dsurround.cfg.huds.compass.Transparency=Compass HUD Transparency -dsurround.cfg.huds.compass.Transparency.tooltip=Transparency factor to apply when rendering the Compass HUD -dsurround.cfg.huds.compass.Format=Coord Format -dsurround.cfg.huds.compass.Format.tooltip=Format string for location coordinates - -dsurround.cfg.speech.cat.Speech=SpeechBubble Options -dsurround.cfg.speech.cat.Speech.tooltip=Options for configuring SpeechBubbles +dsurround.cfg.speech=SpeechBubble Options +dsurround.cfg.speech.tooltip=Options for configuring SpeechBubbles dsurround.cfg.speech.EnableSpeechBubbles=SpeechBubbles dsurround.cfg.speech.EnableSpeechBubbles.tooltip=Enables/disables speech bubbles above player heads dsurround.cfg.speech.EnableEntityChat=Entity Chat @@ -289,8 +246,8 @@ dsurround.cfg.speech.Range.tooltip=Range at which a SpeechBubble is visible. Fi dsurround.cfg.speech.AnimaniaBadges=Animania Badges dsurround.cfg.speech.AnimaniaBadges.tooltip=Enable/disable display of food/water badges over Animania mobs -dsurround.cfg.commands.cat.Commands=Command Options -dsurround.cfg.commands.cat.Commands.tooltip=Options for configuring Commands +dsurround.cfg.commands=Command Options +dsurround.cfg.commands.tooltip=Options for configuring Commands dsurround.cfg.commands.DS.Name=/ds Command Name dsurround.cfg.commands.DS.Name.tooltip=Name to give the /ds command dsurround.cfg.commands.DS.Alias=Alias to give the /ds command @@ -300,8 +257,8 @@ dsurround.cfg.commands.Calc.Name.tooltip=Name to give the /calc command dsurround.cfg.commands.Calc.Alias=Alias to give the /calc command dsurround.cfg.commands.Calc.Alias.tooltip=One or more alias names to give the /calc command (space separated) -dsurround.cfg.profiles.cat.Profiles=Built-in Profiles -dsurround.cfg.profiles.cat.Profiles.tooltip=Enable/disable built-in configuration profiles +dsurround.cfg.profiles=Built-in Profiles +dsurround.cfg.profiles.tooltip=Enable/disable built-in configuration profiles dsurround.season.format=%1$s %2$s dsurround.season.noseason=No Season diff --git a/src/main/resources/assets/dsurround/lang/ru_ru.lang b/src/main/resources/assets/dsurround/lang/ru_ru.lang index 0e690adae..b3c62ec68 100644 --- a/src/main/resources/assets/dsurround/lang/ru_ru.lang +++ b/src/main/resources/assets/dsurround/lang/ru_ru.lang @@ -54,15 +54,15 @@ dsurround.msg.ThunderThresholdSet=§9Порог грозы: %1$s dsurround.msg.NewVersion.dsurround=["§6Доступно обновление: §9[",{"text":"§2%1$s §ev%2$s§f","color":"gold","hoverEvent":{"action":"show_text","value":{"text":"Нажмите, чтобы открыть страницу мода на CurseForge","color":"aqua"}},"clickEvent":{"action":"open_url","value":"%3$s"}},"§9]"] # Настройки -dsurround.cfg.asm.cat.ASM=Настройки ASM преобразователя -dsurround.cfg.asm.cat.ASM.tooltip=Управляет ASM преобразованиями Dynamic Surroundings, происходящими при запуске +dsurround.cfg.asm=Настройки ASM преобразователя +dsurround.cfg.asm.tooltip=Управляет ASM преобразованиями Dynamic Surroundings, происходящими при запуске dsurround.cfg.asm.EnableWeather=Управление погодой dsurround.cfg.asm.EnableWeather.tooltip=Вкл/выкл ASM преобразования для возможности управлять погодой (дождь, снег, брызги, песчаная буря, северное сияние) dsurround.cfg.asm.DisableArrow=Откл. след от стрелы dsurround.cfg.asm.DisableArrow.tooltip=Отключает след из частиц во время полёта стрелы -dsurround.cfg.logging.cat.Logging=Настройки логирования -dsurround.cfg.logging.cat.Logging.tooltip=Определяет как Dynamic Surroundings будет вести лог +dsurround.cfg.logging=Настройки логирования +dsurround.cfg.logging.tooltip=Определяет как Dynamic Surroundings будет вести лог dsurround.cfg.logging.EnableDebug=Отладка dsurround.cfg.logging.EnableDebug.tooltip=Вкл/выкл отладочный лог dsurround.cfg.logging.VersionCheck=Проверка новых версий @@ -72,8 +72,8 @@ dsurround.cfg.logging.ServerStats.tooltip=Вкл/выкл отображение dsurround.cfg.logging.FlagMask=Маска отладки dsurround.cfg.logging.FlagMask.tooltip=Битовая маска для включения различных отладочных трассировок -dsurround.cfg.rain.cat.Rain=Дождь -dsurround.cfg.rain.cat.Rain.tooltip=Настройки дождя в клиенте +dsurround.cfg.rain=Дождь +dsurround.cfg.rain.tooltip=Настройки дождя в клиенте dsurround.cfg.rain.RippleStyle=Вид ряби от дождя dsurround.cfg.rain.RippleStyle.tooltip=0: круг, 1: тёмный круг, 2: квадрат, 3: пикселизированный круг dsurround.cfg.rain.RainVolume=Громкость дождя @@ -91,8 +91,8 @@ dsurround.cfg.rain.MaxRainStrength.tooltip=Максимальная сила д dsurround.cfg.rain.UseVanillaSound=Оригинальный звук дождя dsurround.cfg.rain.UseVanillaSound.tooltip=Использовать оригинальный звук дождя вместо звуков из мода -dsurround.cfg.fog.cat.Fog=Туман -dsurround.cfg.fog.cat.Fog.tooltip=Настройки различных эффектов тумана в клиенте +dsurround.cfg.fog=Туман +dsurround.cfg.fog.tooltip=Настройки различных эффектов тумана в клиенте dsurround.cfg.fog.Enable=Обработка тумана dsurround.cfg.fog.Enable.tooltip=Вкл/выкл обработку тумана dsurround.cfg.fog.EnableMorning=Утренний туман @@ -110,8 +110,8 @@ dsurround.cfg.fog.ElevationHaze.tooltip=Чем выше игрок – тем б dsurround.cfg.fog.BiomeFog=Туман биома dsurround.cfg.fog.BiomeFog.tooltip=Включает туман определённой плотности и цвета для каждого биома -dsurround.cfg.general.cat.General=Основные настройки -dsurround.cfg.general.cat.General.tooltip=Различные настройки +dsurround.cfg.general=Основные настройки +dsurround.cfg.general.tooltip=Различные настройки dsurround.cfg.general.HideChat=Скрыть уведомления в чате dsurround.cfg.general.HideChat.tooltip=Переключает отображение уведомлений Dynamic Surroundings в чате dsurround.cfg.general.ExternalScripts=Внешние файлы настроек @@ -121,15 +121,15 @@ dsurround.cfg.general.StartupSounds.tooltip=Звуки, которые буду dsurround.cfg.general.ChunkCaching=Кэширование чанков dsurround.cfg.general.ChunkCaching.tooltip=Вкл/выкл кэширование чанков на стороне клиента для большей производительности -dsurround.cfg.aurora.cat.Aurora=Северное сияние -dsurround.cfg.aurora.cat.Aurora.tooltip=Настройки поведения и отрисовки северного сияния +dsurround.cfg.aurora=Северное сияние +dsurround.cfg.aurora.tooltip=Настройки поведения и отрисовки северного сияния dsurround.cfg.aurora.EnableAurora=Северное сияние dsurround.cfg.aurora.EnableAurora.tooltip=Вкл/выкл северное сияние на стороне клиента и сервера dsurround.cfg.aurora.EnableShader=Использовать шейдеры dsurround.cfg.aurora.EnableShader.tooltip=Использовать шейдеры при отрисовке северного сияния -dsurround.cfg.biomes.cat.Biomes=Настройки биомов -dsurround.cfg.biomes.cat.Biomes.tooltip=Настройки звуков и эффектов в биомах +dsurround.cfg.biomes=Настройки биомов +dsurround.cfg.biomes.tooltip=Настройки звуков и эффектов в биомах dsurround.cfg.biomes.Sealevel=Перезапись уровня моря dsurround.cfg.biomes.Sealevel.tooltip=Установка уровня моря для мира (0 – по умолчанию для мира) dsurround.cfg.biomes.Aliases=Названия биомов @@ -137,8 +137,8 @@ dsurround.cfg.biomes.Aliases.tooltip=Список названий биомов dsurround.cfg.biomes.DimBlacklist=Чёрный список измерений dsurround.cfg.biomes.DimBlacklist.tooltip=ID измерений, где не будут воспроизвдиться звуки биомов -dsurround.cfg.effects.cat.Effects=Эффекты -dsurround.cfg.effects.cat.Effects.tooltip=Настройки для различных эффектов +dsurround.cfg.effects=Эффекты +dsurround.cfg.effects.tooltip=Настройки для различных эффектов dsurround.cfg.effects.WaterfallCutoff=Срез звука водопада dsurround.cfg.effects.WaterfallCutoff.tooltip=Сила водопада, ниже которой звуки водопада не воспроизводятся dsurround.cfg.effects.FXRange=Дальность эффектов @@ -170,8 +170,8 @@ dsurround.cfg.effects.FootprintStyle.tooltip=0: след от обуви, 1: к dsurround.cfg.effects.ShowBreath=Морозное дыхание dsurround.cfg.effects.ShowBreath.tooltip=Включает морозное дыхание существ в холодную погоду -dsurround.cfg.sound.cat.Sound=Звук -dsurround.cfg.sound.cat.Sound.tooltip=Основные настройки звуковых эффектов +dsurround.cfg.sound=Звук +dsurround.cfg.sound.tooltip=Основные настройки звуковых эффектов dsurround.cfg.sound.BiomeSounds=Звуки биомов dsurround.cfg.sound.BiomeSounds.tooltip=Вкл/выкл фоновые звуки в биомах dsurround.cfg.sound.AutoConfig=Автонастройка звуковых каналов @@ -213,8 +213,8 @@ dsurround.cfg.sound.SoundSettings.tooltip=Настроить отключени dsurround.cfg.sound.BattleMusic=Боевая музыка dsurround.cfg.sound.BattleMusic.tooltip=Вкл/выкл музыку во время боя -dsurround.cfg.player.cat.Player=Эффекты игрока -dsurround.cfg.player.cat.Player.tooltip=Основные настройки для звуков и эффектов игрока +dsurround.cfg.player=Эффекты игрока +dsurround.cfg.player.tooltip=Основные настройки для звуков и эффектов игрока dsurround.cfg.player.PotionParticles=Сдерживать частицы зелий dsurround.cfg.player.PotionParticles.tooltip=Отключает эффект частиц зелий от игрока dsurround.cfg.player.HurtThreshold=Порог боли @@ -222,56 +222,8 @@ dsurround.cfg.player.HurtThreshold.tooltip=До какого значения д dsurround.cfg.player.HungerThreshold=Порог голода dsurround.cfg.player.HungerThreshold.tooltip=До какого значения должна опустеть полоска еды, чтобы появились звуки урчания (0, чтобы выключить) -dsurround.cfg.huds.cat.Huds=Интерфейс и наложения -dsurround.cfg.huds.cat.Huds.tooltip=Настройки для различных элементов интерфейса и наложений - -dsurround.cfg.huds.potionHud.cat.PotionHud=Интерфейс зелий -dsurround.cfg.huds.potionHud.cat.PotionHud.tooltip=Настройки отображения интерфейса зелий -dsurround.cfg.huds.potionHud.NoHUD=Откл. интерфейс зелий -dsurround.cfg.huds.potionHud.NoHUD.tooltip=Выключает интерфейс зелий как оригинальный, так и мода -dsurround.cfg.huds.potionHud.Enable=Интерфейс зелий -dsurround.cfg.huds.potionHud.tooltip=Вкл/выкл отображение плашек с иконкой и именем зелья на экране -dsurround.cfg.huds.potionHud.Transparency=Прозрачность -dsurround.cfg.huds.potionHud.Transparency.tooltip=Величина прозрачности для плашек (чем выше – тем непрозрачнее) -dsurround.cfg.huds.potionHud.LeftOffset=Смещение по горизонтали -dsurround.cfg.huds.potionHud.LeftOffset.tooltip=Смещение от левой стороны экрана -dsurround.cfg.huds.potionHud.TopOffset=Смещение по вертикали -dsurround.cfg.huds.potionHud.TopOffset.tooltip=Смещение от верхней части экрана -dsurround.cfg.huds.potionHud.Scale=Размер интерфейса -dsurround.cfg.huds.potionHud.Scale.tooltip=Размер плашки с иконкой и именем зелья -dsurround.cfg.huds.potionHud.Location=Расположение интерфейса -dsurround.cfg.huds.potionHud.Location.tooltip=0 - сверху слева, 1 - сверху справа - -dsurround.cfg.huds.lightlevel.cat.LightLevel=Отображение уровня освещённости -dsurround.cfg.huds.lightlevel.cat.LightLevel.tooltip=Настройки для интерфейса уровня освещённости -dsurround.cfg.huds.lightlevel.Range=Расстояние -dsurround.cfg.huds.lightlevel.Range.tooltip=На каком расстоянии в блоках анализировать уровень освещённости -dsurround.cfg.huds.lightlevel.MobSpawnThreshold=Уровень света для появления существ -dsurround.cfg.huds.lightlevel.MobSpawnThreshold.tooltip=Уровень света, при котором могут появляться существа -dsurround.cfg.huds.lightlevel.HideSafe=Не показывать безопасные блоки -dsurround.cfg.huds.lightlevel.HideSafe.tooltip=Не показывать уровень освещённости блоков, на которых не могут появляться существа -dsurround.cfg.huds.lightlevel.IndicateCaution=Показывать предупреждение -dsurround.cfg.huds.lightlevel.IndicateCaution.tooltip=Показывать, что уровень освещённости сменится ночью и это приведёт к появлению существ -dsurround.cfg.huds.lightlevel.Colors=Набор цветов -dsurround.cfg.huds.lightlevel.Colors.tooltip=0 - светлый, 1 - тёмный -dsurround.cfg.huds.lightlevel.DisplayMode=Режим отображения -dsurround.cfg.huds.lightlevel.DisplayMode.tooltip=0: освещённость блока, 1: освещённость блока + свет неба - -dsurround.cfg.huds.compass.cat.Compass=Компас/часы -dsurround.cfg.huds.compass.cat.Compass.tooltip=Настройки для компаса и часов -dsurround.cfg.huds.compass.Enable=Интерфейс компаса -dsurround.cfg.huds.compass.Enable.tooltip=Вкл/выкл отображение компаса на экране -dsurround.cfg.huds.compass.ClockEnable=Интерфейс часов -dsurround.cfg.huds.compass.ClockEnable.tooltip=Вкл/выкл отображение часов на экране -dsurround.cfg.huds.compass.Style=Вид компаса -dsurround.cfg.huds.compass.Style.tooltip=Выбор стиля компаса -dsurround.cfg.huds.compass.Transparency=Прозрачность компаса -dsurround.cfg.huds.compass.Transparency.tooltip=Величина прозрачности компаса при отрисовке -dsurround.cfg.huds.compass.Format=Формат координат -dsurround.cfg.huds.compass.Format.tooltip=Формат строки координат для отображения местоположения - -dsurround.cfg.speech.cat.Speech=Пузырьки с речью -dsurround.cfg.speech.cat.Speech.tooltip=Настройки для пузырьков с речью +dsurround.cfg.speech=Пузырьки с речью +dsurround.cfg.speech.tooltip=Настройки для пузырьков с речью dsurround.cfg.speech.EnableSpeechBubbles=Пузырьки с речью dsurround.cfg.speech.EnableSpeechBubbles.tooltip=Вкл/выкл пузырьки с речью над головами игроков dsurround.cfg.speech.EnableEntityChat=Болтовня существ @@ -283,8 +235,8 @@ dsurround.cfg.speech.Range.tooltip=Расстояние, на котором в dsurround.cfg.speech.AnimaniaBadges=Значки Animania dsurround.cfg.speech.AnimaniaBadges.tooltip=Вкл/выкл отображение значков еды/воды над существами из Animania -dsurround.cfg.commands.cat.Commands=Настройки команд -dsurround.cfg.commands.cat.Commands.tooltip=Настройки для команд +dsurround.cfg.commands=Настройки команд +dsurround.cfg.commands.tooltip=Настройки для команд dsurround.cfg.commands.DS.Name=Имя команды /ds dsurround.cfg.commands.DS.Name.tooltip=Имя для команды /ds dsurround.cfg.commands.DS.Alias=Псевдоним для команды /ds @@ -294,8 +246,8 @@ dsurround.cfg.commands.Calc.Name.tooltip=Имя для команды /calc dsurround.cfg.commands.Calc.Alias=Псевдоним для команды /calc dsurround.cfg.commands.Calc.Alias.tooltip=Один или несколько псевдонимов для команды /calc (разделение через пробел) -dsurround.cfg.profiles.cat.Profiles=Встроенные профили -dsurround.cfg.profiles.cat.Profiles.tooltip=Настройка встроенных профилей +dsurround.cfg.profiles=Встроенные профили +dsurround.cfg.profiles.tooltip=Настройка встроенных профилей dsurround.cfg.profiles.noNetherWeather=Откл. погоду в Нижнем мире dsurround.cfg.profiles.noNetherWeather.tooltip=Выключает погодные эффекты в Нижнем мире dsurround.cfg.profiles.noDustEffects=Откл. пыль diff --git a/src/main/resources/mixins.dsurround.json b/src/main/resources/mixins.dsurround.json index 7295d118c..fabc6b6c9 100644 --- a/src/main/resources/mixins.dsurround.json +++ b/src/main/resources/mixins.dsurround.json @@ -15,6 +15,11 @@ "MixinSoundManager", "MixinEntityArrow", "MixinGuiScreenOptionsSounds", - "MixinInventoryEffectRenderer" + "MixinInventoryEffectRenderer", + "MixinGuiConfig", + "ISoundHandlerMixin", + "ISoundManagerMixin", + "ISoundSystemMixin", + "IPositionedSoundMixin" ] } diff --git a/version.json b/version.json index 0293fe9b7..e903d92af 100644 --- a/version.json +++ b/version.json @@ -28,7 +28,7 @@ "1.12-recommended": "3.4.9.15", "1.12.1-latest": "3.4.9.15", "1.12.1-recommended": "3.4.9.15", - "1.12.2-latest": "3.6.0.1", - "1.12.2-recommended": "3.6.0.1" + "1.12.2-latest": "3.6.0.2", + "1.12.2-recommended": "3.6.0.2" } } From 0b0c235cda88f5cd16a2839d76324ad7b620a527 Mon Sep 17 00:00:00 2001 From: OreCruncher Date: Sun, 10 Nov 2019 17:12:25 -0800 Subject: [PATCH 2/6] Update version.json --- version.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.json b/version.json index e903d92af..658d3b690 100644 --- a/version.json +++ b/version.json @@ -17,7 +17,7 @@ "3.4.9.15": "See https://github.com/OreCruncher/DynamicSurroundings/blob/1.12.2/CHANGELOG.md" }, "1.12.2": { - "3.6.0.1": "See https://github.com/OreCruncher/DynamicSurroundings/blob/1.12.2/CHANGELOG.md" + "3.6.0.2": "See https://github.com/OreCruncher/DynamicSurroundings/blob/1.12.2/CHANGELOG.md" }, "promos": { "1.10.2-latest": "3.4.9.17", From a9f300628e2ea674458f92fd9493878831772bb9 Mon Sep 17 00:00:00 2001 From: OreCruncher Date: Sat, 1 Feb 2020 14:07:11 -0800 Subject: [PATCH 3/6] 1.12.2 (#538) * Fix issue with fake worlds during init * Update changelog * Search bar for option screens * Bump min OreLib version * [#514] Change Aurora render handler event priority * Search bar working in release testbed * Option to disable search filter; config lang cleanup * More lang cleanup * Options cleanup * Option comment cleanup * Cleanup * Cleanup material sound mappings * Accessors for sound related things * Fix crash issue when starting up w/missing or outdated mods * Release From 220eb3afc03d7e46935b08a194980c85a71d4d2e Mon Sep 17 00:00:00 2001 From: CreativeMD Date: Sat, 1 Feb 2020 23:07:47 +0100 Subject: [PATCH 4/6] Update LittleTilesAccessor.java (#535) --- .../dsurround/client/footsteps/facade/LittleTilesAccessor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/orecruncher/dsurround/client/footsteps/facade/LittleTilesAccessor.java b/src/main/java/org/orecruncher/dsurround/client/footsteps/facade/LittleTilesAccessor.java index 6525ba799..6fb13f511 100644 --- a/src/main/java/org/orecruncher/dsurround/client/footsteps/facade/LittleTilesAccessor.java +++ b/src/main/java/org/orecruncher/dsurround/client/footsteps/facade/LittleTilesAccessor.java @@ -27,7 +27,7 @@ import org.orecruncher.dsurround.client.footsteps.Generator; import com.creativemd.littletiles.common.api.te.ILittleTileTE; -import com.creativemd.littletiles.common.blocks.BlockTile; +import com.creativemd.littletiles.common.block.BlockTile; import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; From 4e81913def6e04ab7e8f478b86dffca999e6bae3 Mon Sep 17 00:00:00 2001 From: Smollet777 Date: Sat, 4 Apr 2020 18:30:56 +0300 Subject: [PATCH 5/6] Update ru_ru.lang (#554) --- .../resources/assets/dsurround/lang/ru_ru.lang | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/main/resources/assets/dsurround/lang/ru_ru.lang b/src/main/resources/assets/dsurround/lang/ru_ru.lang index b3c62ec68..23ed0491f 100644 --- a/src/main/resources/assets/dsurround/lang/ru_ru.lang +++ b/src/main/resources/assets/dsurround/lang/ru_ru.lang @@ -54,12 +54,19 @@ dsurround.msg.ThunderThresholdSet=§9Порог грозы: %1$s dsurround.msg.NewVersion.dsurround=["§6Доступно обновление: §9[",{"text":"§2%1$s §ev%2$s§f","color":"gold","hoverEvent":{"action":"show_text","value":{"text":"Нажмите, чтобы открыть страницу мода на CurseForge","color":"aqua"}},"clickEvent":{"action":"open_url","value":"%3$s"}},"§9]"] # Настройки +dsurround.cfg.individual=Индивидуальная настройка звука +dsurround.cfg.individual.tooltip=Опции для настройки звуков индивидуально + dsurround.cfg.asm=Настройки ASM преобразователя dsurround.cfg.asm.tooltip=Управляет ASM преобразованиями Dynamic Surroundings, происходящими при запуске dsurround.cfg.asm.EnableWeather=Управление погодой dsurround.cfg.asm.EnableWeather.tooltip=Вкл/выкл ASM преобразования для возможности управлять погодой (дождь, снег, брызги, песчаная буря, северное сияние) dsurround.cfg.asm.DisableArrow=Откл. след от стрелы dsurround.cfg.asm.DisableArrow.tooltip=Отключает след из частиц во время полёта стрелы +dsurround.cfg.asm.DisablePotionIcons=Отключить иконки эффектов зелий инвентаря +dsurround.cfg.asm.DisablePotionIcons.tooltip=Отключает отрисовку эффектов зелий в инвентаре +dsurround.cfg.asm.EnableOptionSearch=Включить опцию поиска в настройках +dsurround.cfg.asm.EnableOptionSearch.tooltip=Включает текстовое поле фильтра поиска в опциях конфигурации мода dsurround.cfg.logging=Настройки логирования dsurround.cfg.logging.tooltip=Определяет как Dynamic Surroundings будет вести лог @@ -90,6 +97,8 @@ dsurround.cfg.rain.MaxRainStrength=Макс. сила дождя по умолч dsurround.cfg.rain.MaxRainStrength.tooltip=Максимальная сила дождя по умолчанию для измерения dsurround.cfg.rain.UseVanillaSound=Оригинальный звук дождя dsurround.cfg.rain.UseVanillaSound.tooltip=Использовать оригинальный звук дождя вместо звуков из мода +dsurround.cfg.rain.EnableMagmaNetherrack=Включить брызги на Адском камне и Магмовом блоке +dsurround.cfg.rain.EnableMagmaNetherrack.tooltip=Включает/отключает частицы лавы на Адском камне и Магмовом блоке во время дождя dsurround.cfg.fog=Туман dsurround.cfg.fog.tooltip=Настройки различных эффектов тумана в клиенте @@ -127,6 +136,8 @@ dsurround.cfg.aurora.EnableAurora=Северное сияние dsurround.cfg.aurora.EnableAurora.tooltip=Вкл/выкл северное сияние на стороне клиента и сервера dsurround.cfg.aurora.EnableShader=Использовать шейдеры dsurround.cfg.aurora.EnableShader.tooltip=Использовать шейдеры при отрисовке северного сияния +dsurround.cfg.aurora.MaxBands=Максимум полос +dsurround.cfg.aurora.MaxBands.tooltip=Ограничение макс. количества полос в сиянии dsurround.cfg.biomes=Настройки биомов dsurround.cfg.biomes.tooltip=Настройки звуков и эффектов в биомах @@ -248,13 +259,14 @@ dsurround.cfg.commands.Calc.Alias.tooltip=Один или несколько п dsurround.cfg.profiles=Встроенные профили dsurround.cfg.profiles.tooltip=Настройка встроенных профилей + dsurround.cfg.profiles.noNetherWeather=Откл. погоду в Нижнем мире dsurround.cfg.profiles.noNetherWeather.tooltip=Выключает погодные эффекты в Нижнем мире dsurround.cfg.profiles.noDustEffects=Откл. пыль dsurround.cfg.profiles.noDustEffects.tooltip=Отключает эффект пыли во всех биомах dsurround.season.format=%1$s %2$s -dsurround.season.noseason=Нет сизона +dsurround.season.noseason=Нет сезона dsurround.season.spring=Весна dsurround.season.summer=Лето dsurround.season.fall=Осень From 2a33e0d41b7990e23e6b742aeb9b509af0fb9d71 Mon Sep 17 00:00:00 2001 From: OreCruncher Date: Sun, 18 Oct 2020 09:35:00 -0700 Subject: [PATCH 6/6] Updated versions for 1.12.2 --- version.json | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/version.json b/version.json index 658d3b690..6827e92b0 100644 --- a/version.json +++ b/version.json @@ -17,7 +17,9 @@ "3.4.9.15": "See https://github.com/OreCruncher/DynamicSurroundings/blob/1.12.2/CHANGELOG.md" }, "1.12.2": { - "3.6.0.2": "See https://github.com/OreCruncher/DynamicSurroundings/blob/1.12.2/CHANGELOG.md" + "3.6.0.2": "See https://github.com/OreCruncher/DynamicSurroundings/blob/1.12.2/CHANGELOG.md", + "3.6.1.0": "See https://github.com/OreCruncher/DynamicSurroundings/blob/1.12.2/CHANGELOG.md", + "3.6.2.0": "See https://github.com/OreCruncher/DynamicSurroundings/blob/1.12.2/CHANGELOG.md" }, "promos": { "1.10.2-latest": "3.4.9.17", @@ -28,7 +30,7 @@ "1.12-recommended": "3.4.9.15", "1.12.1-latest": "3.4.9.15", "1.12.1-recommended": "3.4.9.15", - "1.12.2-latest": "3.6.0.2", - "1.12.2-recommended": "3.6.0.2" + "1.12.2-latest": "3.6.2.0", + "1.12.2-recommended": "3.6.2.0" } }