-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
8 changed files
with
163 additions
and
155 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,5 +21,4 @@ public static void loadCommon(Path configPath) { | |
public static TempConfig config() { | ||
return config; | ||
} | ||
|
||
} |
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
44 changes: 23 additions & 21 deletions
44
common/src/main/java/com/girafi/ping/util/PingSounds.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 |
---|---|---|
@@ -1,21 +1,23 @@ | ||
//package com.girafi.ping.util; | ||
// | ||
//import net.minecraft.resources.ResourceLocation; | ||
//import net.minecraft.sounds.SoundEvent; | ||
// | ||
//public class PingSounds { | ||
// public static final DeferredRegister<SoundEvent> SOUND_DEFERRED = DeferredRegister.create(ForgeRegistries.SOUND_EVENTS, Ping.MOD_ID); | ||
// public static final RegistryObject<SoundEvent> BLOOP = registerSound("bloop"); | ||
// | ||
// /** | ||
// * Registers a sound | ||
// * | ||
// * @param name The name to register the sound with | ||
// * @return The Sound that was registered | ||
// */ | ||
// public static RegistryObject<SoundEvent> registerSound(String name) { | ||
// ResourceLocation resourceLocation = new ResourceLocation(Ping.MOD_ID, name); | ||
// SoundEvent sound = SoundEvent.createVariableRangeEvent(resourceLocation); | ||
// return SOUND_DEFERRED.register(name, () -> sound); | ||
// } | ||
//} | ||
package com.girafi.ping.util; | ||
|
||
import com.girafi.ping.Constants; | ||
import net.minecraft.resources.ResourceLocation; | ||
import net.minecraft.sounds.SoundEvent; | ||
|
||
import java.util.function.Supplier; | ||
|
||
public class PingSounds { | ||
public static final Supplier<SoundEvent> BLOOP = registerSound("bloop"); | ||
|
||
/** | ||
* Registers a sound | ||
* | ||
* @param name The name to register the sound with | ||
* @return The Sound that was registered | ||
*/ | ||
public static Supplier<SoundEvent> registerSound(String name) { | ||
ResourceLocation resourceLocation = new ResourceLocation(Constants.MOD_ID, name); | ||
SoundEvent sound = SoundEvent.createVariableRangeEvent(resourceLocation); | ||
return () -> sound; | ||
} | ||
} |
Oops, something went wrong.