Class NowPlayingToast

java.lang.Object
net.minecraft.client.gui.components.toasts.NowPlayingToast
All Implemented Interfaces:
Toast

public class NowPlayingToast extends Object implements Toast
  • Field Details

    • NOW_PLAYING_BACKGROUND_SPRITE

      private static final ResourceLocation NOW_PLAYING_BACKGROUND_SPRITE
    • MUSIC_NOTES_SPRITE

      private static final ResourceLocation MUSIC_NOTES_SPRITE
    • PADDING

      private static final int PADDING
      See Also:
    • MUSIC_NOTES_SIZE

      private static final int MUSIC_NOTES_SIZE
      See Also:
    • HEIGHT

      private static final int HEIGHT
      See Also:
    • MUSIC_NOTES_SPACE

      private static final int MUSIC_NOTES_SPACE
      See Also:
    • VISIBILITY_DURATION

      private static final int VISIBILITY_DURATION
      See Also:
    • TEXT_COLOR

      private static final int TEXT_COLOR
    • MUSIC_COLOR_CHANGE_FREQUENCY_MS

      private static final long MUSIC_COLOR_CHANGE_FREQUENCY_MS
      See Also:
    • musicNoteColorTick

      private static int musicNoteColorTick
    • lastMusicNoteColorChange

      private static long lastMusicNoteColorChange
    • musicNoteColor

      private static int musicNoteColor
    • updateToast

      private boolean updateToast
    • notificationDisplayTimeMultiplier

      private double notificationDisplayTimeMultiplier
    • currentSong

      @Nullable private static String currentSong
    • minecraft

      private final Minecraft minecraft
    • wantedVisibility

      private Toast.Visibility wantedVisibility
  • Constructor Details

    • NowPlayingToast

      public NowPlayingToast()
  • Method Details

    • renderToast

      public static void renderToast(GuiGraphics pGuiGraphics, Font pFont)
    • tickMusicNotes

      public static void tickMusicNotes()
    • getNowPlayingString

      private static Component getNowPlayingString(@Nullable String pCurrentSong)
    • showToast

      public void showToast(Options pOptions)
    • update

      public void update(ToastManager pToastManager, long pVisibilityTime)
      Specified by:
      update in interface Toast
    • render

      public void render(GuiGraphics pGuiGraphics, Font pFont, long pVisibilityTime)
      Specified by:
      render in interface Toast
    • onFinishedRendering

      public void onFinishedRendering()
      Specified by:
      onFinishedRendering in interface Toast
    • width

      public int width()
      Specified by:
      width in interface Toast
    • getWidth

      private static int getWidth(@Nullable String pText, Font pFont)
    • height

      public int height()
      Specified by:
      height in interface Toast
    • xPos

      public float xPos(int pGuiWidth, float pVisiblePortion)
      Specified by:
      xPos in interface Toast
    • yPos

      public float yPos(int pFirstSlotIndex)
      Specified by:
      yPos in interface Toast
    • getWantedVisibility

      public Toast.Visibility getWantedVisibility()
      Specified by:
      getWantedVisibility in interface Toast
    • setWantedVisibility

      public void setWantedVisibility(Toast.Visibility pWantedVisibility)