Class RealmsUploadScreen

All Implemented Interfaces:
ContainerEventHandler, GuiEventListener, Renderable, TabOrderedElement

public class RealmsUploadScreen extends RealmsScreen
  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • UPLOAD_LOCK

      private static final ReentrantLock UPLOAD_LOCK
    • BAR_WIDTH

      private static final int BAR_WIDTH
      See Also:
    • BAR_TOP

      private static final int BAR_TOP
      See Also:
    • BAR_BOTTOM

      private static final int BAR_BOTTOM
      See Also:
    • BAR_BORDER

      private static final int BAR_BORDER
      See Also:
    • DOTS

      private static final String[] DOTS
    • VERIFYING_TEXT

      private static final Component VERIFYING_TEXT
    • lastScreen

      private final RealmsResetWorldScreen lastScreen
    • selectedLevel

      private final LevelSummary selectedLevel
    • realmCreationTask

      @Nullable private final RealmCreationTask realmCreationTask
    • realmId

      private final long realmId
    • slotId

      private final int slotId
    • uploadStatus

      private final UploadStatus uploadStatus
    • narrationRateLimiter

      private final com.google.common.util.concurrent.RateLimiter narrationRateLimiter
    • errorMessage

      @Nullable private volatile Component[] errorMessage
    • status

      private volatile Component status
    • progress

      @Nullable private volatile String progress
    • cancelled

      private volatile boolean cancelled
    • uploadFinished

      private volatile boolean uploadFinished
    • showDots

      private volatile boolean showDots
    • uploadStarted

      private volatile boolean uploadStarted
    • backButton

      @Nullable private Button backButton
    • cancelButton

      @Nullable private Button cancelButton
    • tickCount

      private int tickCount
    • previousWrittenBytes

      @Nullable private Long previousWrittenBytes
    • previousTimeSnapshot

      @Nullable private Long previousTimeSnapshot
    • bytesPersSecond

      private long bytesPersSecond
    • layout

      private final HeaderAndFooterLayout layout
  • Constructor Details

  • Method Details

    • init

      public void init()
      Overrides:
      init in class Screen
    • repositionElements

      protected void repositionElements()
      Overrides:
      repositionElements in class Screen
    • onBack

      private void onBack()
    • onCancel

      private void onCancel()
    • keyPressed

      public boolean keyPressed(int pKeyCode, int pScanCode, int pModifiers)
      Description copied from class: Screen
      Called when a keyboard key is pressed within the GUI element.

      Specified by:
      keyPressed in interface ContainerEventHandler
      Specified by:
      keyPressed in interface GuiEventListener
      Overrides:
      keyPressed in class Screen
      Parameters:
      pKeyCode - the key code of the pressed key.
      pScanCode - the scan code of the pressed key.
      pModifiers - the keyboard modifiers.
      Returns:
      true if the event is consumed, false otherwise.
    • render

      public void render(GuiGraphics pGuiGraphics, int pMouseX, int pMouseY, float pPartialTick)
      Renders the graphical user interface (GUI) element.
      Specified by:
      render in interface Renderable
      Overrides:
      render in class Screen
      Parameters:
      pGuiGraphics - the GuiGraphics object used for rendering.
      pMouseX - the x-coordinate of the mouse cursor.
      pMouseY - the y-coordinate of the mouse cursor.
      pPartialTick - the partial tick time.
    • drawProgressBar

      private void drawProgressBar(GuiGraphics pGuiGraphics)
    • drawUploadSpeed

      private void drawUploadSpeed(GuiGraphics pGuiGraphics)
    • drawUploadSpeed0

      private void drawUploadSpeed0(GuiGraphics pGuiGraphics, long pBytesPerSecond)
    • tick

      public void tick()
      Overrides:
      tick in class Screen
    • createProgressNarrationMessage

      private Component createProgressNarrationMessage()
    • upload

      private void upload()
    • setErrorMessage

      private void setErrorMessage(Component... pErrorMessage)
    • uploadCancelled

      private void uploadCancelled()
    • verify

      private boolean verify(File pFile)
    • tarGzipArchive

      private File tarGzipArchive(File pFile) throws IOException
      Throws:
      IOException
    • addFileToTarGz

      private void addFileToTarGz(org.apache.commons.compress.archivers.tar.TarArchiveOutputStream p_90108_, String p_90109_, String p_90110_, boolean p_90111_) throws IOException
      Throws:
      IOException