Skip to content

Commit

Permalink
Fix sounds not being registered
Browse files Browse the repository at this point in the history
  • Loading branch information
rubensworks committed Jun 21, 2024
1 parent 79ef901 commit 8b60ff4
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 4 deletions.
6 changes: 6 additions & 0 deletions src/main/java/org/cyclops/integrateddynamics/Configs.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
import org.cyclops.integrateddynamics.recipe.RecipeSerializerCraftingSpecialShapedOmniDirectional3Config;
import org.cyclops.integrateddynamics.recipe.RecipeSerializerCraftingSpecialShapedOmniDirectionalConfig;
import org.cyclops.integrateddynamics.recipe.RecipeSerializerCraftingSpecialShapelessOmniDirectionalConfig;
import org.cyclops.integrateddynamics.sound.SoundEventEffectPageFlipMultipleConfig;
import org.cyclops.integrateddynamics.sound.SoundEventEffectPageFlipSingleConfig;
import org.cyclops.integrateddynamics.world.gen.foliageplacer.FoliagePlacerMenrilConfig;
import org.cyclops.integrateddynamics.world.gen.trunkplacer.TrunkPlacerMenrilConfig;

Expand Down Expand Up @@ -183,6 +185,10 @@ public static void registerBlocks(ConfigHandler configHandler) {
configHandler.addConfigurable(new LootFunctionCopyMechanicalMachineEnergyConfig());
configHandler.addConfigurable(new LootFunctionCopyMechanicalSqueezerTankConfig());
configHandler.addConfigurable(new LootFunctionCopyProxyIdConfig());

// Sounds
configHandler.addConfigurable(new SoundEventEffectPageFlipMultipleConfig());
configHandler.addConfigurable(new SoundEventEffectPageFlipSingleConfig());
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ public class RegistryEntries {
public static final DeferredHolder<RecipeSerializer<?>, SimpleCraftingRecipeSerializer<ItemFacadeRecipe>> RECIPESERIALIZER_FACADE = DeferredHolder.create(Registries.RECIPE_SERIALIZER, new ResourceLocation("integrateddynamics:crafting_special_facade"));
public static final DeferredHolder<RecipeSerializer<?>, SimpleCraftingRecipeSerializer<ItemVariableCopyRecipe>> RECIPESERIALIZER_VARIABLE_COPY = DeferredHolder.create(Registries.RECIPE_SERIALIZER, new ResourceLocation("integrateddynamics:crafting_special_variable_copy"));

public static final DeferredHolder<SoundEvent, SoundEvent> SOUNDEVENT_EFFECT_PAGE_FLIPSINGLE = DeferredHolder.create(Registries.SOUND_EVENT, new ResourceLocation("item.book.page_turn"));
public static final DeferredHolder<SoundEvent, SoundEvent> SOUNDEVENT_EFFECT_PAGE_FLIPMULTIPLE = DeferredHolder.create(Registries.SOUND_EVENT, new ResourceLocation("item.book.put"));
public static final DeferredHolder<SoundEvent, SoundEvent> SOUNDEVENT_EFFECT_PAGE_FLIPSINGLE = DeferredHolder.create(Registries.SOUND_EVENT, new ResourceLocation("integrateddynamics:effect_page_flipsingle"));
public static final DeferredHolder<SoundEvent, SoundEvent> SOUNDEVENT_EFFECT_PAGE_FLIPMULTIPLE = DeferredHolder.create(Registries.SOUND_EVENT, new ResourceLocation("integrateddynamics:effect_page_flipmultiple"));


}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package org.cyclops.integrateddynamics.sound;

import net.minecraft.resources.ResourceLocation;
import net.minecraft.sounds.SoundEvent;
import org.cyclops.integrateddynamics.IntegratedDynamics;

/**
* @author rubensworks
*/
public class SoundEventEffectPageFlipMultipleConfig extends org.cyclops.cyclopscore.config.extendedconfig.SoundEventConfig {
public SoundEventEffectPageFlipMultipleConfig() {
super(
IntegratedDynamics._instance,
"effect_page_flipmultiple",
(eConfig) -> SoundEvent.createVariableRangeEvent(new ResourceLocation(eConfig.getMod().getModId(), eConfig.getNamedId()))
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package org.cyclops.integrateddynamics.sound;

import net.minecraft.resources.ResourceLocation;
import net.minecraft.sounds.SoundEvent;
import org.cyclops.integrateddynamics.IntegratedDynamics;

/**
* @author rubensworks
*/
public class SoundEventEffectPageFlipSingleConfig extends org.cyclops.cyclopscore.config.extendedconfig.SoundEventConfig {
public SoundEventEffectPageFlipSingleConfig() {
super(
IntegratedDynamics._instance,
"effect_page_flipsingle",
(eConfig) -> SoundEvent.createVariableRangeEvent(new ResourceLocation(eConfig.getMod().getModId(), eConfig.getNamedId()))
);
}
}
4 changes: 2 additions & 2 deletions src/main/resources/assets/integrateddynamics/sounds.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"effect.page.flipsingle": {
"effect_page_flipsingle": {
"sounds": [
"integrateddynamics:page_flip1",
"integrateddynamics:page_flip2",
"integrateddynamics:page_flip3"
],
"subtitle": "subtitles.integrateddynamics.effect.page.flipsingle"
},
"effect.page.flipmultiple": {
"effect_page_flipmultiple": {
"sounds": [
"integrateddynamics:pages_flip"
],
Expand Down

0 comments on commit 8b60ff4

Please sign in to comment.