提供: Minecraft Modding Wiki
この編集を取り消せます。
下記の差分を確認して、本当に取り消していいか検証してください。よろしければ変更を保存して取り消しを完了してください。
最新版 | 編集中の文章 | ||
27行目: | 27行目: | ||
import net.minecraftforge.client.event.sound.SoundLoadEvent; | import net.minecraftforge.client.event.sound.SoundLoadEvent; | ||
import net.minecraftforge.event.ForgeSubscribe; | import net.minecraftforge.event.ForgeSubscribe; | ||
− | |||
− | |||
public class SoundHandler | public class SoundHandler | ||
{ | { | ||
− | |||
@ForgeSubscribe | @ForgeSubscribe | ||
public void onSound(SoundLoadEvent event) | public void onSound(SoundLoadEvent event) | ||
{ | { | ||
try { | try { | ||
− | event.manager.addSound("soundsample: | + | event.manager.addSound("soundsample:sample.ogg"); |
} catch (Exception e) { | } catch (Exception e) { | ||
System.err.println("Failed to register one or more sounds."); | System.err.println("Failed to register one or more sounds."); | ||
47行目: | 44行目: | ||
===SoundHandler.java=== | ===SoundHandler.java=== | ||
<source lang = "java"> | <source lang = "java"> | ||
− | |||
@ForgeSubscribe | @ForgeSubscribe | ||
public void onSound(SoundLoadEvent event) | public void onSound(SoundLoadEvent event) |