From 089a43ce6867f6af6eff71ead9622eed8a2c9650 Mon Sep 17 00:00:00 2001 From: Tom Powell Date: Sun, 5 Feb 2023 13:38:36 -0800 Subject: [PATCH] Add config option item dislocator sound (#33) * Add config option item dislocator sound Backport of upstream https://github.com/Draconic-Inc/Draconic-Evolution/commit/4570abbc71c720940493dd0cfdcc20e59b24fb5a When combined with the voiding drop filter, the item dislocator plays a sound for every single item in a stack picked up. This adds a config option to disable the sound entirely --- .../draconicevolution/common/handler/ConfigHandler.java | 6 ++++++ .../draconicevolution/common/items/tools/Magnet.java | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/brandon3055/draconicevolution/common/handler/ConfigHandler.java b/src/main/java/com/brandon3055/draconicevolution/common/handler/ConfigHandler.java index edfe66f7..f23c0c46 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/handler/ConfigHandler.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/handler/ConfigHandler.java @@ -51,6 +51,7 @@ public class ConfigHandler { public static boolean enableFlight; private static String[] itemDislocatorBlacklist; public static Map itemDislocatorBlacklistMap = new HashMap(); + public static boolean itemDislocatorDisableSound; // spawner public static String[] spawnerList; @@ -266,6 +267,11 @@ public class ConfigHandler { Configuration.CATEGORY_GENERAL, new String[] { "appliedenergistics2:item.ItemCrystalSeed" }, "A list of items of items that should be ignored by the item dislocator. Use the items registry name e.g. minecraft:apple you can also add a meta value like so minecraft:wool|4"); + itemDislocatorDisableSound = config.get( + Configuration.CATEGORY_GENERAL, + "Item Dislocator Disable Sound", + false, + "Disable item dislocator sound").getBoolean(false); disableLog = config.get( Configuration.CATEGORY_GENERAL, "Disable Log", diff --git a/src/main/java/com/brandon3055/draconicevolution/common/items/tools/Magnet.java b/src/main/java/com/brandon3055/draconicevolution/common/items/tools/Magnet.java index 3ecdafaa..e644b635 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/items/tools/Magnet.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/items/tools/Magnet.java @@ -121,7 +121,7 @@ public class Magnet extends ItemDE { entity.posY - 0.6, entity.posZ - 0.2 + (world.rand.nextDouble() * 0.4)); } - if (playSound) { + if (playSound && !ConfigHandler.itemDislocatorDisableSound) { world.playSoundAtEntity( entity, "random.orb",