diff --git a/.gitattributes b/.gitattributes index ae0eec1..097f9f9 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,4 +1,9 @@ -gradlew* linguist-vendored -gradle/wrapper/* linguist-vendored -*.bat text eol=crlf +# +# https://help.github.com/articles/dealing-with-line-endings/ +# +# Linux start script should use lf +/gradlew text eol=lf + +# These are Windows script files and should use crlf +*.bat text eol=crlf diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index ffdcce8..0000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1,15 +0,0 @@ -# These are supported funding model platforms - -github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] -patreon: # Replace with a single Patreon username -open_collective: # Replace with a single Open Collective username -ko_fi: # Replace with a single Ko-fi username -tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel -community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry -liberapay: # Replace with a single Liberapay username -issuehunt: # Replace with a single IssueHunt username -lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry -polar: # Replace with a single Polar username -buy_me_a_coffee: # Replace with a single Buy Me a Coffee username -thanks_dev: # Replace with a single thanks.dev username -custom: [https://www.donationalerts.com/r/laybalt] diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e1e773f..524fb1b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,29 +1,30 @@ -name: Run Gradle Build -on: - - push - - pull_request +# Automatically build the project and run any configured tests for every push +# and submitted pull request. This can help catch issues that only occur on +# certain platforms or Java versions, and provides a first line of defence +# against bad commits. + +name: build +on: [pull_request, push] jobs: - gradle: - runs-on: ubuntu-latest + build: + runs-on: ubuntu-24.04 steps: - - name: Checkout source - uses: actions/checkout@v4.1.1 - - - name: Setup Java - uses: actions/setup-java@v4.0.0 + - name: checkout repository + uses: actions/checkout@v6 + - name: validate gradle wrapper + uses: gradle/actions/wrapper-validation@v6 + - name: setup jdk + uses: actions/setup-java@v5 with: - distribution: temurin - java-version: 17 - - - name: Setup Gradle - uses: gradle/actions/setup-gradle@v3 - - - name: Execute Gradle build + java-version: '25' + distribution: 'microsoft' + - name: make gradle wrapper executable + run: chmod +x ./gradlew + - name: build run: ./gradlew build - - - name: Upload built mod JAR - uses: actions/upload-artifact@v4.3.0 + - name: capture build artifacts + uses: actions/upload-artifact@v7 with: - name: mod-jar - path: build/libs/*.jar + name: Artifacts + path: build/libs/ diff --git a/.github/workflows/gradle-wrapper-validation.yml b/.github/workflows/gradle-wrapper-validation.yml deleted file mode 100644 index 12213d2..0000000 --- a/.github/workflows/gradle-wrapper-validation.yml +++ /dev/null @@ -1,10 +0,0 @@ -name: "Validate Gradle Wrapper" -on: [push, pull_request] - -jobs: - validation: - name: "Validation" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4.1.1 - - uses: gradle/wrapper-validation-action@v2.0.0 \ No newline at end of file diff --git a/.gitignore b/.gitignore index 69fa48a..2d66bc9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,51 @@ +# gradle + +.gradle/ +build/ +out/ +classes/ + +# eclipse + +*.launch + +# idea + .idea/ +*.iml +*.ipr +*.iws + +# vscode + +.settings/ .vscode/ +bin/ +.classpath +.project + +# macos + +*.DS_Store + +# fabric + run/ -build/ -.gradle/ +# java + +hs_err_*.log +replay_*.log +*.hprof +*.jfr + +# claude +.claude/ + +# local secrets / personal data — never commit +.env +*.env +.devauth/ +local.properties +*.pem +*.key diff --git a/ContributingGuide b/ContributingGuide deleted file mode 100644 index e40a2ed..0000000 --- a/ContributingGuide +++ /dev/null @@ -1,22 +0,0 @@ -# This mod uses Architectury Loom based template. - -## Usage - -Check out https://moddev.nea.moe/ for a full tutorial on legacy modding. - -Alternatively, read here for a basic overview on how to use this repository. - -This project uses [DevAuth](https://github.com/DJtheRedstoner/DevAuth) per default, so you can log in using your real -minecraft account. If you don't need that, you can remove it from the buildscript. - -To run the mod you will need two JDKs, one Java 17 jdk and one Java 1.8 jdk. You can download those -from [here](https://bell-sw.com) (or use your own downloads). - -When you import your project into IntelliJ, you need to set the gradle jvm to the Java 17 JDK in the gradle tab, and the -Project SDK to the Java 1.8 JDK. Then click on the sync button in IntelliJ, and it should create a run task -called `Minecraft Client`. If it doesn't then try relaunching your IntelliJ. -**Warning for Mac users**: You might have to remove the `-XStartOnFirstThread` vm argument from your run configuration. In the future, that should be handled by the plugin, but for now you'll probably have to do that manually. - -To export your project, run the `gradle build` task, and give other people the -file `build/libs/-.jar`. Ignore the jars in the `build/badjars` folder. Those are intermediary jars that -are used by the build system but *do not work* in a normal forge installation. diff --git a/LICENSE b/LICENSE index 68a49da..25651de 100644 --- a/LICENSE +++ b/LICENSE @@ -1,24 +1,21 @@ -This is free and unencumbered software released into the public domain. +MIT License -Anyone is free to copy, modify, publish, use, compile, sell, or -distribute this software, either in source code form or as a compiled -binary, for any purpose, commercial or non-commercial, and by any -means. +Copyright (c) 2026 LayBalt -In jurisdictions that recognize copyright laws, the author or authors -of this software dedicate any and all copyright interest in the -software to the public domain. We make this dedication for the benefit -of the public at large and to the detriment of our heirs and -successors. We intend this dedication to be an overt act of -relinquishment in perpetuity of all present and future rights to this -software under copyright law. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. -For more information, please refer to +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index ef79243..fdbd348 100644 --- a/README.md +++ b/README.md @@ -1,26 +1,50 @@ - -

LayBalt Repository

-

Version 1.0.0

-

Skyblock Translator is a 1.8.9 Minecraft Forge mod for Hypixel Skyblock.

+# SkyBlock Translator ---- +**[Русский]** Клиентский Fabric-мод, который переводит Hypixel SkyBlock на ваш язык: предметы, лор, меню, диалоги NPC и чат. Игра «внутри» остаётся английской — перевод накладывается только при отрисовке, поэтому другие моды (NEU, Skyblocker и т.д.), поиск и команды продолжают работать. -

Mod Information

-

-Skyblock Translator is a Forge 1.8.9 for Minecraft. This mod will translate all the NPC dialogs, Item description, GUI menu's, etc. -

+**[English]** A client-side Fabric mod that translates Hypixel SkyBlock into your language: items, lore, menus, NPC dialogues and chat. The game stays English under the hood — translation is applied at render time only, so other mods (NEU, Skyblocker, etc.), search and commands keep working. ---- +> ⚠️ В ранней разработке / Early development. -

Official Links

-

-Discord: LayBalt Discord
-More links coming soon... -

+## Как это работает / How it works ---- +``` +Рендер текста → сегментация (сохраняем §-форматирование) + → нормализация (числа → плейсхолдеры: "Damage: +{0}") + → словарь → локальный кэш → API-переводчик +``` -

Contribution Information

-

-Pull requests are welcome. We recomend using BellSoft JDK with this project. -For more info: Contributor Guide. +- **Free** — встроенные словари, локальный кэш, бесплатный машинный перевод для нового текста (с лимитами). +- **Premium** (планируется) — облачный сервис: LLM-перевод со SkyBlock-глоссарием, общий кэш переводов, перевод чата игроков, без лимитов. Сам мод бесплатен для всех — Premium это подписка на облачный API. + +## Версии / Versions + +| | | +|---|---| +| Minecraft | 26.2 | +| Loader | Fabric (Loader ≥ 0.19.3, Fabric API) | +| Java | 25 | + +## Сборка / Building + +``` +./gradlew build +``` + +Jar появится в `build/libs/`. Для запуска дев-клиента: `./gradlew runClient`. Java 25 скачается автоматически (Gradle toolchain), нужна лишь любая Java 17+ для запуска Gradle. + +## Словари / Dictionaries + +Переводы лежат в `src/main/resources/assets/skyblock-translator/dict//*.json` в формате `"английский шаблон": "перевод"`. Числа и имена заменяются плейсхолдерами `{0}`, `{1}`… — один шаблон покрывает все значения. PR с переводами приветствуются. + +## Роадмап / Roadmap + +- [x] Фаза 0 — каркас проекта, CI +- [ ] Фаза 1 — pipeline перевода, словарь, кэш, тултипы и меню +- [ ] Фаза 2 — чат и диалоги NPC, бесплатный API-переводчик — первый публичный релиз +- [ ] Фаза 3 — Premium: облачный LLM-перевод, общий кэш, перевод чата игроков +- [ ] Фаза 4 — scoreboard/bossbar/tablist, другие языки, комьюнити-словари + +## Лицензия / License + +[MIT](LICENSE). Not affiliated with Hypixel or Mojang. diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..a2092fa --- /dev/null +++ b/build.gradle @@ -0,0 +1,80 @@ +plugins { + id 'net.fabricmc.fabric-loom' version "${loom_version}" +} + +version = project.mod_version +group = project.maven_group + +repositories { + // Loom adds the essential maven repositories to download Minecraft and libraries from automatically. + // Add repositories here only when depending on other mods. + maven { + name = 'DevAuth' + url = 'https://pkgs.dev.azure.com/djtheredstoner/DevAuth/_packaging/public/maven/v1' + } +} + +loom { + mods { + "skyblock-translator" { + sourceSet sourceSets.main + } + } + + runs { + client { + // DevAuth: log the dev client into a real Microsoft account. + // First launch prints a device-code link; tokens are stored in + // ~/.devauth (outside the repo, never committed). + vmArg "-Ddevauth.enabled=true" + } + } +} + +dependencies { + // To change the versions see the gradle.properties file + minecraft "com.mojang:minecraft:${project.minecraft_version}" + implementation "net.fabricmc:fabric-loader:${project.loader_version}" + + implementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_api_version}" + + // Dev-environment only: real-account login for runClient (not bundled in the jar) + runtimeOnly "me.djtheredstoner:DevAuth-fabric:1.2.2" +} + +processResources { + def version = project.version + inputs.property "version", version + + filesMatching("fabric.mod.json") { + expand "version": version + } +} + +tasks.withType(JavaCompile).configureEach { + it.options.release = 25 + it.options.encoding = 'UTF-8' +} + +java { + withSourcesJar() + + // Minecraft 26.x requires Java 25. The foojay resolver (see settings.gradle) + // downloads it automatically if missing. + toolchain { + languageVersion = JavaLanguageVersion.of(25) + } +} + +test { + useJUnitPlatform() +} + +jar { + def projectName = project.name + inputs.property "projectName", projectName + + from("LICENSE") { + rename { "${it}_$projectName" } + } +} diff --git a/build.gradle.kts b/build.gradle.kts deleted file mode 100644 index eeaca9e..0000000 --- a/build.gradle.kts +++ /dev/null @@ -1,147 +0,0 @@ -import org.apache.commons.lang3.SystemUtils - -plugins { - idea - java - kotlin("jvm") version "1.8.0" - id("gg.essential.loom") version "0.10.0.+" - id("dev.architectury.architectury-pack200") version "0.1.3" - id("com.github.johnrengelman.shadow") version "8.1.1" -} - -//Constants: - -val baseGroup: String by project -val mcVersion: String by project -val version: String by project -val modid: String by project - -// Toolchains: -java { - toolchain.languageVersion.set(JavaLanguageVersion.of(8)) -} - -// Minecraft configuration: -loom { - log4jConfigs.from(file("log4j2.xml")) - launchConfigs { - "client" { - } - } - runConfigs { - "client" { - if (SystemUtils.IS_OS_MAC_OSX) { - // It can cause crashes on macOS - vmArgs.remove("-XstartOnFirstThread") - } - } - remove(getByName("server")) - } - forge { - pack200Provider.set(dev.architectury.pack200.java.Pack200Adapter()) - } -} - -sourceSets { - main { - java { - setSrcDirs(listOf("src/main/java")) - } - kotlin { - setSrcDirs(listOf("src/main/kotlin")) // Добавить папку kotlin - } - } - test { - java { - setSrcDirs(listOf("src/test/java")) - } - kotlin { - setSrcDirs(listOf("src/test/kotlin")) // Добавить папку kotlin для тестов - } - } -} - -// Dependencies: - -repositories { - mavenCentral() - maven("https://repo.spongepowered.org/maven/") - // If you don't want to log in with your real minecraft account, remove this line - maven("https://pkgs.dev.azure.com/djtheredstoner/DevAuth/_packaging/public/maven/v1") - maven("https://repo.essential.gg/repository/maven-public") -} - -val shadowImpl: Configuration by configurations.creating { - configurations.implementation.get().extendsFrom(this) -} - -dependencies { - minecraft("com.mojang:minecraft:1.8.9") - mappings("de.oceanlabs.mcp:mcp_stable:22-1.8.9") - forge("net.minecraftforge:forge:1.8.9-11.15.1.2318-1.8.9") - - // If you don't want to log in with your real minecraft account, remove this line - runtimeOnly("me.djtheredstoner:DevAuth-forge-legacy:1.2.1") - implementation(kotlin("stdlib")) - - implementation("gg.essential:vigilance-$mcVersion-forge:299") -} - -// Tasks: - -tasks.withType(JavaCompile::class) { - options.encoding = "UTF-8" -} - -tasks.withType(org.gradle.jvm.tasks.Jar::class) { - archiveBaseName.set(modid) - manifest.attributes.run { - this["FMLCorePluginContainsFMLMod"] = "true" - this["ForceLoadAsMod"] = "true" - } -} - -tasks.processResources { - inputs.property("version", project.version) - inputs.property("mcversion", mcVersion) - inputs.property("modid", modid) - inputs.property("basePackage", baseGroup) - - filesMatching(listOf("mcmod.info")) { - expand(inputs.properties) - } - - rename("(.+_at.cfg)", "META-INF/$1") -} - - -val remapJar by tasks.named("remapJar") { - archiveClassifier.set("") - from(tasks.shadowJar) - input.set(tasks.shadowJar.get().archiveFile) -} - -tasks.jar { - archiveClassifier.set("without-deps") - destinationDirectory.set(layout.buildDirectory.dir("intermediates")) -} - -tasks.named("jar") { - duplicatesStrategy = DuplicatesStrategy.EXCLUDE -} - -tasks.shadowJar { - destinationDirectory.set(layout.buildDirectory.dir("intermediates")) - archiveClassifier.set("non-obfuscated-with-deps") - configurations = listOf(shadowImpl) - doLast { - configurations.forEach { - println("Copying dependencies into mod: ${it.files}") - } - } - - // If you want to include other dependencies and shadow them, you can relocate them in here - fun relocate(name: String) = relocate(name, "$baseGroup.deps.$name") -} - -tasks.assemble.get().dependsOn(tasks.remapJar) \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 02ed23e..77ecdc2 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,19 @@ -loom.platform=forge -org.gradle.jvmargs=-Xmx2g -baseGroup = com.github.laybalt.skyblocktranslator -mcVersion = 1.8.9 -modid = skyblocktranslator -version = 1.0.0 +# Done to increase the memory available to gradle. +org.gradle.jvmargs=-Xmx2G +org.gradle.parallel=true + +# IntelliJ IDEA is not yet fully compatible with configuration cache, see: https://github.com/FabricMC/fabric-loom/issues/1349 +org.gradle.configuration-cache=false + +# Fabric Properties +# check these on https://fabricmc.net/develop +minecraft_version=26.2 +loader_version=0.19.3 +loom_version=1.17-SNAPSHOT + +# Mod Properties +mod_version=0.1.0 +maven_group=dev.laybalt + +# Dependencies +fabric_api_version=0.155.2+26.2 diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index e644113..b1b8ef5 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 a441313..df6a6ad 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,7 +1,9 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.1-bin.zip networkTimeout=10000 +retries=0 +retryBackOffMs=500 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew old mode 100755 new mode 100644 index b740cf1..b9bb139 --- a/gradlew +++ b/gradlew @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright © 2015-2021 the original authors. +# Copyright © 2015 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. @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -55,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -84,7 +86,7 @@ done # 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 +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -112,7 +114,6 @@ case "$( uname )" in #( NONSTOP* ) nonstop=true ;; esac -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. @@ -170,7 +171,6 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) JAVACMD=$( cygpath --unix "$JAVACMD" ) @@ -203,15 +203,14 @@ fi 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, +# * DEFAULT_JVM_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 \ + -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ "$@" # Stop when "xargs" is not available. diff --git a/gradlew.bat b/gradlew.bat index 25da30d..24c62d5 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## @@ -21,8 +23,8 @@ @rem @rem ########################################################################## -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal +@rem Set local scope for the variables, and ensure extensions are enabled +setlocal EnableExtensions set DIRNAME=%~dp0 if "%DIRNAME%"=="" set DIRNAME=. @@ -49,7 +51,7 @@ echo. 1>&2 echo Please set the JAVA_HOME variable in your environment to match the 1>&2 echo location of your Java installation. 1>&2 -goto fail +"%COMSPEC%" /c exit 1 :findJavaFromJavaHome set JAVA_HOME=%JAVA_HOME:"=% @@ -63,30 +65,18 @@ echo. 1>&2 echo Please set the JAVA_HOME variable in your environment to match the 1>&2 echo location of your Java installation. 1>&2 -goto fail +"%COMSPEC%" /c exit 1 :execute @rem Setup the command line -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -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! -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 +@rem endlocal doesn't take effect until after the line is parsed and variables are expanded +@rem which allows us to clear the local environment before executing the java command +endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel -:omega +:exitWithErrorLevel +@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts +"%COMSPEC%" /c exit %ERRORLEVEL% diff --git a/log4j2.xml b/log4j2.xml deleted file mode 100644 index af9b1b7..0000000 --- a/log4j2.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 0000000..90df6fc --- /dev/null +++ b/settings.gradle @@ -0,0 +1,18 @@ +pluginManagement { + repositories { + maven { + name = 'Fabric' + url = 'https://maven.fabricmc.net/' + } + mavenCentral() + gradlePluginPortal() + } +} + +plugins { + // Automatically downloads the JDK required by the toolchain (Java 25) + // if it is not installed on the machine. + id 'org.gradle.toolchains.foojay-resolver-convention' version '1.0.0' +} + +rootProject.name = 'skyblock-translator' diff --git a/settings.gradle.kts b/settings.gradle.kts deleted file mode 100644 index d356b7e..0000000 --- a/settings.gradle.kts +++ /dev/null @@ -1,26 +0,0 @@ -pluginManagement { - repositories { - mavenCentral() - gradlePluginPortal() - maven("https://oss.sonatype.org/content/repositories/snapshots") - maven("https://maven.architectury.dev/") - maven("https://maven.fabricmc.net") - maven("https://maven.minecraftforge.net/") - maven("https://repo.spongepowered.org/maven/") - maven("https://repo.sk1er.club/repository/maven-releases/") - } - resolutionStrategy { - eachPlugin { - when (requested.id.id) { - "gg.essential.loom" -> useModule("gg.essential:architectury-loom:${requested.version}") - } - } - } -} - -plugins { - id("org.gradle.toolchains.foojay-resolver-convention") version("0.6.0") -} - - -rootProject.name = "Skyblock-Translator" diff --git a/src/main/java/com/github/laybalt/skyblocktranslator/Main.java b/src/main/java/com/github/laybalt/skyblocktranslator/Main.java deleted file mode 100644 index dcfcda8..0000000 --- a/src/main/java/com/github/laybalt/skyblocktranslator/Main.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.github.laybalt.skyblocktranslator; - -import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.init.Blocks; -import net.minecraftforge.fml.common.Mod; -import net.minecraftforge.fml.common.event.FMLInitializationEvent; - -@Mod(modid = "skyblocktranslator", useMetadata=true) -public class Main { - @Mod.EventHandler - public void init(FMLInitializationEvent event) { - System.out.println("Dirt: " + Blocks.dirt.getUnlocalizedName()); - // Below is a demonstration of an access-transformed class access. - System.out.println("Color State: " + new GlStateManager.Color()); - } -} diff --git a/src/main/java/com/github/laybalt/skyblocktranslator/init/AutoDiscoveryMixinPlugin.java b/src/main/java/com/github/laybalt/skyblocktranslator/init/AutoDiscoveryMixinPlugin.java deleted file mode 100644 index aa17016..0000000 --- a/src/main/java/com/github/laybalt/skyblocktranslator/init/AutoDiscoveryMixinPlugin.java +++ /dev/null @@ -1,188 +0,0 @@ -package com.github.laybalt.skyblocktranslator.init; - -import org.spongepowered.asm.lib.tree.ClassNode; -import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin; -import org.spongepowered.asm.mixin.extensibility.IMixinInfo; - -import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URISyntaxException; -import java.net.URL; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.ArrayList; -import java.util.List; -import java.util.Set; -import java.util.stream.Stream; -import java.util.zip.ZipEntry; -import java.util.zip.ZipInputStream; - -/** - * A mixin plugin to automatically discover all mixins in the current JAR. - *

- * This mixin plugin automatically scans your entire JAR (or class directory, in case of an in-IDE launch) for classes inside of your - * mixin package and registers those. It does this recursively for sub packages of the mixin package as well. This means you will need - * to only have mixin classes inside of your mixin package, which is good style anyway. - * - * @author Linnea Gräf - */ -public class AutoDiscoveryMixinPlugin implements IMixinConfigPlugin { - private static final List mixinPlugins = new ArrayList<>(); - - public static List getMixinPlugins() { - return mixinPlugins; - } - - private String mixinPackage; - - @Override - public void onLoad(String mixinPackage) { - this.mixinPackage = mixinPackage; - mixinPlugins.add(this); - } - - /** - * Resolves the base class root for a given class URL. This resolves either the JAR root, or the class file root. - * In either case the return value of this + the class name will resolve back to the original class url, or to other - * class urls for other classes. - */ - public URL getBaseUrlForClassUrl(URL classUrl) { - String string = classUrl.toString(); - if (classUrl.getProtocol().equals("jar")) { - try { - return new URL(string.substring(4).split("!")[0]); - } catch (MalformedURLException e) { - throw new RuntimeException(e); - } - } - if (string.endsWith(".class")) { - try { - return new URL(string.replace("\\", "/") - .replace(getClass().getCanonicalName() - .replace(".", "/") + ".class", "")); - } catch (MalformedURLException e) { - throw new RuntimeException(e); - } - } - return classUrl; - } - - /** - * Get the package that contains all the mixins. This value is set by mixin itself using {@link #onLoad}. - */ - public String getMixinPackage() { - return mixinPackage; - } - - /** - * Get the path inside the class root to the mixin package - */ - public String getMixinBaseDir() { - return mixinPackage.replace(".", "/"); - } - - /** - * A list of all discovered mixins. - */ - private List mixins = null; - - /** - * Try to add mixin class ot the mixins based on the filepath inside of the class root. - * Removes the {@code .class} file suffix, as well as the base mixin package. - *

This method cannot be called after mixin initialization.

- * - * @param className the name or path of a class to be registered as a mixin. - */ - public void tryAddMixinClass(String className) { - String norm = (className.endsWith(".class") ? className.substring(0, className.length() - ".class".length()) : className) - .replace("\\", "/") - .replace("/", "."); - if (norm.startsWith(getMixinPackage() + ".") && !norm.endsWith(".")) { - mixins.add(norm.substring(getMixinPackage().length() + 1)); - } - } - - /** - * Search through the JAR or class directory to find mixins contained in {@link #getMixinPackage()} - */ - @Override - public List getMixins() { - if (mixins != null) return mixins; - System.out.println("Trying to discover mixins"); - mixins = new ArrayList<>(); - URL classUrl = getClass().getProtectionDomain().getCodeSource().getLocation(); - System.out.println("Found classes at " + classUrl); - Path file; - try { - file = Paths.get(getBaseUrlForClassUrl(classUrl).toURI()); - } catch (URISyntaxException e) { - throw new RuntimeException(e); - } - System.out.println("Base directory found at " + file); - if (Files.isDirectory(file)) { - walkDir(file); - } else { - walkJar(file); - } - System.out.println("Found mixins: " + mixins); - - return mixins; - } - - /** - * Search through directory for mixin classes based on {@link #getMixinBaseDir}. - * - * @param classRoot The root directory in which classes are stored for the default package. - */ - private void walkDir(Path classRoot) { - System.out.println("Trying to find mixins from directory"); - try (Stream classes = Files.walk(classRoot.resolve(getMixinBaseDir()))) { - classes.map(it -> classRoot.relativize(it).toString()) - .forEach(this::tryAddMixinClass); - } catch (IOException e) { - throw new RuntimeException(e); - } - } - - /** - * Read through a JAR file, trying to find all mixins inside. - */ - private void walkJar(Path file) { - System.out.println("Trying to find mixins from jar file"); - try (ZipInputStream zis = new ZipInputStream(Files.newInputStream(file))) { - ZipEntry next; - while ((next = zis.getNextEntry()) != null) { - tryAddMixinClass(next.getName()); - zis.closeEntry(); - } - } catch (IOException e) { - throw new RuntimeException(e); - } - } - - @Override - public void preApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) { - - } - - @Override - public void postApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) { - - } - - @Override - public String getRefMapperConfig() { - return null; - } - - @Override - public boolean shouldApplyMixin(String targetClassName, String mixinClassName) { - return true; - } - - @Override - public void acceptTargets(Set myTargets, Set otherTargets) { - - } -} diff --git a/src/main/java/com/github/laybalt/skyblocktranslator/mixin/MixinGuiMainMenu.java b/src/main/java/com/github/laybalt/skyblocktranslator/mixin/MixinGuiMainMenu.java deleted file mode 100644 index a63cb5e..0000000 --- a/src/main/java/com/github/laybalt/skyblocktranslator/mixin/MixinGuiMainMenu.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.github.laybalt.skyblocktranslator.mixin; - -import net.minecraft.client.gui.GuiMainMenu; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -@Mixin(GuiMainMenu.class) -public class MixinGuiMainMenu { - - @Inject(method = "initGui", at = @At("HEAD")) - public void onInitGui(CallbackInfo ci) { - // - } -} diff --git a/src/main/java/dev/laybalt/skyblocktranslator/SkyblockTranslatorClient.java b/src/main/java/dev/laybalt/skyblocktranslator/SkyblockTranslatorClient.java new file mode 100644 index 0000000..40aff46 --- /dev/null +++ b/src/main/java/dev/laybalt/skyblocktranslator/SkyblockTranslatorClient.java @@ -0,0 +1,15 @@ +package dev.laybalt.skyblocktranslator; + +import net.fabricmc.api.ClientModInitializer; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class SkyblockTranslatorClient implements ClientModInitializer { + public static final String MOD_ID = "skyblock-translator"; + public static final Logger LOGGER = LoggerFactory.getLogger("SkyBlock Translator"); + + @Override + public void onInitializeClient() { + LOGGER.info("SkyBlock Translator initialized"); + } +} diff --git a/src/main/resources/accesstransformer.cfg b/src/main/resources/accesstransformer.cfg deleted file mode 100644 index 1a7a2b3..0000000 --- a/src/main/resources/accesstransformer.cfg +++ /dev/null @@ -1,2 +0,0 @@ - -public net.minecraft.client.renderer.GlStateManager$Color diff --git a/src/main/resources/assets/skyblock-translator/dict/ru_ru/menus.json b/src/main/resources/assets/skyblock-translator/dict/ru_ru/menus.json new file mode 100644 index 0000000..b987d62 --- /dev/null +++ b/src/main/resources/assets/skyblock-translator/dict/ru_ru/menus.json @@ -0,0 +1,12 @@ +{ + "SkyBlock Menu": "Меню SkyBlock", + "Your SkyBlock Profile": "Ваш профиль SkyBlock", + "Your Skills": "Ваши навыки", + "Collections": "Коллекции", + "Recipe Book": "Книга рецептов", + "Fast Travel": "Быстрое перемещение", + "Damage: +{0}": "Урон: +{0}", + "Strength: +{0}": "Сила: +{0}", + "Health: +{0}": "Здоровье: +{0}", + "Defense: +{0}": "Защита: +{0}" +} diff --git a/src/main/resources/assets/skyblock-translator/icon.png b/src/main/resources/assets/skyblock-translator/icon.png new file mode 100644 index 0000000..047b91f Binary files /dev/null and b/src/main/resources/assets/skyblock-translator/icon.png differ diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json new file mode 100644 index 0000000..5b6f587 --- /dev/null +++ b/src/main/resources/fabric.mod.json @@ -0,0 +1,32 @@ +{ + "schemaVersion": 1, + "id": "skyblock-translator", + "version": "${version}", + "name": "SkyBlock Translator", + "description": "Translates Hypixel SkyBlock — items, menus, NPC dialogues and chat — into your language.", + "authors": [ + "LayBalt" + ], + "contact": { + "homepage": "https://github.com/LayBalt/Skyblock-Translator", + "sources": "https://github.com/LayBalt/Skyblock-Translator", + "issues": "https://github.com/LayBalt/Skyblock-Translator/issues" + }, + "license": "MIT", + "icon": "assets/skyblock-translator/icon.png", + "environment": "client", + "entrypoints": { + "client": [ + "dev.laybalt.skyblocktranslator.SkyblockTranslatorClient" + ] + }, + "mixins": [ + "skyblock-translator.mixins.json" + ], + "depends": { + "fabricloader": ">=0.19.3", + "minecraft": "~26.2", + "java": ">=25", + "fabric-api": "*" + } +} diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info deleted file mode 100644 index 2e567d7..0000000 --- a/src/main/resources/mcmod.info +++ /dev/null @@ -1,18 +0,0 @@ -[ - { - "modid": "${modid}", - "name": "Skyblock Translator", - "description": "A mod that idoes translate all the skyblock.", - "version": "${version}", - "mcversion": "${mcversion}", - "url": "https://github.com/LayBalt/Skyblock-Translator", - "updateUrl": "", - "authorList": [ - "Laybalt" - ], - "credits": "", - "logoFile": "", - "screenshots": [], - "dependencies": [] - } -] \ No newline at end of file diff --git a/src/main/resources/mixins.skyblocktranslator.json b/src/main/resources/mixins.skyblocktranslator.json deleted file mode 100644 index 5ea0c57..0000000 --- a/src/main/resources/mixins.skyblocktranslator.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "package": "${basePackage}.mixin", - "plugin": "${basePackage}.init.AutoDiscoveryMixinPlugin", - "refmap": "mixins.${modid}.refmap.json", - "minVersion": "0.7", - "compatibilityLevel": "JAVA_8", - "__comment": "You do not need to manually register mixins in this template. Check the auto discovery mixin plugin for more info." -} diff --git a/src/main/resources/skyblock-translator.mixins.json b/src/main/resources/skyblock-translator.mixins.json new file mode 100644 index 0000000..0fe2652 --- /dev/null +++ b/src/main/resources/skyblock-translator.mixins.json @@ -0,0 +1,12 @@ +{ + "required": true, + "package": "dev.laybalt.skyblocktranslator.mixin", + "compatibilityLevel": "JAVA_25", + "client": [], + "injectors": { + "defaultRequire": 1 + }, + "overwrites": { + "requireAnnotations": true + } +}