diff --git a/.github/ISSUE_TEMPLATE/01_bug_report.yml b/.github/ISSUE_TEMPLATE/01_bug_report.yml deleted file mode 100644 index b11d613..0000000 --- a/.github/ISSUE_TEMPLATE/01_bug_report.yml +++ /dev/null @@ -1,128 +0,0 @@ -name: "Bug Report" -description: "Create a report to help us improve Reden Mod" -title: "[Bug]: " -labels: ["bug"] -assignees: ["zly2006", "Cubik65536"] - -body: - - type: markdown - attributes: - value: | - Thanks for taking the time to report an issue. - - > ### Important! :warning: - > - > The issue list is reserved exclusively for bug reports and feature requests. That means we do not accept usage questions. - > If you open an issue that does not conform to the requirements, it will be closed. - > - > For usage questions, please refer to the following resources: - > * [Join our QQ Group](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=FydjtxbXtobkK9aYrLt9zwW_CVi4Ep2n&authKey=%2BLarhXwt%2BZF2K9GpL9obcswcHff3A%2BkwekRQ9S4wxu0teuFqXIR9Pi5FrJXnv3Bc&noverify=0&group_code=708842363) - > * [Join our Discord Server](https://discord.gg/jUUPjgyAz5) - - - type: checkboxes - id: confirm - attributes: - label: "Please choose if applies:" - description: If you are a developer and you are willing to contribute codes to fix this issue, please check the following option. - options: - - label: I'm currently working on a fix. - required: false - - - type: textarea - id: issue-description - validations: - required: true - attributes: - label: Issue Description - description: | - A clear and concise description of what the bug is. - Please, explain whether it's a build-time error or a runtime error. - placeholder: | - When I do , happens and I see the following error message: - - ``` - - ``` - - Expected behavior: - - When I do , should happen instead. - - - type: textarea - id: reproduction - validations: - required: true - attributes: - label: Reproduction - description: | - Add commands used or steps taken to reproduce the behaviour. - Include links, references or anything else that will give us more context about the issue you are encountering. - placeholder: | - 1. Download application from Release - 2. Click '...' after setting to '...' - 3. See error - - - type: textarea - id: logs - validations: - required: true - attributes: - label: Relevant log output (if applicable) - description: | - Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks. - When pasting verbose logs, please make sure you remove any sensitive information. - If they are too long, please use [Pastebin](https://pastebin.com/) or [GitHub Gist](https://gist.github.com/) and paste the link here. - Or consider using some other services that allows you to directly upload log zip files. - render: Shell - - - type: textarea - id: environment - validations: - required: true - attributes: - label: Environment - description: | - Environment (Operating System, Reden Mod Version, etc.) in which the issue was encountered. - examples: - - **Operating System**: macOS 14.0 Beta (23A5328b) - - **Minecraft Version**: 1.20.1 - - **Reden Mod Version (or commit number)**: 0.1+08272323 - value: | - - **Operating System**: - - **Minecraft Version**: - - **Reden Mod Version (or commit number)**: - - - type: markdown - attributes: - value: | - --------- - - Before you submit this issue, please confirm the following: - - **1. Is there an existing issue for this?** - - Please search to see if an issue already exists for the bug you encountered. - - **2. Confirm you are submitting a bug report** - - Please confirm you are submitting a bug report and not a usage question. - - **3. Confirm this bug still exists in the newest version of Reden Mod** - - Please confirm that the bug still exists in the newest version (commit) of Reden Mod. - - --------- - - - type: checkboxes - id: terms - attributes: - label: Please accept these terms - options: - - label: I have searched the [existing issues](https://github.com/zly2006/reden-is-what-we-made/issues) and this has not been posted before - required: true - - label: This is a bug report - required: true - - label: This bug still exists - required: true - - label: I enabled `redenDebug` in carpet or `debugLogger` options in malilib screen for my log - required: true diff --git a/.github/ISSUE_TEMPLATE/02_feature_request.yml b/.github/ISSUE_TEMPLATE/02_feature_request.yml deleted file mode 100644 index 28db6d2..0000000 --- a/.github/ISSUE_TEMPLATE/02_feature_request.yml +++ /dev/null @@ -1,70 +0,0 @@ -name: "Feature Request" -description: "Suggest an idea for Reden Mod" -title: "[Feature Request]: " -labels: ["enhancement"] -assignees: ["zly2006", "Cubik65536"] - -body: - - type: markdown - attributes: - value: | - Thanks for taking the time to request a feature for Reden Mod! - - > ### Important! :warning: - > - > The issue list is reserved exclusively for bug reports and feature requests. That means we do not accept usage questions. - > If you open an issue that does not conform to the requirements, it will be closed. - > - > For usage questions, please refer to the following resources: - > * [Join our QQ Group](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=FydjtxbXtobkK9aYrLt9zwW_CVi4Ep2n&authKey=%2BLarhXwt%2BZF2K9GpL9obcswcHff3A%2BkwekRQ9S4wxu0teuFqXIR9Pi5FrJXnv3Bc&noverify=0&group_code=708842363) - > * [Join our Discord Server](https://discord.gg/jUUPjgyAz5) - - - type: checkboxes - id: confirm - attributes: - label: "Please choose if applies:" - description: If you are a developer and you are willing to contribute codes to implement this feature, please check the following option. - options: - - label: I'm currently working on adding this feature. - required: false - - - type: textarea - id: solution-description - validations: - required: true - attributes: - label: Describe the solution you'd like - description: A clear and concise description of what you want to happen. - - - type: textarea - id: alternative-description - attributes: - label: Describe alternatives you've considered - description: A clear and concise description of any alternative solutions or features you've considered. - - - type: textarea - id: anything-else - attributes: - label: Anything else? - description: Add any other context, code examples, or references to existing implementations about the feature request here. - - - type: markdown - attributes: - value: | - --------- - - Before you submit this issue, please confirm the following: - - **1. Is there an existing issue for this?** - - Please search to see if an issue related to this feature request already exists. - - --------- - - - type: checkboxes - id: terms - attributes: - label: Please accept these terms - options: - - label: I have searched the [existing issues](https://github.com/zly2006/reden-is-what-we-made/issues) and this has not been posted before - required: true diff --git a/.github/ISSUE_TEMPLATE/09_others.yml b/.github/ISSUE_TEMPLATE/09_others.yml deleted file mode 100644 index d3e7576..0000000 --- a/.github/ISSUE_TEMPLATE/09_others.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: "Others" -description: "Others type of issue" -title: "[Others]: " - -body: - - type: markdown - attributes: - value: | - > ### Important! :warning: - > - > The issue list is reserved exclusively for bug reports and feature requests. That means we do not accept usage questions. - > If you open an issue that does not conform to the requirements, it will be closed. - > - > For usage questions, please refer to the following resources: - > * [Join our QQ Group](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=FydjtxbXtobkK9aYrLt9zwW_CVi4Ep2n&authKey=%2BLarhXwt%2BZF2K9GpL9obcswcHff3A%2BkwekRQ9S4wxu0teuFqXIR9Pi5FrJXnv3Bc&noverify=0&group_code=708842363) - > * [Join our Discord Server](https://discord.gg/jUUPjgyAz5) - - - type: textarea - id: description - validations: - required: true - attributes: - label: Description diff --git a/.github/ISSUE_TEMPLATE/11_bug_report_zh-CN.yml b/.github/ISSUE_TEMPLATE/11_bug_report_zh-CN.yml deleted file mode 100644 index 42d551b..0000000 --- a/.github/ISSUE_TEMPLATE/11_bug_report_zh-CN.yml +++ /dev/null @@ -1,126 +0,0 @@ -name: "Bug 反馈" -description: "创建一个报告帮助我们改进 Reden Mod" -title: "[Bug]: <在此处简单描述一些你将要反馈的 Bug>" -labels: ["bug"] -assignees: ["zly2006", "Cubik65536"] - -body: - - type: markdown - attributes: - value: | - 感谢您参与反馈问题。 - - > ### 重要! :warning: - > - > issue 专为报告问题以及请求新功能而设。这意味着我们不会在此处接受任何关于使用的问题。 - > 如果您打开的 issue 不符合要求,它将被关闭。 - > - > 对于使用上的问题,请参考以下资源: - > * [加入 QQ 群](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=FydjtxbXtobkK9aYrLt9zwW_CVi4Ep2n&authKey=%2BLarhXwt%2BZF2K9GpL9obcswcHff3A%2BkwekRQ9S4wxu0teuFqXIR9Pi5FrJXnv3Bc&noverify=0&group_code=708842363) - > * [加入 Discord 服务器](https://discord.gg/jUUPjgyAz5) - - - type: checkboxes - id: confirm - attributes: - label: 请选择: - description: 如果您是开发者并且愿意为 Reden Mod 贡献代码来修复这个问题,请勾选以下选项。 - options: - - label: 我正在着手修复这个问题 - required: false - - - type: textarea - id: issue-description - validations: - required: true - attributes: - label: 问题描述 - description: | - 清晰简洁的描述您遇到的错误。 - 请告诉我们它是构建时错误还是运行时错误。 - placeholder: | - 当我执行 时,会发生 并且我看到以下错误消息: - - ``` - <错误信息> - ``` - - 预期行为: - - 当我执行 时,应该发生 。 - - - type: textarea - id: reproduction - validations: - required: true - attributes: - label: 重现 - description: | - 添加用于重现行为的命令或采取的步骤。 - 包括链接、参考资料以及其他任何可以帮助我们了解您遇到的问题的内容。 - placeholder: | - 1. 从 Release 下载应用 - 2. 点击 '...' 并将 设置为 '...' - 3. 看到错误 - - - type: textarea - id: logs - attributes: - label: 相关日志输出(如果有) - description: | - 请复制并粘贴任何相关的日志输出。您的内容会自动被格式化为代码。 - 粘贴详细日志时,请确保删除所有敏感信息。 - 如果日志过长,请使用 [Pastebin](https://pastebin.com/) 或 [GitHub Gist](https://gist.github.com/) 并将链接粘贴在此处。 - 或者考虑使用其他允许您直接上传日志 zip 文件的服务。 - render: Shell - - - type: textarea - id: environment - validations: - required: true - attributes: - label: 环境 - description: | - 请告诉我们您遇到问题的环境(操作系统、Reden Mod 版本等)。 - 示例: - - **操作系统**: macOS 14.0 Beta (23A5328b) - - **Minecraft 版本**: 1.20.1 - - **Reden Mod 版本(或 commit SHA)**: 0.1+08272323 - value: | - - **操作系统**: - - **Minecraft 版本**: - - **Reden Mod 版本(或 commit SHA):**: - - - type: markdown - attributes: - value: | - --------- - - 在您提交本 issue 之前,请确认以下内容: - - **1. 本问题是否已经被反馈过了?** - - 请确认是否已经有 issue 反馈过了本问题。 - - **2. 确认您提交的是错误报告** - - 请确认您提交的是错误报告,而不是使用上的问题。 - - **3. 确认本错误仍然存在于最新版本的 Reden Mod 中** - - 请确认本错误仍然存在于最新版本(或提交)的 Reden Mod 中。 - - --------- - - - type: checkboxes - id: terms - attributes: - label: 请确认以下条款 - options: - - label: 我已经查看了 [已有 issue](https://github.com/zly2006/reden-is-what-we-made/issues) 并确定我提交的问题并没有重复 - required: true - - label: 本 issue 是 bug 反馈 - required: true - - label: 本 bug 在最新版本中仍存在 - required: true - - label: 我在carpet中启用了`redenDebug`选项或在malilib配置中启用了`debugLogger`选项 - required: true diff --git a/.github/ISSUE_TEMPLATE/12_feature_request_zh-CN.yml b/.github/ISSUE_TEMPLATE/12_feature_request_zh-CN.yml deleted file mode 100644 index e295f70..0000000 --- a/.github/ISSUE_TEMPLATE/12_feature_request_zh-CN.yml +++ /dev/null @@ -1,70 +0,0 @@ -name: "功能请求" -description: "为 Reden Mod 提供方案或解决思路" -title: "[功能请求]: <在此处简单描述一些你将要请求的功能>" -labels: ["enhancement"] -assignees: ["zly2006", "Cubik65536"] - -body: - - type: markdown - attributes: - value: | - 感谢您为 Reden Mod 提供新的方案或解决思路! - - > ### 重要! :warning: - > - > issue 专为报告问题以及请求新功能而设。这意味着我们不会在此处接受任何关于使用的问题。 - > 如果您打开的 issue 不符合要求,它将被关闭。 - > - > 对于使用上的问题,请参考以下资源: - > * [加入 QQ 群](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=FydjtxbXtobkK9aYrLt9zwW_CVi4Ep2n&authKey=%2BLarhXwt%2BZF2K9GpL9obcswcHff3A%2BkwekRQ9S4wxu0teuFqXIR9Pi5FrJXnv3Bc&noverify=0&group_code=708842363) - > * [加入 Discord 服务器](https://discord.gg/jUUPjgyAz5) - - - type: checkboxes - id: confirm - attributes: - label: 请选择: - description: 如果您是开发者并且愿意为 Reden Mod 贡献代码来实现这个功能,请勾选以下选项。 - options: - - label: 我正在着手增加这个功能 - required: false - - - type: textarea - id: solution-description - validations: - required: true - attributes: - label: 描述您想要的解决方案 - description: 清晰简洁的描述您想要的解决方案 - - - type: textarea - id: alternative-description - attributes: - label: 描述您考虑过的替代方案 - description: 清晰简洁的描述您考虑过的替代解决方案或功能。 - - - type: textarea - id: anything-else - attributes: - label: 还有其他的吗? - description: 在此处添加任何与功能请求相关的内容、代码示例或现有实现。 - - - type: markdown - attributes: - value: | - --------- - - 在您提交本 issue 之前,请确认以下内容: - - **1. 是否已经有现有的 issue 请求了这个功能?** - - 请确认是否已经有与该功能请求的 issue。 - - --------- - - - type: checkboxes - id: terms - attributes: - label: 请确认以下条款 - options: - - label: 我已经查看了 [已有 issue](https://github.com/zly2006/reden-is-what-we-made/issues) 并确定没有人提交过与此功能请求相关的 issue - required: true \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/19_others_zh-CN.yml b/.github/ISSUE_TEMPLATE/19_others_zh-CN.yml deleted file mode 100644 index ddc0d2a..0000000 --- a/.github/ISSUE_TEMPLATE/19_others_zh-CN.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: "其他问题" -description: "其他类型的问题" -title: "[其他]: " - -body: - - type: markdown - attributes: - value: | - > ### 重要! :warning: - > - > issue 专为报告问题以及请求新功能而设。这意味着我们不会在此处接受任何关于使用的问题。 - > 如果您打开的 issue 不符合要求,它将被关闭。 - > - > 对于使用上的问题,请参考以下资源: - > * [加入 QQ 群](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=FydjtxbXtobkK9aYrLt9zwW_CVi4Ep2n&authKey=%2BLarhXwt%2BZF2K9GpL9obcswcHff3A%2BkwekRQ9S4wxu0teuFqXIR9Pi5FrJXnv3Bc&noverify=0&group_code=708842363) - > * [加入 Discord 服务器](https://discord.gg/jUUPjgyAz5) - - - type: textarea - id: description - validations: - required: true - attributes: - label: 描述 diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 4495f76..857d8b0 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,8 +1,8 @@ blank_issues_enabled: false contact_links: - - name: Join QQ Group | 加入 QQ 群 - url: http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=FydjtxbXtobkK9aYrLt9zwW_CVi4Ep2n&authKey=%2BLarhXwt%2BZF2K9GpL9obcswcHff3A%2BkwekRQ9S4wxu0teuFqXIR9Pi5FrJXnv3Bc&noverify=0&group_code=708842363 - about: Ask questions and discuss with Reden Mod maintainers and community | 和 Reden Mod 维护者和社区讨论 - - name: Join Discord Server | 加入 Discord 服务器 + - name: Go to Reden + url: https://github.com/zly2006/reden-is-wjat-we-made + about: This mod is hard forked from Reden Mod, and it is not officially supported by Reden Mod maintainers. + - name: Join Discord Server url: https://discord.gg/jUUPjgyAz5 - about: Ask questions and discuss with Reden Mod maintainers and community | 和 Reden Mod 维护者和社区讨论 + about: Ask questions and discuss with Reden Mod maintainers and community diff --git a/.github/workflows/build-and-publish-latest.yml b/.github/workflows/build-and-publish-latest.yml deleted file mode 100644 index 6d55737..0000000 --- a/.github/workflows/build-and-publish-latest.yml +++ /dev/null @@ -1,107 +0,0 @@ -name: Build Stable Release version and Publish - -on: - release: - # It is recommended to set the release tag as "v..-patch." (e.g. "v.1.0-patch.1") when creating a release. - types: [released] - -jobs: - build-and-publish-pre-release: - strategy: - matrix: - # Use thses Java versions: - java: [17] # Only use the latest Java LTS - # Use these operating systems: - os: [ubuntu-latest] - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@v3 - with: - distribution: temurin - java-version: ${{ matrix.java }} - - name: Show Java version - run: java -version - - name: Validate Gradle Wrapper - uses: gradle/wrapper-validation-action@v1 - - name: Setup Gradle - uses: gradle/gradle-build-action@v2 - - name: Show Gradle version - run: gradle --version - - - name: Build with Gradle - env: - REDEN_BUILD_TYPE: "RELEASE" - run: gradle build --stacktrace - - - name: Get Mod Info - id: get_mod_info - uses: christian-draeger/read-properties@1.1.1 - with: - path: gradle.properties - properties: 'mod_name mod_version' - - name: Get commit SHA - id: get_commit_sha - run: | - short_sha=$(echo ${GITHUB_SHA} | cut -c1-7) - echo "short_sha=$short_sha" >> $GITHUB_OUTPUT - - name: Get commit count - id: get_commit_count - run: | - commit_count=$(git log | grep -e '^commit [a-zA-Z0-9]*' | wc -l) - echo "commit_count=$commit_count" >> $GITHUB_OUTPUT - - - name: Upload assets to GitHub Action - uses: actions/upload-artifact@v3 - with: - name: "${{ steps.get_mod_info.outputs.mod_name }} ${{ steps.get_mod_info.outputs.mod_version }}.${{ steps.get_commit_count.outputs.commit_count }}+${{ steps.get_commit_sha.outputs.short_sha }}" - path: build/libs/*.jar - - - name: Publish to GitHub Releases - uses: ncipollo/release-action@v1 - with: - allowUpdates: true - artifacts: build/libs/*.jar - body: "[RELEASE-CI#${{ github.run_number }}] ${{ steps.get_mod_info.outputs.mod_name }} Mod Stable Release ${{ steps.get_mod_info.outputs.mod_version }}.${{ steps.get_commit_count.outputs.commit_count }}+${{ steps.get_commit_sha.outputs.short_sha }}" - generateReleaseNotes: true - makeLatest: true - tag: ${{ github.event.ref }} - - - name: Publish to Modrinth & CurseForge - uses: Kir-Antipov/mc-publish@v3.3 - with: - # Publish to Modrinth - modrinth-id: xRu8OXEJ - modrinth-token: ${{ secrets.MODRINTH_TOKEN }} - # Publish to CurseForge - curseforge-id: 903236 - curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} - # Universal Configurations - files: build/libs/*-@(stable).jar - - name: "${{ steps.get_mod_info.outputs.mod_name }} ${{ steps.get_mod_info.outputs.mod_version }}.${{ steps.get_commit_count.outputs.commit_count }}+${{ steps.get_commit_sha.outputs.short_sha }}" - version: "${{ steps.get_mod_info.outputs.mod_version }}.${{ steps.get_commit_count.outputs.commit_count }}+${{ steps.get_commit_sha.outputs.short_sha }}" - version-type: release - - loaders: fabric - game-versions: 1.20.1 - game-version-filter: any - - dependencies: | - carpet - malilib - fabric-api - fabric-language-kotlin - owo-lib - - java: | - 17 - 18 - 19 - 20 - retry-attempts: 2 - retry-delay: 10000 diff --git a/.github/workflows/build-and-publish-pre-release.yml b/.github/workflows/build-and-publish-pre-release.yml index 3de7bf3..2e57f95 100644 --- a/.github/workflows/build-and-publish-pre-release.yml +++ b/.github/workflows/build-and-publish-pre-release.yml @@ -1,12 +1,6 @@ name: Build Pre-Release version and Publish on: - workflow_dispatch: - inputs: - release-beta: - description: 'Publish a beta release?' - required: true - type: boolean push: branches: - '**' # Pushes to any branch @@ -24,14 +18,6 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 0 - - name: Store all lowercase commit message - run: | - echo COMMIT_MESSAGE=$( git log --format=%B --no-merges -n 1 | tr '[:upper:]' '[:lower:]' ) >> ${GITHUB_ENV} - echo COMMIT_MESSAGE_ALL=$( git log --format=%B --no-merges -n 1 ) >> ${GITHUB_ENV} - - name: Detect if a beta release should be published - if: ${{ contains(env.COMMIT_MESSAGE, '[publish beta]') || inputs.release-beta }} - run: | - echo "PUBLISH_BETA=true" >> ${GITHUB_ENV} - name: Set up JDK ${{ matrix.java }} uses: actions/setup-java@v3 with: @@ -45,17 +31,8 @@ jobs: uses: gradle/gradle-build-action@v2 - name: Show Gradle version run: gradle --version - - - name: Build with Gradle (DEV) - if : ${{ env.PUBLISH_BETA != 'true' }} run: gradle build --stacktrace - - name: Build with Gradle (BETA) - if : ${{ env.PUBLISH_BETA == 'true' }} - env: - REDEN_BUILD_TYPE: "BETA" - run: gradle build --stacktrace - - name: Get Mod Info id: get_mod_info uses: christian-draeger/read-properties@1.1.1 @@ -78,55 +55,3 @@ jobs: with: name: "[DEV-CI#${{ github.run_number }}] ${{ steps.get_mod_info.outputs.mod_name }} ${{ steps.get_mod_info.outputs.mod_version }}.${{ steps.get_commit_count.outputs.commit_count }}+${{ steps.get_commit_sha.outputs.short_sha }} - Java ${{ matrix.java }}" path: build/libs/*.jar - - - name: Publish to GitHub Pre-Releases - if: ${{ env.PUBLISH_BETA == 'true' && matrix.java == 17 }} # Only publish the version built with Java LTS - uses: ncipollo/release-action@v1 - with: - allowUpdates: true - artifacts: build/libs/*.jar - generateReleaseNotes: true - name: "[CI#${{ github.run_number }}] ${{ steps.get_mod_info.outputs.mod_name }} Mod Pre-Release ${{ steps.get_mod_info.outputs.mod_version }}.${{ steps.get_commit_count.outputs.commit_count }}+${{ steps.get_commit_sha.outputs.short_sha }}" - prerelease: true - tag: "beta/${{ steps.get_commit_sha.outputs.short_sha }}" - - - name: Publish to Modrinth & CurseForge - if: ${{ env.PUBLISH_BETA == 'true' && matrix.java == 17 }} # Only publish the version built with Java LTS - uses: Kir-Antipov/mc-publish@v3.3 - with: - # Publish to Modrinth - modrinth-id: xRu8OXEJ - modrinth-token: ${{ secrets.MODRINTH_TOKEN }} - # Publish to CurseForge - #curseforge-id: 903236 - #curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} - # Universal Configurations - files: | - build/libs/*-@(beta).jar - build/libs/*-@(beta)*@(ci)*[0123456789].jar - - name: "${{ steps.get_mod_info.outputs.mod_name }} Pre-Release ${{ steps.get_mod_info.outputs.mod_version }}.${{ steps.get_commit_count.outputs.commit_count }}+${{ steps.get_commit_sha.outputs.short_sha }}.github.ci.${{ github.run_number }}" - version: "${{ steps.get_mod_info.outputs.mod_version }}-beta+${{ steps.get_commit_sha.outputs.short_sha }}.ci.${{ github.run_number }}" - version-type: beta - - loaders: | - fabric - quilt - game-versions: 1.20.1 - game-version-filter: any - - dependencies: | - carpet - malilib - fabric-api - fabric-language-kotlin - owo-lib - - java: | - 17 - 18 - 19 - 20 - retry-attempts: 2 - retry-delay: 10000 - changelog: ${{ env.COMMIT_MESSAGE_ALL }} diff --git a/.github/workflows/build-pr.yml b/.github/workflows/build-pr.yml deleted file mode 100644 index 503a611..0000000 --- a/.github/workflows/build-pr.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: Build from Pull Request - -on: [pull_request] - -jobs: - build-pr: - strategy: - matrix: - # Use thses Java versions: - java: [17, 20] # Current Java LTS and current latest Java version - # Use these operating systems: - os: [ubuntu-latest] - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v3 - - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@v3 - with: - distribution: temurin - java-version: ${{ matrix.java }} - - name: Show Java version - run: java -version - - name: Validate Gradle Wrapper - uses: gradle/wrapper-validation-action@v1 - - name: Setup Gradle - uses: gradle/gradle-build-action@v2 - - name: Show Gradle version - run: gradle --version - - - - name: Build with Gradle - run: gradle build --stacktrace - - - name: Get Mod Info - id: get_mod_info - uses: christian-draeger/read-properties@1.1.1 - with: - path: gradle.properties - properties: 'mod_name mod_version' - - name: Get commit SHA - id: get_commit_sha - run: | - short_sha=$(echo ${GITHUB_SHA} | cut -c1-7) - echo "short_sha=$short_sha" >> $GITHUB_OUTPUT - - name: Get commit count - id: get_commit_count - run: | - commit_count=$(git log | grep -e '^commit [a-zA-Z0-9]*' | wc -l) - echo "commit_count=$commit_count" >> $GITHUB_OUTPUT - - - name: Upload assets to GitHub Action - uses: actions/upload-artifact@v3 - with: - name: "[PR-CI#${{ github.run_number }}] ${{ steps.get_mod_info.outputs.mod_name }} ${{ steps.get_mod_info.outputs.mod_version }}.${{ steps.get_commit_count.outputs.commit_count }}+${{ steps.get_commit_sha.outputs.short_sha }} - Java ${{ matrix.java }}" - path: build/libs/*.jar diff --git a/build.gradle b/build.gradle index 02abbb0..05a36e8 100644 --- a/build.gradle +++ b/build.gradle @@ -14,7 +14,7 @@ plugins { id "com.jfrog.artifactory" version "5.1.10" } -version = "project.mod_version" +version = project.mod_version group = project.maven_group allprojects { diff --git a/src/main/java/com/github/zly2006/reden/ModNames.java b/src/main/java/com/github/zly2006/reden/ModNames.java deleted file mode 100644 index ca29204..0000000 --- a/src/main/java/com/github/zly2006/reden/ModNames.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.github.zly2006.reden; - -public final class ModNames { - public static final String litematica = "litematica"; -} diff --git a/src/main/java/com/github/zly2006/reden/access/PlayerData.kt b/src/main/java/com/github/zly2006/reden/access/PlayerData.kt index 425825d..a49c4bc 100644 --- a/src/main/java/com/github/zly2006/reden/access/PlayerData.kt +++ b/src/main/java/com/github/zly2006/reden/access/PlayerData.kt @@ -120,7 +120,7 @@ ${data.map { "${BlockPos.fromLong(it.key).toShortString()} = ${it.value.state}" ) : UndoRedoRecord(id, lastChangedTick, entities, data) { var notified = false - enum class Cause(message: Text) { + enum class Cause(val message: Text) { BREAK_BLOCK(Text.translatable("reden.feature.undo.cause.break_block")), USE_BLOCK(Text.translatable("reden.feature.undo.cause.use_block")), USE_ITEM(Text.translatable("reden.feature.undo.cause.use_item")), @@ -128,7 +128,6 @@ ${data.map { "${BlockPos.fromLong(it.key).toShortString()} = ${it.value.state}" ATTACK_ENTITY(Text.translatable("reden.feature.undo.cause.attack_entity")), COMMAND(Text.translatable("reden.feature.undo.cause.command")), LITEMATICA_TASK(Text.translatable("reden.feature.undo.cause.litematica_task")), - PROJECTILE(Text.translatable("reden.feature.undo.cause.projectile")), UNKNOWN(Text.translatable("reden.feature.undo.cause.unknown")) } } diff --git a/src/main/java/com/github/zly2006/reden/access/ServerData.kt b/src/main/java/com/github/zly2006/reden/access/ServerData.kt index 2938102..0d88b85 100644 --- a/src/main/java/com/github/zly2006/reden/access/ServerData.kt +++ b/src/main/java/com/github/zly2006/reden/access/ServerData.kt @@ -7,6 +7,9 @@ import net.minecraft.client.MinecraftClient import net.minecraft.server.MinecraftServer import java.util.* +/** + * Note: in this fork it is client-side only. + */ class ServerData( val version: Version, mcServer: MinecraftServer? diff --git a/src/main/java/com/github/zly2006/reden/itemShadow/ItemStackOwner.kt b/src/main/java/com/github/zly2006/reden/itemShadow/ItemStackOwner.kt deleted file mode 100644 index 1b87462..0000000 --- a/src/main/java/com/github/zly2006/reden/itemShadow/ItemStackOwner.kt +++ /dev/null @@ -1,34 +0,0 @@ -package com.github.zly2006.reden.itemShadow - -import net.minecraft.block.entity.LecternBlockEntity -import net.minecraft.entity.ItemEntity -import net.minecraft.inventory.Inventory -import net.minecraft.item.ItemStack - -interface ItemStackOwner { - val type: Type - - enum class Type { - Inventory, - StackEntity, - Lectern, - } - - /** - * Check if the owner contains the stack. - * This is used by item shadowing, and only check reference equality. - */ - fun checkContains(stack: ItemStack): Boolean { - return when (type) { - Type.Inventory -> if (this is Inventory) { - this.containsAny { it === stack } - } else false - Type.Lectern -> if (this is LecternBlockEntity) { - this.book === stack - } else false - Type.StackEntity -> if (this is ItemEntity) { - this.stack === stack - } else false - } - } -} diff --git a/src/main/java/com/github/zly2006/reden/utils/TaskScheduler.kt b/src/main/java/com/github/zly2006/reden/utils/TaskScheduler.kt deleted file mode 100644 index 7e0c399..0000000 --- a/src/main/java/com/github/zly2006/reden/utils/TaskScheduler.kt +++ /dev/null @@ -1,18 +0,0 @@ -package com.github.zly2006.reden.utils - -import net.fabricmc.fabric.api.event.lifecycle.v1.ServerTickEvents -import net.minecraft.server.MinecraftServer - -object TaskScheduler: ServerTickEvents.EndTick { - val map = mutableMapOf>() - var ticks = 0 - fun runLater(delay: Int, runnable: Runnable) { - map.computeIfAbsent(ticks + delay) { mutableListOf() } - .add(runnable) - } - - override fun onEndTick(server: MinecraftServer) { - map.remove(ticks)?.forEach { it.run() } - ticks++ - } -} \ No newline at end of file diff --git a/src/main/resources/reden.accesswidener b/src/main/resources/reden.accesswidener index 695a920..45b9063 100644 --- a/src/main/resources/reden.accesswidener +++ b/src/main/resources/reden.accesswidener @@ -1,151 +1,9 @@ accessWidener v1 named -accessible class net/minecraft/world/block/ChainRestrictedNeighborUpdater$Entry -accessible field net/minecraft/world/World neighborUpdater Lnet/minecraft/world/block/NeighborUpdater; -accessible class net/minecraft/server/command/DataCommand$ModifyOperation -accessible field net/minecraft/block/AbstractBlock settings Lnet/minecraft/block/AbstractBlock$Settings; -accessible field net/minecraft/block/AbstractBlock$Settings mapColorProvider Ljava/util/function/Function; -accessible field net/minecraft/block/MapColor COLORS [Lnet/minecraft/block/MapColor; -accessible method net/minecraft/client/gui/screen/Screen remove (Lnet/minecraft/client/gui/Element;)V -accessible method net/minecraft/client/gui/hud/ChatHud toChatLineX (D)D -accessible method net/minecraft/client/gui/hud/ChatHud getMessageLineIndex (DD)I -accessible method net/minecraft/client/gui/hud/ChatHud toChatLineY (D)D -accessible field net/minecraft/client/gui/hud/ChatHud visibleMessages Ljava/util/List; -accessible class net/minecraft/client/render/chunk/ChunkBuilder$BuiltChunk$RebuildTask -accessible class net/minecraft/client/render/chunk/ChunkBuilder$BuiltChunk$RebuildTask$RenderData -accessible field net/minecraft/client/render/BufferBuilder format Lnet/minecraft/client/render/VertexFormat; -accessible field net/minecraft/nbt/NbtCompound entries Ljava/util/Map; -accessible field net/minecraft/structure/StructureTemplate size Lnet/minecraft/util/math/Vec3i; -accessible method net/minecraft/structure/StructureTemplate$PalettedBlockInfoList (Ljava/util/List;)V -accessible field net/minecraft/structure/StructureTemplate blockInfoLists Ljava/util/List; -accessible field net/minecraft/structure/StructureTemplate entities Ljava/util/List; -accessible method net/minecraft/client/gui/widget/ButtonWidget (IIIILnet/minecraft/text/Text;Lnet/minecraft/client/gui/widget/ButtonWidget$PressAction;Lnet/minecraft/client/gui/widget/ButtonWidget$NarrationSupplier;)V -mutable field net/minecraft/util/math/Vec3d x D -mutable field net/minecraft/util/math/Vec3d y D -mutable field net/minecraft/util/math/Vec3d z D -accessible field net/minecraft/entity/vehicle/AbstractMinecartEntity clientX D -accessible field net/minecraft/entity/vehicle/AbstractMinecartEntity clientY D -accessible field net/minecraft/entity/vehicle/AbstractMinecartEntity clientZ D -extendable class net/minecraft/world/tick/OrderedTick -extendable class net/minecraft/server/world/BlockEvent -accessible method net/minecraft/world/World getDestructionType (Lnet/minecraft/world/GameRules$Key;)Lnet/minecraft/world/explosion/Explosion$DestructionType; accessible field net/minecraft/world/chunk/Chunk heightmaps Ljava/util/Map; accessible field net/minecraft/command/EntitySelector PASSTHROUGH_FILTER Lnet/minecraft/util/TypeFilter; -accessible field net/minecraft/server/integrated/IntegratedServer localPlayerUuid Ljava/util/UUID; accessible field net/minecraft/server/world/ServerWorld syncedBlockEventQueue Lit/unimi/dsi/fastutil/objects/ObjectLinkedOpenHashSet; -accessible field net/minecraft/world/tick/WorldTickScheduler tickableTicks Ljava/util/Queue; -accessible field net/minecraft/world/tick/WorldTickScheduler tickedTicks Ljava/util/List; -accessible field net/minecraft/world/tick/WorldTickScheduler copiedTickableTicksList Ljava/util/Set; -accessible field net/minecraft/world/tick/ChunkTickScheduler queuedTicks Ljava/util/Set; -accessible field net/minecraft/block/entity/PistonBlockEntity progress F -accessible field net/minecraft/block/entity/PistonBlockEntity lastProgress F -accessible field net/minecraft/registry/Registries ROOT Lnet/minecraft/registry/MutableRegistry; -accessible method net/minecraft/client/network/ClientPlayerInteractionManager sendSequencedPacket (Lnet/minecraft/client/world/ClientWorld;Lnet/minecraft/client/network/SequencedPacketCreator;)V -accessible field net/minecraft/world/tick/ChunkTickScheduler tickQueue Ljava/util/Queue; -accessible field net/minecraft/server/world/ThreadedAnvilChunkStorage currentChunkHolders Lit/unimi/dsi/fastutil/longs/Long2ObjectLinkedOpenHashMap; -accessible method net/minecraft/server/world/ThreadedAnvilChunkStorage unloadChunks (Ljava/util/function/BooleanSupplier;)V -accessible field net/minecraft/server/world/ServerWorld entityManager Lnet/minecraft/server/world/ServerEntityManager; -accessible method net/minecraft/server/world/ThreadedAnvilChunkStorage updateHolderMap ()Z -accessible field net/minecraft/server/world/ThreadedAnvilChunkStorage chunkHolderListDirty Z -accessible method net/minecraft/server/world/ServerChunkManager tick ()Z -accessible field net/minecraft/server/world/ServerChunkManager ticketManager Lnet/minecraft/server/world/ChunkTicketManager; -accessible field net/minecraft/server/world/ChunkTicketManager chunkHolders Ljava/util/Set; -accessible field net/minecraft/server/world/ChunkTicketManager chunkPositions Lit/unimi/dsi/fastutil/longs/LongSet; -accessible field net/minecraft/server/world/ChunkHolder futuresByStatus Ljava/util/concurrent/atomic/AtomicReferenceArray; -mutable field net/minecraft/server/world/ChunkHolder futuresByStatus Ljava/util/concurrent/atomic/AtomicReferenceArray; -accessible field net/minecraft/server/world/ChunkHolder CHUNK_STATUSES Ljava/util/List; -accessible field net/minecraft/server/world/ChunkHolder accessibleFuture Ljava/util/concurrent/CompletableFuture; -accessible field net/minecraft/server/world/ChunkHolder tickingFuture Ljava/util/concurrent/CompletableFuture; -accessible field net/minecraft/server/world/ChunkHolder entityTickingFuture Ljava/util/concurrent/CompletableFuture; -accessible field net/minecraft/server/world/ChunkHolder UNLOADED_WORLD_CHUNK_FUTURE Ljava/util/concurrent/CompletableFuture; -accessible field net/minecraft/server/world/ChunkHolder lastTickLevel I -accessible field net/minecraft/server/world/ChunkTicketManager ticketsByPosition Lit/unimi/dsi/fastutil/longs/Long2ObjectOpenHashMap; -mutable field net/minecraft/server/world/ChunkTicketManager ticketsByPosition Lit/unimi/dsi/fastutil/longs/Long2ObjectOpenHashMap; -accessible field net/minecraft/server/world/ChunkTicketManager playersByChunkPos Lit/unimi/dsi/fastutil/longs/Long2ObjectMap; -mutable field net/minecraft/server/world/ChunkTicketManager playersByChunkPos Lit/unimi/dsi/fastutil/longs/Long2ObjectMap; -accessible method net/minecraft/server/world/ThreadedAnvilChunkStorage tick (Ljava/util/function/BooleanSupplier;)V -accessible field net/minecraft/server/world/ThreadedAnvilChunkStorage chunksToUnload Lit/unimi/dsi/fastutil/longs/Long2ObjectLinkedOpenHashMap; -accessible field net/minecraft/server/world/ThreadedAnvilChunkStorage unloadedChunks Lit/unimi/dsi/fastutil/longs/LongSet; -accessible method net/minecraft/server/world/ChunkTicketManager purge ()V -accessible field net/minecraft/server/world/ThreadedAnvilChunkStorage world Lnet/minecraft/server/world/ServerWorld; -accessible field net/minecraft/server/world/ThreadedAnvilChunkStorage chunkToNextSaveTimeMs Lit/unimi/dsi/fastutil/longs/Long2LongMap; -accessible field net/minecraft/server/world/ThreadedAnvilChunkStorage loadedChunks Lit/unimi/dsi/fastutil/longs/LongSet; -accessible field net/minecraft/server/world/ChunkTicketManager simulationDistanceTracker Lnet/minecraft/world/SimulationDistanceLevelPropagator; -accessible field net/minecraft/server/world/ChunkTicketManager distanceFromTicketTracker Lnet/minecraft/server/world/ChunkTicketManager$TicketDistanceLevelPropagator; -accessible class net/minecraft/server/world/ChunkTicketManager$TicketDistanceLevelPropagator -accessible method net/minecraft/server/world/ChunkTicketManager getLevel (Lnet/minecraft/util/collection/SortedArraySet;)I -accessible method net/minecraft/server/world/ThreadedAnvilChunkStorage tryUnloadChunk (JLnet/minecraft/server/world/ChunkHolder;)V -accessible field net/minecraft/server/world/ThreadedAnvilChunkStorage unloadTaskQueue Ljava/util/Queue; -accessible field net/minecraft/server/world/ThreadedAnvilChunkStorage lightingProvider Lnet/minecraft/server/world/ServerLightingProvider; -accessible field net/minecraft/server/world/ThreadedAnvilChunkStorage worldGenerationProgressListener Lnet/minecraft/server/WorldGenerationProgressListener; -accessible field net/minecraft/server/world/ThreadedAnvilChunkStorage LOGGER Lorg/slf4j/Logger; -accessible method net/minecraft/server/world/ServerLightingProvider updateChunkStatus (Lnet/minecraft/util/math/ChunkPos;)V -accessible method net/minecraft/server/world/ServerChunkManager initChunkCaches ()V -accessible class net/minecraft/server/world/ServerEntityManager$Status -accessible method net/minecraft/server/world/ChunkTicketManager addTicket (JLnet/minecraft/server/world/ChunkTicket;)V -accessible method net/minecraft/util/thread/ThreadExecutor runTasks ()V -accessible field net/minecraft/server/world/ServerEntityManager managedStatuses Lit/unimi/dsi/fastutil/longs/Long2ObjectMap; -accessible field net/minecraft/server/world/ServerEntityManager cache Lnet/minecraft/world/entity/SectionedEntityCache; -accessible method net/minecraft/server/world/ThreadedAnvilChunkStorage loadChunk (Lnet/minecraft/util/math/ChunkPos;)Ljava/util/concurrent/CompletableFuture; accessible field net/minecraft/client/MinecraftClient userApiService Lcom/mojang/authlib/minecraft/UserApiService; -accessible field net/minecraft/screen/HopperScreenHandler inventory Lnet/minecraft/inventory/Inventory; -accessible field net/minecraft/block/entity/HopperBlockEntity transferCooldown I -mutable field net/minecraft/client/gui/screen/Screen title Lnet/minecraft/text/Text; -accessible method net/minecraft/server/MinecraftServer shouldKeepTicking ()Z -accessible method net/minecraft/server/MinecraftServer runTasksTillTickEnd ()V -accessible field net/minecraft/client/util/NarratorManager narrator Lcom/mojang/text2speech/Narrator; -accessible field net/minecraft/server/PlayerManager players Ljava/util/List; -accessible field net/minecraft/server/PlayerManager playerMap Ljava/util/Map; -accessible field net/minecraft/server/network/ServerPlayNetworkHandler connection Lnet/minecraft/network/ClientConnection; -accessible field net/minecraft/network/ClientConnection channel Lio/netty/channel/Channel; -accessible field net/minecraft/network/ClientConnection address Ljava/net/SocketAddress; -accessible method net/minecraft/network/ClientConnection sendQueuedPackets ()V -accessible class net/minecraft/world/block/ChainRestrictedNeighborUpdater$StatefulEntry -accessible class net/minecraft/world/block/ChainRestrictedNeighborUpdater$SimpleEntry -accessible class net/minecraft/world/block/ChainRestrictedNeighborUpdater$SixWayEntry -accessible class net/minecraft/world/block/ChainRestrictedNeighborUpdater$StateReplacementEntry -accessible field net/minecraft/world/block/ChainRestrictedNeighborUpdater$SixWayEntry currentDirectionIndex I -accessible field net/minecraft/server/MinecraftServer timeReference J -accessible field net/minecraft/world/block/ChainRestrictedNeighborUpdater$SixWayEntry pos Lnet/minecraft/util/math/BlockPos; -accessible method net/minecraft/world/block/ChainRestrictedNeighborUpdater$StatefulEntry (Lnet/minecraft/block/BlockState;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/Block;Lnet/minecraft/util/math/BlockPos;Z)V -accessible method net/minecraft/world/block/ChainRestrictedNeighborUpdater$SixWayEntry (Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/Block;Lnet/minecraft/util/math/Direction;)V -accessible field net/minecraft/world/block/ChainRestrictedNeighborUpdater$SixWayEntry sourceBlock Lnet/minecraft/block/Block; -accessible field net/minecraft/world/block/ChainRestrictedNeighborUpdater$SixWayEntry except Lnet/minecraft/util/math/Direction; -accessible method net/minecraft/world/block/ChainRestrictedNeighborUpdater runQueuedUpdates ()V -accessible method net/minecraft/world/block/ChainRestrictedNeighborUpdater$SimpleEntry (Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/Block;Lnet/minecraft/util/math/BlockPos;)V -accessible method net/minecraft/world/block/ChainRestrictedNeighborUpdater$StateReplacementEntry (Lnet/minecraft/util/math/Direction;Lnet/minecraft/block/BlockState;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/BlockPos;II)V accessible field net/minecraft/entity/ItemEntity STACK Lnet/minecraft/entity/data/TrackedData; -extendable class net/minecraft/item/ItemStack accessible field net/minecraft/client/gui/screen/Screen client Lnet/minecraft/client/MinecraftClient; -accessible method net/minecraft/entity/Entity setFlag (IZ)V -accessible field net/minecraft/command/EntitySelector box Lnet/minecraft/util/math/Box; -accessible field net/minecraft/command/EntitySelector playerName Ljava/lang/String; -accessible field net/minecraft/command/EntitySelector uuid Ljava/util/UUID; -accessible field net/minecraft/command/EntitySelector positionOffset Ljava/util/function/Function; -accessible method net/minecraft/command/EntitySelector getPositionPredicate (Lnet/minecraft/util/math/Vec3d;)Ljava/util/function/Predicate; -accessible field net/minecraft/command/EntitySelector senderOnly Z -accessible field net/minecraft/command/EntitySelector entityFilter Lnet/minecraft/util/TypeFilter; -accessible method net/minecraft/command/EntitySelector getAppendLimit ()I -accessible method net/minecraft/client/world/ClientWorld getEntityLookup ()Lnet/minecraft/world/entity/EntityLookup; -accessible field net/minecraft/command/EntitySelector sorter Ljava/util/function/BiConsumer; -accessible class net/minecraft/server/world/ServerChunkManager$ChunkWithHolder -accessible method net/minecraft/server/world/ThreadedAnvilChunkStorage tickEntityMovement ()V -accessible method net/minecraft/server/world/ThreadedAnvilChunkStorage entryIterator ()Ljava/lang/Iterable; -accessible method net/minecraft/server/world/ServerChunkManager$ChunkWithHolder (Lnet/minecraft/world/chunk/WorldChunk;Lnet/minecraft/server/world/ChunkHolder;)V -accessible method net/minecraft/server/world/ThreadedAnvilChunkStorage shouldTick (Lnet/minecraft/util/math/ChunkPos;)Z -accessible field net/minecraft/server/world/ServerChunkManager$ChunkWithHolder holder Lnet/minecraft/server/world/ChunkHolder; -accessible field net/minecraft/server/world/ServerChunkManager$ChunkWithHolder chunk Lnet/minecraft/world/chunk/WorldChunk; -accessible field net/minecraft/server/world/ServerChunkManager spawnAnimals Z -accessible field net/minecraft/server/world/ServerChunkManager spawnMonsters Z -accessible method net/minecraft/world/tick/WorldTickScheduler tick (Ljava/util/function/BiConsumer;)V -accessible method net/minecraft/server/world/ServerWorld tickBlock (Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/Block;)V -accessible method net/minecraft/server/world/ServerWorld tickFluid (Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/fluid/Fluid;)V -accessible field net/minecraft/server/world/ServerWorld inBlockTick Z -accessible method net/minecraft/server/world/ServerWorld processSyncedBlockEvents ()V -accessible method net/minecraft/entity/mob/MobEntity initGoals ()V -accessible method net/minecraft/world/World tickBlockEntities ()V -accessible class net/minecraft/world/chunk/WorldChunk$DirectBlockEntityTickInvoker -accessible class net/minecraft/world/chunk/WorldChunk$WrappedBlockEntityTickInvoker -accessible field net/minecraft/world/chunk/WorldChunk$WrappedBlockEntityTickInvoker wrapped Lnet/minecraft/world/chunk/BlockEntityTickInvoker; -accessible field net/minecraft/world/chunk/WorldChunk$DirectBlockEntityTickInvoker blockEntity Lnet/minecraft/block/entity/BlockEntity; -accessible field net/minecraft/util/thread/ReentrantThreadExecutor runningTasks I -accessible field net/minecraft/client/gui/hud/InGameHud overlayRemaining I +extendable class net/minecraft/server/world/BlockEvent +extendable class net/minecraft/world/tick/OrderedTick diff --git a/src/test/kotlin/com/github/zly2006/reden/StageTreeTest.kt b/src/test/kotlin/com/github/zly2006/reden/StageTreeTest.kt deleted file mode 100644 index ec67d66..0000000 --- a/src/test/kotlin/com/github/zly2006/reden/StageTreeTest.kt +++ /dev/null @@ -1,196 +0,0 @@ -package com.github.zly2006.reden - -import com.github.zly2006.reden.debugger.TickStage -import com.github.zly2006.reden.debugger.tree.StageTree -import net.minecraft.Bootstrap -import net.minecraft.SharedConstants -import org.junit.jupiter.api.BeforeAll -import org.junit.jupiter.api.Test - -class StageTreeTest { - companion object { - @JvmStatic - @BeforeAll - fun setup() { - SharedConstants.createGameVersion() - Bootstrap.initialize() - } - } - private class EmptyTickStage(name: String, parent: TickStage?) : TickStage(name, parent) { - override fun tick() { - // dont clear children - // super.tick() - } - } - - private fun getMutableChildrenTree(): StageTree { - val tree = StageTree() - // init the tree - val root = StageTreeBuilder("root") { - +child("1") { - +child("1-1") { - +"1-1-1" - } - } - +child("2") { - +child("2-1") { - +"2-1-1" - } - +child("2-2") { - +"2-2-1" - } - } - }.toStage() - tree.initRoot(root, false) - return tree - } - - class StageTreeBuilder private constructor(name: String, parent: TickStage? = null, block: StageTreeBuilder.() -> Unit) { - constructor(name: String, block: StageTreeBuilder.() -> Unit): this(name, null, block) - private val stage: EmptyTickStage - init { - stage = EmptyTickStage(name, parent) - block() - } - operator fun String.unaryPlus() { - stage.children.add(EmptyTickStage(this, stage)) - } - operator fun TickStage.unaryPlus() { - stage.children.add(this) - } - fun child(name: String, block: StageTreeBuilder.() -> Unit): TickStage { - return StageTreeBuilder(name, stage, block).toStage() - } - fun toStage(): TickStage = stage - } - @Test - fun mutableChildrenTickTest01() { - val x = object : TickStage("test", null) { - override fun tick() { - children.add(object : TickStage("1", this) { - override fun tick() { - children.add(object : TickStage("1-1", this) { - override fun tick() { - children.add(EmptyTickStage("1-1-1", this)) - } - }) - } - }) - children.add(object : TickStage("2", this) { - override fun tick() { - children.add(object : TickStage("2-1", this) { - override fun tick() { - children.add(EmptyTickStage("2-1-1", this)) - } - }) - children.add(object : TickStage("2-2", this) { - override fun tick() { - children.add(EmptyTickStage("2-2-1", this)) - } - }) - } - }) - } - } - val tree = StageTree() - tree.root = StageTree.TreeNode(null, x, false, null) - tree.child = tree.root - - val list = mutableListOf() - while (tree.hasNext()) { - val tickStage = tree.next() - list.add(tickStage.name) - tickStage.tick() - } - assert(list == listOf("test", "1", "1-1", "1-1-1", "2", "2-1", "2-1-1", "2-2", "2-2-1")) - } - - @Test - fun insertTest01() { - val tree = getMutableChildrenTree() - val list = mutableListOf() - repeat(3) { - val tickStage = tree.next() - list.add(tickStage.name) - tickStage.tick() - } - tree.insert2child(EmptyTickStage("insert-1", null)) - while (tree.hasNext()) { - val tickStage = tree.next() - list.add(tickStage.name) - tickStage.tick() - } - assert(list == listOf("root", "1", "1-1", "insert-1", "1-1-1", "2", "2-1", "2-1-1", "2-2", "2-2-1")) - } - @Test - fun insertTest02() { - val tree = getMutableChildrenTree() - val list = mutableListOf() - repeat(4) { - val tickStage = tree.next() - list.add(tickStage.name) - tickStage.tick() - } - tree.insert2child(tree.peekLeaf(), EmptyTickStage("insert-1", null)) - while (tree.hasNext()) { - val tickStage = tree.next() - list.add(tickStage.name) - tickStage.tick() - } - assert(list == listOf("root", "1", "1-1", "1-1-1", "insert-1", "2", "2-1", "2-1-1", "2-2", "2-2-1")) - } - - @Test - fun insertTest03() { - val dyingTree = StageTreeBuilder("root") { - +child("1") { - +"1-1" - +"1-2" - +"1-3" - } - }.run { StageTree().apply{ initRoot(toStage(), true) } } - val list = mutableListOf() - fun tickTree() { - val tickStage = dyingTree.next() - list.add(tickStage.name) - tickStage.tick() - } - repeat(3) { tickTree() } - dyingTree.insert2child(dyingTree.peekLeaf(), EmptyTickStage("insert-1", dyingTree.peekLeaf())) - tickTree() // insert-1 - tickTree() // 1-3 - dyingTree.insert2child(dyingTree.peekLeaf(), EmptyTickStage("insert-2", dyingTree.peekLeaf())) - // this tree is dying, but child should be null only if the tree is dead (by next() or hasNext()) - while (dyingTree.hasNext()) - tickTree() - assert(list == listOf("1", "1-1", "1-2", "insert-1", "1-3", "insert-2")) - print(list) - assert("insert-1" in list) - assert("insert-2" in list) - } - - @Test - fun insertTest04() { - val dyingTree = StageTreeBuilder("root") { - +child("1") { - +"1-1" - +child("1-2") { - } - } - }.run { StageTree().apply{ initRoot(toStage(), true) } } - val list = mutableListOf() - fun tickTree() { - val tickStage = dyingTree.next() - list.add(tickStage.name) - tickStage.tick() - } - while (dyingTree.hasNext()) - tickTree() - dyingTree.insert2child(dyingTree.peekLeaf(), EmptyTickStage("insert-1", dyingTree.peekLeaf())) - tickTree() // insert-1 - - while (dyingTree.hasNext()) - tickTree() - print(list) - } -}