Skip to content

Minecraft mod that embeds Modern UI into Minecraft, providing modding API, text layout engine and some widgets.

License

Notifications You must be signed in to change notification settings

BloCamLimb/ModernUI-MC

Repository files navigation

Modern UI for Minecraft

CurseForge CurseForge

Description

Modern UI for Minecraft, is a Minecraft Mod that is based on Modern UI Core Framework and Modern UI Core Extensions. It provides Modern UI bootstrap program in Minecraft environment and Modding API based on Forge/Fabric, to make powerful Graphical User Interface in Minecraft.

This Mod also includes a powerful text layout engine and text rendering system designed for Minecraft. This engine provides appropriate methods for processing Unicode text and gives you more readable text in any scale, in 2D/3D. In details:

  • Real-time preview and reload TrueType/OpenType fonts
  • A better font fallback implementation
  • Anti-aliasing text and FreeType font hinting
  • Use improved SDF text rendering in 2D/3D (also use batch rendering)
  • Compute exact font size in device space for native glyph rendering
  • Use Google Noto Color Emoji and support all the Unicode 15.0 Emoji
  • Configurable bidirectional text heuristic algorithm
  • Configurable text shadow and raw font size
  • Unicode line breaking and CSS line-break & word-break
  • Fast, exact and asynchronous Unicode text layout computation
  • Faster and more memory efficient rectangle packing algorithm for glyphs
  • Use real grayscale texture (1 byte-per-pixel, whereas Minecraft is 4 bpp)
  • Compatible with OptiFine, Sodium (Rubidium), Iris (Oculus) and many mods
  • Compatible with Minecraft's JSON font definition (bitmap fonts, TTF fonts)

Additionally, this Mod provides many utilities which improve game performance and gaming experience. Currently, we have:

  • Changing screen background color
  • Gaussian blur to screen backdrop image
  • Fade-in animation to screen background
  • More window modes: Fullscreen (borderless), Maximized (borderless)
  • Framerate limit and master volume fading on window inactive (out of focus) and minimized
  • Pausing single-player game when Inventory is open
  • Changing GUI scale option to Slider and providing hint text
  • Playing a "Ding" sound when Minecraft loads and reaches the Main Menu
  • Enabling smooth scrolling in Vanilla's Selection List and Forge's Scroll Panel
  • Pressing "C" to Zoom that is the same as OptiFine
  • Undo/Redo and Unicode word iterator for all text fields
  • Playing local music, allowing to seek and view spectrum
  • Support Discord/Slack/GitHub/IamCal/JoyPixels emoji shortcodes in Chatting
  • A fancy tooltip style
    • Choose rounded border or normal border (with anti-aliasing)
    • Add title break and control title line spacing
    • Center the title line, support RTL layout direction
    • Exactly position the tooltip to pixel grid (smooth movement)
    • Change background color and border color (with gradient and animation)

Releases for Minecraft Mod are available on CurseForge and Modrinth.
For historical reasons, issues should go to Core Repo's Issue Tracker. If you have any questions, feel free to join our Discord server.

License

  • Modern UI for Minecraft
    • Copyright (C) 2019-2024 BloCamLimb et al.
    • License
  • Additional Assets

Gradle configuration

repositories {
    maven {
        name 'IzzelAliz Maven'
        url 'https://maven.izzel.io/releases/'
    }
}
ForgeGradle 5
configurations {
    library
    implementation.extendsFrom library
}
minecraft.runs.all {
    lazyToken('minecraft_classpath') {
        configurations.library.copyRecursive().resolve().collect { it.absolutePath }.join(File.pathSeparator)
    }
}
dependencies {
    // Modern UI core framework
    library "icyllis.modernui:ModernUI-Core:${modernui_version}"
    // Modern UI core extensions
    library "icyllis.modernui:ModernUI-Markdown:${modernui_version}"
    // Modern UI for Minecraft Forge
    implementation fg.deobf("icyllis.modernui:ModernUI-Forge:${minecraft_version}-${modernui_version}.+")
}

Add these if you have not MixinGradle:

minecraft {
    runs {
        client {
            property 'mixin.env.remapRefMap', 'true'
            property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"
        }
        server {
            property 'mixin.env.remapRefMap', 'true'
            property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"
        }
        // apply to data if you have datagen
    }
}

You need to regenerate run configurations if you make any changes on this.

Building Modern UI for Minecraft

Modern UI for Minecraft requires the latest Modern UI codebase to build. You should clone ModernUI into the same parent directory of ModernUI-MC and ensure they're up-to-date. Checkout ModernUI/master branch or a stable branch.

Screenshots (maybe outdated, try yourself)

ModernUI-MC-Diagram.png
New Tooltip
new tooltip.png
Center Screen
2024-03-30_16.17.11.png Markdown
markdown
Texts
fast text new4
Navigation
new5
Graphics
new3.gif
Audio visualization
new2
Out-of-date widgets
a b