Skip to content

About

Simple Custom Early Loading for Minecraft NeoForge

Topics

Resources

Stars

4 stars

Watchers

1 watching

Forks

Repository files navigation

Simple Custom Early Loading

Curseforge Modrinth

This mod allows the customization of Neoforge's early loading screen.

There is also a quite "hacky" version for Forge 1.20.1, 1.20.2, 1.20.4, 1.20.6.
I do not plan to continue in supporting other Forge versions due to technical reasons.
For newer versions, please use the NeoForge. See forge version description: Releases.

Preview

Currently, the window is not able to dynamically change its resolution when the window is resized.
I won't allow removing the Mojang logo.

Features:

  • add and position custom images (see supported image formats)
  • toggle and change the position of the progress bar
  • toggle performance bar
  • toggle NeoForge's fox
  • toggle bottom left log
  • toggle NeoForge's version (bottom right)

Supported image formats:

Animated images:

  • APNG - must be created without unchanged pixels detection (each frame is rendered from scratch). The animation will respect the image timing and repeat count.

Static images:

  • JPEG baseline & progressive (12 bpc/arithmetic not supported, same as stock IJG lib
  • PNG 1/2/4/8/16-bit-per-channel
  • TGA (not sure what subset, if a subset)
  • BMP non-1bpp, non-RLE
  • PSD (composited view only, no extra channels, 8/16 bit-per-channel)
  • GIF (renders only single static frame, use APNG instead)
  • HDR (radiance rgbE format)
  • PIC (Softimage PIC)
  • PNM (PPM and PGM binary only)

Installation - NeoForge:

  1. place the jar in the mods folder
  2. modify the config/fml.toml file
# Early window provider
earlyWindowProvider = "SimpleCustomEarlyLoading"
# ... Other options ...
# Optionally set the window to be maximized
earlyWindowMaximized = true

Installation - Forge:

  1. place the jar in the mods folder
  2. forge version requires default config/fml.toml value
#Early window provider
earlyWindowProvider = "fmlearlywindow"

Unfortunately, the override is applied quite late, which may result in the original red early loading (or a white screen) to "flash" on the very game start. I can't do anything about that.

However, the red color of the original loading can be changed to black using

  1. Optional: update options.txt file: darkMojangStudiosBackground:true

Configuration:

Place your images in the config/simple-custom-early-loading folder.

Then you can edit the configuration file config/simple-custom-early-loading.json.
You can find default config here.

In the configuration you can specify elements. Each element is one image in a supported format. The element needs to have a position specified.

First you define the position_anchor which specifies which part of the image is aligned with the x and y coordinates. For example, TOP_LEFT means, that top left corner of the image will be aligned to the x and y coordinates. Possible values are: TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, BOTTOM_RIGHT, CENTER, TOP_CENTER, BOTTOM_CENTER, LEFT_CENTER, RIGHT_CENTER. You can see the specifications in the ElementAnchor enum.

position_unit specifies the type of coordinates for x and y coordinates. PIXELS means that coordinates are absolute pixels in the window. PERCENTAGE means that coordinates are percentage of the window size. E.g. x=50 and y=50 means that the image anchor will be positioned in the middle of the window.

It is also possible to specify the position units for each coordinate separately. (position_unit_x, position_unit_y)

x and y coordinates specify the position of the image anchor in the position units.

width and height specify the size of the image on the screen.

size_unit specifies the unit for the width and height parameters (again PIXELS or PERCENTAGE). Percentage values are calculated from the window size.

You can specify only one parameter, either width or height and the second will be calculated from the aspect ratio of the image.

The default config contains an example of background (stretched to the whole window) - it is a screenshot from the game with the stellarview mod.
Second element is an APNG animation created with BlockBench with text generator plugin and ScreenToGif application.

For creating APNG animations, I recommend using ScreenToGif application. During export, you need to uncheck the "Detect unchanged pixels" option.

Display conditions

Since version 2.2, it is possible to specify display conditions for each element.

  • The condition result can be negated with "negate": true
  • The condition can also be activated only once and hold forever after that with "hold_after_trigger": true
"display_conditions": [
    // a list of conditions, when any of the conditions is met, the element will be rendered
    {
      "type": "LOADING_PERCENTAGE", // renders the element when the Minecraft loading progress percentage is in the defined range
      "minimum": 0,
      "minimumInclusive": false,
      "maximum": 50,
      "maximumInclusive": true,
    },
    {
    "type": "LOADING_STAGE", // renders the element when any active loading stage contains any of the defined keywords (stages below)
    // the match is not case sensitive
    "stages": [
      // Note that some stages may occure concurently or in a different order
      // some of the options for example are:
      "Scanning mod candidates",
      "Launching minecraft",
      "Loading bootstrap resources",
      "Loading mods",
      "Mod Construction",
      "Mod Construction: Deferred Queue",
      "Registry initialization",
      "Config loading",
      "Minecraft Progress",
      "Sided setup",
       // Note that those stages differ between Forge and NeoForge
       // Forge stages are below:
       "Discovering mod files",
       "Loaded language provider",
       "Scanning mod candidates",
       "Launching minecraft",
       "Loading bootstrap resources",
       "Loading mods",
       "Mod Gather",
       "Mod Gather working",
       "Mod Gather: dispatching CONSTRUCT",
       "State transition CREATE_REGISTRIES",
       "State transition OBJECT_HOLDERS",
       "State transition LOAD_REGISTRIES",
       "Minecraft Progress"
    ]
  }
],

Custom loading textures

Since version 2.3, it is possible to use APNG textures that will be rendered based on the loading progress percentage. Each frame of the APNG texture will be rendered based on the current loading progress percentage. If APNG has 100 frames, each frame will be rendered for 1% of the loading progress.

  • GAME_LOADING_IMAGE uses minecraft loading progress, note that this progress is AFTER the early loading
  • TOTAL_LOADING_IMAGE uses heuristic based on known loading phases to estimate the total loading progress, that includes the early loading AND minecraft loading in total
{
  "image": "loading.apng",
  "type": "TOTAL_LOADING_IMAGE" // or "GAME_LOADING_IMAGE"
  "position": {
    // ...
  }
}

Development

This is a simplified version of StargateEarlyLoading mod.

If you are interested in some implementation details, see implementation description of StargateEarlyLoading.

Copyright

Japng © Copyright A. Ellerton.
Japng is licensed under Apache-2.0.
Japng GitHub repository


NOT AN OFFICIAL MINECRAFT PRODUCT/SERVICE/MOD. NOT APPROVED BY OR ASSOCIATED WITH MOJANG OR MICROSOFT

About

Simple Custom Early Loading for Minecraft NeoForge

Topics

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages