diff --git a/build.gradle b/build.gradle index ebd3521..734dc18 100644 --- a/build.gradle +++ b/build.gradle @@ -2,21 +2,23 @@ buildscript { repositories { // These repositories are only for Gradle plugins, put any other repositories in the repository block further below maven { url = 'https://maven.minecraftforge.net' } - maven { url = 'https://repo.spongepowered.org/maven' } + maven { url = 'https://repo.spongepowered.org/repository/maven-public/' } + maven { url = 'https://maven.parchmentmc.org' } mavenCentral() } dependencies { - classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true + classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '6+', changing: true + classpath "org.parchmentmc:librarian:1.+" //classpath 'org.spongepowered:mixingradle:0.7-SNAPSHOT' } } apply plugin: 'net.minecraftforge.gradle' // Only edit below this line, the above code adds and enables the necessary things for Forge to be setup. -apply plugin: 'eclipse' +apply plugin: 'org.parchmentmc.librarian.forgegradle' apply plugin: 'maven-publish' //apply plugin: 'org.spongepowered.mixin' -version = '2.6.4+1.19.2-forge' +version = '2.6.4+1.20.1-forge' group = 'com.redlimerl.detailab' // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = 'DetailArmorBar' @@ -36,9 +38,8 @@ minecraft { // // Use non-default mappings at your own risk. They may not always work. // Simply re-run your setup task after changing the mappings to update your workspace. - mappings channel: 'official', version: '1.19.2' - - // accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') // Currently, this location cannot be changed from the default. + mappings channel: 'parchment', version: '2023.09.03-1.20.1' + accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') // Currently, this location cannot be changed from the default. // Default run configurations. // These can be tweaked, removed, or duplicated as needed. @@ -81,7 +82,7 @@ repositories { } dependencies { - minecraft 'net.minecraftforge:forge:1.19.2-43.0.0' + minecraft 'net.minecraftforge:forge:1.20.1-47.2.0' //implementation(fg.deobf("me.shedaniel.cloth:cloth-config-forge:5.0.38")) } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 7454180..7f93135 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 60103f9..3fa8f86 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https://services.gradle.org/distributions/gradle-7.4.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 744e882..1aa94a4 100644 --- a/gradlew +++ b/gradlew @@ -1,7 +1,7 @@ -#!/usr/bin/env sh +#!/bin/sh # -# Copyright 2015 the original author or authors. +# Copyright © 2015-2021 the original authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -17,67 +17,99 @@ # ############################################################################## -## -## Gradle start up script for UN*X -## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# ############################################################################## # Attempt to set APP_HOME + # Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" +MAX_FD=maximum warn () { echo "$*" -} +} >&2 die () { echo echo "$*" echo exit 1 -} +} >&2 # OS specific support (must be 'true' or 'false'). cygwin=false msys=false darwin=false nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MSYS* | MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -87,9 +119,9 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" + JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD="$JAVA_HOME/bin/java" + JAVACMD=$JAVA_HOME/bin/java fi if [ ! -x "$JAVACMD" ] ; then die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME @@ -98,88 +130,120 @@ Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + JAVACMD=java + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac fi -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. # For Cygwin or MSYS, switch paths to Windows format before running java -if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) fi - i=`expr $i + 1` + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg done - case $i in - 0) set -- ;; - 1) set -- "$args0" ;; - 2) set -- "$args0" "$args1" ;; - 3) set -- "$args0" "$args1" "$args2" ;; - 4) set -- "$args0" "$args1" "$args2" "$args3" ;; - 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac fi -# Escape application args -save () { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done - echo " " -} -APP_ARGS=`save "$@"` -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat index 107acd3..93e3f59 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -40,7 +41,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/src/main/java/com/redlimerl/detailab/events/PlayerEvents.java b/src/main/java/com/redlimerl/detailab/events/PlayerEvents.java index 6b42514..2c85904 100644 --- a/src/main/java/com/redlimerl/detailab/events/PlayerEvents.java +++ b/src/main/java/com/redlimerl/detailab/events/PlayerEvents.java @@ -26,7 +26,7 @@ public static void onArmorRender(RenderGuiOverlayEvent.Pre event) { event.setCanceled(true); var instance = Minecraft.getInstance(); if (instance.player != null && instance.gameMode != null && instance.gameMode.getPlayerMode().isSurvival()) { - ArmorBarRenderer.INSTANCE.render(event.getPoseStack(), instance.player); + ArmorBarRenderer.INSTANCE.render(event.getGuiGraphics().pose(), instance.player); } } } diff --git a/src/main/java/com/redlimerl/detailab/render/ArmorBarRenderer.java b/src/main/java/com/redlimerl/detailab/render/ArmorBarRenderer.java index 81bd7b6..be53abe 100644 --- a/src/main/java/com/redlimerl/detailab/render/ArmorBarRenderer.java +++ b/src/main/java/com/redlimerl/detailab/render/ArmorBarRenderer.java @@ -9,7 +9,6 @@ import com.redlimerl.detailab.api.render.CustomArmorBar; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.GuiComponent; import net.minecraft.client.renderer.GameRenderer; import net.minecraft.world.entity.ai.attributes.Attribute; import net.minecraft.world.entity.ai.attributes.AttributeInstance; @@ -213,7 +212,7 @@ private static List> getArmorPoints(Player playe private static int getDefense(ItemStack itemStack) { ArmorItem armorItem = (ArmorItem) itemStack.getItem(); - Multimap attributes = itemStack.getAttributeModifiers(armorItem.getSlot()); + Multimap attributes = itemStack.getAttributeModifiers(armorItem.getEquipmentSlot()); if (attributes.containsKey(Attributes.ARMOR)) { return attributes.get(Attributes.ARMOR).stream() .filter(att -> Arrays.stream(MODIFIERS).toList().contains(att.getId())).mapToInt(att -> (int) att.getAmount()).sum(); @@ -396,7 +395,7 @@ public void render(PoseStack matrices, Player player) { RenderSystem.disableBlend(); RenderSystem.setShaderColor(1f, 1f, 1f, 1f); - RenderSystem.setShaderTexture(0, GuiComponent.GUI_ICONS_LOCATION); + RenderSystem.setShaderTexture(0, Gui.GUI_ICONS_LOCATION); } private void drawEnchantTexture(PoseStack matrices, int x, int y, Color color, int half) { diff --git a/src/main/java/com/redlimerl/detailab/render/InGameDrawer.java b/src/main/java/com/redlimerl/detailab/render/InGameDrawer.java index 77fc2c7..c31fd04 100644 --- a/src/main/java/com/redlimerl/detailab/render/InGameDrawer.java +++ b/src/main/java/com/redlimerl/detailab/render/InGameDrawer.java @@ -2,8 +2,8 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.mojang.blaze3d.vertex.*; -import com.mojang.math.Matrix4f; import net.minecraft.client.renderer.GameRenderer; +import org.joml.Matrix4f; import java.awt.*; diff --git a/src/main/java/com/redlimerl/detailab/screen/OptionsScreen.java b/src/main/java/com/redlimerl/detailab/screen/OptionsScreen.java index 03c8bca..a9b3507 100644 --- a/src/main/java/com/redlimerl/detailab/screen/OptionsScreen.java +++ b/src/main/java/com/redlimerl/detailab/screen/OptionsScreen.java @@ -2,7 +2,9 @@ import com.mojang.blaze3d.vertex.PoseStack; import net.minecraft.ChatFormatting; +import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.components.Button; +import net.minecraft.client.gui.components.Tooltip; import net.minecraft.client.gui.screens.Screen; import net.minecraft.network.chat.*; @@ -36,156 +38,242 @@ protected void init() { if (optionType == OptionType.FEATURES) { - addRenderableWidget(new Button(width / 2 - 155 + buttonCount % 2 * 160, height / 6 - 12 + 24 * (buttonCount / 2), 150, 20, - getToggleName("enchantments", getConfig().getOptions().toggleEnchants), (button) -> { - getConfig().getOptions().toggleEnchants = !getConfig().getOptions().toggleEnchants; getConfig().save(); - button.setMessage(getToggleName("enchantments", getConfig().getOptions().toggleEnchants)); - }, (button, matrices, mouseX, mouseY) -> renderTooltip(matrices, getToggleDescription("enchantments"), Optional.empty(), mouseX, mouseY))); + addRenderableWidget( + Button.builder(getToggleName("enchantments", getConfig().getOptions().toggleEnchants), + (button) -> { + getConfig().getOptions().toggleEnchants = !getConfig().getOptions().toggleEnchants; + getConfig().save(); + button.setMessage(getToggleName("enchantments", getConfig().getOptions().toggleEnchants)); + }).pos(width / 2 - 155 + buttonCount % 2 * 160, height / 6 - 12 + 24 * (buttonCount / 2)) + .width(150).size(150, 20) + .tooltip(Tooltip.create(getToggleDescription("enchantments"))) + .build() + ); buttonCount++; - addRenderableWidget(new Button(width / 2 - 155 + buttonCount % 2 * 160, height / 6 - 12 + 24 * (buttonCount / 2), 150, 20, - getToggleName("netherites", getConfig().getOptions().toggleNetherites), (button) -> { - getConfig().getOptions().toggleNetherites = !getConfig().getOptions().toggleNetherites; getConfig().save(); - button.setMessage(getToggleName("netherites", getConfig().getOptions().toggleNetherites)); - }, (button, matrices, mouseX, mouseY) -> renderTooltip(matrices, getToggleDescription("netherites"), Optional.empty(), mouseX, mouseY))); + addRenderableWidget(Button.builder(getToggleName("netherites", getConfig().getOptions().toggleNetherites), + (button) -> { + getConfig().getOptions().toggleNetherites = !getConfig().getOptions().toggleNetherites; + getConfig().save(); + button.setMessage(getToggleName("netherites", getConfig().getOptions().toggleNetherites)); + }).pos(width / 2 - 155 + buttonCount % 2 * 160, height / 6 - 12 + 24 * (buttonCount / 2)) + .width(150).size(150, 20) + .tooltip(Tooltip.create(getToggleDescription("netherites"))) + .build() + ); buttonCount++; - addRenderableWidget(new Button(width / 2 - 155 + buttonCount % 2 * 160, height / 6 - 12 + 24 * (buttonCount / 2), 150, 20, - getToggleName("thorns", getConfig().getOptions().toggleThorns), (button) -> { - getConfig().getOptions().toggleThorns = !getConfig().getOptions().toggleThorns; getConfig().save(); - button.setMessage(getToggleName("thorns", getConfig().getOptions().toggleThorns)); - }, (button, matrices, mouseX, mouseY) -> renderTooltip(matrices, getToggleDescription("thorns"), Optional.empty(), mouseX, mouseY))); + addRenderableWidget(Button.builder(getToggleName("thorns", getConfig().getOptions().toggleThorns), + (button) -> { + getConfig().getOptions().toggleThorns = !getConfig().getOptions().toggleThorns; + getConfig().save(); + button.setMessage(getToggleName("thorns", getConfig().getOptions().toggleThorns)); + }).pos(width / 2 - 155 + buttonCount % 2 * 160, height / 6 - 12 + 24 * (buttonCount / 2)) + .width(150).size(150, 20) + .tooltip(Tooltip.create(getToggleDescription("thorns"))) + .build() + ); buttonCount++; - addRenderableWidget(new Button(width / 2 - 155 + buttonCount % 2 * 160, height / 6 - 12 + 24 * (buttonCount / 2), 150, 20, - getToggleName("durability", getConfig().getOptions().toggleDurability), (button) -> { - getConfig().getOptions().toggleDurability = !getConfig().getOptions().toggleDurability; getConfig().save(); - button.setMessage(getToggleName("durability", getConfig().getOptions().toggleDurability)); - }, (button, matrices, mouseX, mouseY) -> renderTooltip(matrices, getToggleDescription("durability"), Optional.empty(), mouseX, mouseY))); + addRenderableWidget(Button.builder(getToggleName("durability", getConfig().getOptions().toggleDurability), + (button) -> { + getConfig().getOptions().toggleDurability = !getConfig().getOptions().toggleDurability; + getConfig().save(); + button.setMessage(getToggleName("durability", getConfig().getOptions().toggleDurability)); + }).pos(width / 2 - 155 + buttonCount % 2 * 160, height / 6 - 12 + 24 * (buttonCount / 2)) + .width(150).size(150, 20) + .tooltip(Tooltip.create(getToggleDescription("durability"))) + .build() + ); buttonCount++; - addRenderableWidget(new Button(width / 2 - 155 + buttonCount % 2 * 160, height / 6 - 12 + 24 * (buttonCount / 2), 150, 20, - getToggleName("mending", getConfig().getOptions().toggleMending), (button) -> { - getConfig().getOptions().toggleMending = !getConfig().getOptions().toggleMending; getConfig().save(); - button.setMessage(getToggleName("mending", getConfig().getOptions().toggleMending)); - }, (button, matrices, mouseX, mouseY) -> renderTooltip(matrices, getToggleDescription("mending"), Optional.empty(), mouseX, mouseY))); + addRenderableWidget(Button.builder(getToggleName("mending", getConfig().getOptions().toggleMending), + (button) -> { + getConfig().getOptions().toggleMending = !getConfig().getOptions().toggleMending; + getConfig().save(); + button.setMessage(getToggleName("mending", getConfig().getOptions().toggleMending)); + }).pos(width / 2 - 155 + buttonCount % 2 * 160, height / 6 - 12 + 24 * (buttonCount / 2)) + .width(150).size(150, 20) + .tooltip(Tooltip.create(getToggleDescription("mending"))) + .build() + ); buttonCount++; - addRenderableWidget(new Button(width / 2 - 155 + buttonCount % 2 * 160, height / 6 - 12 + 24 * (buttonCount / 2), 150, 20, - getToggleName("armor_types", getConfig().getOptions().toggleArmorTypes), (button) -> { - getConfig().getOptions().toggleArmorTypes = !getConfig().getOptions().toggleArmorTypes; getConfig().save(); - button.setMessage(getToggleName("armor_types", getConfig().getOptions().toggleArmorTypes)); - }, (button, matrices, mouseX, mouseY) -> renderTooltip(matrices, getToggleDescription("armor_types"), Optional.empty(), mouseX, mouseY))); + addRenderableWidget(Button.builder(getToggleName("armor_types", getConfig().getOptions().toggleArmorTypes), + (button) -> { + getConfig().getOptions().toggleArmorTypes = !getConfig().getOptions().toggleArmorTypes; + getConfig().save(); + button.setMessage(getToggleName("armor_types", getConfig().getOptions().toggleArmorTypes)); + }).pos(width / 2 - 155 + buttonCount % 2 * 160, height / 6 - 12 + 24 * (buttonCount / 2)) + .width(150).size(150, 20) + .tooltip(Tooltip.create(getToggleDescription("armor_types"))) + .build() + ); buttonCount++; - addRenderableWidget(new Button(width / 2 - 155 + buttonCount % 2 * 160, height / 6 - 12 + 24 * (buttonCount / 2), 150, 20, - getToggleName("item_types", getConfig().getOptions().toggleItemBar), (button) -> { - getConfig().getOptions().toggleItemBar = !getConfig().getOptions().toggleItemBar; getConfig().save(); - button.setMessage(getToggleName("item_types", getConfig().getOptions().toggleItemBar)); - }, (button, matrices, mouseX, mouseY) -> renderTooltip(matrices, getToggleDescription("item_types"), Optional.empty(), mouseX, mouseY))); + addRenderableWidget(Button.builder(getToggleName("item_types", getConfig().getOptions().toggleItemBar), + (button) -> { + getConfig().getOptions().toggleItemBar = !getConfig().getOptions().toggleItemBar; + getConfig().save(); + button.setMessage(getToggleName("item_types", getConfig().getOptions().toggleItemBar)); + }).pos(width / 2 - 155 + buttonCount % 2 * 160, height / 6 - 12 + 24 * (buttonCount / 2)) + .width(150).size(150, 20) + .tooltip(Tooltip.create(getToggleDescription("item_types"))) + .build() + ); buttonCount++; - addRenderableWidget(new Button(width / 2 - 155 + buttonCount % 2 * 160, height / 6 - 12 + 24 * (buttonCount / 2), 150, 20, - getToggleName("empty_bar", getConfig().getOptions().toggleEmptyBar), (button) -> { - getConfig().getOptions().toggleEmptyBar = !getConfig().getOptions().toggleEmptyBar; getConfig().save(); - button.setMessage(getToggleName("empty_bar", getConfig().getOptions().toggleEmptyBar)); - }, (button, matrices, mouseX, mouseY) -> renderTooltip(matrices, getToggleDescription("empty_bar"), Optional.empty(), mouseX, mouseY))); + addRenderableWidget(Button.builder(getToggleName("empty_bar", getConfig().getOptions().toggleEmptyBar), + (button) -> { + getConfig().getOptions().toggleEmptyBar = !getConfig().getOptions().toggleEmptyBar; + getConfig().save(); + button.setMessage(getToggleName("empty_bar", getConfig().getOptions().toggleEmptyBar)); + }).pos(width / 2 - 155 + buttonCount % 2 * 160, height / 6 - 12 + 24 * (buttonCount / 2)) + .width(150).size(150, 20) + .tooltip(Tooltip.create(getToggleDescription("empty_bar"))) + .build() + ); buttonCount++; + } if (optionType == OptionType.ANIMATION) { - addRenderableWidget(new Button(width / 2 - 155 + buttonCount % 2 * 160, height / 6 - 12 + 24 * (buttonCount / 2), 150, 20, - getEnumName("effect_type", getConfig().getOptions().effectType), (button) -> { - getConfig().getOptions().effectType = getEnumNext(getConfig().getOptions().effectType); - getConfig().save(); - button.setMessage(getEnumName("effect_type", getConfig().getOptions().effectType)); - }, (button, matrices, mouseX, mouseY) -> renderTooltip(matrices, getEnumDescription("effect_type", getConfig().getOptions().effectType), Optional.empty(), mouseX, mouseY))); + addRenderableWidget(Button.builder(getEnumName("effect_type", getConfig().getOptions().effectType), + (button) -> { + getConfig().getOptions().effectType = getEnumNext(getConfig().getOptions().effectType); + getConfig().save(); + button.setMessage(getEnumName("effect_type", getConfig().getOptions().effectType)); + }).pos(width / 2 - 155 + buttonCount % 2 * 160, height / 6 - 12 + 24 * (buttonCount / 2)) + .width(150).size(150, 20) + .tooltip(Tooltip.create(getEnumDescription("effect_type", getConfig().getOptions().effectType))) + .build() + ); buttonCount++; - addRenderableWidget(new Button(width / 2 - 155 + buttonCount % 2 * 160, height / 6 - 12 + 24 * (buttonCount / 2), 150, 20, - getEnumName("effect_speed", getConfig().getOptions().effectSpeed), (button) -> { - getConfig().getOptions().effectSpeed = getEnumNext(getConfig().getOptions().effectSpeed); - getConfig().save(); - button.setMessage(getEnumName("effect_speed", getConfig().getOptions().effectSpeed)); - }, (button, matrices, mouseX, mouseY) -> renderTooltip(matrices, getEnumDescription("effect_speed", getConfig().getOptions().effectSpeed), Optional.empty(), mouseX, mouseY))); + addRenderableWidget(Button.builder(getEnumName("effect_speed", getConfig().getOptions().effectSpeed), + (button) -> { + getConfig().getOptions().effectSpeed = getEnumNext(getConfig().getOptions().effectSpeed); + getConfig().save(); + button.setMessage(getEnumName("effect_speed", getConfig().getOptions().effectSpeed)); + }).pos(width / 2 - 155 + buttonCount % 2 * 160, height / 6 - 12 + 24 * (buttonCount / 2)) + .width(150).size(150, 20) + .tooltip(Tooltip.create(getEnumDescription("effect_speed", getConfig().getOptions().effectSpeed))) + .build() + ); buttonCount++; - addRenderableWidget(new Button(width / 2 - 155 + buttonCount % 2 * 160, height / 6 - 12 + 24 * (buttonCount / 2), 150, 20, - getEnumName("thorn", getConfig().getOptions().effectThorn), (button) -> { - getConfig().getOptions().effectThorn = getEnumNext(getConfig().getOptions().effectThorn); - getConfig().save(); - button.setMessage(getEnumName("thorn", getConfig().getOptions().effectThorn)); - }, (button, matrices, mouseX, mouseY) -> renderTooltip(matrices, getEnumDescription("thorn", getConfig().getOptions().effectThorn), Optional.empty(), mouseX, mouseY))); + addRenderableWidget(Button.builder(getEnumName("thorn", getConfig().getOptions().effectThorn), + (button) -> { + getConfig().getOptions().effectThorn = getEnumNext(getConfig().getOptions().effectThorn); + getConfig().save(); + button.setMessage(getEnumName("thorn", getConfig().getOptions().effectThorn)); + }).pos(width / 2 - 155 + buttonCount % 2 * 160, height / 6 - 12 + 24 * (buttonCount / 2)) + .width(150).size(150, 20) + .tooltip(Tooltip.create(getEnumDescription("thorn", getConfig().getOptions().effectThorn))) + .build() + ); buttonCount++; } if (optionType == OptionType.ETC) { - addRenderableWidget(new Button(width / 2 - 155 + buttonCount % 2 * 160, height / 6 - 12 + 24 * (buttonCount / 2), 150, 20, - getToggleName("vanilla_texture", getConfig().getOptions().toggleVanillaTexture), (button) -> { - getConfig().getOptions().toggleVanillaTexture = !getConfig().getOptions().toggleVanillaTexture; getConfig().save(); - button.setMessage(getToggleName("vanilla_texture", getConfig().getOptions().toggleVanillaTexture)); - }, (button, matrices, mouseX, mouseY) -> renderTooltip(matrices, getToggleDescription("vanilla_texture"), Optional.empty(), mouseX, mouseY))); + addRenderableWidget(Button.builder(getToggleName("vanilla_texture", getConfig().getOptions().toggleVanillaTexture), + (button) -> { + getConfig().getOptions().toggleVanillaTexture = !getConfig().getOptions().toggleVanillaTexture; + getConfig().save(); + button.setMessage(getToggleName("vanilla_texture", getConfig().getOptions().toggleVanillaTexture)); + }).pos(width / 2 - 155 + buttonCount % 2 * 160, height / 6 - 12 + 24 * (buttonCount / 2)) + .width(150).size(150, 20) + .tooltip(Tooltip.create(getToggleDescription("vanilla_texture"))) + .build() + ); buttonCount++; - addRenderableWidget(new Button(width / 2 - 155 + buttonCount % 2 * 160, height / 6 - 12 + 24 * (buttonCount / 2), 150, 20, - getToggleName("compatible_heart_mod", getConfig().getOptions().toggleCompatibleHeartMod), (button) -> { - getConfig().getOptions().toggleCompatibleHeartMod = !getConfig().getOptions().toggleCompatibleHeartMod; getConfig().save(); - button.setMessage(getToggleName("compatible_heart_mod", getConfig().getOptions().toggleCompatibleHeartMod)); - }, (button, matrices, mouseX, mouseY) -> renderTooltip(matrices, getToggleDescription("compatible_heart_mod"), Optional.empty(), mouseX, mouseY))); + addRenderableWidget(Button.builder(getToggleName("compatible_heart_mod", getConfig().getOptions().toggleCompatibleHeartMod), + (button) -> { + getConfig().getOptions().toggleCompatibleHeartMod = !getConfig().getOptions().toggleCompatibleHeartMod; + getConfig().save(); + button.setMessage(getToggleName("compatible_heart_mod", getConfig().getOptions().toggleCompatibleHeartMod)); + }).pos(width / 2 - 155 + buttonCount % 2 * 160, height / 6 - 12 + 24 * (buttonCount / 2)) + .width(150).size(150, 20) + .tooltip(Tooltip.create(getToggleDescription("compatible_heart_mod"))) + .build() + ); buttonCount++; - addRenderableWidget(new Button(width / 2 - 155 + buttonCount % 2 * 160, height / 6 - 12 + 24 * (buttonCount / 2), 150, 20, - getToggleName("inverse_slot", getConfig().getOptions().toggleInverseSlot), (button) -> { - getConfig().getOptions().toggleInverseSlot = !getConfig().getOptions().toggleInverseSlot; getConfig().save(); - button.setMessage(getToggleName("inverse_slot", getConfig().getOptions().toggleInverseSlot)); - }, (button, matrices, mouseX, mouseY) -> renderTooltip(matrices, getToggleDescription("inverse_slot"), Optional.empty(), mouseX, mouseY))); + addRenderableWidget(Button.builder(getToggleName("inverse_slot", getConfig().getOptions().toggleInverseSlot), + (button) -> { + getConfig().getOptions().toggleInverseSlot = !getConfig().getOptions().toggleInverseSlot; + getConfig().save(); + button.setMessage(getToggleName("inverse_slot", getConfig().getOptions().toggleInverseSlot)); + }).pos(width / 2 - 155 + buttonCount % 2 * 160, height / 6 - 12 + 24 * (buttonCount / 2)) + .width(150).size(150, 20) + .tooltip(Tooltip.create(getToggleDescription("inverse_slot"))) + .build() + ); buttonCount++; - addRenderableWidget(new Button(width / 2 - 155 + buttonCount % 2 * 160, height / 6 - 12 + 24 * (buttonCount / 2), 150, 20, - getToggleName("sort_special_item", getConfig().getOptions().toggleSortSpecialItem), (button) -> { - getConfig().getOptions().toggleSortSpecialItem = !getConfig().getOptions().toggleSortSpecialItem; getConfig().save(); - button.setMessage(getToggleName("sort_special_item", getConfig().getOptions().toggleSortSpecialItem)); - }, (button, matrices, mouseX, mouseY) -> renderTooltip(matrices, getToggleDescription("sort_special_item"), Optional.empty(), mouseX, mouseY))); + addRenderableWidget(Button.builder(getToggleName("sort_special_item", getConfig().getOptions().toggleSortSpecialItem), + (button) -> { + getConfig().getOptions().toggleSortSpecialItem = !getConfig().getOptions().toggleSortSpecialItem; + getConfig().save(); + button.setMessage(getToggleName("sort_special_item", getConfig().getOptions().toggleSortSpecialItem)); + }).pos(width / 2 - 155 + buttonCount % 2 * 160, height / 6 - 12 + 24 * (buttonCount / 2)) + .width(150).size(150, 20) + .tooltip(Tooltip.create(getToggleDescription("sort_special_item"))) + .build() + ); buttonCount++; } - Button features = addRenderableWidget(new Button(width / 2 - 92, height / 6 + 140, 60, 20, - Component.translatable("option.detailarmorbar.title.features"), (matrixStack) -> { - if (this.minecraft != null) { - this.minecraft.setScreen(new OptionsScreen(parent, OptionType.FEATURES)); - } - })); + Button features = addRenderableWidget(Button.builder(Component.translatable("option.detailarmorbar.title.features"), + (button) -> { + if (this.minecraft != null) { + this.minecraft.setScreen(new OptionsScreen(parent, OptionType.FEATURES)); + } + }) + .pos(width / 2 - 92, height / 6 + 140) + .size(60, 20) + .build() + ); features.active = optionType != OptionType.FEATURES; - Button animation = addRenderableWidget(new Button(width / 2 - 30, height / 6 + 140, 60, 20, - Component.translatable("option.detailarmorbar.title.animation"), (matrixStack) -> { - if (this.minecraft != null) { - this.minecraft.setScreen(new OptionsScreen(parent, OptionType.ANIMATION)); - } - })); +; + Button animation = addRenderableWidget(Button.builder(Component.translatable("option.detailarmorbar.title.animation"), + (button) -> { + if (this.minecraft != null) { + this.minecraft.setScreen(new OptionsScreen(parent, OptionType.ANIMATION)); + } + }) + .pos(width / 2 - 30, height / 6 + 140) + .size(60, 20) + .build() + ); animation.active = optionType != OptionType.ANIMATION; - Button etc = addRenderableWidget(new Button(width / 2 + 32, height / 6 + 140, 60, 20, - Component.translatable("option.detailarmorbar.title.etc"), (matrixStack) -> { - if (this.minecraft != null) { - this.minecraft.setScreen(new OptionsScreen(parent, OptionType.ETC)); - } - })); + Button etc = addRenderableWidget(Button.builder(Component.translatable("option.detailarmorbar.title.etc"), + (button) -> { + if (this.minecraft != null) { + this.minecraft.setScreen(new OptionsScreen(parent, OptionType.ETC)); + } + }) + .pos(width / 2 + 32, height / 6 + 140) + .size(60, 20) + .build() + ); etc.active = optionType != OptionType.ETC; - addRenderableWidget(new Button(width / 2 - 100, height / 6 + 168, 200, 20, CommonComponents.GUI_DONE, (matrixStack) -> { + addRenderableWidget(Button.builder(CommonComponents.GUI_DONE, (button) -> { if (this.minecraft != null) { this.minecraft.setScreen(parent); } - })); + }).pos(width / 2 - 100, height / 6 + 168).size(200, 20).build()); } @Override - public void render(@Nonnull PoseStack matrices, int mouseX, int mouseY, float delta) { - //buttonCount = 0; - this.renderBackground(matrices); - drawCenteredString(matrices, this.font, this.title, this.width / 2, 15, 16777215); - super.render(matrices, mouseX, mouseY, delta); + public void render(GuiGraphics pGuiGraphics, int pMouseX, int pMouseY, float pPartialTick) { + this.renderBackground(pGuiGraphics); + pGuiGraphics.drawCenteredString(this.font, this.title, this.width / 2, 15, 16777215); + super.render(pGuiGraphics, pMouseX, pMouseY, pPartialTick); } @Override @@ -206,21 +294,18 @@ private > MutableComponent getEnumName(String type, T target) .append(Component.translatable("option.detailarmorbar.effects."+type+"."+target.name().toLowerCase(Locale.ROOT))); } - private > List getEnumDescription(String type, T target) { - ArrayList list = new ArrayList<>(); - for (String s : Component.translatable("context.detailarmorbar.effects." + type).getString().split("/")) - list.add(Component.translatable(s).withStyle(ChatFormatting.YELLOW)); - - list.add(Component.empty()); - + private > Component getEnumDescription(String type, T target) { + MutableComponent comp = Component.translatable("context.detailarmorbar.effects." + type).withStyle(ChatFormatting.YELLOW); + comp.append("\n"); List v = EnumSet.allOf(target.getDeclaringClass()).stream().toList(); for (T t : v) { - list.add(Component.literal(" ") + comp.append("\n"); + comp.append(Component.empty() .append(Component.translatable("option.detailarmorbar.effects."+type+"."+t.name().toLowerCase(Locale.ROOT)).withStyle(ChatFormatting.ITALIC)) .append(" - ") .append(Component.translatable("context.detailarmorbar.effects."+type+"."+t.name().toLowerCase(Locale.ROOT)))); } - return list; + return comp; } private MutableComponent getToggleName(String type, boolean target) { @@ -229,10 +314,7 @@ private MutableComponent getToggleName(String type, boolean target) { .append(target ? CommonComponents.OPTION_ON : CommonComponents.OPTION_OFF); } - private List getToggleDescription(String type) { - ArrayList list = new ArrayList<>(); - for (String s : Component.translatable("context.detailarmorbar.toggle." + type).getString().split("/")) - list.add(Component.translatable(s).withStyle(ChatFormatting.YELLOW)); - return list; + private Component getToggleDescription(String type) { + return Component.translatable("context.detailarmorbar.toggle." + type); } } diff --git a/src/main/resources/META-INF/accesstransformer.cfg b/src/main/resources/META-INF/accesstransformer.cfg new file mode 100644 index 0000000..c75608b --- /dev/null +++ b/src/main/resources/META-INF/accesstransformer.cfg @@ -0,0 +1 @@ +public net.minecraft.client.gui.Gui f_279580_ \ No newline at end of file diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index 3e482fd..217b6ed 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -1,5 +1,5 @@ modLoader="javafml" #mandatory -loaderVersion="[41,)" +loaderVersion="[47,)" license="MIT Licence" [[mods]] @@ -16,12 +16,12 @@ displayURL="https://github.com/RedLime/DetailArmorBar/tree/1.19-forge" modId="forge" mandatory=true # setting the minimum comaptible Forge version to 41.0.94 due to incompatibility with previous versions - versionRange="[43.0.0,)" + versionRange="[47.0.0,)" ordering="NONE" side="CLIENT" [[dependencies.detailab]] modId="minecraft" mandatory=true - versionRange="[1.19.2]" + versionRange="[1.20.1]" ordering="NONE" side="CLIENT" diff --git a/src/main/resources/assets/detailab/lang/en_us.json b/src/main/resources/assets/detailab/lang/en_us.json index 020a254..372730a 100644 --- a/src/main/resources/assets/detailab/lang/en_us.json +++ b/src/main/resources/assets/detailab/lang/en_us.json @@ -3,13 +3,13 @@ "option.detailarmorbar.title.animation": "Animations", "option.detailarmorbar.title.etc": "etc..", "option.detailarmorbar.effects.effect_type": "Protection Effect", - "context.detailarmorbar.effects.effect_type": "Changes the type of/protection enchantment effect.", + "context.detailarmorbar.effects.effect_type": "Changes the type of protection enchantment effect.", "option.detailarmorbar.effects.effect_type.aura": "Aura", "context.detailarmorbar.effects.effect_type.aura": "Display an aura on the armor bar.", "option.detailarmorbar.effects.effect_type.outline": "Outline", "context.detailarmorbar.effects.effect_type.outline": "Display an outline on the armor bar.", "option.detailarmorbar.effects.effect_speed": "Effect Speed", - "context.detailarmorbar.effects.effect_speed": "Changes the effect speed for/protection effect and low durability warn.", + "context.detailarmorbar.effects.effect_speed": "Changes the effect speed for protection effect and low durability warn.", "option.detailarmorbar.effects.effect_speed.normal": "Normal", "context.detailarmorbar.effects.effect_speed.normal": "x1.0 Speed", "option.detailarmorbar.effects.effect_speed.slow": "Slow", @@ -29,23 +29,23 @@ "option.detailarmorbar.toggle.enchantments": "Protections Effect", "context.detailarmorbar.toggle.enchantments": "Displays the protection enchantment effect on the armor bar.", "option.detailarmorbar.toggle.netherites": "Netherite Armor Bar", - "context.detailarmorbar.toggle.netherites": "When equipped netherite armor,/the armor bar in that area changes to/netherite armor texture.", + "context.detailarmorbar.toggle.netherites": "When equipped netherite armor, the armor bar in that area changes to netherite armor texture.", "option.detailarmorbar.toggle.thorns": "Thorns Armor Bar", - "context.detailarmorbar.toggle.thorns": "If the armor has a thorn enchantment,/it will display a thorn overlay on the armor bar.", + "context.detailarmorbar.toggle.thorns": "If the armor has a thorn enchantment, it will display a thorn overlay on the armor bar.", "option.detailarmorbar.toggle.durability": "Low Durability Warn", - "context.detailarmorbar.toggle.durability": "A warning effect will be displayed/if any of the equipped armor has durability of 8% or less.", + "context.detailarmorbar.toggle.durability": "A warning effect will be displayed if any of the equipped armor has durability of 8% or less.", "option.detailarmorbar.toggle.mending": "Repair Effect", - "context.detailarmorbar.toggle.mending": "If the armor is repaired by repair,/the repair effect is displayed on the armor bar.", + "context.detailarmorbar.toggle.mending": "If the armor is repaired by repair, the repair effect is displayed on the armor bar.", "option.detailarmorbar.toggle.armor_types": "Armor Type Bar", - "context.detailarmorbar.toggle.armor_types": "Changes the armor bar to match the texture of the equipped armor./(You will on or off this, It does not affect netherite armor bar.)", + "context.detailarmorbar.toggle.armor_types": "Changes the armor bar to match the texture of the equipped armor. (You will on or off this, It does not affect netherite armor bar.)", "option.detailarmorbar.toggle.item_types": "Item Type Bar", - "context.detailarmorbar.toggle.item_types": "When a special item is equipped,/it is displayed on the armor bar./(e.g. elytra)", + "context.detailarmorbar.toggle.item_types": "When a special item is equipped, it is displayed on the armor bar. (e.g. elytra)", "option.detailarmorbar.toggle.empty_bar": "Empty Armor Bar", "context.detailarmorbar.toggle.empty_bar": "Shows an empty armor bar.", "option.detailarmorbar.toggle.vanilla_texture": "Vanilla Style Texture", - "context.detailarmorbar.toggle.vanilla_texture": "Displays armor bars with vanilla-style textures./When OFF, displays better texture but different with original./credit: Heamaci, snessim", + "context.detailarmorbar.toggle.vanilla_texture": "Displays armor bars with vanilla-style textures. When OFF, displays better texture but different with original. credit: Heamaci, snessim", "option.detailarmorbar.toggle.compatible_heart_mod": "Compatibility Mode", - "context.detailarmorbar.toggle.compatible_heart_mod": "Makes it compatible with mods/that health is displayed as a single line./Prevents the armor bar moving upwards.", + "context.detailarmorbar.toggle.compatible_heart_mod": "Makes it compatible with mods that health is displayed as a single line. Prevents the armor bar moving upwards.", "option.detailarmorbar.toggle.inverse_slot": "Reversed Slot", "context.detailarmorbar.toggle.inverse_slot": "Reverses the slot order of the armor bar.", "option.detailarmorbar.toggle.sort_special_item": "Sort Special Items", diff --git a/src/main/resources/assets/detailab/lang/fr_fr.json b/src/main/resources/assets/detailab/lang/fr_fr.json new file mode 100644 index 0000000..d0f077f --- /dev/null +++ b/src/main/resources/assets/detailab/lang/fr_fr.json @@ -0,0 +1,53 @@ +{ + "option.detailarmorbar.title.features": "Fonctionnalités", + "option.detailarmorbar.title.animation": "Animations", + "option.detailarmorbar.title.etc": "etc..", + "option.detailarmorbar.effects.effect_type": "Type d'effet de protection", + "context.detailarmorbar.effects.effect_type": "Modifie le type d'effet d'enchantement de protection.", + "option.detailarmorbar.effects.effect_type.aura": "Aura", + "context.detailarmorbar.effects.effect_type.aura": "Affiche une aura sur la barre d'armure.", + "option.detailarmorbar.effects.effect_type.outline": "Contour", + "context.detailarmorbar.effects.effect_type.outline": "Affiche un contour sur la barre d'armure.", + "option.detailarmorbar.effects.effect_speed": "Vitesse de l'effet", + "context.detailarmorbar.effects.effect_speed": "Modifie la vitesse de l'effet de protection et de l'avertissement de faible durabilité.", + "option.detailarmorbar.effects.effect_speed.normal": "Normal", + "context.detailarmorbar.effects.effect_speed.normal": "Vitesse x1.0", + "option.detailarmorbar.effects.effect_speed.slow": "Lent", + "context.detailarmorbar.effects.effect_speed.slow": "Vitesse x0.75", + "option.detailarmorbar.effects.effect_speed.very_slow": "Très Lent", + "context.detailarmorbar.effects.effect_speed.very_slow": "Vitesse x0.5", + "option.detailarmorbar.effects.effect_speed.fast": "Rapide", + "context.detailarmorbar.effects.effect_speed.fast": "Vitesse x1.25", + "option.detailarmorbar.effects.effect_speed.very_fast": "Très Rapide", + "context.detailarmorbar.effects.effect_speed.very_fast": "Vitesse x1.5", + "option.detailarmorbar.effects.thorn": "Animation d'épine", + "context.detailarmorbar.effects.thorn": "Modifie l'animation de l'enchantement d'épine.", + "option.detailarmorbar.effects.thorn.static": "Statique", + "context.detailarmorbar.effects.thorn.static": "Aucune animation lors de l'attaque d'une entité par une épine.", + "option.detailarmorbar.effects.thorn.animation": "Animation", + "context.detailarmorbar.effects.thorn.animation": "Animations clignotantes lors de l'attaque d'une entité par une épine.", + "option.detailarmorbar.toggle.enchantments": "Effets de protection", + "context.detailarmorbar.toggle.enchantments": "Affiche l'effet d'enchantement de protection sur la barre d'armure.", + "option.detailarmorbar.toggle.netherites": "Barre d'armure en Netherite", + "context.detailarmorbar.toggle.netherites": "Lorsque l'armure en Netherite est équipée, la barre d'armure dans cette zone change en texture d'armure en Netherite.", + "option.detailarmorbar.toggle.thorns": "Barre d'armure d'épines", + "context.detailarmorbar.toggle.thorns": "Si l'armure est enchantée avec une épine, une superposition d'épine est affichée sur la barre d'armure.", + "option.detailarmorbar.toggle.durability": "Avertissement de faible durabilité", + "context.detailarmorbar.toggle.durability": "Un effet d'avertissement sera affiché si l'une des armures équipées a une durabilité de 8% ou moins.", + "option.detailarmorbar.toggle.mending": "Effet de réparation", + "context.detailarmorbar.toggle.mending": "Si l'armure est réparée par réparation, l'effet de réparation est affiché sur la barre d'armure.", + "option.detailarmorbar.toggle.armor_types": "Barre de type d'armure", + "context.detailarmorbar.toggle.armor_types": "Modifie la barre d'armure pour correspondre à la texture de l'armure équipée. (Vous pouvez activer ou désactiver cela, cela n'affecte pas la barre d'armure en Netherite.)", + "option.detailarmorbar.toggle.item_types": "Barre de type d'objet", + "context.detailarmorbar.toggle.item_types": "Lorsqu'un objet spécial est équipé, il est affiché sur la barre d'armure. (par exemple, élytres)", + "option.detailarmorbar.toggle.empty_bar": "Barre d'armure vide", + "context.detailarmorbar.toggle.empty_bar": "Affiche une barre d'armure vide.", + "option.detailarmorbar.toggle.vanilla_texture": "Texture de style vanille", + "context.detailarmorbar.toggle.vanilla_texture": "Affiche les barres d'armure avec des textures de style vanille. Lorsqu'il est désactivé, affiche une meilleure texture mais différente de l'originale. crédit : Heamaci, snessim", + "option.detailarmorbar.toggle.compatible_heart_mod": "Mode de compatibilité", + "context.detailarmorbar.toggle.compatible_heart_mod": "Le rend compatible avec les mods où la santé est affichée sous forme d'une seule ligne. Empêche la barre d'armure de monter vers le haut.", + "option.detailarmorbar.toggle.inverse_slot": "Emplacement inversé", + "context.detailarmorbar.toggle.inverse_slot": "Inverse l'ordre des emplacements de la barre d'armure.", + "option.detailarmorbar.toggle.sort_special_item": "Trier les objets spéciaux", + "context.detailarmorbar.toggle.sort_special_item": "Trie les objets spéciaux (comme les élytres) sur la droite de la barre d'armure." +} diff --git a/src/main/resources/assets/detailab/lang/ko_kr.json b/src/main/resources/assets/detailab/lang/ko_kr.json index 39bebfc..e5b52ee 100644 --- a/src/main/resources/assets/detailab/lang/ko_kr.json +++ b/src/main/resources/assets/detailab/lang/ko_kr.json @@ -9,7 +9,7 @@ "option.detailarmorbar.effects.effect_type.outline": "테두리", "context.detailarmorbar.effects.effect_type.outline": "갑옷바 위에 효과별 테두리를 표시합니다.", "option.detailarmorbar.effects.effect_speed": "애니메이션 속도", - "context.detailarmorbar.effects.effect_speed": "보호 효과와 내구도 경고 효과의/속도를 조정합니다.", + "context.detailarmorbar.effects.effect_speed": "보호 효과와 내구도 경고 효과의 속도를 조정합니다.", "option.detailarmorbar.effects.effect_speed.normal": "보통", "context.detailarmorbar.effects.effect_speed.normal": "x1.0배 속도", "option.detailarmorbar.effects.effect_speed.slow": "느리게", @@ -29,23 +29,23 @@ "option.detailarmorbar.toggle.enchantments": "보호 효과", "context.detailarmorbar.toggle.enchantments": "갑옷바에 보호 인챈트 효과를 표시합니다.", "option.detailarmorbar.toggle.netherites": "네더라이트 갑옷바", - "context.detailarmorbar.toggle.netherites": "네더라이트 갑옷을 장착할 시,/갑옷바에서 해당 부위는 네더라이트 갑옷 텍스쳐로 바뀝니다.", + "context.detailarmorbar.toggle.netherites": "네더라이트 갑옷을 장착할 시, 갑옷바에서 해당 부위는 네더라이트 갑옷 텍스쳐로 바뀝니다.", "option.detailarmorbar.toggle.thorns": "가시 갑옷바", - "context.detailarmorbar.toggle.thorns": "장착한 갑옷에 가시 인챈트가 있다면/갑옷바에 가시 오버레이를 표시합니다.", + "context.detailarmorbar.toggle.thorns": "장착한 갑옷에 가시 인챈트가 있다면 갑옷바에 가시 오버레이를 표시합니다.", "option.detailarmorbar.toggle.durability": "내구도 경고", - "context.detailarmorbar.toggle.durability": "장착한 갑옷이 내구도가 8%이하라면/갑옷바에 경고 이펙트를 표시합니다.", + "context.detailarmorbar.toggle.durability": "장착한 갑옷이 내구도가 8%이하라면 갑옷바에 경고 이펙트를 표시합니다.", "option.detailarmorbar.toggle.mending": "수선 효과", - "context.detailarmorbar.toggle.mending": "수선에 의해서 장착한 갑옷이 수리될 경우,/갑옷바에 수선 이펙트를 표시합니다.", + "context.detailarmorbar.toggle.mending": "수선에 의해서 장착한 갑옷이 수리될 경우, 갑옷바에 수선 이펙트를 표시합니다.", "option.detailarmorbar.toggle.armor_types": "종류별 갑옷바", - "context.detailarmorbar.toggle.armor_types": "갑옷바를 장착한 갑옷의 텍스쳐에 맞춰 변경합니다./(이 옵션을 켜거나 꺼도 네더라이트 갑옷은 영향을 받지 않음)", + "context.detailarmorbar.toggle.armor_types": "갑옷바를 장착한 갑옷의 텍스쳐에 맞춰 변경합니다. (이 옵션을 켜거나 꺼도 네더라이트 갑옷은 영향을 받지 않음)", "option.detailarmorbar.toggle.item_types": "특수 아이템 갑옷바", - "context.detailarmorbar.toggle.item_types": "특수 아이템을 장착 시,/갑옷바에 표시합니다 (예: 겉날개)", + "context.detailarmorbar.toggle.item_types": "특수 아이템을 장착 시, 갑옷바에 표시합니다 (예: 겉날개)", "option.detailarmorbar.toggle.empty_bar": "빈 갑옷바 표시", "context.detailarmorbar.toggle.empty_bar": "빈 갑옷바를 표시합니다.", "option.detailarmorbar.toggle.vanilla_texture": "바닐라 텍스쳐 스타일", - "context.detailarmorbar.toggle.vanilla_texture": "아머바를 바닐라 스타일의 텍스쳐로 표시합니다./OFF일 경우, 고급 텍스쳐가 적용됩니다./제공: Heamaci, snessim", + "context.detailarmorbar.toggle.vanilla_texture": "아머바를 바닐라 스타일의 텍스쳐로 표시합니다. OFF일 경우, 고급 텍스쳐가 적용됩니다. 제공: Heamaci, snessim", "option.detailarmorbar.toggle.compatible_heart_mod": "호환 모드", - "context.detailarmorbar.toggle.compatible_heart_mod": "체력이 한 줄로 표시되는 모드와 호환되게 만듭니다./갑옷바가 혼자 위로 뜨는 현상을 막습니다.", + "context.detailarmorbar.toggle.compatible_heart_mod": "체력이 한 줄로 표시되는 모드와 호환되게 만듭니다. 갑옷바가 혼자 위로 뜨는 현상을 막습니다.", "option.detailarmorbar.toggle.inverse_slot": "슬롯 반전", "context.detailarmorbar.toggle.inverse_slot": "아머바의 슬롯 순서를 반전합니다.", "option.detailarmorbar.toggle.sort_special_item": "특수 아이템 정렬", diff --git a/src/main/resources/pack.mcmeta b/src/main/resources/pack.mcmeta index f4a897a..99dc25b 100644 --- a/src/main/resources/pack.mcmeta +++ b/src/main/resources/pack.mcmeta @@ -1,8 +1,8 @@ { "pack": { "description": "Detail Armor Bar resources", - "pack_format": 9, - "forge:resource_pack_format": 9, + "pack_format": 15, + "forge:resource_pack_format": 15, "forge:data_pack_format": 10 } }