Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Thanks to Choonster for posting helpful info on Minecraft Forum about custom sound events.
- Loading branch information
Showing
9 changed files
with
56 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
src/main/java/com/yooksi/fierysouls/common/CustomSoundEvents.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.yooksi.fierysouls.common; | ||
|
||
import net.minecraft.util.ResourceLocation; | ||
import net.minecraft.util.SoundEvent; | ||
import net.minecraftforge.fml.common.registry.GameRegistry; | ||
|
||
public class CustomSoundEvents | ||
{ | ||
public static SoundEvent item_match_strike; | ||
|
||
/** | ||
* Register the {@link SoundEvent}s. | ||
*/ | ||
public static void registerSounds() | ||
{ | ||
item_match_strike = registerSound("item.match_strike"); | ||
} | ||
|
||
private static SoundEvent registerSound(String soundName) | ||
{ | ||
final ResourceLocation soundID = new ResourceLocation(FierySouls.MODID, soundName); | ||
return GameRegistry.register(new SoundEvent(soundID).setRegistryName(soundID)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"item.match_strike": { | ||
"category": "item", | ||
"sounds": [ | ||
{ | ||
# Sound downloaded from https://www.freesound.org/people/HunteR4708/sounds/256804/ | ||
# All credits got to user HunterR4708 | ||
|
||
"name": "fierysouls:item/match_strike", | ||
"stream": true | ||
} | ||
] | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters