From bbde30331bb07db971cfa7413c89856588e917d3 Mon Sep 17 00:00:00 2001 From: Hendrix-Shen Date: Sun, 3 Apr 2022 20:55:14 +0800 Subject: [PATCH] Refector with MagicLib --- .github/workflows/CI.yml | 147 ++++++------- bilibili-danmaku-compat-mc1_14/build.gradle | 8 + .../gradle.properties | 15 ++ .../BilibiliDanmakuCompat.java | 12 ++ .../BilibiliDanmakuCompatReference.java | 32 +++ .../compat/modmenu/ModMenuApiImpl.java | 24 +++ .../bilibili-danmaku-compat.mixins.json | 14 ++ .../src/main/resources/fabric.mod.json | 41 ++++ bilibili-danmaku-compat-mc1_15/build.gradle | 8 + .../gradle.properties | 15 ++ .../BilibiliDanmakuCompat.java | 12 ++ .../BilibiliDanmakuCompatReference.java | 32 +++ .../compat/modmenu/ModMenuApiImpl.java | 16 ++ .../bilibili-danmaku-compat.mixins.json | 14 ++ .../src/main/resources/fabric.mod.json | 41 ++++ bilibili-danmaku-compat-mc1_16/build.gradle | 8 + .../gradle.properties | 15 ++ .../BilibiliDanmakuCompat.java | 12 ++ .../BilibiliDanmakuCompatReference.java | 32 +++ .../compat/modmenu/ModMenuApiImpl.java | 5 +- .../bilibili-danmaku-compat.mixins.json | 14 ++ .../src/main/resources/fabric.mod.json | 41 ++++ bilibili-danmaku-compat-mc1_17/build.gradle | 8 + .../gradle.properties | 15 ++ .../BilibiliDanmakuCompat.java | 12 ++ .../BilibiliDanmakuCompatReference.java | 32 +++ .../compat/modmenu/ModMenuApiImpl.java | 16 ++ .../bilibili-danmaku-compat.mixins.json | 14 ++ .../src/main/resources/fabric.mod.json | 41 ++++ bilibili-danmaku-compat-mc1_18/build.gradle | 8 + .../gradle.properties | 15 ++ .../BilibiliDanmakuCompat.java | 12 ++ .../BilibiliDanmakuCompatReference.java | 32 +++ .../compat/modmenu/ModMenuApiImpl.java | 16 ++ .../bilibili-danmaku-compat.mixins.json | 14 ++ .../src/main/resources/fabric.mod.json | 41 ++++ bilibili-danmaku-compat-mc1_19/build.gradle | 8 + .../gradle.properties | 15 ++ .../BilibiliDanmakuCompat.java | 12 ++ .../BilibiliDanmakuCompatReference.java | 32 +++ .../compat/modmenu/ModMenuApiImpl.java | 16 ++ .../bilibili-danmaku-compat.mixins.json | 14 ++ .../src/main/resources/fabric.mod.json | 41 ++++ build.gradle | 197 +++++++++--------- gradle.properties | 71 ++----- settings.gradle | 17 +- .../bilibilidanmaku/BilibiliDanmaku.java | 23 +- .../BilibiliDanmakuConfigGui.java | 22 ++ .../BilibiliDanmakuMixinPlugin.java | 2 +- .../BilibiliDanmakuPredicates.java | 14 ++ .../BilibiliDanmakuReference.java | 6 + .../bilibilidanmaku/config/ConfigGui.java | 22 -- .../bilibilidanmaku/config/ConfigStorage.java | 77 ------- .../bilibilidanmaku/config/Configs.java | 109 +++++----- .../bilibilidanmaku/event/CallBacks.java | 29 +-- .../bilibilidanmaku/event/InputHandler.java | 25 --- .../event/MixinClientPacketListener.java | 2 +- .../bilibilidanmaku/util/InfoUtil.java | 6 +- .../bilibilidanmaku/util/VersionParser.java | 14 ++ .../util/bilibili/Bilibili.java | 8 +- .../util/bilibili/JsonDeserializer.java | 14 +- .../util/bilibili/MessageHandler.java | 44 ++-- .../assets/bilibili-danmaku/lang/en_us.json | 135 ++++++------ .../assets/bilibili-danmaku/lang/zh_cn.json | 135 ++++++------ src/main/resources/fabric.mod.json | 3 +- 65 files changed, 1337 insertions(+), 610 deletions(-) create mode 100644 bilibili-danmaku-compat-mc1_14/build.gradle create mode 100644 bilibili-danmaku-compat-mc1_14/gradle.properties create mode 100644 bilibili-danmaku-compat-mc1_14/src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmakuCompat.java create mode 100644 bilibili-danmaku-compat-mc1_14/src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmakuCompatReference.java create mode 100644 bilibili-danmaku-compat-mc1_14/src/main/java/top/hendrixshen/bilibilidanmaku/compat/modmenu/ModMenuApiImpl.java create mode 100644 bilibili-danmaku-compat-mc1_14/src/main/resources/bilibili-danmaku-compat.mixins.json create mode 100644 bilibili-danmaku-compat-mc1_14/src/main/resources/fabric.mod.json create mode 100644 bilibili-danmaku-compat-mc1_15/build.gradle create mode 100644 bilibili-danmaku-compat-mc1_15/gradle.properties create mode 100644 bilibili-danmaku-compat-mc1_15/src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmakuCompat.java create mode 100644 bilibili-danmaku-compat-mc1_15/src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmakuCompatReference.java create mode 100644 bilibili-danmaku-compat-mc1_15/src/main/java/top/hendrixshen/bilibilidanmaku/compat/modmenu/ModMenuApiImpl.java create mode 100644 bilibili-danmaku-compat-mc1_15/src/main/resources/bilibili-danmaku-compat.mixins.json create mode 100644 bilibili-danmaku-compat-mc1_15/src/main/resources/fabric.mod.json create mode 100644 bilibili-danmaku-compat-mc1_16/build.gradle create mode 100644 bilibili-danmaku-compat-mc1_16/gradle.properties create mode 100644 bilibili-danmaku-compat-mc1_16/src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmakuCompat.java create mode 100644 bilibili-danmaku-compat-mc1_16/src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmakuCompatReference.java rename {src => bilibili-danmaku-compat-mc1_16/src}/main/java/top/hendrixshen/bilibilidanmaku/compat/modmenu/ModMenuApiImpl.java (73%) create mode 100644 bilibili-danmaku-compat-mc1_16/src/main/resources/bilibili-danmaku-compat.mixins.json create mode 100644 bilibili-danmaku-compat-mc1_16/src/main/resources/fabric.mod.json create mode 100644 bilibili-danmaku-compat-mc1_17/build.gradle create mode 100644 bilibili-danmaku-compat-mc1_17/gradle.properties create mode 100644 bilibili-danmaku-compat-mc1_17/src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmakuCompat.java create mode 100644 bilibili-danmaku-compat-mc1_17/src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmakuCompatReference.java create mode 100644 bilibili-danmaku-compat-mc1_17/src/main/java/top/hendrixshen/bilibilidanmaku/compat/modmenu/ModMenuApiImpl.java create mode 100644 bilibili-danmaku-compat-mc1_17/src/main/resources/bilibili-danmaku-compat.mixins.json create mode 100644 bilibili-danmaku-compat-mc1_17/src/main/resources/fabric.mod.json create mode 100644 bilibili-danmaku-compat-mc1_18/build.gradle create mode 100644 bilibili-danmaku-compat-mc1_18/gradle.properties create mode 100644 bilibili-danmaku-compat-mc1_18/src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmakuCompat.java create mode 100644 bilibili-danmaku-compat-mc1_18/src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmakuCompatReference.java create mode 100644 bilibili-danmaku-compat-mc1_18/src/main/java/top/hendrixshen/bilibilidanmaku/compat/modmenu/ModMenuApiImpl.java create mode 100644 bilibili-danmaku-compat-mc1_18/src/main/resources/bilibili-danmaku-compat.mixins.json create mode 100644 bilibili-danmaku-compat-mc1_18/src/main/resources/fabric.mod.json create mode 100644 bilibili-danmaku-compat-mc1_19/build.gradle create mode 100644 bilibili-danmaku-compat-mc1_19/gradle.properties create mode 100644 bilibili-danmaku-compat-mc1_19/src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmakuCompat.java create mode 100644 bilibili-danmaku-compat-mc1_19/src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmakuCompatReference.java create mode 100644 bilibili-danmaku-compat-mc1_19/src/main/java/top/hendrixshen/bilibilidanmaku/compat/modmenu/ModMenuApiImpl.java create mode 100644 bilibili-danmaku-compat-mc1_19/src/main/resources/bilibili-danmaku-compat.mixins.json create mode 100644 bilibili-danmaku-compat-mc1_19/src/main/resources/fabric.mod.json create mode 100644 src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmakuConfigGui.java create mode 100644 src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmakuPredicates.java delete mode 100644 src/main/java/top/hendrixshen/bilibilidanmaku/config/ConfigGui.java delete mode 100644 src/main/java/top/hendrixshen/bilibilidanmaku/config/ConfigStorage.java delete mode 100644 src/main/java/top/hendrixshen/bilibilidanmaku/event/InputHandler.java create mode 100644 src/main/java/top/hendrixshen/bilibilidanmaku/util/VersionParser.java diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index a22e8b2..547286e 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -9,162 +9,163 @@ on: pull_request: jobs: build: - if: ${{ github.event_name == 'push' }} + if: ${{ github.event_name == 'push' && !startsWith(github.event.ref, 'refs/tags/') }} strategy: matrix: - java: [17] - os: [ubuntu-latest] + java: [ 17 ] + os: [ ubuntu-latest ] runs-on: ${{ matrix.os }} steps: - name: Checkout the sources uses: actions/checkout@v2 + - name: Set up JDK ${{ matrix.java }} uses: actions/setup-java@v2 with: distribution: 'adopt' java-version: ${{ matrix.java }} + - name: Cache Gradle packages uses: actions/cache@v2 with: path: ~/.gradle/caches key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} restore-keys: ${{ runner.os }}-gradle + - name: Get short commit sha id: get_short_sha run: | short_sha=$(echo ${GITHUB_SHA} | cut -c1-7) echo "::set-output name=short_sha::$short_sha" - - name: Set build number in codes - run: | - sed -i "s/Development/Public Beta/g" src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmakuReference.java - - name: Read relevant fields from gradle.properties - id: properties - run: | - path='./gradle.properties' - for property in mod_name mod_version minecraft_version_out - do - result=$(sed -n "/^[[:space:]]*$property[[:space:]]*=[[:space:]]*/s/^[[:space:]]*$property[[:space:]]*=[[:space:]]*//p" "$path") - echo "$property: $result" - echo ::set-output name=$property::"$result" - done + + - name: Read Properties mod_name + id: mod_name + uses: christian-draeger/read-properties@1.0.1 + with: + path: gradle.properties + property: mod_name + + - name: Read Properties mod_version + id: mod_version + uses: christian-draeger/read-properties@1.0.1 + with: + path: gradle.properties + property: mod_version + - name: Grant execute permission for gradlew run: chmod +x gradlew + - name: Build with Gradle env: - GIT_COMMIT_ID: ${{ steps.get_short_sha.outputs.short_sha }} + COMMIT_SHA: ${{ steps.get_short_sha.outputs.short_sha }} + BUILD_TYPE: "BETA" + BUILD_NUMBER: ${{ github.run_number}} run: ./gradlew build + + - name: Upload assets to GitHub Action + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.mod_name.outputs.value }} ${{ steps.mod_version.outputs.value }}.${{ github.run_number}}+${{ steps.get_short_sha.outputs.short_sha }} + path: build/libs/ + - name: Create Github release uses: marvinpinto/action-automatic-releases@v1.2.1 with: repo_token: "${{ secrets.GITHUB_TOKEN }}" automatic_release_tag: "CI/build.${{ github.run_number}}" prerelease: true - title: "[CI#${{ github.run_number}}]${{ steps.properties.outputs.mod_name }} ${{ steps.properties.outputs.mod_version }}(${{ steps.get_short_sha.outputs.short_sha }}) for Minecraft ${{ steps.properties.outputs.minecraft_version_out }}" + title: "[CI#${{ github.run_number}}]${{ steps.mod_name.outputs.value }} ${{ steps.mod_version.outputs.value }}.${{ github.run_number}}+${{ steps.get_short_sha.outputs.short_sha }}" files: | LICENSE build/libs/*.jar + publish: if: ${{ github.event_name == 'release' }} strategy: matrix: - java: [17] - os: [ubuntu-latest] - branch: [1.15, 1.16, 1.17, 1.18, 1.19] + java: [ 17 ] + os: [ ubuntu-latest ] runs-on: ${{ matrix.os }} steps: - name: Checkout the sources uses: actions/checkout@v2 - with: - ref: ${{ matrix.branch }} + - name: Set up JDK ${{ matrix.java }} uses: actions/setup-java@v2 with: distribution: 'adopt' java-version: ${{ matrix.java }} + - name: Cache Gradle packages uses: actions/cache@v2 with: path: ~/.gradle/caches key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} restore-keys: ${{ runner.os }}-gradle - - name: Get commit sha from the corresponding branch - id: get_sha - uses: mego22/actions-git-sha@main - with: - repo: "https://github.com/Hendrix-Shen/Bilibili-Danmaku" - branch: "${{ matrix.branch }}" + - name: Get short commit sha id: get_short_sha run: | - short_sha=$(echo ${{ steps.get_sha.outputs.sha }} | cut -c1-7) + short_sha=$(echo ${GITHUB_SHA} | cut -c1-7) echo "::set-output name=short_sha::$short_sha" - - name: Set build number in codes - run: | - sed -i "s/Development/Public Beta/g" src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmakuReference.java - - name: Read relevant fields from gradle.properties - id: properties - run: | - path='./gradle.properties' - for property in mod_file_name mod_version minecraft_version_out cruseforge_gameversion cruseforge_projectid cruseforge_relations cruseforge_release cruseforge_release_type github_release modrinth_release modrinth_release_type - do - result=$(sed -n "/^[[:space:]]*$property[[:space:]]*=[[:space:]]*/s/^[[:space:]]*$property[[:space:]]*=[[:space:]]*//p" "$path") - echo "$property: $result" - echo ::set-output name=$property::"$result" - done + + - name: Read Properties mod_name + id: mod_name + uses: christian-draeger/read-properties@1.0.1 + with: + path: gradle.properties + property: mod_name + + - name: Read Properties mod_version + id: mod_version + uses: christian-draeger/read-properties@1.0.1 + with: + path: gradle.properties + property: mod_version + - name: Grant execute permission for gradlew run: chmod +x gradlew + - name: Build with Gradle env: - GIT_COMMIT_ID: ${{ steps.get_short_sha.outputs.short_sha }} + COMMIT_SHA: ${{ steps.get_short_sha.outputs.short_sha }} + BUILD_TYPE: "RELEASE" + BUILD_NUMBER: ${{ github.run_number}} run: ./gradlew build - - name: Find correct jar - id: findjar - run: | - output="$(find build/libs/ ! -name "*-dev.jar" ! -name "*-sources.jar" -type f -printf "%f\n")" - echo "::set-output name=jarname::$output" + + - name: Upload assets to GitHub Action + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.mod_name.outputs.value }} ${{ steps.mod_version.outputs.value }}.${{ github.run_number}}+${{ steps.get_short_sha.outputs.short_sha }} + path: build/libs/ + - name: Upload assets to GitHub Release if: ${{ steps.properties.outputs.github_release == 'true' }} uses: AButler/upload-release-assets@v2.0 with: - files: 'build/libs/${{ steps.findjar.outputs.jarname }}' + files: 'build/libs/*' repo-token: ${{ secrets.GITHUB_TOKEN }} - - name: Upload assets to Curseforge - if: ${{ steps.properties.outputs.cruseforge_release == 'true' }} - uses: itsmeow/curseforge-upload@v3 - with: - token: ${{ secrets.CF_API_TOKEN }} - project_id: ${{ steps.properties.outputs.cruseforge_projectid }} - game_endpoint: minecraft - file_path: build/libs/${{ steps.findjar.outputs.jarname }} - changelog_type: markdown - changelog: ${{ github.event.release.body }} - game_versions: ${{ steps.properties.outputs.cruseforge_gameversion }} - release_type: ${{ steps.properties.outputs.cruseforge_release_type }} - relations: ${{ steps.properties.outputs.cruseforge_relations }} - - name: Upload assets to Modrinth - if: ${{ steps.properties.outputs.modrinth_release == 'true' }} - run: ./gradlew publishModrinth - env: - CHANGE_LOG: ${{ github.event.release.body }} - GIT_COMMIT_ID: ${{ steps.get_short_sha.outputs.short_sha }} - MODRINTH_API_TOKEN: ${{ secrets.MODRINTH_API_TOKEN }} - VERSION_NUMBER: ${{ steps.properties.outputs.mod_file_name }}-mc${{ steps.properties.outputs.minecraft_version_out }}-${{ steps.properties.outputs.mod_version }}+${{ steps.get_short_sha.outputs.short_sha }} + pull_request: if: ${{ github.event_name == 'pull_request' }} strategy: matrix: - java: [17] - os: [ubuntu-latest] + java: [ 17 ] + os: [ ubuntu-latest ] runs-on: ${{ matrix.os }} + steps: - name: Checkout the sources uses: actions/checkout@v2 + - name: Set up JDK ${{ matrix.java }} uses: actions/setup-java@v2 with: distribution: 'adopt' java-version: ${{ matrix.java }} + - name: Grant execute permission for gradlew run: chmod +x gradlew + - name: Build with Gradle run: ./gradlew build diff --git a/bilibili-danmaku-compat-mc1_14/build.gradle b/bilibili-danmaku-compat-mc1_14/build.gradle new file mode 100644 index 0000000..a659456 --- /dev/null +++ b/bilibili-danmaku-compat-mc1_14/build.gradle @@ -0,0 +1,8 @@ +dependencies { + minecraft("com.mojang:minecraft:${project.minecraft_version}") + + modImplementation("curse.maven:malilib-303119:${project.library_malilib_version}") + modImplementation("curse.maven:modmenu-308702:${project.library_modmenu_version}") + + modRuntimeOnly("curse.maven:in-game-account-switcher-232676:${project.library_inGameAccountSwitcher_version}") +} \ No newline at end of file diff --git a/bilibili-danmaku-compat-mc1_14/gradle.properties b/bilibili-danmaku-compat-mc1_14/gradle.properties new file mode 100644 index 0000000..c90c9fa --- /dev/null +++ b/bilibili-danmaku-compat-mc1_14/gradle.properties @@ -0,0 +1,15 @@ +# Mod reference +mod_id = bilibili-danmaku-compat-mc1_14 + +# Development Environment +minecraft_version = 1.14.4 + +# Require Libraries +# MaLiLib - 0.10.0-dev.20+arne.2 +library_malilib_version = 2876325 +# Mod Menu - 1.7.17 +library_modmenu_version = 3121565 + +# Runtime Libraries +# In-Game Account Switcher - 7.1.3 +library_inGameAccountSwitcher_version = 3493805 \ No newline at end of file diff --git a/bilibili-danmaku-compat-mc1_14/src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmakuCompat.java b/bilibili-danmaku-compat-mc1_14/src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmakuCompat.java new file mode 100644 index 0000000..dff8790 --- /dev/null +++ b/bilibili-danmaku-compat-mc1_14/src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmakuCompat.java @@ -0,0 +1,12 @@ +package top.hendrixshen.bilibilidanmaku; + +import net.fabricmc.api.ModInitializer; + +public class BilibiliDanmakuCompat implements ModInitializer { + @Override + public void onInitialize() { + BilibiliDanmaku.getLogger().info("[{}]: Compat module for {} loaded. Starting compat api...", BilibiliDanmakuCompatReference.getModName(), BilibiliDanmakuCompatReference.getCompatVersion()); + + BilibiliDanmaku.getLogger().info("[{}]: Compat initialized - Version: {} ({})", BilibiliDanmakuCompatReference.getModName(), BilibiliDanmakuCompatReference.getModVersion(), BilibiliDanmakuCompatReference.getModVersionType()); + } +} diff --git a/bilibili-danmaku-compat-mc1_14/src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmakuCompatReference.java b/bilibili-danmaku-compat-mc1_14/src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmakuCompatReference.java new file mode 100644 index 0000000..1cb3493 --- /dev/null +++ b/bilibili-danmaku-compat-mc1_14/src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmakuCompatReference.java @@ -0,0 +1,32 @@ +package top.hendrixshen.bilibilidanmaku; + +import net.fabricmc.loader.api.FabricLoader; +import top.hendrixshen.bilibilidanmaku.util.VersionParser; + +public class BilibiliDanmakuCompatReference { + private static final String MOD_COMPAT_VERSION = "MC 1.14.x"; + private static final String MOD_ID = "bilibili-danmaku-compat-mc1_14"; + private static final String MOD_NAME = FabricLoader.getInstance().getModContainer(MOD_ID).orElseThrow(RuntimeException::new).getMetadata().getName(); + private static final String MOD_VERSION = FabricLoader.getInstance().getModContainer(MOD_ID).orElseThrow(RuntimeException::new).getMetadata().getVersion().getFriendlyString(); + private static final String MOD_VERSION_TYPE = VersionParser.getVersionType(MOD_VERSION); + + public static String getCompatVersion() { + return MOD_COMPAT_VERSION; + } + + public static String getModId() { + return MOD_ID; + } + + public static String getModName() { + return MOD_NAME; + } + + public static String getModVersion() { + return MOD_VERSION; + } + + public static String getModVersionType() { + return MOD_VERSION_TYPE; + } +} diff --git a/bilibili-danmaku-compat-mc1_14/src/main/java/top/hendrixshen/bilibilidanmaku/compat/modmenu/ModMenuApiImpl.java b/bilibili-danmaku-compat-mc1_14/src/main/java/top/hendrixshen/bilibilidanmaku/compat/modmenu/ModMenuApiImpl.java new file mode 100644 index 0000000..bfd7a1c --- /dev/null +++ b/bilibili-danmaku-compat-mc1_14/src/main/java/top/hendrixshen/bilibilidanmaku/compat/modmenu/ModMenuApiImpl.java @@ -0,0 +1,24 @@ +package top.hendrixshen.bilibilidanmaku.compat.modmenu; + +import io.github.prospector.modmenu.api.ModMenuApi; +import net.minecraft.client.gui.screens.Screen; +import top.hendrixshen.bilibilidanmaku.BilibiliDanmakuConfigGui; +import top.hendrixshen.bilibilidanmaku.BilibiliDanmakuReference; + +import java.util.function.Function; + +public class ModMenuApiImpl implements ModMenuApi { + @Override + public String getModId() { + return BilibiliDanmakuReference.getModId(); + } + + @Override + public Function getConfigScreenFactory() { + return (screen) -> { + BilibiliDanmakuConfigGui gui = BilibiliDanmakuConfigGui.getInstance(); + gui.setParent(screen); + return gui; + }; + } +} diff --git a/bilibili-danmaku-compat-mc1_14/src/main/resources/bilibili-danmaku-compat.mixins.json b/bilibili-danmaku-compat-mc1_14/src/main/resources/bilibili-danmaku-compat.mixins.json new file mode 100644 index 0000000..cfd7574 --- /dev/null +++ b/bilibili-danmaku-compat-mc1_14/src/main/resources/bilibili-danmaku-compat.mixins.json @@ -0,0 +1,14 @@ +{ + "required": true, + "package": "top.hendrixshen.bilibilidanmaku.compat.mixin", + "plugin": "top.hendrixshen.bilibilidanmaku.BilibiliDanmakuMixinPlugin", + "minVersion": "0.8", + "compatibilityLevel": "JAVA_8", + "client": [ + ], + "mixins": [ + ], + "injectors": { + "defaultRequire": 0 + } +} diff --git a/bilibili-danmaku-compat-mc1_14/src/main/resources/fabric.mod.json b/bilibili-danmaku-compat-mc1_14/src/main/resources/fabric.mod.json new file mode 100644 index 0000000..e2bf5ff --- /dev/null +++ b/bilibili-danmaku-compat-mc1_14/src/main/resources/fabric.mod.json @@ -0,0 +1,41 @@ +{ + "schemaVersion": 1, + "id": "bilibili-danmaku-compat-mc1_14", + "name": "Bilibili Danmaku Compat", + "version": "${mod_version}", + "description": "Bilibili Danmaku compat for Minecraft 1.14.x", + "authors": [ + { + "name": "Hendrix_Shen", + "contact": { + "homepage": "https://github.com/Hendrix-Shen" + } + } + ], + "contact": { + "homepage": "https://github.com/Hendrix-Shen/Bilibili-Danmaku", + "issues": "https://github.com/Hendrix-Shen/Bilibili-Danmaku/issues", + "sources": "https://github.com/Hendrix-Shen/Bilibili-Danmaku" + }, + "license": "GPLv3", + "environment": "client", + "entrypoints": { + "main": [ + "top.hendrixshen.bilibilidanmaku.BilibiliDanmakuCompat" + ] + }, + "mixins": [ + "bilibili-danmaku-compat.mixins.json" + ], + "depends": { + "minecraft": "1.14.x", + "bilibili-danmaku": "*" + }, + "custom": { + "modmenu:parent": "bilibili-danmaku", + "modmenu:clientsideOnly": true, + "modmenu": { + "parent": "bilibili-danmaku" + } + } +} diff --git a/bilibili-danmaku-compat-mc1_15/build.gradle b/bilibili-danmaku-compat-mc1_15/build.gradle new file mode 100644 index 0000000..a659456 --- /dev/null +++ b/bilibili-danmaku-compat-mc1_15/build.gradle @@ -0,0 +1,8 @@ +dependencies { + minecraft("com.mojang:minecraft:${project.minecraft_version}") + + modImplementation("curse.maven:malilib-303119:${project.library_malilib_version}") + modImplementation("curse.maven:modmenu-308702:${project.library_modmenu_version}") + + modRuntimeOnly("curse.maven:in-game-account-switcher-232676:${project.library_inGameAccountSwitcher_version}") +} \ No newline at end of file diff --git a/bilibili-danmaku-compat-mc1_15/gradle.properties b/bilibili-danmaku-compat-mc1_15/gradle.properties new file mode 100644 index 0000000..5ee01b2 --- /dev/null +++ b/bilibili-danmaku-compat-mc1_15/gradle.properties @@ -0,0 +1,15 @@ +# Mod reference +mod_id = bilibili-danmaku-compat-mc1_15 + +# Development Environment +minecraft_version = 1.15.2 + +# Require Libraries +# MaLiLib - 0.10.0-dev.21+arne.2 +library_malilib_version = 2942271 +# Mod Menu - 1.10.6 +library_modmenu_version = 3271693 + +# Runtime Libraries +# In-Game Account Switcher - 7.1.3 +library_inGameAccountSwitcher_version = 3493807 \ No newline at end of file diff --git a/bilibili-danmaku-compat-mc1_15/src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmakuCompat.java b/bilibili-danmaku-compat-mc1_15/src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmakuCompat.java new file mode 100644 index 0000000..dff8790 --- /dev/null +++ b/bilibili-danmaku-compat-mc1_15/src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmakuCompat.java @@ -0,0 +1,12 @@ +package top.hendrixshen.bilibilidanmaku; + +import net.fabricmc.api.ModInitializer; + +public class BilibiliDanmakuCompat implements ModInitializer { + @Override + public void onInitialize() { + BilibiliDanmaku.getLogger().info("[{}]: Compat module for {} loaded. Starting compat api...", BilibiliDanmakuCompatReference.getModName(), BilibiliDanmakuCompatReference.getCompatVersion()); + + BilibiliDanmaku.getLogger().info("[{}]: Compat initialized - Version: {} ({})", BilibiliDanmakuCompatReference.getModName(), BilibiliDanmakuCompatReference.getModVersion(), BilibiliDanmakuCompatReference.getModVersionType()); + } +} diff --git a/bilibili-danmaku-compat-mc1_15/src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmakuCompatReference.java b/bilibili-danmaku-compat-mc1_15/src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmakuCompatReference.java new file mode 100644 index 0000000..197e5d1 --- /dev/null +++ b/bilibili-danmaku-compat-mc1_15/src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmakuCompatReference.java @@ -0,0 +1,32 @@ +package top.hendrixshen.bilibilidanmaku; + +import net.fabricmc.loader.api.FabricLoader; +import top.hendrixshen.bilibilidanmaku.util.VersionParser; + +public class BilibiliDanmakuCompatReference { + private static final String MOD_COMPAT_VERSION = "MC 1.16.x"; + private static final String MOD_ID = "bilibili-danmaku-compat-mc1_16"; + private static final String MOD_NAME = FabricLoader.getInstance().getModContainer(MOD_ID).orElseThrow(RuntimeException::new).getMetadata().getName(); + private static final String MOD_VERSION = FabricLoader.getInstance().getModContainer(MOD_ID).orElseThrow(RuntimeException::new).getMetadata().getVersion().getFriendlyString(); + private static final String MOD_VERSION_TYPE = VersionParser.getVersionType(MOD_VERSION); + + public static String getCompatVersion() { + return MOD_COMPAT_VERSION; + } + + public static String getModId() { + return MOD_ID; + } + + public static String getModName() { + return MOD_NAME; + } + + public static String getModVersion() { + return MOD_VERSION; + } + + public static String getModVersionType() { + return MOD_VERSION_TYPE; + } +} diff --git a/bilibili-danmaku-compat-mc1_15/src/main/java/top/hendrixshen/bilibilidanmaku/compat/modmenu/ModMenuApiImpl.java b/bilibili-danmaku-compat-mc1_15/src/main/java/top/hendrixshen/bilibilidanmaku/compat/modmenu/ModMenuApiImpl.java new file mode 100644 index 0000000..ace178f --- /dev/null +++ b/bilibili-danmaku-compat-mc1_15/src/main/java/top/hendrixshen/bilibilidanmaku/compat/modmenu/ModMenuApiImpl.java @@ -0,0 +1,16 @@ +package top.hendrixshen.bilibilidanmaku.compat.modmenu; + +import io.github.prospector.modmenu.api.ConfigScreenFactory; +import io.github.prospector.modmenu.api.ModMenuApi; +import top.hendrixshen.bilibilidanmaku.BilibiliDanmakuConfigGui; + +public class ModMenuApiImpl implements ModMenuApi { + @Override + public ConfigScreenFactory getModConfigScreenFactory() { + return (screen) -> { + BilibiliDanmakuConfigGui gui = BilibiliDanmakuConfigGui.getInstance(); + gui.setParent(screen); + return gui; + }; + } +} diff --git a/bilibili-danmaku-compat-mc1_15/src/main/resources/bilibili-danmaku-compat.mixins.json b/bilibili-danmaku-compat-mc1_15/src/main/resources/bilibili-danmaku-compat.mixins.json new file mode 100644 index 0000000..cfd7574 --- /dev/null +++ b/bilibili-danmaku-compat-mc1_15/src/main/resources/bilibili-danmaku-compat.mixins.json @@ -0,0 +1,14 @@ +{ + "required": true, + "package": "top.hendrixshen.bilibilidanmaku.compat.mixin", + "plugin": "top.hendrixshen.bilibilidanmaku.BilibiliDanmakuMixinPlugin", + "minVersion": "0.8", + "compatibilityLevel": "JAVA_8", + "client": [ + ], + "mixins": [ + ], + "injectors": { + "defaultRequire": 0 + } +} diff --git a/bilibili-danmaku-compat-mc1_15/src/main/resources/fabric.mod.json b/bilibili-danmaku-compat-mc1_15/src/main/resources/fabric.mod.json new file mode 100644 index 0000000..f40dc1c --- /dev/null +++ b/bilibili-danmaku-compat-mc1_15/src/main/resources/fabric.mod.json @@ -0,0 +1,41 @@ +{ + "schemaVersion": 1, + "id": "bilibili-danmaku-compat-mc1_15", + "name": "Bilibili Danmaku Compat", + "version": "${mod_version}", + "description": "Bilibili Danmaku compat for Minecraft 1.15.x", + "authors": [ + { + "name": "Hendrix_Shen", + "contact": { + "homepage": "https://github.com/Hendrix-Shen" + } + } + ], + "contact": { + "homepage": "https://github.com/Hendrix-Shen/Bilibili-Danmaku", + "issues": "https://github.com/Hendrix-Shen/Bilibili-Danmaku/issues", + "sources": "https://github.com/Hendrix-Shen/Bilibili-Danmaku" + }, + "license": "GPLv3", + "environment": "client", + "entrypoints": { + "main": [ + "top.hendrixshen.bilibilidanmaku.BilibiliDanmakuCompat" + ] + }, + "mixins": [ + "bilibili-danmaku-compat.mixins.json" + ], + "depends": { + "minecraft": "1.15.x", + "bilibili-danmaku": "*" + }, + "custom": { + "modmenu:parent": "bilibili-danmaku", + "modmenu:clientsideOnly": true, + "modmenu": { + "parent": "bilibili-danmaku" + } + } +} diff --git a/bilibili-danmaku-compat-mc1_16/build.gradle b/bilibili-danmaku-compat-mc1_16/build.gradle new file mode 100644 index 0000000..a659456 --- /dev/null +++ b/bilibili-danmaku-compat-mc1_16/build.gradle @@ -0,0 +1,8 @@ +dependencies { + minecraft("com.mojang:minecraft:${project.minecraft_version}") + + modImplementation("curse.maven:malilib-303119:${project.library_malilib_version}") + modImplementation("curse.maven:modmenu-308702:${project.library_modmenu_version}") + + modRuntimeOnly("curse.maven:in-game-account-switcher-232676:${project.library_inGameAccountSwitcher_version}") +} \ No newline at end of file diff --git a/bilibili-danmaku-compat-mc1_16/gradle.properties b/bilibili-danmaku-compat-mc1_16/gradle.properties new file mode 100644 index 0000000..b1bb66f --- /dev/null +++ b/bilibili-danmaku-compat-mc1_16/gradle.properties @@ -0,0 +1,15 @@ +# Mod reference +mod_id = bilibili-danmaku-compat-mc1_16 + +# Development Environment +minecraft_version = 1.16.5 + +# Require Libraries +# Malilib - 0.10.0-dev.21+arne.8 +library_malilib_version = 3542536 +# Mod Menu - 1.16.22 +library_modmenu_version = 3479748 + +# Runtime Libraries +# In-Game Account Switcher - 7.1.3 +library_inGameAccountSwitcher_version = 3493810 \ No newline at end of file diff --git a/bilibili-danmaku-compat-mc1_16/src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmakuCompat.java b/bilibili-danmaku-compat-mc1_16/src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmakuCompat.java new file mode 100644 index 0000000..dff8790 --- /dev/null +++ b/bilibili-danmaku-compat-mc1_16/src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmakuCompat.java @@ -0,0 +1,12 @@ +package top.hendrixshen.bilibilidanmaku; + +import net.fabricmc.api.ModInitializer; + +public class BilibiliDanmakuCompat implements ModInitializer { + @Override + public void onInitialize() { + BilibiliDanmaku.getLogger().info("[{}]: Compat module for {} loaded. Starting compat api...", BilibiliDanmakuCompatReference.getModName(), BilibiliDanmakuCompatReference.getCompatVersion()); + + BilibiliDanmaku.getLogger().info("[{}]: Compat initialized - Version: {} ({})", BilibiliDanmakuCompatReference.getModName(), BilibiliDanmakuCompatReference.getModVersion(), BilibiliDanmakuCompatReference.getModVersionType()); + } +} diff --git a/bilibili-danmaku-compat-mc1_16/src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmakuCompatReference.java b/bilibili-danmaku-compat-mc1_16/src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmakuCompatReference.java new file mode 100644 index 0000000..197e5d1 --- /dev/null +++ b/bilibili-danmaku-compat-mc1_16/src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmakuCompatReference.java @@ -0,0 +1,32 @@ +package top.hendrixshen.bilibilidanmaku; + +import net.fabricmc.loader.api.FabricLoader; +import top.hendrixshen.bilibilidanmaku.util.VersionParser; + +public class BilibiliDanmakuCompatReference { + private static final String MOD_COMPAT_VERSION = "MC 1.16.x"; + private static final String MOD_ID = "bilibili-danmaku-compat-mc1_16"; + private static final String MOD_NAME = FabricLoader.getInstance().getModContainer(MOD_ID).orElseThrow(RuntimeException::new).getMetadata().getName(); + private static final String MOD_VERSION = FabricLoader.getInstance().getModContainer(MOD_ID).orElseThrow(RuntimeException::new).getMetadata().getVersion().getFriendlyString(); + private static final String MOD_VERSION_TYPE = VersionParser.getVersionType(MOD_VERSION); + + public static String getCompatVersion() { + return MOD_COMPAT_VERSION; + } + + public static String getModId() { + return MOD_ID; + } + + public static String getModName() { + return MOD_NAME; + } + + public static String getModVersion() { + return MOD_VERSION; + } + + public static String getModVersionType() { + return MOD_VERSION_TYPE; + } +} diff --git a/src/main/java/top/hendrixshen/bilibilidanmaku/compat/modmenu/ModMenuApiImpl.java b/bilibili-danmaku-compat-mc1_16/src/main/java/top/hendrixshen/bilibilidanmaku/compat/modmenu/ModMenuApiImpl.java similarity index 73% rename from src/main/java/top/hendrixshen/bilibilidanmaku/compat/modmenu/ModMenuApiImpl.java rename to bilibili-danmaku-compat-mc1_16/src/main/java/top/hendrixshen/bilibilidanmaku/compat/modmenu/ModMenuApiImpl.java index 9b3d085..750ed80 100644 --- a/src/main/java/top/hendrixshen/bilibilidanmaku/compat/modmenu/ModMenuApiImpl.java +++ b/bilibili-danmaku-compat-mc1_16/src/main/java/top/hendrixshen/bilibilidanmaku/compat/modmenu/ModMenuApiImpl.java @@ -2,14 +2,13 @@ import com.terraformersmc.modmenu.api.ConfigScreenFactory; import com.terraformersmc.modmenu.api.ModMenuApi; -import top.hendrixshen.bilibilidanmaku.config.ConfigGui; +import top.hendrixshen.bilibilidanmaku.BilibiliDanmakuConfigGui; public class ModMenuApiImpl implements ModMenuApi { @Override public ConfigScreenFactory getModConfigScreenFactory() { - return (screen) -> { - ConfigGui gui = ConfigGui.getInstance(); + BilibiliDanmakuConfigGui gui = BilibiliDanmakuConfigGui.getInstance(); gui.setParent(screen); return gui; }; diff --git a/bilibili-danmaku-compat-mc1_16/src/main/resources/bilibili-danmaku-compat.mixins.json b/bilibili-danmaku-compat-mc1_16/src/main/resources/bilibili-danmaku-compat.mixins.json new file mode 100644 index 0000000..cfd7574 --- /dev/null +++ b/bilibili-danmaku-compat-mc1_16/src/main/resources/bilibili-danmaku-compat.mixins.json @@ -0,0 +1,14 @@ +{ + "required": true, + "package": "top.hendrixshen.bilibilidanmaku.compat.mixin", + "plugin": "top.hendrixshen.bilibilidanmaku.BilibiliDanmakuMixinPlugin", + "minVersion": "0.8", + "compatibilityLevel": "JAVA_8", + "client": [ + ], + "mixins": [ + ], + "injectors": { + "defaultRequire": 0 + } +} diff --git a/bilibili-danmaku-compat-mc1_16/src/main/resources/fabric.mod.json b/bilibili-danmaku-compat-mc1_16/src/main/resources/fabric.mod.json new file mode 100644 index 0000000..d7285f2 --- /dev/null +++ b/bilibili-danmaku-compat-mc1_16/src/main/resources/fabric.mod.json @@ -0,0 +1,41 @@ +{ + "schemaVersion": 1, + "id": "bilibili-danmaku-compat-mc1_16", + "name": "Bilibili Danmaku Compat", + "version": "${mod_version}", + "description": "Bilibili Danmaku compat for Minecraft 1.16.x", + "authors": [ + { + "name": "Hendrix_Shen", + "contact": { + "homepage": "https://github.com/Hendrix-Shen" + } + } + ], + "contact": { + "homepage": "https://github.com/Hendrix-Shen/Bilibili-Danmaku", + "issues": "https://github.com/Hendrix-Shen/Bilibili-Danmaku/issues", + "sources": "https://github.com/Hendrix-Shen/Bilibili-Danmaku" + }, + "license": "GPLv3", + "environment": "client", + "entrypoints": { + "main": [ + "top.hendrixshen.bilibilidanmaku.BilibiliDanmakuCompat" + ] + }, + "mixins": [ + "bilibili-danmaku-compat.mixins.json" + ], + "depends": { + "minecraft": "1.16.x", + "bilibili-danmaku": "*" + }, + "custom": { + "modmenu:parent": "bilibili-danmaku", + "modmenu:clientsideOnly": true, + "modmenu": { + "parent": "bilibili-danmaku" + } + } +} diff --git a/bilibili-danmaku-compat-mc1_17/build.gradle b/bilibili-danmaku-compat-mc1_17/build.gradle new file mode 100644 index 0000000..a659456 --- /dev/null +++ b/bilibili-danmaku-compat-mc1_17/build.gradle @@ -0,0 +1,8 @@ +dependencies { + minecraft("com.mojang:minecraft:${project.minecraft_version}") + + modImplementation("curse.maven:malilib-303119:${project.library_malilib_version}") + modImplementation("curse.maven:modmenu-308702:${project.library_modmenu_version}") + + modRuntimeOnly("curse.maven:in-game-account-switcher-232676:${project.library_inGameAccountSwitcher_version}") +} \ No newline at end of file diff --git a/bilibili-danmaku-compat-mc1_17/gradle.properties b/bilibili-danmaku-compat-mc1_17/gradle.properties new file mode 100644 index 0000000..eba82d2 --- /dev/null +++ b/bilibili-danmaku-compat-mc1_17/gradle.properties @@ -0,0 +1,15 @@ +# Mod reference +mod_id = bilibili-danmaku-compat-mc1_17 + +# Development Environment +minecraft_version = 1.17.1 + +# Require Libraries +# MaLiLib - 0.10.0-dev.26 +library_malilib_version = 3498871 +# Mod Menu - 2.0.14 +library_modmenu_version = 3479750 + +# Runtime Libraries +# In-Game Account Switcher - 7.1.3 +library_inGameAccountSwitcher_version = 3493811 \ No newline at end of file diff --git a/bilibili-danmaku-compat-mc1_17/src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmakuCompat.java b/bilibili-danmaku-compat-mc1_17/src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmakuCompat.java new file mode 100644 index 0000000..dff8790 --- /dev/null +++ b/bilibili-danmaku-compat-mc1_17/src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmakuCompat.java @@ -0,0 +1,12 @@ +package top.hendrixshen.bilibilidanmaku; + +import net.fabricmc.api.ModInitializer; + +public class BilibiliDanmakuCompat implements ModInitializer { + @Override + public void onInitialize() { + BilibiliDanmaku.getLogger().info("[{}]: Compat module for {} loaded. Starting compat api...", BilibiliDanmakuCompatReference.getModName(), BilibiliDanmakuCompatReference.getCompatVersion()); + + BilibiliDanmaku.getLogger().info("[{}]: Compat initialized - Version: {} ({})", BilibiliDanmakuCompatReference.getModName(), BilibiliDanmakuCompatReference.getModVersion(), BilibiliDanmakuCompatReference.getModVersionType()); + } +} diff --git a/bilibili-danmaku-compat-mc1_17/src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmakuCompatReference.java b/bilibili-danmaku-compat-mc1_17/src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmakuCompatReference.java new file mode 100644 index 0000000..1ba4a89 --- /dev/null +++ b/bilibili-danmaku-compat-mc1_17/src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmakuCompatReference.java @@ -0,0 +1,32 @@ +package top.hendrixshen.bilibilidanmaku; + +import net.fabricmc.loader.api.FabricLoader; +import top.hendrixshen.bilibilidanmaku.util.VersionParser; + +public class BilibiliDanmakuCompatReference { + private static final String MOD_COMPAT_VERSION = "MC 1.17.x"; + private static final String MOD_ID = "bilibili-danmaku-compat-mc1_17"; + private static final String MOD_NAME = FabricLoader.getInstance().getModContainer(MOD_ID).orElseThrow(RuntimeException::new).getMetadata().getName(); + private static final String MOD_VERSION = FabricLoader.getInstance().getModContainer(MOD_ID).orElseThrow(RuntimeException::new).getMetadata().getVersion().getFriendlyString(); + private static final String MOD_VERSION_TYPE = VersionParser.getVersionType(MOD_VERSION); + + public static String getCompatVersion() { + return MOD_COMPAT_VERSION; + } + + public static String getModId() { + return MOD_ID; + } + + public static String getModName() { + return MOD_NAME; + } + + public static String getModVersion() { + return MOD_VERSION; + } + + public static String getModVersionType() { + return MOD_VERSION_TYPE; + } +} diff --git a/bilibili-danmaku-compat-mc1_17/src/main/java/top/hendrixshen/bilibilidanmaku/compat/modmenu/ModMenuApiImpl.java b/bilibili-danmaku-compat-mc1_17/src/main/java/top/hendrixshen/bilibilidanmaku/compat/modmenu/ModMenuApiImpl.java new file mode 100644 index 0000000..750ed80 --- /dev/null +++ b/bilibili-danmaku-compat-mc1_17/src/main/java/top/hendrixshen/bilibilidanmaku/compat/modmenu/ModMenuApiImpl.java @@ -0,0 +1,16 @@ +package top.hendrixshen.bilibilidanmaku.compat.modmenu; + +import com.terraformersmc.modmenu.api.ConfigScreenFactory; +import com.terraformersmc.modmenu.api.ModMenuApi; +import top.hendrixshen.bilibilidanmaku.BilibiliDanmakuConfigGui; + +public class ModMenuApiImpl implements ModMenuApi { + @Override + public ConfigScreenFactory getModConfigScreenFactory() { + return (screen) -> { + BilibiliDanmakuConfigGui gui = BilibiliDanmakuConfigGui.getInstance(); + gui.setParent(screen); + return gui; + }; + } +} diff --git a/bilibili-danmaku-compat-mc1_17/src/main/resources/bilibili-danmaku-compat.mixins.json b/bilibili-danmaku-compat-mc1_17/src/main/resources/bilibili-danmaku-compat.mixins.json new file mode 100644 index 0000000..cfd7574 --- /dev/null +++ b/bilibili-danmaku-compat-mc1_17/src/main/resources/bilibili-danmaku-compat.mixins.json @@ -0,0 +1,14 @@ +{ + "required": true, + "package": "top.hendrixshen.bilibilidanmaku.compat.mixin", + "plugin": "top.hendrixshen.bilibilidanmaku.BilibiliDanmakuMixinPlugin", + "minVersion": "0.8", + "compatibilityLevel": "JAVA_8", + "client": [ + ], + "mixins": [ + ], + "injectors": { + "defaultRequire": 0 + } +} diff --git a/bilibili-danmaku-compat-mc1_17/src/main/resources/fabric.mod.json b/bilibili-danmaku-compat-mc1_17/src/main/resources/fabric.mod.json new file mode 100644 index 0000000..0d2930a --- /dev/null +++ b/bilibili-danmaku-compat-mc1_17/src/main/resources/fabric.mod.json @@ -0,0 +1,41 @@ +{ + "schemaVersion": 1, + "id": "bilibili-danmaku-compat-mc1_17", + "name": "Bilibili Danmaku Compat", + "version": "${mod_version}", + "description": "Bilibili Danmaku compat for Minecraft 1.17.x", + "authors": [ + { + "name": "Hendrix_Shen", + "contact": { + "homepage": "https://github.com/Hendrix-Shen" + } + } + ], + "contact": { + "homepage": "https://github.com/Hendrix-Shen/Bilibili-Danmaku", + "issues": "https://github.com/Hendrix-Shen/Bilibili-Danmaku/issues", + "sources": "https://github.com/Hendrix-Shen/Bilibili-Danmaku" + }, + "license": "GPLv3", + "environment": "client", + "entrypoints": { + "main": [ + "top.hendrixshen.bilibilidanmaku.BilibiliDanmakuCompat" + ] + }, + "mixins": [ + "bilibili-danmaku-compat.mixins.json" + ], + "depends": { + "minecraft": "1.17.x", + "bilibili-danmaku": "*" + }, + "custom": { + "modmenu:parent": "bilibili-danmaku", + "modmenu:clientsideOnly": true, + "modmenu": { + "parent": "bilibili-danmaku" + } + } +} diff --git a/bilibili-danmaku-compat-mc1_18/build.gradle b/bilibili-danmaku-compat-mc1_18/build.gradle new file mode 100644 index 0000000..a659456 --- /dev/null +++ b/bilibili-danmaku-compat-mc1_18/build.gradle @@ -0,0 +1,8 @@ +dependencies { + minecraft("com.mojang:minecraft:${project.minecraft_version}") + + modImplementation("curse.maven:malilib-303119:${project.library_malilib_version}") + modImplementation("curse.maven:modmenu-308702:${project.library_modmenu_version}") + + modRuntimeOnly("curse.maven:in-game-account-switcher-232676:${project.library_inGameAccountSwitcher_version}") +} \ No newline at end of file diff --git a/bilibili-danmaku-compat-mc1_18/gradle.properties b/bilibili-danmaku-compat-mc1_18/gradle.properties new file mode 100644 index 0000000..3ac2e48 --- /dev/null +++ b/bilibili-danmaku-compat-mc1_18/gradle.properties @@ -0,0 +1,15 @@ +# Mod reference +mod_id = bilibili-danmaku-compat-mc1_18 + +# Development Environment +minecraft_version = 1.18.2 + +# Require Libraries +# MaLiLib - 0.12.1 +library_malilib_version = 3692220 +# Mod Menu - 3.1.0 +library_modmenu_version = 3668801 + +# Runtime Libraries +# In-Game Account Switcher - 7.1.3 +library_inGameAccountSwitcher_version = 3545107 \ No newline at end of file diff --git a/bilibili-danmaku-compat-mc1_18/src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmakuCompat.java b/bilibili-danmaku-compat-mc1_18/src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmakuCompat.java new file mode 100644 index 0000000..dff8790 --- /dev/null +++ b/bilibili-danmaku-compat-mc1_18/src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmakuCompat.java @@ -0,0 +1,12 @@ +package top.hendrixshen.bilibilidanmaku; + +import net.fabricmc.api.ModInitializer; + +public class BilibiliDanmakuCompat implements ModInitializer { + @Override + public void onInitialize() { + BilibiliDanmaku.getLogger().info("[{}]: Compat module for {} loaded. Starting compat api...", BilibiliDanmakuCompatReference.getModName(), BilibiliDanmakuCompatReference.getCompatVersion()); + + BilibiliDanmaku.getLogger().info("[{}]: Compat initialized - Version: {} ({})", BilibiliDanmakuCompatReference.getModName(), BilibiliDanmakuCompatReference.getModVersion(), BilibiliDanmakuCompatReference.getModVersionType()); + } +} diff --git a/bilibili-danmaku-compat-mc1_18/src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmakuCompatReference.java b/bilibili-danmaku-compat-mc1_18/src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmakuCompatReference.java new file mode 100644 index 0000000..1d44fca --- /dev/null +++ b/bilibili-danmaku-compat-mc1_18/src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmakuCompatReference.java @@ -0,0 +1,32 @@ +package top.hendrixshen.bilibilidanmaku; + +import net.fabricmc.loader.api.FabricLoader; +import top.hendrixshen.bilibilidanmaku.util.VersionParser; + +public class BilibiliDanmakuCompatReference { + private static final String MOD_COMPAT_VERSION = "MC 1.18.x"; + private static final String MOD_ID = "bilibili-danmaku-compat-mc1_18"; + private static final String MOD_NAME = FabricLoader.getInstance().getModContainer(MOD_ID).orElseThrow(RuntimeException::new).getMetadata().getName(); + private static final String MOD_VERSION = FabricLoader.getInstance().getModContainer(MOD_ID).orElseThrow(RuntimeException::new).getMetadata().getVersion().getFriendlyString(); + private static final String MOD_VERSION_TYPE = VersionParser.getVersionType(MOD_VERSION); + + public static String getCompatVersion() { + return MOD_COMPAT_VERSION; + } + + public static String getModId() { + return MOD_ID; + } + + public static String getModName() { + return MOD_NAME; + } + + public static String getModVersion() { + return MOD_VERSION; + } + + public static String getModVersionType() { + return MOD_VERSION_TYPE; + } +} diff --git a/bilibili-danmaku-compat-mc1_18/src/main/java/top/hendrixshen/bilibilidanmaku/compat/modmenu/ModMenuApiImpl.java b/bilibili-danmaku-compat-mc1_18/src/main/java/top/hendrixshen/bilibilidanmaku/compat/modmenu/ModMenuApiImpl.java new file mode 100644 index 0000000..750ed80 --- /dev/null +++ b/bilibili-danmaku-compat-mc1_18/src/main/java/top/hendrixshen/bilibilidanmaku/compat/modmenu/ModMenuApiImpl.java @@ -0,0 +1,16 @@ +package top.hendrixshen.bilibilidanmaku.compat.modmenu; + +import com.terraformersmc.modmenu.api.ConfigScreenFactory; +import com.terraformersmc.modmenu.api.ModMenuApi; +import top.hendrixshen.bilibilidanmaku.BilibiliDanmakuConfigGui; + +public class ModMenuApiImpl implements ModMenuApi { + @Override + public ConfigScreenFactory getModConfigScreenFactory() { + return (screen) -> { + BilibiliDanmakuConfigGui gui = BilibiliDanmakuConfigGui.getInstance(); + gui.setParent(screen); + return gui; + }; + } +} diff --git a/bilibili-danmaku-compat-mc1_18/src/main/resources/bilibili-danmaku-compat.mixins.json b/bilibili-danmaku-compat-mc1_18/src/main/resources/bilibili-danmaku-compat.mixins.json new file mode 100644 index 0000000..cfd7574 --- /dev/null +++ b/bilibili-danmaku-compat-mc1_18/src/main/resources/bilibili-danmaku-compat.mixins.json @@ -0,0 +1,14 @@ +{ + "required": true, + "package": "top.hendrixshen.bilibilidanmaku.compat.mixin", + "plugin": "top.hendrixshen.bilibilidanmaku.BilibiliDanmakuMixinPlugin", + "minVersion": "0.8", + "compatibilityLevel": "JAVA_8", + "client": [ + ], + "mixins": [ + ], + "injectors": { + "defaultRequire": 0 + } +} diff --git a/bilibili-danmaku-compat-mc1_18/src/main/resources/fabric.mod.json b/bilibili-danmaku-compat-mc1_18/src/main/resources/fabric.mod.json new file mode 100644 index 0000000..70895e9 --- /dev/null +++ b/bilibili-danmaku-compat-mc1_18/src/main/resources/fabric.mod.json @@ -0,0 +1,41 @@ +{ + "schemaVersion": 1, + "id": "bilibili-danmaku-compat-mc1_18", + "name": "Bilibili Danmaku Compat", + "version": "${mod_version}", + "description": "Bilibili Danmaku compat for Minecraft 1.18.x", + "authors": [ + { + "name": "Hendrix_Shen", + "contact": { + "homepage": "https://github.com/Hendrix-Shen" + } + } + ], + "contact": { + "homepage": "https://github.com/Hendrix-Shen/Bilibili-Danmaku", + "issues": "https://github.com/Hendrix-Shen/Bilibili-Danmaku/issues", + "sources": "https://github.com/Hendrix-Shen/Bilibili-Danmaku" + }, + "license": "GPLv3", + "environment": "client", + "entrypoints": { + "main": [ + "top.hendrixshen.bilibilidanmaku.BilibiliDanmakuCompat" + ] + }, + "mixins": [ + "bilibili-danmaku-compat.mixins.json" + ], + "depends": { + "minecraft": "1.18.x", + "bilibili-danmaku": "*" + }, + "custom": { + "modmenu:parent": "bilibili-danmaku", + "modmenu:clientsideOnly": true, + "modmenu": { + "parent": "bilibili-danmaku" + } + } +} diff --git a/bilibili-danmaku-compat-mc1_19/build.gradle b/bilibili-danmaku-compat-mc1_19/build.gradle new file mode 100644 index 0000000..d3245f7 --- /dev/null +++ b/bilibili-danmaku-compat-mc1_19/build.gradle @@ -0,0 +1,8 @@ +dependencies { + minecraft("com.mojang:minecraft:${project.minecraft_version}") + + modImplementation("curse.maven:malilib-303119:${project.library_malilib_version}") + modCompileOnly("curse.maven:modmenu-308702:${project.library_modmenu_version}") + + modRuntimeOnly("curse.maven:in-game-account-switcher-232676:${project.library_inGameAccountSwitcher_version}") +} \ No newline at end of file diff --git a/bilibili-danmaku-compat-mc1_19/gradle.properties b/bilibili-danmaku-compat-mc1_19/gradle.properties new file mode 100644 index 0000000..1ee305c --- /dev/null +++ b/bilibili-danmaku-compat-mc1_19/gradle.properties @@ -0,0 +1,15 @@ +# Mod reference +mod_id = bilibili-danmaku-compat-mc1_19 + +# Development Environment +minecraft_version = 22w13a + +# Require Libraries +# MaLiLib - 0.12.1 +library_malilib_version = 3692220 +# Mod Menu - 3.0.1 +library_modmenu_version = 3570652 + +# Runtime Libraries +# In-Game Account Switcher - 7.1.3 +library_inGameAccountSwitcher_version = 3545107 \ No newline at end of file diff --git a/bilibili-danmaku-compat-mc1_19/src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmakuCompat.java b/bilibili-danmaku-compat-mc1_19/src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmakuCompat.java new file mode 100644 index 0000000..dff8790 --- /dev/null +++ b/bilibili-danmaku-compat-mc1_19/src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmakuCompat.java @@ -0,0 +1,12 @@ +package top.hendrixshen.bilibilidanmaku; + +import net.fabricmc.api.ModInitializer; + +public class BilibiliDanmakuCompat implements ModInitializer { + @Override + public void onInitialize() { + BilibiliDanmaku.getLogger().info("[{}]: Compat module for {} loaded. Starting compat api...", BilibiliDanmakuCompatReference.getModName(), BilibiliDanmakuCompatReference.getCompatVersion()); + + BilibiliDanmaku.getLogger().info("[{}]: Compat initialized - Version: {} ({})", BilibiliDanmakuCompatReference.getModName(), BilibiliDanmakuCompatReference.getModVersion(), BilibiliDanmakuCompatReference.getModVersionType()); + } +} diff --git a/bilibili-danmaku-compat-mc1_19/src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmakuCompatReference.java b/bilibili-danmaku-compat-mc1_19/src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmakuCompatReference.java new file mode 100644 index 0000000..7a80c97 --- /dev/null +++ b/bilibili-danmaku-compat-mc1_19/src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmakuCompatReference.java @@ -0,0 +1,32 @@ +package top.hendrixshen.bilibilidanmaku; + +import net.fabricmc.loader.api.FabricLoader; +import top.hendrixshen.bilibilidanmaku.util.VersionParser; + +public class BilibiliDanmakuCompatReference { + private static final String MOD_COMPAT_VERSION = "MC 1.19.x"; + private static final String MOD_ID = "bilibili-danmaku-compat-mc1_19"; + private static final String MOD_NAME = FabricLoader.getInstance().getModContainer(MOD_ID).orElseThrow(RuntimeException::new).getMetadata().getName(); + private static final String MOD_VERSION = FabricLoader.getInstance().getModContainer(MOD_ID).orElseThrow(RuntimeException::new).getMetadata().getVersion().getFriendlyString(); + private static final String MOD_VERSION_TYPE = VersionParser.getVersionType(MOD_VERSION); + + public static String getCompatVersion() { + return MOD_COMPAT_VERSION; + } + + public static String getModId() { + return MOD_ID; + } + + public static String getModName() { + return MOD_NAME; + } + + public static String getModVersion() { + return MOD_VERSION; + } + + public static String getModVersionType() { + return MOD_VERSION_TYPE; + } +} diff --git a/bilibili-danmaku-compat-mc1_19/src/main/java/top/hendrixshen/bilibilidanmaku/compat/modmenu/ModMenuApiImpl.java b/bilibili-danmaku-compat-mc1_19/src/main/java/top/hendrixshen/bilibilidanmaku/compat/modmenu/ModMenuApiImpl.java new file mode 100644 index 0000000..750ed80 --- /dev/null +++ b/bilibili-danmaku-compat-mc1_19/src/main/java/top/hendrixshen/bilibilidanmaku/compat/modmenu/ModMenuApiImpl.java @@ -0,0 +1,16 @@ +package top.hendrixshen.bilibilidanmaku.compat.modmenu; + +import com.terraformersmc.modmenu.api.ConfigScreenFactory; +import com.terraformersmc.modmenu.api.ModMenuApi; +import top.hendrixshen.bilibilidanmaku.BilibiliDanmakuConfigGui; + +public class ModMenuApiImpl implements ModMenuApi { + @Override + public ConfigScreenFactory getModConfigScreenFactory() { + return (screen) -> { + BilibiliDanmakuConfigGui gui = BilibiliDanmakuConfigGui.getInstance(); + gui.setParent(screen); + return gui; + }; + } +} diff --git a/bilibili-danmaku-compat-mc1_19/src/main/resources/bilibili-danmaku-compat.mixins.json b/bilibili-danmaku-compat-mc1_19/src/main/resources/bilibili-danmaku-compat.mixins.json new file mode 100644 index 0000000..cfd7574 --- /dev/null +++ b/bilibili-danmaku-compat-mc1_19/src/main/resources/bilibili-danmaku-compat.mixins.json @@ -0,0 +1,14 @@ +{ + "required": true, + "package": "top.hendrixshen.bilibilidanmaku.compat.mixin", + "plugin": "top.hendrixshen.bilibilidanmaku.BilibiliDanmakuMixinPlugin", + "minVersion": "0.8", + "compatibilityLevel": "JAVA_8", + "client": [ + ], + "mixins": [ + ], + "injectors": { + "defaultRequire": 0 + } +} diff --git a/bilibili-danmaku-compat-mc1_19/src/main/resources/fabric.mod.json b/bilibili-danmaku-compat-mc1_19/src/main/resources/fabric.mod.json new file mode 100644 index 0000000..995e935 --- /dev/null +++ b/bilibili-danmaku-compat-mc1_19/src/main/resources/fabric.mod.json @@ -0,0 +1,41 @@ +{ + "schemaVersion": 1, + "id": "bilibili-danmaku-compat-mc1_19", + "name": "Bilibili Danmaku Compat", + "version": "${mod_version}", + "description": "Bilibili Danmaku compat for Minecraft 1.19.x", + "authors": [ + { + "name": "Hendrix_Shen", + "contact": { + "homepage": "https://github.com/Hendrix-Shen" + } + } + ], + "contact": { + "homepage": "https://github.com/Hendrix-Shen/Bilibili-Danmaku", + "issues": "https://github.com/Hendrix-Shen/Bilibili-Danmaku/issues", + "sources": "https://github.com/Hendrix-Shen/Bilibili-Danmaku" + }, + "license": "GPLv3", + "environment": "client", + "entrypoints": { + "main": [ + "top.hendrixshen.bilibilidanmaku.BilibiliDanmakuCompat" + ] + }, + "mixins": [ + "bilibili-danmaku-compat.mixins.json" + ], + "depends": { + "minecraft": "1.19.x", + "bilibili-danmaku": "*" + }, + "custom": { + "modmenu:parent": "bilibili-danmaku", + "modmenu:clientsideOnly": true, + "modmenu": { + "parent": "bilibili-danmaku" + } + } +} diff --git a/build.gradle b/build.gradle index 60e42b9..06a155c 100644 --- a/build.gradle +++ b/build.gradle @@ -1,131 +1,130 @@ -import com.modrinth.minotaur.TaskModrinthUpload -import com.modrinth.minotaur.request.VersionType - plugins { id 'fabric-loom' version '0.11-SNAPSHOT' - id 'maven-publish' - id "com.modrinth.minotaur" version "1.2.1" + id 'io.github.juuxel.loom-quiltflower' version '1.6.1' } -static String getVersionString() { - String git_commit_id = System.getenv("GIT_COMMIT_ID") - if (git_commit_id != null) { - return git_commit_id - } else { - return new Date().format('yyyyMMdd.HHmmss') - } +def baseVersion = "${project.mod_version}" as String +def ENV = System.getenv() + +if (ENV.BUILD_NUMBER) { + baseVersion = baseVersion + '.' + ENV.BUILD_NUMBER +} else { + baseVersion = baseVersion + '.0' } -group = "${project.group}.${project.mod_id}" as Object -archivesBaseName = "${project.mod_file_name}-mc${project.minecraft_version_out}" -version = "${project.mod_version}+${getVersionString()}" as Object - -repositories { - // Add repositories to retrieve artifacts from in here. - // You should only use this when depending on other mods because - // Loom adds the essential maven repositories to download Minecraft and libraries from automatically. - // See https://docs.gradle.org/current/userguide/declaring_repositories.html - // for more information about repositories. - maven { - url 'https://www.cursemaven.com/' - } - maven { - url 'https://maven.hendrixshen.top' +if (ENV.COMMIT_SHA) { + baseVersion = baseVersion + "+" + ENV.COMMIT_SHA +} +if (ENV.BUILD_TYPE) { + if (ENV.BUILD_TYPE == "RELEASE") { + baseVersion = baseVersion + "-stable" + } else if (ENV.BUILD_TYPE == "BETA") { + baseVersion = baseVersion + "-beta" } +} else { + baseVersion = baseVersion + "-dev" } +version = baseVersion + dependencies { - // Development Environment minecraft("com.mojang:minecraft:${project.minecraft_version}") - mappings(loom.officialMojangMappings()) - modApi("net.fabricmc:fabric-loader:${project.fabric_loader_version}") - // Required library - modApi("top.hendrixshen.magiclib:magiclib:${project.library_magiclib_version}") - include("top.hendrixshen.magiclib:magiclib:${project.library_magiclib_version}") - modApi("curse.maven:malilib-303119:${project.library_malilib_version}") - // Optional mod compatibility library - modCompileOnly("curse.maven:modmenu-308702:${project.library_mod_menu_version}") -} + modCompileOnly("curse.maven:inGameAcountSwitcher-232676:${project.library_inGameAcountSwitcher_version}") + modCompileOnly("curse.maven:malilib-303119:${project.library_malilib_version}") -processResources { - inputs.property "version", project.version + if (project.gradle.startParameter.projectDir != null && + !project.gradle.startParameter.projectDir.getName().startsWith("bilibili-danmaku-compat")) { + modRuntimeOnly("curse.maven:inGameAcountSwitcher-232676:${project.library_inGameAcountSwitcher_version}") + modRuntimeOnly("curse.maven:malilib-303119:${project.library_malilib_version}") + modImplementation("curse.maven:modmenu-308702:${project.library_mod_menu_version}") - filesMatching("fabric.mod.json") { - include "fabric.mod.json" - expand "mod_version": project.version + runtimeOnly(fileTree(dir: "bilibili-danmaku-compat-mc1_16/build/devlibs", include: ["*-dev.jar"])) } -} -tasks.withType(JavaCompile).configureEach { - // ensure that the encoding is set to UTF-8, no matter what the system default is - // this fixes some edge cases with special characters not displaying correctly - // see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html - // If Javadoc is generated, this must be specified in that task too. - it.options.encoding = "UTF-8" - it.sourceCompatibility = JavaVersion.VERSION_1_8 - it.targetCompatibility = JavaVersion.VERSION_1_8 + subprojects.each { + include(project("${it.name}:")) + } } -task publishModrinth(type: TaskModrinthUpload) { - onlyIf { - System.getenv("MODRINTH_API_TOKEN") +allprojects { + apply plugin: 'fabric-loom' + apply plugin: 'io.github.juuxel.loom-quiltflower' + + group = "${project.group}.${project.mod_id}" as String + archivesBaseName = "${project.mod_id}" + + loom.runConfigs.configureEach { + property('mixin.debug.export', 'true') } - token = System.getenv("MODRINTH_API_TOKEN") - projectId = "${project.modrinth_project_id}" - versionNumber = System.getenv("VERSION_NUMBER") - changelog = System.getenv("CHANGE_LOG") - uploadFile = remapJar - switch ("${project.modrinth_release_type}") { - case "alpha": - versionType = VersionType.ALPHA - break - case "beta": - versionType = VersionType.BETA - break - case "release": - versionType = VersionType.RELEASE - break + + version = rootProject.version + group = rootProject.group + + repositories { + maven { + url 'https://www.cursemaven.com' + } + maven { + url 'https://maven.hendrixshen.top' + } } - addGameVersion("${project.minecraft_version}") - addLoader('fabric') -} -runClient { - defaultCharacterEncoding = "UTF-8" -} + dependencies { + mappings(loom.officialMojangMappings()) + modImplementation("net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}") + modImplementation("top.hendrixshen.magiclib:magiclib:${project.library_magiclib_version}") + modRuntimeOnly("curse.maven:lazydfu-433518:${project.library_lazydfu_version}") + } -runServer { - defaultCharacterEncoding = "UTF-8" -} + loom { + runs { + client { + runDir = "$project.name/run" + } + } + } -java { - // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task - // if it is present. - // If you remove this line, sources will not be generated. - withSourcesJar() -} + runClient { + defaultCharacterEncoding = "UTF-8" + } -jar { - from("LICENSE") { - rename { "${it}_${project.archivesBaseName}" } + runServer { + defaultCharacterEncoding = "UTF-8" } -} -publishing { - publications { - mavenJava(MavenPublication) { - from components.java + java { + withSourcesJar() + } + + tasks.withType(JavaCompile).configureEach { + it.options.encoding = "UTF-8" + it.sourceCompatibility = JavaVersion.VERSION_1_8 + it.targetCompatibility = JavaVersion.VERSION_1_8 + } + + processResources { + inputs.property "version", rootProject.version + + filesMatching("fabric.mod.json") { + include "fabric.mod.json" + expand "mod_version": rootProject.version } } +} - repositories { - // Add repositories to publish to here. - // Notice: This block does NOT have the same function as the block in the top level. - // The repositories here will be used for publishing your artifact, not for - // retrieving dependencies. - maven { - url "$projectDir/publish" +subprojects { + if (project.gradle.startParameter.taskNames.size() == 1 && project.gradle.startParameter.taskNames.get(0) == "runClient") { + dependencies { + modImplementation(rootProject) + } + } else { + dependencies { + implementation(rootProject) } } } +jar { + from("LICENSE") +} + diff --git a/gradle.properties b/gradle.properties index 8617949..51f15f7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,62 +1,27 @@ # Gradle properties -org.gradle.jvmargs=-Xmx2G +org.gradle.jvmargs=-Xmx4G # Mod reference -author = Hendrix_Shen -group = top.hendrixshen -mod_file_name = BilibiliDanmaku-fabric -mod_id = bilibili-danmaku -mod_name = Bilibili Danmaku -mod_version = 1.0.0 +author=Hendrix-Shen +group=top.hendrixshen +mod_id=bilibili-danmaku +mod_name=Bilibili Danmaku +mod_version=1.0 # Development Environment -fabric_loader_version = 0.13.3 -minecraft_version = 1.16.5 -minecraft_version_out = 1.16 +fabric_loader_version=0.13.3 +minecraft_version=1.16.5 -# Required library -# MagicLib - 0.2.4 -library_magiclib_version = 0.2.5 +# Compatible Libraries +# MagicLib - 0.3.24 +library_magiclib_version=0.3.24 # MaLiLib - 0.10.0-dev.21+arne.8 -library_malilib_version = 3542536 - -# Optional mod compatibility library +library_malilib_version=3542536 # Mod Menu - 1.16.22 -library_mod_menu_version = 3479748 +library_mod_menu_version=3479748 -# Release settings -# Curseforge api code is follow: -# Java: -# 8: 4458 -# 9: 6762 -# 10: 7113 -# 11: 8320 -# 12: 8321 -# 13: 8322 -# 14: 8323 -# 15: 8324 -# 16: 8325 -# 17: 8326 -# 18: 8634 -# Minecraft: -# 1.14.4: 7469 -# 1.15.2: 7722 -# 1.16.5: 8203 -# 1.17.1: 8516 -# 1.18.2: 9008 -# 1.19-snapshot: 8993 -# Fabric: 7499 -# Curseforge release type: alpha, beta, release -# Curseforge relations format: slug1:type,slug2,type,... -# Curseforge relations types embeddedLibrary, incompatible, optionalDependency, requiredDependency, tool -# Modrinth api code is follow: -# Modrinth release type: alpha, beta, release -cruseforge_gameversion = 7499, 4458, 6762, 7113, 8320, 8321, 8322, 8323, 8324, 8325, 8326, 8203 -cruseforge_projectid = undefined -cruseforge_relations = malilib:requiredDependency -cruseforge_release = true -cruseforge_release_type = release -github_release = true -modrinth_project_id = undefined -modrinth_release = false -modrinth_release_type = alpha \ No newline at end of file +# Runtime Libraries - Only for development environment +# In-Game Account Switcher - 7.1.3 +library_inGameAcountSwitcher_version=3493810 +# LazyDFU 0.1.3 +library_lazydfu_version=3209972 diff --git a/settings.gradle b/settings.gradle index 5b60df3..753f4bc 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,10 +1,25 @@ pluginManagement { repositories { - jcenter() maven { name = 'Fabric' url = 'https://maven.fabricmc.net/' } + maven { + name = 'Cotton' + url = 'https://server.bbkr.space/artifactory/libs-release/' + } gradlePluginPortal() } } + +rootProject.name = "bilibili-danmaku" + +if (!(gradle.startParameter.taskNames.size() == 1 && gradle.startParameter.taskNames.get(0) == "runClient") || + (gradle.startParameter.projectDir != null && gradle.startParameter.projectDir.getName().startsWith("bilibili-danmaku-compat"))) { + include "bilibili-danmaku-compat-mc1_14" + include "bilibili-danmaku-compat-mc1_15" + include "bilibili-danmaku-compat-mc1_16" + include "bilibili-danmaku-compat-mc1_17" + include "bilibili-danmaku-compat-mc1_18" + include "bilibili-danmaku-compat-mc1_19" +} diff --git a/src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmaku.java b/src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmaku.java index d544fe0..9656566 100644 --- a/src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmaku.java +++ b/src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmaku.java @@ -1,22 +1,18 @@ package top.hendrixshen.bilibilidanmaku; -import fi.dy.masa.malilib.event.InitializationHandler; -import fi.dy.masa.malilib.event.InputEventHandler; import net.fabricmc.api.ModInitializer; import net.minecraft.client.Minecraft; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import top.hendrixshen.bilibilidanmaku.config.ConfigStorage; import top.hendrixshen.bilibilidanmaku.config.Configs; -import top.hendrixshen.bilibilidanmaku.event.InputHandler; -import top.hendrixshen.magiclib.untils.language.I18n; -import top.hendrixshen.magiclib.util.malilib.ConfigManager; +import top.hendrixshen.magiclib.config.ConfigHandler; +import top.hendrixshen.magiclib.config.ConfigManager; public class BilibiliDanmaku implements ModInitializer { private static final Logger logger = LogManager.getLogger(BilibiliDanmakuReference.getModId()); private static final Minecraft minecraftClient = Minecraft.getInstance(); - public static ConfigManager cm = new ConfigManager(BilibiliDanmakuReference.getModId()); + public static ConfigManager cm = ConfigManager.get(BilibiliDanmakuReference.getModId()); public static Minecraft getMinecraftClient() { return minecraftClient; @@ -28,16 +24,11 @@ public static Logger getLogger() { @Override public void onInitialize() { - InitializationHandler.getInstance().registerInitializationHandler(() -> { - cm.parseConfigClass(Configs.class); - fi.dy.masa.malilib.config.ConfigManager.getInstance().registerConfigHandler(BilibiliDanmakuReference.getModId(), new ConfigStorage()); - InputEventHandler.getKeybindManager().registerKeybindProvider(new InputHandler()); - Configs.initCallbacks(); + cm.parseConfigClass(Configs.class); - logger.info(String.format("[%s]: Mod initialized - Version: %s (%s)", BilibiliDanmakuReference.getModName(), BilibiliDanmakuReference.getModVersion(), BilibiliDanmakuReference.getModVersionType())); - }); + ConfigHandler.register(new ConfigHandler(BilibiliDanmakuReference.getModId(), cm, BilibiliDanmakuReference.getConfigVersion(), null, null)); + Configs.initCallbacks(cm); - I18n.getInstance().register(BilibiliDanmakuReference.getModId(), "en_us"); - I18n.getInstance().register(BilibiliDanmakuReference.getModId(), "zh_cn"); + logger.info(String.format("[%s]: Mod initialized - Version: %s (%s)", BilibiliDanmakuReference.getModName(), BilibiliDanmakuReference.getModVersion(), BilibiliDanmakuReference.getModVersionType())); } } diff --git a/src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmakuConfigGui.java b/src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmakuConfigGui.java new file mode 100644 index 0000000..d97375e --- /dev/null +++ b/src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmakuConfigGui.java @@ -0,0 +1,22 @@ +package top.hendrixshen.bilibilidanmaku; + +import fi.dy.masa.malilib.util.StringUtils; +import top.hendrixshen.bilibilidanmaku.config.ConfigCategory; +import top.hendrixshen.magiclib.config.ConfigManager; +import top.hendrixshen.magiclib.gui.ConfigGui; + +public class BilibiliDanmakuConfigGui extends ConfigGui { + private static final BilibiliDanmakuConfigGui INSTANCE; + + public BilibiliDanmakuConfigGui(String identifier, String defaultTab, ConfigManager configManager) { + super(identifier, defaultTab, configManager, StringUtils.translate("bilibili-danmaku.gui.title", BilibiliDanmakuReference.getModVersion(), StringUtils.translate(String.format("bilibili-danmaku.misc.versionType.%s", BilibiliDanmakuReference.getModVersionType())))); + } + + static { + INSTANCE = new BilibiliDanmakuConfigGui(BilibiliDanmakuReference.getModId(), ConfigCategory.GENERIC, BilibiliDanmaku.cm); + } + + public static BilibiliDanmakuConfigGui getInstance() { + return INSTANCE; + } +} diff --git a/src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmakuMixinPlugin.java b/src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmakuMixinPlugin.java index f0f6f2e..3965757 100644 --- a/src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmakuMixinPlugin.java +++ b/src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmakuMixinPlugin.java @@ -1,6 +1,6 @@ package top.hendrixshen.bilibilidanmaku; -import top.hendrixshen.magiclib.api.dependencyValidator.mixin.MagicMixinPlugin; +import top.hendrixshen.magiclib.dependency.mixin.MagicMixinPlugin; public class BilibiliDanmakuMixinPlugin extends MagicMixinPlugin { } diff --git a/src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmakuPredicates.java b/src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmakuPredicates.java new file mode 100644 index 0000000..22de53d --- /dev/null +++ b/src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmakuPredicates.java @@ -0,0 +1,14 @@ +package top.hendrixshen.bilibilidanmaku; + +import top.hendrixshen.bilibilidanmaku.config.Configs; +import top.hendrixshen.magiclib.config.Option; +import top.hendrixshen.magiclib.dependency.annotation.OptionDependencyPredicate; + +public class BilibiliDanmakuPredicates { + public static class DebugOptionPredicate implements OptionDependencyPredicate { + @Override + public boolean test(Option option) { + return Configs.debugMode; + } + } +} diff --git a/src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmakuReference.java b/src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmakuReference.java index db0c867..85cb009 100644 --- a/src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmakuReference.java +++ b/src/main/java/top/hendrixshen/bilibilidanmaku/BilibiliDanmakuReference.java @@ -8,6 +8,8 @@ public class BilibiliDanmakuReference { private static final String MOD_VERSION = FabricLoader.getInstance().getModContainer(MOD_ID).orElseThrow(RuntimeException::new).getMetadata().getVersion().getFriendlyString(); private static final String MOD_VERSION_TYPE = "Development"; + private static final int CONFIG_VERSION = 1; + public static String getModId() { return MOD_ID; } @@ -23,4 +25,8 @@ public static String getModVersion() { public static String getModVersionType() { return MOD_VERSION_TYPE; } + + public static int getConfigVersion() { + return CONFIG_VERSION; + } } diff --git a/src/main/java/top/hendrixshen/bilibilidanmaku/config/ConfigGui.java b/src/main/java/top/hendrixshen/bilibilidanmaku/config/ConfigGui.java deleted file mode 100644 index fad2641..0000000 --- a/src/main/java/top/hendrixshen/bilibilidanmaku/config/ConfigGui.java +++ /dev/null @@ -1,22 +0,0 @@ -package top.hendrixshen.bilibilidanmaku.config; - -import top.hendrixshen.bilibilidanmaku.BilibiliDanmaku; -import top.hendrixshen.bilibilidanmaku.BilibiliDanmakuReference; -import top.hendrixshen.magiclib.untils.language.I18n; -import top.hendrixshen.magiclib.util.malilib.ConfigManager; - -public class ConfigGui extends top.hendrixshen.magiclib.impl.malilib.ConfigGui { - private static final ConfigGui INSTANCE; - - public ConfigGui(String identifier, String defaultTab, ConfigManager configManager) { - super(identifier, defaultTab, configManager, I18n.translate("bilibili-danmaku.gui.title", BilibiliDanmakuReference.getModVersion(), I18n.translate(String.format("bilibili-danmaku.misc.versionType.%s", BilibiliDanmakuReference.getModVersionType())))); - } - - static { - INSTANCE = new ConfigGui(BilibiliDanmakuReference.getModId(), ConfigCategory.GENERIC, BilibiliDanmaku.cm); - } - - public static ConfigGui getInstance() { - return INSTANCE; - } -} diff --git a/src/main/java/top/hendrixshen/bilibilidanmaku/config/ConfigStorage.java b/src/main/java/top/hendrixshen/bilibilidanmaku/config/ConfigStorage.java deleted file mode 100644 index 3fb64f3..0000000 --- a/src/main/java/top/hendrixshen/bilibilidanmaku/config/ConfigStorage.java +++ /dev/null @@ -1,77 +0,0 @@ -package top.hendrixshen.bilibilidanmaku.config; - -import com.google.common.collect.Lists; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import fi.dy.masa.malilib.config.ConfigUtils; -import fi.dy.masa.malilib.config.IConfigBase; -import fi.dy.masa.malilib.config.IConfigHandler; -import fi.dy.masa.malilib.config.options.ConfigBooleanHotkeyed; -import fi.dy.masa.malilib.util.FileUtils; -import fi.dy.masa.malilib.util.JsonUtils; -import top.hendrixshen.bilibilidanmaku.BilibiliDanmaku; -import top.hendrixshen.bilibilidanmaku.BilibiliDanmakuReference; - -import java.io.File; -import java.util.List; - -public class ConfigStorage implements IConfigHandler { - private static final String CONFIG_FILE_NAME = BilibiliDanmakuReference.getModId() + ".json"; - - public String getToggleLabel(String category) { - return String.format("%s_toggle", category); - } - - public String getHotkeyLabel(String category) { - return String.format("%s_hotkey", category); - } - - public List getCoveredList(List category) { - List list = Lists.newArrayList(); - for (IConfigBase iConfigBase : category) { - if (iConfigBase instanceof ConfigBooleanHotkeyed) { - list.add((ConfigBooleanHotkeyed) iConfigBase); - } - } - return list; - } - - public void loadFromFile() { - File configFile = new File(FileUtils.getConfigDirectory(), CONFIG_FILE_NAME); - - if (configFile.exists() && configFile.isFile() && configFile.canRead()) { - JsonElement element = JsonUtils.parseJsonFile(configFile); - - if (element != null && element.isJsonObject()) { - JsonObject root = element.getAsJsonObject(); - ConfigUtils.readConfigBase(root, ConfigCategory.GENERIC, BilibiliDanmaku.cm.getConfigsByCategory(ConfigCategory.GENERIC)); - ConfigUtils.readConfigBase(root, ConfigCategory.TOGGLE_CHAT, BilibiliDanmaku.cm.getConfigsByCategory(ConfigCategory.TOGGLE_CHAT)); - ConfigUtils.readConfigBase(root, ConfigCategory.FORMAT_CHAT, BilibiliDanmaku.cm.getConfigsByCategory(ConfigCategory.FORMAT_CHAT)); - ConfigUtils.readConfigBase(root, ConfigCategory.DEBUG, BilibiliDanmaku.cm.getConfigsByCategory(ConfigCategory.FORMAT_CHAT)); - } - } - } - - public void saveToFile() { - File dir = FileUtils.getConfigDirectory(); - - if ((dir.exists() && dir.isDirectory()) || dir.mkdirs()) { - JsonObject root = new JsonObject(); - ConfigUtils.writeConfigBase(root, ConfigCategory.GENERIC, BilibiliDanmaku.cm.getConfigsByCategory(ConfigCategory.GENERIC)); - ConfigUtils.writeConfigBase(root, ConfigCategory.TOGGLE_CHAT, BilibiliDanmaku.cm.getConfigsByCategory(ConfigCategory.TOGGLE_CHAT)); - ConfigUtils.writeConfigBase(root, ConfigCategory.FORMAT_CHAT, BilibiliDanmaku.cm.getConfigsByCategory(ConfigCategory.FORMAT_CHAT)); - ConfigUtils.writeConfigBase(root, ConfigCategory.DEBUG, BilibiliDanmaku.cm.getConfigsByCategory(ConfigCategory.DEBUG)); - JsonUtils.writeJsonToFile(root, new File(dir, CONFIG_FILE_NAME)); - } - } - - @Override - public void load() { - loadFromFile(); - } - - @Override - public void save() { - saveToFile(); - } -} diff --git a/src/main/java/top/hendrixshen/bilibilidanmaku/config/Configs.java b/src/main/java/top/hendrixshen/bilibilidanmaku/config/Configs.java index 9f1e7a0..9ae6496 100644 --- a/src/main/java/top/hendrixshen/bilibilidanmaku/config/Configs.java +++ b/src/main/java/top/hendrixshen/bilibilidanmaku/config/Configs.java @@ -1,123 +1,132 @@ package top.hendrixshen.bilibilidanmaku.config; -import com.google.common.collect.ImmutableList; -import fi.dy.masa.malilib.config.options.*; +import com.google.common.collect.Lists; +import fi.dy.masa.malilib.config.options.ConfigHotkey; +import top.hendrixshen.bilibilidanmaku.BilibiliDanmakuPredicates; import top.hendrixshen.bilibilidanmaku.event.CallBacks; -import top.hendrixshen.magiclib.api.malilib.annotation.Config; +import top.hendrixshen.magiclib.config.ConfigManager; +import top.hendrixshen.magiclib.config.annotation.Config; +import top.hendrixshen.magiclib.config.annotation.Hotkey; +import top.hendrixshen.magiclib.config.annotation.Numeric; +import top.hendrixshen.magiclib.dependency.Predicates; -import static top.hendrixshen.bilibilidanmaku.BilibiliDanmaku.cm; +import java.util.ArrayList; public class Configs { // Generic configs @Config(category = ConfigCategory.GENERIC) - public static final ConfigBoolean enable = cm.createBoolean("enable", false); + public static boolean enable = false; @Config(category = ConfigCategory.GENERIC) - public static final ConfigStringList blockGifts = cm.createStringList("blockGifts", ImmutableList.of("辣条")); + public static ArrayList blockGifts = Lists.newArrayList("辣条"); @Config(category = ConfigCategory.GENERIC) - public static final ConfigStringList blockWords = cm.createStringList("blockWords", ImmutableList.of("Fuck")); + public static ArrayList blockWords = Lists.newArrayList("Fuck"); + @Hotkey(hotkey = "B,C") @Config(category = ConfigCategory.GENERIC) - public static final ConfigHotkey openConfigGui = cm.createHotkey("openConfigGui", "B,C"); + public static ConfigHotkey openConfigGui; + @Numeric(minValue = 0, maxValue = Integer.MAX_VALUE) @Config(category = ConfigCategory.GENERIC) - public static final ConfigInteger roomId = cm.createInteger("roomId", 0, 0, Integer.MAX_VALUE); + public static int roomId; // Chat toggle configs @Config(category = ConfigCategory.TOGGLE_CHAT) - public static final ConfigBoolean chatDanmakuEnable = cm.createBoolean("chatDanmakuEnable", true); + public static boolean chatDanmakuEnable = true; @Config(category = ConfigCategory.TOGGLE_CHAT) - public static final ConfigBoolean chatGiftEnable = cm.createBoolean("chatGiftEnable", true); + public static boolean chatGiftEnable = true; @Config(category = ConfigCategory.TOGGLE_CHAT) - public static final ConfigBoolean chatGuardBuyEnable = cm.createBoolean("chatGuardBuyEnable", true); + public static boolean chatGuardBuyEnable = true; @Config(category = ConfigCategory.TOGGLE_CHAT) - public static final ConfigBoolean chatGuardBuyLevel1Enable = cm.createBoolean("chatGuardBuyLevel1Enable", true); + public static boolean chatGuardBuyLevel1Enable = true; @Config(category = ConfigCategory.TOGGLE_CHAT) - public static final ConfigBoolean chatGuardBuyLevel2Enable = cm.createBoolean("chatGuardBuyLevel2Enable", true); + public static boolean chatGuardBuyLevel2Enable = true; @Config(category = ConfigCategory.TOGGLE_CHAT) - public static final ConfigBoolean chatGuardBuyLevel3Enable = cm.createBoolean("chatGuardBuyLevel3Enable", true); + public static boolean chatGuardBuyLevel3Enable = true; @Config(category = ConfigCategory.TOGGLE_CHAT) - public static final ConfigBoolean chatSuperChatEnable = cm.createBoolean("chatSuperChatEnable", true); + public static boolean chatSuperChatEnable = true; @Config(category = ConfigCategory.TOGGLE_CHAT) - public static final ConfigBoolean chatWelcomeEnable = cm.createBoolean("chatWelcomeEnable", true); + public static boolean chatWelcomeEnable = true; - @Config(category = ConfigCategory.TOGGLE_CHAT, devOnly = true) - public static final ConfigBoolean chatWelcomeGuardEnable = cm.createBoolean("chatWelcomeGuardEnable", false); + @Config(category = ConfigCategory.TOGGLE_CHAT, predicate = Predicates.DevOptionPredicate.class) + public static boolean chatWelcomeGuardEnable = false; - @Config(category = ConfigCategory.TOGGLE_CHAT, devOnly = true) - public static final ConfigBoolean chatWelcomeGuardLv1Enable = cm.createBoolean("chatWelcomeGuardLv1Enable", false); + @Config(category = ConfigCategory.TOGGLE_CHAT, predicate = Predicates.DevOptionPredicate.class) + public static boolean chatWelcomeGuardLv1Enable = false; - @Config(category = ConfigCategory.TOGGLE_CHAT, devOnly = true) - public static final ConfigBoolean chatWelcomeGuardLv2Enable = cm.createBoolean("chatWelcomeGuardLv2Enable", false); + @Config(category = ConfigCategory.TOGGLE_CHAT, predicate = Predicates.DevOptionPredicate.class) + public static boolean chatWelcomeGuardLv2Enable = false; - @Config(category = ConfigCategory.TOGGLE_CHAT, devOnly = true) - public static final ConfigBoolean chatWelcomeGuardLv3Enable = cm.createBoolean("chatWelcomeGuardLv3Enable", false); + @Config(category = ConfigCategory.TOGGLE_CHAT, predicate = Predicates.DevOptionPredicate.class) + public static boolean chatWelcomeGuardLv3Enable = false; @Config(category = ConfigCategory.TOGGLE_CHAT) - public static final ConfigBoolean chatWelcomeNormalEnable = cm.createBoolean("chatWelcomeNormalEnable", true); + public static boolean chatWelcomeNormalEnable = true; // Chat format configs @Config(category = ConfigCategory.FORMAT_CHAT) - public static final ConfigString formatChatAdmin = cm.createString("formatChatAdmin", "&4[房] &d<%{user}> &f%{danmaku}"); + public static String formatChatAdmin = "&4[房] &d<%{user}> &f%{danmaku}"; @Config(category = ConfigCategory.FORMAT_CHAT) - public static final ConfigString formatChatBuyGuardLv1 = cm.createString("formatChatBuyGuardLv1", "&4%{user} 开通了主播的总督"); + public static String formatChatBuyGuardLv1 = "&4%{user} 开通了主播的总督"; @Config(category = ConfigCategory.FORMAT_CHAT) - public static final ConfigString formatChatBuyGuardLv2 = cm.createString("formatChatBuyGuardLv2", "&6%{user} 开通了主播的提督"); + public static String formatChatBuyGuardLv2 = "&6%{user} 开通了主播的提督"; @Config(category = ConfigCategory.FORMAT_CHAT) - public static final ConfigString formatChatBuyGuardLv3 = cm.createString("formatChatBuyGuardLv3", "&3%{user} 开通了主播的舰长"); + public static String formatChatBuyGuardLv3 = "&3%{user} 开通了主播的舰长"; @Config(category = ConfigCategory.FORMAT_CHAT) - public static final ConfigString formatChatDanmakuGuard = cm.createString("formatChatDanmakuGuard", "&6[舰] &2<%{user}> &f%{danmaku}"); + public static String formatChatDanmakuGuard = "&6[舰] &2<%{user}> &f%{danmaku}"; @Config(category = ConfigCategory.FORMAT_CHAT) - public static final ConfigString formatChatDanmakuNormal = cm.createString("formatChatDanmakuNormal", "&7[普] &b<%{user}> &f%{danmaku}"); + public static String formatChatDanmakuNormal = "&7[普] &b<%{user}> &f%{danmaku}"; @Config(category = ConfigCategory.FORMAT_CHAT) - public static final ConfigString formatChatGifts = cm.createString("formatChatGifts", "&7%{user} %{action} [%{gift}] × %{num}"); + public static String formatChatGifts = "&7%{user} %{action} [%{gift}] × %{num}"; @Config(category = ConfigCategory.FORMAT_CHAT) - public static final ConfigString formatChatSuperChat = cm.createString("formatChatSuperChat", "&4%{user} > %{msg} [¥%{price}]"); + public static String formatChatSuperChat = "&4%{user} > %{msg} [¥%{price}]"; - @Config(category = ConfigCategory.FORMAT_CHAT, devOnly = true) - public static final ConfigString formatChatWelcomeGuardLv1 = cm.createString("formatChatWelcomeGuardLv1", "&4欢迎总督 %{user} 进入直播间"); + @Config(category = ConfigCategory.FORMAT_CHAT, predicate = Predicates.DevOptionPredicate.class) + public static String formatChatWelcomeGuardLv1 = "&4欢迎总督 %{user} 进入直播间"; - @Config(category = ConfigCategory.FORMAT_CHAT, devOnly = true) - public static final ConfigString formatChatWelcomeGuardLv2 = cm.createString("formatChatWelcomeGuardLv2", "&6欢迎提督 %{user} 进入直播间"); + @Config(category = ConfigCategory.FORMAT_CHAT, predicate = Predicates.DevOptionPredicate.class) + public static String formatChatWelcomeGuardLv2 = "&6欢迎提督 %{user} 进入直播间"; - @Config(category = ConfigCategory.FORMAT_CHAT, devOnly = true) - public static final ConfigString formatChatWelcomeGuardLv3 = cm.createString("formatChatWelcomeGuardLv3", "&3欢迎舰长 %{user} 进入直播间"); + @Config(category = ConfigCategory.FORMAT_CHAT, predicate = Predicates.DevOptionPredicate.class) + public static String formatChatWelcomeGuardLv3 = "&3欢迎舰长 %{user} 进入直播间"; @Config(category = ConfigCategory.FORMAT_CHAT) - public static final ConfigString formatChatWelcomeNormal = cm.createString("formatChatWelcomeNormal", "&7欢迎 %{user} 进入直播间"); + public static String formatChatWelcomeNormal = "&7欢迎 %{user} 进入直播间"; // Debug configs @Config(category = ConfigCategory.DEBUG) - public static final ConfigBoolean debugMode = cm.createBoolean("debugMode", false); + public static boolean debugMode = false; - @Config(category = ConfigCategory.DEBUG, debug = true) - public static final ConfigString initApiUrl = cm.createString("initApiUrl", "https://api.live.bilibili.com/room/v1/Room/room_init"); + @Config(category = ConfigCategory.DEBUG, predicate = BilibiliDanmakuPredicates.DebugOptionPredicate.class) + public static String initApiUrl = "https://api.live.bilibili.com/room/v1/Room/room_init"; - @Config(category = ConfigCategory.DEBUG, debug = true) - public static final ConfigString websocketUri = cm.createString("websocketUri", "wss://broadcastlv.chat.bilibili.com:443/sub"); + @Config(category = ConfigCategory.DEBUG, predicate = BilibiliDanmakuPredicates.DebugOptionPredicate.class) + public static String websocketUri = "wss://broadcastlv.chat.bilibili.com:443/sub"; - public static void initCallbacks() { + public static void initCallbacks(ConfigManager cm) { // Generic config callback - enable.setValueChangeCallback(CallBacks::enableCallback); + cm.setValueChangeCallback("enable", CallBacks::enableCallback); openConfigGui.getKeybind().setCallback(CallBacks::openConfigGuiCallback); - roomId.setValueChangeCallback(CallBacks::roomIdCallback); + cm.setValueChangeCallback("roomId", CallBacks::roomIdCallback); // Debug config callback - debugMode.setValueChangeCallback(CallBacks::debugModeCallBack); + cm.setValueChangeCallback("debugMode", CallBacks::debugModeCallBack); + + CallBacks.debugModeCallBack(null); } } diff --git a/src/main/java/top/hendrixshen/bilibilidanmaku/event/CallBacks.java b/src/main/java/top/hendrixshen/bilibilidanmaku/event/CallBacks.java index a72cf2e..b3e2376 100644 --- a/src/main/java/top/hendrixshen/bilibilidanmaku/event/CallBacks.java +++ b/src/main/java/top/hendrixshen/bilibilidanmaku/event/CallBacks.java @@ -1,28 +1,24 @@ package top.hendrixshen.bilibilidanmaku.event; -import fi.dy.masa.malilib.config.options.ConfigBoolean; -import fi.dy.masa.malilib.config.options.ConfigInteger; import fi.dy.masa.malilib.gui.GuiBase; import fi.dy.masa.malilib.hotkeys.IKeybind; import fi.dy.masa.malilib.hotkeys.KeyAction; import org.apache.logging.log4j.Level; import org.apache.logging.log4j.core.config.Configurator; +import top.hendrixshen.bilibilidanmaku.BilibiliDanmakuConfigGui; import top.hendrixshen.bilibilidanmaku.BilibiliDanmakuReference; -import top.hendrixshen.bilibilidanmaku.config.ConfigGui; import top.hendrixshen.bilibilidanmaku.config.Configs; import top.hendrixshen.bilibilidanmaku.util.websocket.WebSocketManager; -import top.hendrixshen.magiclib.util.FabricUtil; - -import static top.hendrixshen.bilibilidanmaku.BilibiliDanmaku.cm; +import top.hendrixshen.magiclib.config.Option; public class CallBacks { public static boolean openConfigGuiCallback(KeyAction keyAction, IKeybind keybind) { - GuiBase.openGui(ConfigGui.getInstance()); + GuiBase.openGui(BilibiliDanmakuConfigGui.getInstance()); return true; } - public static void enableCallback(ConfigBoolean configBoolean) { - if (configBoolean.getBooleanValue()) { + public static void enableCallback(Option option) { + if (Configs.enable) { if (WebSocketManager.getWebSocketClient() != null) { WebSocketManager.close(); } @@ -32,8 +28,8 @@ public static void enableCallback(ConfigBoolean configBoolean) { WebSocketManager.close(); } - public static void roomIdCallback(ConfigInteger configInteger) { - if (Configs.enable.getBooleanValue()) { + public static void roomIdCallback(Option option) { + if (Configs.enable) { if (WebSocketManager.getWebSocketClient() != null) { WebSocketManager.close(); } @@ -43,13 +39,10 @@ public static void roomIdCallback(ConfigInteger configInteger) { WebSocketManager.close(); } - public static void debugModeCallBack(ConfigBoolean configBoolean) { - Configurator.setLevel(BilibiliDanmakuReference.getModId(), Level.toLevel(configBoolean.getBooleanValue() ? "DEBUG" : "INFO")); - cm.setHideDisabled(!configBoolean.getBooleanValue()); - cm.setHideDebug(!configBoolean.getBooleanValue()); - if (FabricUtil.isDevelopmentEnvironment()) { - cm.setHideDevOnly(!configBoolean.getBooleanValue()); + public static void debugModeCallBack(Option option) { + Configurator.setLevel(BilibiliDanmakuReference.getModId(), Level.toLevel(Configs.debugMode ? "DEBUG" : "INFO")); + if (option != null) { + BilibiliDanmakuConfigGui.getInstance().reDraw(); } - ConfigGui.getInstance().reDraw(); } } diff --git a/src/main/java/top/hendrixshen/bilibilidanmaku/event/InputHandler.java b/src/main/java/top/hendrixshen/bilibilidanmaku/event/InputHandler.java deleted file mode 100644 index 953e99c..0000000 --- a/src/main/java/top/hendrixshen/bilibilidanmaku/event/InputHandler.java +++ /dev/null @@ -1,25 +0,0 @@ -package top.hendrixshen.bilibilidanmaku.event; - -import fi.dy.masa.malilib.hotkeys.IHotkey; -import fi.dy.masa.malilib.hotkeys.IKeybindManager; -import fi.dy.masa.malilib.hotkeys.IKeybindProvider; -import top.hendrixshen.bilibilidanmaku.BilibiliDanmaku; - -import java.util.List; -import java.util.stream.Collectors; - -public class InputHandler implements IKeybindProvider { - private static final List ALL_CUSTOM_HOTKEYS = BilibiliDanmaku.cm.getAllConfigOptionStream(). - filter(option -> option instanceof IHotkey). - map(option -> (IHotkey) option). - collect(Collectors.toList()); - - @Override - public void addKeysToMap(IKeybindManager manager) { - ALL_CUSTOM_HOTKEYS.forEach(iHotkey -> manager.addKeybindToMap(iHotkey.getKeybind())); - } - - @Override - public void addHotkeys(IKeybindManager manager) { - } -} diff --git a/src/main/java/top/hendrixshen/bilibilidanmaku/mixin/event/MixinClientPacketListener.java b/src/main/java/top/hendrixshen/bilibilidanmaku/mixin/event/MixinClientPacketListener.java index e422128..00a701c 100644 --- a/src/main/java/top/hendrixshen/bilibilidanmaku/mixin/event/MixinClientPacketListener.java +++ b/src/main/java/top/hendrixshen/bilibilidanmaku/mixin/event/MixinClientPacketListener.java @@ -18,7 +18,7 @@ public class MixinClientPacketListener { ) ) private void afterLogin(ClientboundLoginPacket clientboundLoginPacket, CallbackInfo ci) { - if (Configs.enable.getBooleanValue()) { + if (Configs.enable) { WebSocketManager.open(); } } diff --git a/src/main/java/top/hendrixshen/bilibilidanmaku/util/InfoUtil.java b/src/main/java/top/hendrixshen/bilibilidanmaku/util/InfoUtil.java index a754d2f..d008b05 100644 --- a/src/main/java/top/hendrixshen/bilibilidanmaku/util/InfoUtil.java +++ b/src/main/java/top/hendrixshen/bilibilidanmaku/util/InfoUtil.java @@ -1,11 +1,11 @@ package top.hendrixshen.bilibilidanmaku.util; +import fi.dy.masa.malilib.util.StringUtils; import net.minecraft.client.Minecraft; import net.minecraft.client.player.LocalPlayer; import net.minecraft.network.chat.TextComponent; import top.hendrixshen.bilibilidanmaku.BilibiliDanmaku; import top.hendrixshen.bilibilidanmaku.BilibiliDanmakuReference; -import top.hendrixshen.magiclib.untils.language.I18n; public class InfoUtil { private static final Minecraft minecraft = BilibiliDanmaku.getMinecraftClient(); @@ -17,11 +17,11 @@ public static void sendClientMessage(String string) { public static void sendClientMessage(TextComponent component) { LocalPlayer player = minecraft.player; if (player != null) { - player.sendMessage(component, player.getUUID()); + player.displayClientMessage(component, false); } } public static String getMessage(String node, Object... objects) { - return I18n.translate(String.format("%s.messages.%s", BilibiliDanmakuReference.getModId(), node), objects); + return StringUtils.translate(String.format("%s.messages.%s", BilibiliDanmakuReference.getModId(), node), objects); } } diff --git a/src/main/java/top/hendrixshen/bilibilidanmaku/util/VersionParser.java b/src/main/java/top/hendrixshen/bilibilidanmaku/util/VersionParser.java new file mode 100644 index 0000000..2d7641c --- /dev/null +++ b/src/main/java/top/hendrixshen/bilibilidanmaku/util/VersionParser.java @@ -0,0 +1,14 @@ +package top.hendrixshen.bilibilidanmaku.util; + +public class VersionParser { + public static String getVersionType(String version) { + if (version.endsWith("stable")) { + return "Public Release"; + } else if (version.endsWith("beta")) { + return "Public Beta"; + } else if (version.endsWith("dev")) { + return "Development"; + } + return "Unknown"; + } +} diff --git a/src/main/java/top/hendrixshen/bilibilidanmaku/util/bilibili/Bilibili.java b/src/main/java/top/hendrixshen/bilibilidanmaku/util/bilibili/Bilibili.java index ab4f259..b1f8dae 100644 --- a/src/main/java/top/hendrixshen/bilibilidanmaku/util/bilibili/Bilibili.java +++ b/src/main/java/top/hendrixshen/bilibilidanmaku/util/bilibili/Bilibili.java @@ -13,6 +13,7 @@ import top.hendrixshen.bilibilidanmaku.util.InfoUtil; import top.hendrixshen.bilibilidanmaku.util.Zlib; import top.hendrixshen.bilibilidanmaku.util.websocket.WebSocketClient; +import top.hendrixshen.bilibilidanmaku.util.websocket.WebSocketManager; import java.io.IOException; import java.net.URL; @@ -53,11 +54,11 @@ public static Bilibili getInstance() { } public String getUri() { - return Configs.websocketUri.getStringValue(); + return Configs.websocketUri; } public String getInitApiUrl() { - return Configs.initApiUrl.getStringValue(); + return Configs.initApiUrl; } public int getRealRoomId(int id) { @@ -74,7 +75,7 @@ public int getRealRoomId(int id) { } public void initMessage(WebSocketClient client) { - int id = this.getRealRoomId(Configs.roomId.getIntegerValue()); + int id = this.getRealRoomId(Configs.roomId); if (id > -1) { InfoUtil.sendClientMessage(InfoUtil.getMessage("getRealRoomID.successful", id)); byte[] message = String.format("{\"roomid\": %d}", id).getBytes(StandardCharsets.UTF_8); @@ -88,6 +89,7 @@ public void initMessage(WebSocketClient client) { client.sendMessage(buf); } else { InfoUtil.sendClientMessage(InfoUtil.getMessage("getRealRoomID.failed")); + WebSocketManager.close(); } } diff --git a/src/main/java/top/hendrixshen/bilibilidanmaku/util/bilibili/JsonDeserializer.java b/src/main/java/top/hendrixshen/bilibilidanmaku/util/bilibili/JsonDeserializer.java index 867f734..a27434d 100644 --- a/src/main/java/top/hendrixshen/bilibilidanmaku/util/bilibili/JsonDeserializer.java +++ b/src/main/java/top/hendrixshen/bilibilidanmaku/util/bilibili/JsonDeserializer.java @@ -16,38 +16,38 @@ public String deserialize(JsonElement json, Type typeOfT, JsonDeserializationCon String type = data.get("cmd").getAsString(); switch (type) { case "DANMU_MSG": - if (Configs.chatDanmakuEnable.getBooleanValue()) { + if (Configs.chatDanmakuEnable) { return MessageHandler.handleDanmaku(data); } break; case "SEND_GIFT": - if (Configs.chatGiftEnable.getBooleanValue()) { + if (Configs.chatGiftEnable) { return MessageHandler.handleGift(data); } break; case "COMBO_SEND": - if (Configs.chatGiftEnable.getBooleanValue()) { + if (Configs.chatGiftEnable) { return MessageHandler.handleComboGift(data); } break; case "INTERACT_WORD": case "WELCOME": // Not tested, may no longer work. - if (Configs.chatWelcomeEnable.getBooleanValue() && Configs.chatWelcomeNormalEnable.getBooleanValue()) { + if (Configs.chatWelcomeEnable && Configs.chatWelcomeNormalEnable) { return MessageHandler.handleWelcomeNormal(data); } break; case "WELCOME_GUARD": // Not tested, may no longer work. - if (Configs.chatWelcomeEnable.getBooleanValue() && Configs.chatWelcomeGuardEnable.getBooleanValue()) { + if (Configs.chatWelcomeEnable && Configs.chatWelcomeGuardEnable) { return MessageHandler.handleWelcomeGuard(data); } break; case "GUARD_BUY": // Not tested! - if (Configs.chatGuardBuyEnable.getBooleanValue()) { + if (Configs.chatGuardBuyEnable) { return MessageHandler.handleBuyGuard(data); } break; case "SUPER_CHAT_MESSAGE": // Not tested! - if (Configs.chatSuperChatEnable.getBooleanValue()) { + if (Configs.chatSuperChatEnable) { return MessageHandler.handleSuperChat(data); } break; diff --git a/src/main/java/top/hendrixshen/bilibilidanmaku/util/bilibili/MessageHandler.java b/src/main/java/top/hendrixshen/bilibilidanmaku/util/bilibili/MessageHandler.java index 7b8e510..4bf2843 100644 --- a/src/main/java/top/hendrixshen/bilibilidanmaku/util/bilibili/MessageHandler.java +++ b/src/main/java/top/hendrixshen/bilibilidanmaku/util/bilibili/MessageHandler.java @@ -17,19 +17,19 @@ public static String handleDanmaku(JsonObject data) { boolean isAdmin = user.get(2).getAsInt() == 1; boolean isGuard = StringUtils.isNotBlank(user.get(7).getAsString()); - if (Configs.blockWords.getStrings().stream().noneMatch((danmaku::contains))) { + if (Configs.blockWords.stream().noneMatch((danmaku::contains))) { if (isAdmin) { - return String.format(Configs.formatChatAdmin.getStringValue() + return String.format(Configs.formatChatAdmin .replaceAll("&([0-9a-fk-or])", "§$1") .replaceAll("%\\{user}", Matcher.quoteReplacement("%1$s")) .replaceAll("%\\{danmaku}", Matcher.quoteReplacement("%2$s")), userName, danmaku); } else if (isGuard) { - return String.format(Configs.formatChatDanmakuGuard.getStringValue() + return String.format(Configs.formatChatDanmakuGuard .replaceAll("&([0-9a-fk-or])", "§$1") .replaceAll("%\\{user}", Matcher.quoteReplacement("%1$s")) .replaceAll("%\\{danmaku}", Matcher.quoteReplacement("%2$s")), userName, danmaku); } else { - return String.format(Configs.formatChatDanmakuNormal.getStringValue() + return String.format(Configs.formatChatDanmakuNormal .replaceAll("&([0-9a-fk-or])", "§$1") .replaceAll("%\\{user}", Matcher.quoteReplacement("%1$s")) .replaceAll("%\\{danmaku}", Matcher.quoteReplacement("%2$s")), userName, danmaku); @@ -45,8 +45,8 @@ public static String handleGift(JsonObject data) { String giftName = jsonObject.get("giftName").getAsString(); int num = jsonObject.get("num").getAsInt(); - if (Configs.blockGifts.getStrings().stream().noneMatch(giftName::contains)) { - return String.format(Configs.formatChatGifts.getStringValue() + if (Configs.blockGifts.stream().noneMatch(giftName::contains)) { + return String.format(Configs.formatChatGifts .replaceAll("&([0-9a-fk-or])", "§$1") .replaceAll("%\\{user}", Matcher.quoteReplacement("%1$s")) .replaceAll("%\\{action}", Matcher.quoteReplacement("%2$s")) @@ -60,7 +60,7 @@ public static String handleWelcomeNormal(JsonObject data) { JsonObject jsonObject = data.getAsJsonObject("data"); String userName = jsonObject.get("uname").getAsString(); - return String.format(Configs.formatChatWelcomeNormal.getStringValue() + return String.format(Configs.formatChatWelcomeNormal .replaceAll("&([0-9a-fk-or])", "§$1") .replaceAll("%\\{user}", Matcher.quoteReplacement("%1$s")), userName); } @@ -71,20 +71,20 @@ public static String handleWelcomeGuard(JsonObject data) { int level = jsonObject.get("guard_level").getAsInt(); switch (level) { case 1: - if (Configs.chatWelcomeGuardLv1Enable.getBooleanValue()) { - return String.format(Configs.formatChatWelcomeGuardLv1.getStringValue() + if (Configs.chatWelcomeGuardLv1Enable) { + return String.format(Configs.formatChatWelcomeGuardLv1 .replaceAll("&([0-9a-fk-or])", "§$1") .replaceAll("%\\{user}", Matcher.quoteReplacement("%1$s")), userName); } case 2: - if (Configs.chatWelcomeGuardLv2Enable.getBooleanValue()) { - return String.format(Configs.formatChatWelcomeGuardLv2.getStringValue() + if (Configs.chatWelcomeGuardLv2Enable) { + return String.format(Configs.formatChatWelcomeGuardLv2 .replaceAll("&([0-9a-fk-or])", "§$1") .replaceAll("%\\{user}", Matcher.quoteReplacement("%1$s")), userName); } case 3: - if (Configs.chatWelcomeGuardLv3Enable.getBooleanValue()) { - return String.format(Configs.formatChatWelcomeGuardLv3.getStringValue() + if (Configs.chatWelcomeGuardLv3Enable) { + return String.format(Configs.formatChatWelcomeGuardLv3 .replaceAll("&([0-9a-fk-or])", "§$1") .replaceAll("%\\{user}", Matcher.quoteReplacement("%1$s")), userName); } @@ -100,8 +100,8 @@ public static String handleComboGift(JsonObject data) { String giftName = jsonObject.get("gift_name").getAsString(); int num = jsonObject.get("total_num").getAsInt(); - if (Configs.blockGifts.getStrings().stream().noneMatch(giftName::contains)) { - return String.format(Configs.formatChatGifts.getStringValue() + if (Configs.blockGifts.stream().noneMatch(giftName::contains)) { + return String.format(Configs.formatChatGifts .replaceAll("&([0-9a-fk-or])", "§$1") .replaceAll("%\\{user}", Matcher.quoteReplacement("%1$s")) .replaceAll("%\\{action}", Matcher.quoteReplacement("%2$s")) @@ -118,20 +118,20 @@ public static String handleBuyGuard(JsonObject data) { int level = jsonObject.get("guard_level").getAsInt(); switch (level) { case 1: - if (Configs.chatGuardBuyLevel1Enable.getBooleanValue()) { - return String.format(Configs.formatChatBuyGuardLv1.getStringValue() + if (Configs.chatGuardBuyLevel1Enable) { + return String.format(Configs.formatChatBuyGuardLv1 .replaceAll("&([0-9a-fk-or])", "§$1") .replaceAll("%\\{user}", Matcher.quoteReplacement("%1$s")), userName); } case 2: - if (Configs.chatGuardBuyLevel2Enable.getBooleanValue()) { - return String.format(Configs.formatChatBuyGuardLv2.getStringValue() + if (Configs.chatGuardBuyLevel2Enable) { + return String.format(Configs.formatChatBuyGuardLv2 .replaceAll("&([0-9a-fk-or])", "§$1") .replaceAll("%\\{user}", Matcher.quoteReplacement("%1$s")), userName); } case 3: - if (Configs.chatGuardBuyLevel3Enable.getBooleanValue()) { - return String.format(Configs.formatChatBuyGuardLv3.getStringValue() + if (Configs.chatGuardBuyLevel3Enable) { + return String.format(Configs.formatChatBuyGuardLv3 .replaceAll("&([0-9a-fk-or])", "§$1") .replaceAll("%\\{user}", Matcher.quoteReplacement("%1$s")), userName); } @@ -147,7 +147,7 @@ public static String handleSuperChat(JsonObject data) { String message = jsonObject.get("message").getAsString(); int price = jsonObject.get("price").getAsInt(); - return String.format(Configs.formatChatSuperChat.getStringValue() + return String.format(Configs.formatChatSuperChat .replaceAll("&([0-9a-fk-or])", "§$1") .replaceAll("%\\{user}", Matcher.quoteReplacement("%1$s")) .replaceAll("%\\{msg}", Matcher.quoteReplacement("%2$s")) diff --git a/src/main/resources/assets/bilibili-danmaku/lang/en_us.json b/src/main/resources/assets/bilibili-danmaku/lang/en_us.json index c991a46..49326dd 100644 --- a/src/main/resources/assets/bilibili-danmaku/lang/en_us.json +++ b/src/main/resources/assets/bilibili-danmaku/lang/en_us.json @@ -6,9 +6,10 @@ "bilibili-danmaku.gui.button.tab.generic": "Generic", "bilibili-danmaku.gui.button.tab.toggle_chat": "Chat Toggle", + "bilibili-danmaku.misc.versionType.Development": "Development", "bilibili-danmaku.misc.versionType.Public Beta": "Public Beta", "bilibili-danmaku.misc.versionType.Public Release": "Public Release", - "bilibili-danmaku.misc.versionType.Development": "Development", + "bilibili-danmaku.misc.versionType.Unknown": "Unknown", "bilibili-danmaku.messages.getRealRoomID.failed": "§6[Bilibili Danmaku]§4Get room identifier failed!", "bilibili-danmaku.messages.getRealRoomID.successful": "§6[Bilibili Danmaku]§2Get room identifier successfully(%s)!", @@ -18,73 +19,73 @@ "bilibili-danmaku.messages.websocket.close": "§6[Bilibili Danmaku]§eWebsocket disconnect!", - "bilibili-danmaku.config.enable.name": "enable", - "bilibili-danmaku.config.enable.comment": "", - "bilibili-danmaku.config.blockGifts.name": "blockGifts", - "bilibili-danmaku.config.blockGifts.comment": "", - "bilibili-danmaku.config.blockWords.name": "blockWords", - "bilibili-danmaku.config.blockWords.comment": "", - "bilibili-danmaku.config.openConfigGui.name": "openConfigGui", - "bilibili-danmaku.config.openConfigGui.comment": "A hotkey to open the in-game Config GUI.。", - "bilibili-danmaku.config.roomId.name": "roomId", - "bilibili-danmaku.config.roomId.comment": "", + "bilibili-danmaku.config.generic.enable.name": "enable", + "bilibili-danmaku.config.generic.enable.comment": "", + "bilibili-danmaku.config.generic.blockGifts.name": "blockGifts", + "bilibili-danmaku.config.generic.blockGifts.comment": "", + "bilibili-danmaku.config.generic.blockWords.name": "blockWords", + "bilibili-danmaku.config.generic.blockWords.comment": "", + "bilibili-danmaku.config.generic.openConfigGui.name": "openConfigGui", + "bilibili-danmaku.config.generic.openConfigGui.comment": "A hotkey to open the in-game Config GUI.", + "bilibili-danmaku.config.generic.roomId.name": "roomId", + "bilibili-danmaku.config.generic.roomId.comment": "", - "bilibili-danmaku.config.chatDanmakuEnable.name": "chatDanmakuEnable", - "bilibili-danmaku.config.chatDanmakuEnable.comment": "", - "bilibili-danmaku.config.chatGiftEnable.name": "chatGiftEnable", - "bilibili-danmaku.config.chatGiftEnable.comment": "", - "bilibili-danmaku.config.chatGuardBuyEnable.name": "chatGuardBuyEnable", - "bilibili-danmaku.config.chatGuardBuyEnable.comment": "", - "bilibili-danmaku.config.chatGuardBuyLevel1Enable.name": "chatGuardBuyLevel1Enable", - "bilibili-danmaku.config.chatGuardBuyLevel1Enable.comment": "", - "bilibili-danmaku.config.chatGuardBuyLevel2Enable.name": "chatGuardBuyLevel2Enable", - "bilibili-danmaku.config.chatGuardBuyLevel2Enable.comment": "", - "bilibili-danmaku.config.chatGuardBuyLevel3Enable.name": "chatGuardBuyLevel3Enable", - "bilibili-danmaku.config.chatGuardBuyLevel3Enable.comment": "", - "bilibili-danmaku.config.chatSuperChatEnable.name": "chatSuperChatEnable", - "bilibili-danmaku.config.chatSuperChatEnable.comment": "", - "bilibili-danmaku.config.chatWelcomeEnable.name": "chatWelcomeEnable", - "bilibili-danmaku.config.chatWelcomeEnable.comment": "", - "bilibili-danmaku.config.chatWelcomeGuardEnable.name": "chatWelcomeGuardEnable", - "bilibili-danmaku.config.chatWelcomeGuardEnable.comment": "", - "bilibili-danmaku.config.chatWelcomeGuardLv1Enable.name": "chatWelcomeGuardLv1Enable", - "bilibili-danmaku.config.chatWelcomeGuardLv1Enable.comment": "", - "bilibili-danmaku.config.chatWelcomeGuardLv2Enable.name": "chatWelcomeGuardLv2Enable", - "bilibili-danmaku.config.chatWelcomeGuardLv2Enable.comment": "", - "bilibili-danmaku.config.chatWelcomeGuardLv3Enable.name": "chatWelcomeGuardLv3Enable", - "bilibili-danmaku.config.chatWelcomeGuardLv3Enable.comment": "", - "bilibili-danmaku.config.chatWelcomeNormalEnable.name": "chatWelcomeNormalEnable", - "bilibili-danmaku.config.chatWelcomeNormalEnable.comment": "", + "bilibili-danmaku.config.toggle_chat.chatDanmakuEnable.name": "chatDanmakuEnable", + "bilibili-danmaku.config.toggle_chat.chatDanmakuEnable.comment": "", + "bilibili-danmaku.config.toggle_chat.chatGiftEnable.name": "chatGiftEnable", + "bilibili-danmaku.config.toggle_chat.chatGiftEnable.comment": "", + "bilibili-danmaku.config.toggle_chat.chatGuardBuyEnable.name": "chatGuardBuyEnable", + "bilibili-danmaku.config.toggle_chat.chatGuardBuyEnable.comment": "", + "bilibili-danmaku.config.toggle_chat.chatGuardBuyLevel1Enable.name": "chatGuardBuyLevel1Enable", + "bilibili-danmaku.config.toggle_chat.chatGuardBuyLevel1Enable.comment": "", + "bilibili-danmaku.config.toggle_chat.chatGuardBuyLevel2Enable.name": "chatGuardBuyLevel2Enable", + "bilibili-danmaku.config.toggle_chat.chatGuardBuyLevel2Enable.comment": "", + "bilibili-danmaku.config.toggle_chat.chatGuardBuyLevel3Enable.name": "chatGuardBuyLevel3Enable", + "bilibili-danmaku.config.toggle_chat.chatGuardBuyLevel3Enable.comment": "", + "bilibili-danmaku.config.toggle_chat.chatSuperChatEnable.name": "chatSuperChatEnable", + "bilibili-danmaku.config.toggle_chat.chatSuperChatEnable.comment": "", + "bilibili-danmaku.config.toggle_chat.chatWelcomeEnable.name": "chatWelcomeEnable", + "bilibili-danmaku.config.toggle_chat.chatWelcomeEnable.comment": "", + "bilibili-danmaku.config.toggle_chat.chatWelcomeGuardEnable.name": "chatWelcomeGuardEnable", + "bilibili-danmaku.config.toggle_chat.chatWelcomeGuardEnable.comment": "", + "bilibili-danmaku.config.toggle_chat.chatWelcomeGuardLv1Enable.name": "chatWelcomeGuardLv1Enable", + "bilibili-danmaku.config.toggle_chat.chatWelcomeGuardLv1Enable.comment": "", + "bilibili-danmaku.config.toggle_chat.chatWelcomeGuardLv2Enable.name": "chatWelcomeGuardLv2Enable", + "bilibili-danmaku.config.toggle_chat.chatWelcomeGuardLv2Enable.comment": "", + "bilibili-danmaku.config.toggle_chat.chatWelcomeGuardLv3Enable.name": "chatWelcomeGuardLv3Enable", + "bilibili-danmaku.config.toggle_chat.chatWelcomeGuardLv3Enable.comment": "", + "bilibili-danmaku.config.toggle_chat.chatWelcomeNormalEnable.name": "chatWelcomeNormalEnable", + "bilibili-danmaku.config.toggle_chat.chatWelcomeNormalEnable.comment": "", - "bilibili-danmaku.config.formatChatAdmin.name": "formatChatAdmin", - "bilibili-danmaku.config.formatChatAdmin.comment": "", - "bilibili-danmaku.config.formatChatBuyGuardLv1.name": "formatChatBuyGuardLv1", - "bilibili-danmaku.config.formatChatBuyGuardLv1.comment": "", - "bilibili-danmaku.config.formatChatBuyGuardLv2.name": "formatChatBuyGuardLv2", - "bilibili-danmaku.config.formatChatBuyGuardLv2.comment": "", - "bilibili-danmaku.config.formatChatBuyGuardLv3.name": "formatChatBuyGuardLv3", - "bilibili-danmaku.config.formatChatBuyGuardLv3.comment": "", - "bilibili-danmaku.config.formatChatDanmakuGuard.name": "formatChatDanmakuGuard", - "bilibili-danmaku.config.formatChatDanmakuGuard.comment": "", - "bilibili-danmaku.config.formatChatDanmakuNormal.name": "formatChatDanmakuNormal", - "bilibili-danmaku.config.formatChatDanmakuNormal.comment": "", - "bilibili-danmaku.config.formatChatGifts.name": "formatChatGifts", - "bilibili-danmaku.config.formatChatGifts.comment": "", - "bilibili-danmaku.config.formatChatSuperChat.name": "聊天栏醒目留言格式", - "bilibili-danmaku.config.formatChatSuperChat.comment": "当收到醒目留言时展示的信格式息。", - "bilibili-danmaku.config.formatChatWelcomeGuardLv1.name": "formatChatWelcomeGuardLv1", - "bilibili-danmaku.config.formatChatWelcomeGuardLv1.comment": "", - "bilibili-danmaku.config.formatChatWelcomeGuardLv2.name": "formatChatWelcomeGuardLv2", - "bilibili-danmaku.config.formatChatWelcomeGuardLv2.comment": "", - "bilibili-danmaku.config.formatChatWelcomeGuardLv3.name": "formatChatWelcomeGuardLv3", - "bilibili-danmaku.config.formatChatWelcomeGuardLv3.comment": "", - "bilibili-danmaku.config.formatChatWelcomeNormal.name": "formatChatWelcomeNormal", - "bilibili-danmaku.config.formatChatWelcomeNormal.comment": "", + "bilibili-danmaku.config.format_chat.formatChatAdmin.name": "formatChatAdmin", + "bilibili-danmaku.config.format_chat.formatChatAdmin.comment": "", + "bilibili-danmaku.config.format_chat.formatChatBuyGuardLv1.name": "formatChatBuyGuardLv1", + "bilibili-danmaku.config.format_chat.formatChatBuyGuardLv1.comment": "", + "bilibili-danmaku.config.format_chat.formatChatBuyGuardLv2.name": "formatChatBuyGuardLv2", + "bilibili-danmaku.config.format_chat.formatChatBuyGuardLv2.comment": "", + "bilibili-danmaku.config.format_chat.formatChatBuyGuardLv3.name": "formatChatBuyGuardLv3", + "bilibili-danmaku.config.format_chat.formatChatBuyGuardLv3.comment": "", + "bilibili-danmaku.config.format_chat.formatChatDanmakuGuard.name": "formatChatDanmakuGuard", + "bilibili-danmaku.config.format_chat.formatChatDanmakuGuard.comment": "", + "bilibili-danmaku.config.format_chat.formatChatDanmakuNormal.name": "formatChatDanmakuNormal", + "bilibili-danmaku.config.format_chat.formatChatDanmakuNormal.comment": "", + "bilibili-danmaku.config.format_chat.formatChatGifts.name": "formatChatGifts", + "bilibili-danmaku.config.format_chat.formatChatGifts.comment": "", + "bilibili-danmaku.config.format_chat.formatChatSuperChat.name": "聊天栏醒目留言格式", + "bilibili-danmaku.config.format_chat.formatChatSuperChat.comment": "当收到醒目留言时展示的信格式息。", + "bilibili-danmaku.config.format_chat.formatChatWelcomeGuardLv1.name": "formatChatWelcomeGuardLv1", + "bilibili-danmaku.config.format_chat.formatChatWelcomeGuardLv1.comment": "", + "bilibili-danmaku.config.format_chat.formatChatWelcomeGuardLv2.name": "formatChatWelcomeGuardLv2", + "bilibili-danmaku.config.format_chat.formatChatWelcomeGuardLv2.comment": "", + "bilibili-danmaku.config.format_chat.formatChatWelcomeGuardLv3.name": "formatChatWelcomeGuardLv3", + "bilibili-danmaku.config.format_chat.formatChatWelcomeGuardLv3.comment": "", + "bilibili-danmaku.config.format_chat.formatChatWelcomeNormal.name": "formatChatWelcomeNormal", + "bilibili-danmaku.config.format_chat.formatChatWelcomeNormal.comment": "", - "bilibili-danmaku.config.debugMode.name": "debugMode", - "bilibili-danmaku.config.debugMode.comment": "", - "bilibili-danmaku.config.initApiUrl.name": "initApiUrl", - "bilibili-danmaku.config.initApiUrl.comment": "", - "bilibili-danmaku.config.websocketUri.name": "websocketUri", - "bilibili-danmaku.config.websocketUri.comment": "" + "bilibili-danmaku.config.debug.debugMode.name": "debugMode", + "bilibili-danmaku.config.debug.debugMode.comment": "", + "bilibili-danmaku.config.debug.initApiUrl.name": "initApiUrl", + "bilibili-danmaku.config.debug.initApiUrl.comment": "", + "bilibili-danmaku.config.debug.websocketUri.name": "websocketUri", + "bilibili-danmaku.config.debug.websocketUri.comment": "" } diff --git a/src/main/resources/assets/bilibili-danmaku/lang/zh_cn.json b/src/main/resources/assets/bilibili-danmaku/lang/zh_cn.json index 3c93914..f1d3b86 100644 --- a/src/main/resources/assets/bilibili-danmaku/lang/zh_cn.json +++ b/src/main/resources/assets/bilibili-danmaku/lang/zh_cn.json @@ -6,9 +6,10 @@ "bilibili-danmaku.gui.button.tab.generic": "全局", "bilibili-danmaku.gui.button.tab.toggle_chat": "聊天栏开关", + "bilibili-danmaku.misc.versionType.Development": "开发版", "bilibili-danmaku.misc.versionType.Public Beta": "公共测试版", "bilibili-danmaku.misc.versionType.Public Release": "公共发行版", - "bilibili-danmaku.misc.versionType.Development": "开发版", + "bilibili-danmaku.misc.versionType.Unknown": "未知版本", "bilibili-danmaku.messages.getRealRoomID.failed": "§6[哔哩哔哩弹幕姬]§4房间号获取失败!", "bilibili-danmaku.messages.getRealRoomID.successful": "§6[哔哩哔哩弹幕姬]§2成功获取房间号(%s)!", @@ -18,73 +19,73 @@ "bilibili-danmaku.messages.websocket.close": "§6[哔哩哔哩弹幕姬]§eWebsocket 已断开!", - "bilibili-danmaku.config.enable.name": "启用", - "bilibili-danmaku.config.enable.comment": "启用后进入单人游戏/多人游戏会自动连接至直播间", - "bilibili-danmaku.config.blockGifts.name": "屏蔽礼物", - "bilibili-danmaku.config.blockGifts.comment": "在此列表中的礼物会被屏蔽。", - "bilibili-danmaku.config.blockWords.name": "屏蔽词", - "bilibili-danmaku.config.blockWords.comment": "在此列表中的弹幕会被屏蔽。", - "bilibili-danmaku.config.openConfigGui.name": "打开设置界面", - "bilibili-danmaku.config.openConfigGui.comment": "打开设置界面的快捷键。", - "bilibili-danmaku.config.roomId.name": "房间编号", - "bilibili-danmaku.config.roomId.comment": "连接弹幕监听的直播间号。", + "bilibili-danmaku.config.generic.enable.name": "启用", + "bilibili-danmaku.config.generic.enable.comment": "启用后进入单人游戏/多人游戏会自动连接至直播间", + "bilibili-danmaku.config.generic.blockGifts.name": "屏蔽礼物", + "bilibili-danmaku.config.generic.blockGifts.comment": "在此列表中的礼物会被屏蔽。", + "bilibili-danmaku.config.generic.blockWords.name": "屏蔽词", + "bilibili-danmaku.config.generic.blockWords.comment": "在此列表中的弹幕会被屏蔽。", + "bilibili-danmaku.config.generic.openConfigGui.name": "打开设置界面", + "bilibili-danmaku.config.generic.openConfigGui.comment": "打开设置界面的快捷键。", + "bilibili-danmaku.config.generic.roomId.name": "房间编号", + "bilibili-danmaku.config.generic.roomId.comment": "连接弹幕监听的直播间号。", - "bilibili-danmaku.config.chatDanmakuEnable.name": "启用聊天栏弹幕", - "bilibili-danmaku.config.chatDanmakuEnable.comment": "在聊天栏展示收到的弹幕。", - "bilibili-danmaku.config.chatGiftEnable.name": "启用聊天栏礼物", - "bilibili-danmaku.config.chatGiftEnable.comment": "在聊天栏展示收到的礼物。", - "bilibili-danmaku.config.chatGuardBuyEnable.name": "启用聊天栏大航海购买提示总开关", - "bilibili-danmaku.config.chatGuardBuyEnable.comment": "在聊天栏展示大航海购买信息,记得感谢Ta哦~", - "bilibili-danmaku.config.chatGuardBuyLevel1Enable.name": "启用聊天栏总督购买提示", - "bilibili-danmaku.config.chatGuardBuyLevel1Enable.comment": "在聊天栏展示总督购买信息,记得感谢Ta哦~", - "bilibili-danmaku.config.chatGuardBuyLevel2Enable.name": "启用聊天栏提督购买提示", - "bilibili-danmaku.config.chatGuardBuyLevel2Enable.comment": "在聊天栏展示提督购买信息,记得感谢Ta哦~", - "bilibili-danmaku.config.chatGuardBuyLevel3Enable.name": "启用聊天栏舰长购买提示", - "bilibili-danmaku.config.chatGuardBuyLevel3Enable.comment": "在聊天栏展示舰长购买信息,记得感谢Ta哦~", - "bilibili-danmaku.config.chatSuperChatEnable.name": "启用聊天栏醒目留言", - "bilibili-danmaku.config.chatSuperChatEnable.comment": "在聊天栏展示醒目留言。", - "bilibili-danmaku.config.chatWelcomeEnable.name": "启用聊天栏欢迎信息总开关", - "bilibili-danmaku.config.chatWelcomeEnable.comment": "在聊天栏展示进入直播间的观众。", - "bilibili-danmaku.config.chatWelcomeGuardEnable.name": "启用聊天栏大航海欢迎信息", - "bilibili-danmaku.config.chatWelcomeGuardEnable.comment": "在聊天栏展示进入直播间的大航海观众。", - "bilibili-danmaku.config.chatWelcomeGuardLv1Enable.name": "启用聊天栏总督欢迎信息", - "bilibili-danmaku.config.chatWelcomeGuardLv1Enable.comment": "在聊天栏展示进入直播间的总督。", - "bilibili-danmaku.config.chatWelcomeGuardLv2Enable.name": "启用聊天栏提督欢迎信息", - "bilibili-danmaku.config.chatWelcomeGuardLv2Enable.comment": "在聊天栏展示进入直播间的提督。", - "bilibili-danmaku.config.chatWelcomeGuardLv3Enable.name": "启用聊天栏舰长欢迎信息", - "bilibili-danmaku.config.chatWelcomeGuardLv3Enable.comment": "在聊天栏展示进入直播间的舰长。", - "bilibili-danmaku.config.chatWelcomeNormalEnable.name": "启用聊天栏普通观众欢迎信息", - "bilibili-danmaku.config.chatWelcomeNormalEnable.comment": "在聊天栏展示进入直播间的普通观众。", + "bilibili-danmaku.config.toggle_chat.chatDanmakuEnable.name": "启用聊天栏弹幕", + "bilibili-danmaku.config.toggle_chat.chatDanmakuEnable.comment": "在聊天栏展示收到的弹幕。", + "bilibili-danmaku.config.toggle_chat.chatGiftEnable.name": "启用聊天栏礼物", + "bilibili-danmaku.config.toggle_chat.chatGiftEnable.comment": "在聊天栏展示收到的礼物。", + "bilibili-danmaku.config.toggle_chat.chatGuardBuyEnable.name": "启用聊天栏大航海购买提示总开关", + "bilibili-danmaku.config.toggle_chat.chatGuardBuyEnable.comment": "在聊天栏展示大航海购买信息,记得感谢Ta哦~", + "bilibili-danmaku.config.toggle_chat.chatGuardBuyLevel1Enable.name": "启用聊天栏总督购买提示", + "bilibili-danmaku.config.toggle_chat.chatGuardBuyLevel1Enable.comment": "在聊天栏展示总督购买信息,记得感谢Ta哦~", + "bilibili-danmaku.config.toggle_chat.chatGuardBuyLevel2Enable.name": "启用聊天栏提督购买提示", + "bilibili-danmaku.config.toggle_chat.chatGuardBuyLevel2Enable.comment": "在聊天栏展示提督购买信息,记得感谢Ta哦~", + "bilibili-danmaku.config.toggle_chat.chatGuardBuyLevel3Enable.name": "启用聊天栏舰长购买提示", + "bilibili-danmaku.config.toggle_chat.chatGuardBuyLevel3Enable.comment": "在聊天栏展示舰长购买信息,记得感谢Ta哦~", + "bilibili-danmaku.config.toggle_chat.chatSuperChatEnable.name": "启用聊天栏醒目留言", + "bilibili-danmaku.config.toggle_chat.chatSuperChatEnable.comment": "在聊天栏展示醒目留言。", + "bilibili-danmaku.config.toggle_chat.chatWelcomeEnable.name": "启用聊天栏欢迎信息总开关", + "bilibili-danmaku.config.toggle_chat.chatWelcomeEnable.comment": "在聊天栏展示进入直播间的观众。", + "bilibili-danmaku.config.toggle_chat.chatWelcomeGuardEnable.name": "启用聊天栏大航海欢迎信息", + "bilibili-danmaku.config.toggle_chat.chatWelcomeGuardEnable.comment": "在聊天栏展示进入直播间的大航海观众。", + "bilibili-danmaku.config.toggle_chat.chatWelcomeGuardLv1Enable.name": "启用聊天栏总督欢迎信息", + "bilibili-danmaku.config.toggle_chat.chatWelcomeGuardLv1Enable.comment": "在聊天栏展示进入直播间的总督。", + "bilibili-danmaku.config.toggle_chat.chatWelcomeGuardLv2Enable.name": "启用聊天栏提督欢迎信息", + "bilibili-danmaku.config.toggle_chat.chatWelcomeGuardLv2Enable.comment": "在聊天栏展示进入直播间的提督。", + "bilibili-danmaku.config.toggle_chat.chatWelcomeGuardLv3Enable.name": "启用聊天栏舰长欢迎信息", + "bilibili-danmaku.config.toggle_chat.chatWelcomeGuardLv3Enable.comment": "在聊天栏展示进入直播间的舰长。", + "bilibili-danmaku.config.toggle_chat.chatWelcomeNormalEnable.name": "启用聊天栏普通观众欢迎信息", + "bilibili-danmaku.config.toggle_chat.chatWelcomeNormalEnable.comment": "在聊天栏展示进入直播间的普通观众。", - "bilibili-danmaku.config.formatChatAdmin.name": "聊天栏房管弹幕格式", - "bilibili-danmaku.config.formatChatAdmin.comment": "当房管在直播间中发言时展示的弹幕格式。", - "bilibili-danmaku.config.formatChatBuyGuardLv1.name": "聊天栏总督欢迎购买提示格式", - "bilibili-danmaku.config.formatChatBuyGuardLv1.comment": "当观众购买总督时的提示信息格式,记得感谢Ta哦~", - "bilibili-danmaku.config.formatChatBuyGuardLv2.name": "聊天栏提督欢迎购买提示格式", - "bilibili-danmaku.config.formatChatBuyGuardLv2.comment": "当观众购买提督时的提示信息格式,记得感谢Ta哦~", - "bilibili-danmaku.config.formatChatBuyGuardLv3.name": "聊天栏舰长欢迎购买提示格式", - "bilibili-danmaku.config.formatChatBuyGuardLv3.comment": "当观众购买舰长时的提示信息格式,记得感谢Ta哦~", - "bilibili-danmaku.config.formatChatDanmakuGuard.name": "聊天栏大航海弹幕格式", - "bilibili-danmaku.config.formatChatDanmakuGuard.comment": "当大航海观众在直播间中发言时展示的弹幕格式。", - "bilibili-danmaku.config.formatChatDanmakuNormal.name": "聊天栏普通观众弹幕格式", - "bilibili-danmaku.config.formatChatDanmakuNormal.comment": "当普通观众在直播间中发言时展示的弹幕格式。", - "bilibili-danmaku.config.formatChatGifts.name": "聊天栏礼物格式", - "bilibili-danmaku.config.formatChatGifts.comment": "当收到礼物时展示的信息格式。", - "bilibili-danmaku.config.formatChatSuperChat.name": "聊天栏醒目留言格式", - "bilibili-danmaku.config.formatChatSuperChat.comment": "当收到醒目留言时展示的信格式息。", - "bilibili-danmaku.config.formatChatWelcomeGuardLv1.name": "聊天栏总督欢迎信息格式", - "bilibili-danmaku.config.formatChatWelcomeGuardLv1.comment": "当总督进入直播间时展示的欢迎信息格式。", - "bilibili-danmaku.config.formatChatWelcomeGuardLv2.name": "聊天栏提督欢迎信息格式", - "bilibili-danmaku.config.formatChatWelcomeGuardLv2.comment": "当提督进入直播间时展示的欢迎信息格式。", - "bilibili-danmaku.config.formatChatWelcomeGuardLv3.name": "聊天栏舰长欢迎信息格式", - "bilibili-danmaku.config.formatChatWelcomeGuardLv3.comment": "当舰长进入直播间时展示的欢迎信息格式。", - "bilibili-danmaku.config.formatChatWelcomeNormal.name": "聊天栏普通观众欢迎信息格式", - "bilibili-danmaku.config.formatChatWelcomeNormal.comment": "当普通观众进入直播间时展示的欢迎信息格式。", + "bilibili-danmaku.config.format_chat.formatChatAdmin.name": "聊天栏房管弹幕格式", + "bilibili-danmaku.config.format_chat.formatChatAdmin.comment": "当房管在直播间中发言时展示的弹幕格式。", + "bilibili-danmaku.config.format_chat.formatChatBuyGuardLv1.name": "聊天栏总督欢迎购买提示格式", + "bilibili-danmaku.config.format_chat.formatChatBuyGuardLv1.comment": "当观众购买总督时的提示信息格式,记得感谢Ta哦~", + "bilibili-danmaku.config.format_chat.formatChatBuyGuardLv2.name": "聊天栏提督欢迎购买提示格式", + "bilibili-danmaku.config.format_chat.formatChatBuyGuardLv2.comment": "当观众购买提督时的提示信息格式,记得感谢Ta哦~", + "bilibili-danmaku.config.format_chat.formatChatBuyGuardLv3.name": "聊天栏舰长欢迎购买提示格式", + "bilibili-danmaku.config.format_chat.formatChatBuyGuardLv3.comment": "当观众购买舰长时的提示信息格式,记得感谢Ta哦~", + "bilibili-danmaku.config.format_chat.formatChatDanmakuGuard.name": "聊天栏大航海弹幕格式", + "bilibili-danmaku.config.format_chat.formatChatDanmakuGuard.comment": "当大航海观众在直播间中发言时展示的弹幕格式。", + "bilibili-danmaku.config.format_chat.formatChatDanmakuNormal.name": "聊天栏普通观众弹幕格式", + "bilibili-danmaku.config.format_chat.formatChatDanmakuNormal.comment": "当普通观众在直播间中发言时展示的弹幕格式。", + "bilibili-danmaku.config.format_chat.formatChatGifts.name": "聊天栏礼物格式", + "bilibili-danmaku.config.format_chat.formatChatGifts.comment": "当收到礼物时展示的信息格式。", + "bilibili-danmaku.config.format_chat.formatChatSuperChat.name": "聊天栏醒目留言格式", + "bilibili-danmaku.config.format_chat.formatChatSuperChat.comment": "当收到醒目留言时展示的信格式息。", + "bilibili-danmaku.config.format_chat.formatChatWelcomeGuardLv1.name": "聊天栏总督欢迎信息格式", + "bilibili-danmaku.config.format_chat.formatChatWelcomeGuardLv1.comment": "当总督进入直播间时展示的欢迎信息格式。", + "bilibili-danmaku.config.format_chat.formatChatWelcomeGuardLv2.name": "聊天栏提督欢迎信息格式", + "bilibili-danmaku.config.format_chat.formatChatWelcomeGuardLv2.comment": "当提督进入直播间时展示的欢迎信息格式。", + "bilibili-danmaku.config.format_chat.formatChatWelcomeGuardLv3.name": "聊天栏舰长欢迎信息格式", + "bilibili-danmaku.config.format_chat.formatChatWelcomeGuardLv3.comment": "当舰长进入直播间时展示的欢迎信息格式。", + "bilibili-danmaku.config.format_chat.formatChatWelcomeNormal.name": "聊天栏普通观众欢迎信息格式", + "bilibili-danmaku.config.format_chat.formatChatWelcomeNormal.comment": "当普通观众进入直播间时展示的欢迎信息格式。", - "bilibili-danmaku.config.debugMode.name": "调试模式", - "bilibili-danmaku.config.debugMode.comment": "启用调试日志,及相关调试选项", - "bilibili-danmaku.config.initApiUrl.name": "获取直播间信息地址", - "bilibili-danmaku.config.initApiUrl.comment": "请不要修改,除非你知道你在做什么", - "bilibili-danmaku.config.websocketUri.name": "直播姬Websocket通信地址", - "bilibili-danmaku.config.websocketUri.comment": "请不要修改,除非你知道你在做什么" + "bilibili-danmaku.config.debug.debugMode.name": "调试模式", + "bilibili-danmaku.config.debug.debugMode.comment": "启用调试日志,及相关调试选项", + "bilibili-danmaku.config.debug.initApiUrl.name": "获取直播间信息地址", + "bilibili-danmaku.config.debug.initApiUrl.comment": "请不要修改,除非你知道你在做什么", + "bilibili-danmaku.config.debug.websocketUri.name": "直播姬Websocket通信地址", + "bilibili-danmaku.config.debug.websocketUri.comment": "请不要修改,除非你知道你在做什么" } diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 7d50176..8a92cf1 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -32,7 +32,6 @@ ], "depends": { "fabricloader": ">=0.9.0", - "magiclib": ">=0.2.4 <0.3", - "malilib": ">=0.10.0-dev.21" + "magiclib": ">=0.3.24" } }