From bf70425b8f70e3ce60fe80ee418527811f47a88b Mon Sep 17 00:00:00 2001 From: DarkKronicle Date: Mon, 5 Sep 2022 15:04:56 -0600 Subject: [PATCH] Fixing crash on tab complete --- .github/workflows/beta.yml | 19 +++++++++++ .github/workflows/publish.yml | 34 +++++++++++++++++++ build.gradle | 29 ++-------------- gradle.properties | 31 +++++++++++++---- .../chat/ChatSuggestorGui.java | 4 +-- 5 files changed, 82 insertions(+), 35 deletions(-) create mode 100644 .github/workflows/beta.yml create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml new file mode 100644 index 0000000..1ba42fd --- /dev/null +++ b/.github/workflows/beta.yml @@ -0,0 +1,19 @@ +on: + push: + branches: + - main +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@main + - name: Set up JDK 17 + uses: actions/setup-java@v1 + with: + java-version: 17 + - name: Upload to Discord + run: ./gradlew discord --stacktrace + if: | + !contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.pull_request.title, '[ci skip]') + env: + discord_webhook: ${{ secrets.DISCORD_WEBHOOK }} \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..247cada --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,34 @@ +on: + workflow_dispatch: + inputs: + previousVersion: + description: 'Previous Version (Do not include v prefix, must be same as the last version tag! Example: 1.4.1)' + required: true + version: + description: 'Version (Do not include v prefix! Example: 1.4.2)' + required: true +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@main + - name: Fetch tags + run: git fetch --tags + - name: Set up JDK 17 + uses: actions/setup-java@v1 + with: + java-version: 17 + - name: Upload to websites + run: ./gradlew publishThirdParty --stacktrace -PlastTag="v${{ github.event.inputs.previousVersion }}" -PcurrentTag="v${{ github.event.inputs.version }}" + if: | + !contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.pull_request.title, '[ci skip]') + env: + modrinth_token: ${{ secrets.MODRINTH_TOKEN }} + curseforge_token: ${{ secrets.CURSEFORGE_TOKEN }} + github_token: ${{ secrets.GH_API_KEY }} + discord_release_webhook: ${{ secrets.DISCORD_ANNOUNCEMENT_WEBHOOK }} + - name: Capture build artifacts + uses: actions/upload-artifact@v2 + with: + name: Artifacts + path: build/libs/ \ No newline at end of file diff --git a/build.gradle b/build.gradle index 49b8489..ef1aaf8 100644 --- a/build.gradle +++ b/build.gradle @@ -2,9 +2,10 @@ plugins { id 'fabric-loom' version '0.12-SNAPSHOT' id 'maven-publish' id "io.freefair.lombok" version "6.0.0-m2" - id "com.diffplug.spotless" version "5.17.1" } +apply from: 'https://raw.githubusercontent.com/DarkKronicle/GradleScripts/main/gradle/publish.gradle' + sourceCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_17 @@ -63,9 +64,6 @@ tasks.withType(JavaCompile).configureEach { } 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() } @@ -73,24 +71,6 @@ jar { from "LICENSE.txt" } -spotless { - ratchetFrom 'origin/main' - format 'misc', { - // define the files to apply `misc` to - target '*.gradle', '*.md', '.gitignore' - - // define the steps to apply to those files - trimTrailingWhitespace() - indentWithTabs() // or spaces. Takes an integer argument if you don't like 4 - endWithNewline() - } - java { - target 'src/*/java/**/*.java' - removeUnusedImports() - licenseHeaderFile "HEADER.txt" - } -} - // configure the maven publication publishing { publications { @@ -107,9 +87,6 @@ publishing { // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing. 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. + } } diff --git a/gradle.properties b/gradle.properties index e7569b9..9d3a811 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,13 +1,30 @@ -minecraft_version=1.19 -yarn_mappings=1.19+build.4 -loader_version=0.14.8 -fabric_api_version=0.57.0+1.19 +minecraft_version=1.19.2 +yarn_mappings=1.19.2+build.1 +loader_version=0.14.9 +fabric_api_version=0.59.0+1.19.2 -mod_version=1.1.5 +mod_version=1.1.6 maven_group=io.github.darkkronicle archives_base_name=AdvancedChatBox malilib_version = 0.13.0 -advancedchat_version=1.5.3-build1 +advancedchat_version=1.5.7 mxparser_version=4.4.2 -org.gradle.jvmargs=-Xmx1G \ No newline at end of file +org.gradle.jvmargs=-Xmx1G + +# Uploading data +curseforge_slug=advancedchatbox +curseforge_id=541714 + +modrinth_slug=advancedchatbox +modrinth_id=8WeCY8Xd + +# default_release_type can be stable, beta, or alpha +default_release_type=stable +project_name=AdvancedChatBox +project_url=https://modrinth.com/mod/advancedchatbox +project_logo=https://raw.githubusercontent.com/DarkKronicle/AdvancedChatBox/main/src/main/resources/assets/advancedchatbox/icon.png +project_color=0x4480ad +changelog_hide_unimportant_commits=true +changelog_max_commit_search=200 +discord_webhook_changelog_line_limit=10 \ No newline at end of file diff --git a/src/main/java/io/github/darkkronicle/advancedchatbox/chat/ChatSuggestorGui.java b/src/main/java/io/github/darkkronicle/advancedchatbox/chat/ChatSuggestorGui.java index 3fd158f..c0c612a 100644 --- a/src/main/java/io/github/darkkronicle/advancedchatbox/chat/ChatSuggestorGui.java +++ b/src/main/java/io/github/darkkronicle/advancedchatbox/chat/ChatSuggestorGui.java @@ -452,8 +452,8 @@ public void select(int index) { Suggestion suggestion = this.suggestions.get(this.selection); ChatSuggestorGui.this.textField.setSuggestion(ChatSuggestorGui .getSuggestionSuffix(ChatSuggestorGui.this.textField.getText(), suggestion.apply(this.typedText))); - if (NarratorManager.INSTANCE.isActive() && this.lastNarrationIndex != this.selection) { - NarratorManager.INSTANCE.narrate(this.getNarration()); + if (client.getNarratorManager().isActive() && this.lastNarrationIndex != this.selection) { + client.getNarratorManager().narrate(this.getNarration()); } }