diff --git a/src/main/java/com/lothrazar/cyclic/block/soundmuff/SoundmufflerBlock.java b/src/main/java/com/lothrazar/cyclic/block/soundmuff/SoundmufflerBlock.java index 3fa5dfadd..2d894ace4 100644 --- a/src/main/java/com/lothrazar/cyclic/block/soundmuff/SoundmufflerBlock.java +++ b/src/main/java/com/lothrazar/cyclic/block/soundmuff/SoundmufflerBlock.java @@ -13,14 +13,12 @@ import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.client.event.sound.PlaySoundEvent; -import net.minecraftforge.common.ForgeConfigSpec.IntValue; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.eventbus.api.SubscribeEvent; public class SoundmufflerBlock extends BlockCyclic { private static final int VOL_REDUCE_PER_BLOCK = 2; - public static IntValue RADIUS; // 6 public SoundmufflerBlock(Properties properties) { super(properties.strength(1F).sound(SoundType.SCAFFOLDING)); @@ -37,7 +35,7 @@ public void onPlaySound(PlaySoundEvent event) { SoundInstance sound = event.getSound(); final boolean isPowered = false; // if im NOT powered, im running List blocks = BlockstatesUtil.findBlocks(clientWorld, new BlockPos(sound.getX(), sound.getY(), sound.getZ()), this, - RADIUS.get(), + ConfigRegistry.SOUND_RADIUS.get(), isPowered); if (blocks == null || blocks.size() == 0) { return; diff --git a/src/main/java/com/lothrazar/cyclic/block/soundrecord/BlockSoundRecorder.java b/src/main/java/com/lothrazar/cyclic/block/soundrecord/BlockSoundRecorder.java index 03f391abf..2d9030c94 100644 --- a/src/main/java/com/lothrazar/cyclic/block/soundrecord/BlockSoundRecorder.java +++ b/src/main/java/com/lothrazar/cyclic/block/soundrecord/BlockSoundRecorder.java @@ -2,6 +2,7 @@ import java.util.List; import com.lothrazar.cyclic.block.BlockCyclic; +import com.lothrazar.cyclic.config.ConfigRegistry; import com.lothrazar.cyclic.net.PacketRecordSound; import com.lothrazar.cyclic.registry.MenuTypeRegistry; import com.lothrazar.cyclic.registry.PacketRegistry; @@ -17,14 +18,11 @@ import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.client.event.sound.PlaySoundEvent; -import net.minecraftforge.common.ForgeConfigSpec.IntValue; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.eventbus.api.SubscribeEvent; public class BlockSoundRecorder extends BlockCyclic { - public static IntValue RADIUS; - public BlockSoundRecorder(Properties properties) { super(properties.strength(1F).sound(SoundType.SCAFFOLDING)); MinecraftForge.EVENT_BUS.register(this); @@ -50,7 +48,8 @@ public void onPlaySound(PlaySoundEvent event) { } //long term/repeating/music final boolean isPowered = false; // if im NOT powered, im running List blocks = BlockstatesUtil.findBlocks(clientWorld, - new BlockPos(event.getSound().getX(), event.getSound().getY(), event.getSound().getZ()), this, RADIUS.get(), isPowered); + new BlockPos(event.getSound().getX(), event.getSound().getY(), event.getSound().getZ()), this, + ConfigRegistry.RECORDER_RADIUS.get(), isPowered); for (BlockPos nearby : blocks) { String sid = event.getSound().getLocation().toString(); PacketRegistry.INSTANCE.sendToServer(new PacketRecordSound(sid, nearby)); diff --git a/src/main/java/com/lothrazar/cyclic/config/ConfigRegistry.java b/src/main/java/com/lothrazar/cyclic/config/ConfigRegistry.java index 9b81423b4..abd9d2223 100644 --- a/src/main/java/com/lothrazar/cyclic/config/ConfigRegistry.java +++ b/src/main/java/com/lothrazar/cyclic/config/ConfigRegistry.java @@ -41,8 +41,6 @@ import com.lothrazar.cyclic.block.packager.TilePackager; import com.lothrazar.cyclic.block.peatfarm.TilePeatFarm; import com.lothrazar.cyclic.block.shapebuilder.TileStructure; -import com.lothrazar.cyclic.block.soundmuff.SoundmufflerBlock; -import com.lothrazar.cyclic.block.soundrecord.BlockSoundRecorder; import com.lothrazar.cyclic.block.spawntriggers.BlockAltarNoTraders; import com.lothrazar.cyclic.block.spawntriggers.CandlePeaceBlock; import com.lothrazar.cyclic.block.sprinkler.TileSprinkler; @@ -126,6 +124,7 @@ public class ConfigRegistry { public static BooleanValue CYAN_PODZOL_LEGACY; public static BooleanValue TRANSFER_NODES_DIMENSIONAL; public static IntValue SOUND_RADIUS; + public static IntValue RECORDER_RADIUS; static { buildDefaults(); initConfig(); @@ -405,8 +404,6 @@ private static void initConfig() { CFG.pop(); //items CFG.comment(WALL, " Block specific configs", WALL).push("blocks"); //////////////////////////////////////////////////////////////////////////////////// blocks //buffer size for cables - SoundmufflerBlock.RADIUS = CFG.comment("Radius to find and muffle sounds. ") - .defineInRange("soundproofing.radius", 6, 1, 128); TileAntiBeacon.HARMFUL_POTIONS = CFG.comment("If true, then all potions marked as harmful/negative will be used in addition to the 'anti_beacon.potion_list' for cures and immunities (used by both sponge and artemisbeacon).") .define("harmful_potions", true); TileAntiBeacon.RADIUS = CFG.comment("Radius to protect players and entities from potion effects being applied (used by both sponge and artemisbeacon). ") @@ -484,8 +481,8 @@ private static void initConfig() { + "This affects blocks cyclic:wireless_energy, cyclic:wireless_item, cyclic:wireless_fluid, cyclic:wireless_transmitter; " + "If you change it to false it will only work if the target is in the same dimension.") .define("wireless_transfer_dimensional", true); - CFG.comment("Ender shelf settings").push("sound"); - BlockSoundRecorder.RADIUS = CFG.comment("Sound Recorder - how far out does it listen to record sounds").defineInRange("radius", 8, 1, 64); + CFG.push("sound_recorder"); + RECORDER_RADIUS = CFG.comment("Sound Recorder - how far out does it listen to record sounds").defineInRange("radius", 8, 1, 64); CFG.pop(); CFG.push("ender_shelf"); EnderShelfItemHandler.BOOKS_PER_ROW = CFG.comment("Each shelf has five rows. Set the number of books stored per row here").defineInRange("books_per_row", 256, 1, 1024);