diff --git a/README.md b/README.md index 087a2c6e4..f5aff7230 100644 --- a/README.md +++ b/README.md @@ -127,5 +127,8 @@ There is a common crash caused by Minecraft's render distance slider going out o ### Log spam caused by ComparableStack In some modpacks (exact mods needed to replicate this are unknown), it's possible that invalid registered items may cause problems for NEI handlers. To prevent crashes, the ComparableStack class used to represent stacks will default to a safe registered item, and print a log message. In certain situations, this may cause dozens of errors to be printed at once, potentially even lagging the game. If that happens, the log message (but not the error handling) can be disabled with the config option `1.28_enableSilentCompStackErrors`. +### Sound system limit +By default, the sound system only allows a limited amount of sounds to run at once (28 regular sounds and 4 streaming sounds), this causes issues when there's many machines running at once, since their looped sounds will constantly interrupt each other, causing them to immediately restart, which in some isolated cases has proven to cause massive lagspikes. To prevent this, NTM will increase the sound limit to 1000 regular sounds and 50 streaming sounds, this can be disabled with the config option `1.39_enableSoundExtension`. + # License This software is licensed under the GNU Lesser General Public License version 3. In short: This software is free, you may run the software freely, create modified versions, distribute this software and distribute modified versions, as long as the modified software too has a free software license (with an exception for linking to this software, as stated by the "Lesser" part of the LGPL, where this may not be required). You win this round, Stallman. The full license can be found in the `LICENSE` and `LICENSE.LESSER` files. diff --git a/changelog b/changelog index dba353fb3..3665cedcf 100644 --- a/changelog +++ b/changelog @@ -10,6 +10,8 @@ * Diamonds are now a valid crucible material, turning into carbon at a 1:1 ratio (like graphite) * Emerald is also a valid crucible material now, turning into beryllium at a 4:3 ratio * Emeralds can now be mined as bedrock ores with a weight of 50 (half as common as iron, as common as redstone) +* Tritium lamps are now substantially cheaper +* Glyphid scouts can now spawn during the day when rampant glyphid spawning is enabled (artificial light however will still prevent them from spawning, keeping them out of bases) ## Fixed * Fixed rocket artillery turret not saving loaded ammo type/count diff --git a/src/main/java/com/hbm/config/GeneralConfig.java b/src/main/java/com/hbm/config/GeneralConfig.java index 3aedd78bc..75c61aed1 100644 --- a/src/main/java/com/hbm/config/GeneralConfig.java +++ b/src/main/java/com/hbm/config/GeneralConfig.java @@ -34,6 +34,7 @@ public class GeneralConfig { public static boolean enableMOTD = true; public static boolean enableGuideBook = true; public static boolean enableSteamParticles = true; + public static boolean enableSoundExtension = true; public static int hintPos = 0; public static boolean enableExpensiveMode = false; @@ -101,6 +102,7 @@ public class GeneralConfig { enableMOTD = config.get(CATEGORY_GENERAL, "1.36_enableMOTD", true, "If enabled, shows the 'Loaded mod!' chat message as well as update notifications when joining a world").getBoolean(true); enableGuideBook = config.get(CATEGORY_GENERAL, "1.37_enableGuideBook", true, "If enabled, gives players the guide book when joining the world for the first time").getBoolean(true); enableSteamParticles = config.get(CATEGORY_GENERAL, "1.38_enableSteamParticles",true, "If disabled, auxiliary cooling towers and large cooling towers will not emit steam particles when in use.").getBoolean(true); + enableSoundExtension = config.get(CATEGORY_GENERAL, "1.39_enableSoundExtension",true, "If enabled, will change the limit for how many sounds can play at once.").getBoolean(true); enableExpensiveMode = config.get(CATEGORY_GENERAL, "1.99_enableExpensiveMode", false, "It does what the name implies.").getBoolean(false); diff --git a/src/main/java/com/hbm/main/ClientProxy.java b/src/main/java/com/hbm/main/ClientProxy.java index 6b984dd85..ad0831044 100644 --- a/src/main/java/com/hbm/main/ClientProxy.java +++ b/src/main/java/com/hbm/main/ClientProxy.java @@ -33,6 +33,7 @@ import net.minecraft.world.World; import net.minecraftforge.client.MinecraftForgeClient; import net.minecraftforge.client.model.AdvancedModelLoader; import net.minecraftforge.common.MinecraftForge; +import paulscode.sound.SoundSystemConfig; import java.awt.Color; import java.awt.Desktop; @@ -55,6 +56,7 @@ import com.hbm.blocks.generic.BlockSnowglobe.TileEntitySnowglobe; import com.hbm.blocks.machine.MachineFan.TileEntityFan; import com.hbm.blocks.machine.PistonInserter.TileEntityPistonInserter; import com.hbm.blocks.machine.WatzPump.TileEntityWatzPump; +import com.hbm.config.GeneralConfig; import com.hbm.entity.cart.*; import com.hbm.entity.effect.*; import com.hbm.entity.grenade.*; @@ -147,6 +149,11 @@ public class ClientProxy extends ServerProxy { registerBlockRenderer(); Jars.initJars(); + + if(GeneralConfig.enableSoundExtension) { + SoundSystemConfig.setNumberNormalChannels(1000); + SoundSystemConfig.setNumberStreamingChannels(50); + } } private void registerClientEventHandler(Object handler) { diff --git a/src/main/java/com/hbm/main/CraftingManager.java b/src/main/java/com/hbm/main/CraftingManager.java index a3896a2fe..cb9013f34 100644 --- a/src/main/java/com/hbm/main/CraftingManager.java +++ b/src/main/java/com/hbm/main/CraftingManager.java @@ -453,8 +453,8 @@ public class CraftingManager { addRecipeAuto(new ItemStack(Item.getItemFromBlock(ModBlocks.reinforced_lamp_off), 1), new Object[] { "FFF", "FBF", "FFF", 'F', Blocks.iron_bars, 'B', Blocks.redstone_lamp }); addRecipeAuto(new ItemStack(Item.getItemFromBlock(ModBlocks.reinforced_sand), 4), new Object[] { "FBF", "BFB", "FBF", 'F', Blocks.iron_bars, 'B', Blocks.sandstone }); - addRecipeAuto(new ItemStack(ModBlocks.lamp_tritium_green_off, 1), new Object[] { "GPG", "1T2", "GPG", 'G', KEY_ANYGLASS, 'P', P_RED.dust(), 'T', ModItems.cell_tritium, '1', "dustSulfur", '2', CU.dust() }); - addRecipeAuto(new ItemStack(ModBlocks.lamp_tritium_blue_off, 1), new Object[] { "GPG", "1T2", "GPG", 'G', KEY_ANYGLASS, 'P',P_RED.dust(), 'T', ModItems.cell_tritium, '1', AL.dust(), '2', ST.dust() }); + addShapelessAuto(new ItemStack(ModBlocks.lamp_tritium_green_off, 1), new Object[] { KEY_ANYGLASS, P_RED.dust(), Fluids.TRITIUM.getDict(1_000), S.dust() }); + addShapelessAuto(new ItemStack(ModBlocks.lamp_tritium_blue_off, 1), new Object[] { KEY_ANYGLASS, P_RED.dust(), Fluids.TRITIUM.getDict(1_000), AL.dust() }); addRecipeAuto(new ItemStack(ModBlocks.lantern, 1), new Object[] { "PGP", " S ", " S ", 'P', KEY_ANYPANE, 'G', Items.glowstone_dust, 'S', ModBlocks.steel_beam }); addRecipeAuto(new ItemStack(ModBlocks.spotlight_incandescent, 8), new Object[] { " G ", " T ", " I ", 'G', KEY_ANYPANE, 'T', ModItems.wire_tungsten, 'I', Items.iron_ingot }); addRecipeAuto(new ItemStack(ModBlocks.spotlight_fluoro, 8), new Object[] { " G ", " M ", " A ", 'G', KEY_ANYPANE, 'M', ModItems.ingot_mercury, 'A', ModItems.plate_aluminium });