@Nullable @Override public SoundEventAccessor createAccessor(@Nonnull SoundHandler handler) { SoundEventAccessor soundEventAccessor = handler.getAccessor(this.soundLocation); if (soundEventAccessor == null) { FirstAid.logger.warn("Missing sound for location " + this.soundLocation); this.sound = SoundHandler.MISSING_SOUND; } else { this.sound = soundEventAccessor.cloneEntry(); } return soundEventAccessor; }
public void soundPlay(ISound soundIn, SoundEventAccessor accessor) { if (accessor.getSubtitle() != null) { String s = accessor.getSubtitle().getFormattedText(); if (!this.subtitles.isEmpty()) { for (GuiSubtitleOverlay.Subtitle guisubtitleoverlay$subtitle : this.subtitles) { if (guisubtitleoverlay$subtitle.getString().equals(s)) { guisubtitleoverlay$subtitle.refresh(new Vec3d((double)soundIn.getXPosF(), (double)soundIn.getYPosF(), (double)soundIn.getZPosF())); return; } } } this.subtitles.add(new GuiSubtitleOverlay.Subtitle(s, new Vec3d((double)soundIn.getXPosF(), (double)soundIn.getYPosF(), (double)soundIn.getZPosF()))); } }
/** Adds a subtitle to the list in the given colour. */ public void addSubtitle(ISound sound, SoundEventAccessor accessor, int colour) { if (sound != null && accessor.getSubtitle() != null) { String s = accessor.getSubtitle().getFormattedText(); if (!this.subtitles.isEmpty()) { for (Subtitle subtitle : this.subtitles) { if (subtitle.getString().equals(s)) { subtitle.refresh(new Vec3d(sound.getXPosF(), sound.getYPosF(), sound.getZPosF())); return; } } } this.subtitles.add(new Subtitle(s, new Vec3d(sound.getXPosF(), sound.getYPosF(), sound.getZPosF()), colour)); } }
@Override public SoundEventAccessor createAccessor(SoundHandler handler) { return sound.createAccessor(handler); }
@Override public SoundEventAccessor createAccessor(SoundHandler arg0) { this.soundEvent = arg0.getAccessor(this.getSoundLocation()); this.sound = this.soundEvent == null ? SoundHandler.MISSING_SOUND : this.soundEvent.cloneEntry(); return this.soundEvent; }