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 keyCode, int scanCode, int modifiers)
      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:
      keyCode - the key code of the pressed key.
      scanCode - the scan code of the pressed key.
      modifiers - the keyboard modifiers.
      Returns:
      true if the event is consumed, false otherwise.
    • render

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

      private void drawProgressBar(GuiGraphics guiGraphics)
    • drawUploadSpeed

      private void drawUploadSpeed(GuiGraphics guiGraphics)
    • drawUploadSpeed0

      private void drawUploadSpeed0(GuiGraphics guiGraphics, long bytesPerSecond)
    • tick

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

      private Component createProgressNarrationMessage()
    • upload

      private void upload()
    • setErrorMessage

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

      private void uploadCancelled()
    • verify

      private boolean verify(File file)
    • tarGzipArchive

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

      private void addFileToTarGz(org.apache.commons.compress.archivers.tar.TarArchiveOutputStream tarArchiveOutputStream, String pathname, String name, boolean rootDirectory) throws IOException
      Throws:
      IOException