Skip to content

Commit

Permalink
Alchemical Collection Sound & Custom Subtitle
Browse files Browse the repository at this point in the history
  • Loading branch information
DonovanDMC committed Jan 31, 2023
1 parent c30d461 commit ee84f23
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,9 @@
"gui.projectexpansion.config.persist_enchanted_books_only.desc": "If ProjectE's processors.EnchantmentProcessor.persistent option should only include enchanted books.",
"gui.projectexpansion.config.enable_learned_tooltip": "Enable Learned Tooltip",
"gui.projectexpansion.config.enable_learned_tooltip.desc": "If a tooltip should be shown on items which can be learned, denoting if the item has been learned or not. Note: ProjectE's client.shiftEmcToolTips applies to this.",
"gui.projectexpansion.advanced_alchemical_chest.title": "Alchemical Chest",
"gui.projectexpansion.config.alchemical_collection_sound": "Alchemical Collection Sound",
"gui.projectexpansion.config.alchemical_collection_sound.desc": "If a sound should be played when something is collected with Alchemical Collection.",
"gui.projectexpansion.advanced_alchemical_chest.title": "Advanced Alchemical Chest",
"item.projectexpansion.compressed_collector.tooltip": "Crafting Ingredient",
"item.projectexpansion.basic_compressed_collector": "Basic Compressed Collector [MK 1]",
"item.projectexpansion.dark_compressed_collector": "Dark Compressed Collector [MK 2]",
Expand Down Expand Up @@ -299,5 +301,6 @@
"enchantment.projectexpansion.alchemical_collection.desc": "Converts any mined items with an emc value directly into emc.",
"sounds.projectexpansion.knowledge_sharing_book.store": "Knowledge Stored",
"sounds.projectexpansion.knowledge_sharing_book.use": "Knowledge Gained",
"sounds.projectexpansion.knowledge_sharing_book.use_none": "No Knowledge Gained"
"sounds.projectexpansion.knowledge_sharing_book.use_none": "No Knowledge Gained",
"sounds.projectexpansion.alchemical_collection.collect": "Alchemically Collected"
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@ public final class Config {
public static final ForgeConfigSpec.ConfigValue<Integer> infiniteSteakCost = Builder.comment("The cost of using the infinite steak item.").defineInRange("infiniteSteakCost", 64, 1, Integer.MAX_VALUE);
public static final ForgeConfigSpec.ConfigValue<Boolean> persistEnchantedBooksOnly = Builder.comment("If ProjectE's processors.EnchantmentProcessor.persistent option should only include enchanted books.").define("persistEnchantedBooksOnly", false);
public static final ForgeConfigSpec.ConfigValue<Boolean> enabledLearnedTooltip = Builder.comment("If a tooltip should be shown on items which can be learned, denoting if the item has been learned or not. Note: ProjectE's client.shiftEmcToolTips applies to this.").define("enabledLearnedTooltip", true);
public static final ForgeConfigSpec.ConfigValue<Boolean> alchemicalCollectionSound = Builder.comment("If a sound should be played when something is collected with Alchemical Collection.").define("alchemicalCollectionSound", true);
static { Spec = Builder.build(); }
}
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,12 @@ protected void init() {
(__, newValue) -> Config.enabledLearnedTooltip.set(newValue)
));

optionsRowList.addBig(new BooleanOption(
"gui.projectexpansion.config.alchemical_collection_sound",
__ -> Config.alchemicalCollectionSound.get(),
(__, newValue) -> Config.alchemicalCollectionSound.set(newValue)
));

addButton(new Button((width - BUTTON_WIDTH) / 2, height - DONE_BUTTON_TOP_OFFSET, BUTTON_WIDTH, BUTTON_HEIGHT, new TranslationTextComponent("gui.done"), (button) -> minecraft.pushGuiLayer(parentScreen)));
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package cool.furry.mc.forge.projectexpansion.mixin;

import cool.furry.mc.forge.projectexpansion.config.Config;
import cool.furry.mc.forge.projectexpansion.registries.Enchantments;
import cool.furry.mc.forge.projectexpansion.registries.SoundEvents;
import cool.furry.mc.forge.projectexpansion.util.NBTNames;
import cool.furry.mc.forge.projectexpansion.util.Util;
import moze_intel.projecte.api.ItemInfo;
Expand All @@ -16,7 +18,6 @@
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.SoundEvents;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.server.ServerWorld;
import org.spongepowered.asm.mixin.Mixin;
Expand Down Expand Up @@ -69,7 +70,7 @@ private static void getDrops(BlockState state, ServerWorld world, BlockPos pos,
});
}
provider.syncEmc(player);
world.playSound(null, pos, SoundEvents.BLAZE_SHOOT, SoundCategory.BLOCKS, 1f, 0.75f);
if(Config.alchemicalCollectionSound.get()) world.playSound(null, pos, SoundEvents.ALCHEMICAL_COLLECTION_COLLECT.get(), SoundCategory.BLOCKS, 1f, 0.75f);
cir.setReturnValue(newDrops);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ public class SoundEvents {
public static final RegistryObject<SoundEvent> KNOWLEDGE_SHARING_BOOK_STORE = Registry.register("knowledge_sharing_book.store", () -> new SoundEvent(new ResourceLocation(Main.MOD_ID, "knowledge_sharing_book.store")));
public static final RegistryObject<SoundEvent> KNOWLEDGE_SHARING_BOOK_USE = Registry.register("knowledge_sharing_book.use", () -> new SoundEvent(new ResourceLocation(Main.MOD_ID, "knowledge_sharing_book.use")));
public static final RegistryObject<SoundEvent> KNOWLEDGE_SHARING_BOOK_USE_NONE = Registry.register("knowledge_sharing_book.use_none", () -> new SoundEvent(new ResourceLocation(Main.MOD_ID, "knowledge_sharing_book.use_none")));
public static final RegistryObject<SoundEvent> ALCHEMICAL_COLLECTION_COLLECT = Registry.register("alchemical_collection.collect", () -> new SoundEvent(new ResourceLocation(Main.MOD_ID, "alchemical_collection.collect")));
}
4 changes: 4 additions & 0 deletions src/main/resources/assets/projectexpansion/sounds.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,9 @@
"knowledge_sharing_book.use_none": {
"subtitle": "sounds.projectexpansion.knowledge_sharing_book.use_none",
"sounds": ["minecraft:random/fizz"]
},
"alchemical_collection.collect": {
"subtitle": "sounds.projectexpansion.alchemical_collection.collect",
"sounds": ["minecraft:mob/ghast/fireball4"]
}
}

0 comments on commit ee84f23

Please sign in to comment.