diff --git a/.github/workflows/publish_project.yml b/.github/workflows/publish_project.yml new file mode 100644 index 0000000..973290d --- /dev/null +++ b/.github/workflows/publish_project.yml @@ -0,0 +1,105 @@ +# Publishes the project to GitHub Releases, CurseForge, and Modrinth +name: Publish Project + +on: + push: + tags: + - "v[0-9]+.[0-9]+.[0-9]+" # any SemVer tag, e.g. v1.2.3 + +env: + # link to the changelog with a format code for the version + CHANGELOG_LOCATION: "Changelog is available [here](https://github.com/${{ github.repository }}/releases/tag/${{ github.ref_name }})" + # type of release + RELEASE_TYPE: "beta" + +concurrency: + group: publish-${{ github.head_ref || github.ref }} + cancel-in-progress: true + +jobs: + publish: + name: Publish + runs-on: ubuntu-latest + + permissions: + contents: write # needed to create GitHub releases + + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + - name: Set up JDK 17 + uses: actions/setup-java@v1 + with: + java-version: 17 + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Cache Gradle packages + uses: actions/cache@v1 + with: + path: ~/.gradle/caches + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} + restore-keys: ${{ runner.os }}-gradle + + - name: Build Project + run: ./gradlew build --warning-mode all --build-cache + + - name: Publish to GitHub + uses: softprops/action-gh-release@v2 + with: + files: | + "forge/build/libs/betterp2p-${{ steps.build.outputs.version }}-forge.jar" + "fabric/build/libs/betterp2p-${{ steps.build.outputs.version }}-fabric.jar" + generate_release_notes: true + fail_on_unmatched_files: true + + - name: "Upload Forge to CurseForge" + uses: itsmeow/curseforge-upload@v3 + with: + file_path: "forge/build/libs/betterp2p-${{ steps.build.outputs.version }}-forge.jar" + game_endpoint: "minecraft" + relations: "applied-energistics-2:requiredDependency,architectury-api:requiredDependency,kotlin-for-forge:requiredDependency" + game_versions: "Minecraft 1.20.1,Java 17,Forge" + project_id: "538092" + token: "${{ secrets.CF_API_TOKEN }}" + + - name: "Upload Fabric to CurseForge" + uses: itsmeow/curseforge-upload@v3 + with: + file_path: "fabric/build/libs/betterp2p-${{ steps.build.outputs.version }}-fabric.jar" + game_endpoint: "minecraft" + relations: "fabric-api:requiredDependency,applied-energistics-2:requiredDependency,fabric-language-kotlin:requiredDependency,architectury-api:requiredDependency" + game_versions: "Minecraft 1.20.1,Java 17,Fabric" + project_id: "538092" + token: "${{ secrets.CF_API_TOKEN }}" + + - name: "Upload Forge to Modrinth" + uses: dsx137/modrinth-release-action@main + env: + MODRINTH_TOKEN: "${{ secrets.MODRINTH_TOKEN }}" + with: + name: "[Forge 1.20.1] v${{ steps.build.outputs.version }}" + project_id: 9DDxOvTJ + loaders: forge + game_versions: 1.20.1 + version_number: "${{ steps.build.outputs.version }}" + files: | + "forge/build/libs/betterp2p-${{ steps.build.outputs.version }}-forge.jar" + dependencies: lhGA9TYQ:required, ordsPcFz:required, XxWD5pD3:required + version_type: release + + - name: "Upload Fabric to Modrinth" + uses: dsx137/modrinth-release-action@main + env: + MODRINTH_TOKEN: "${{ secrets.MODRINTH_TOKEN }}" + with: + name: "[Fabric 1.20.1] v${{ steps.build.outputs.version }}" + project_id: 9DDxOvTJ + loaders: fabric + game_versions: 1.20.1 + version_number: "${{ steps.build.outputs.version }}" + files: | + "fabric/build/libs/betterp2p-${{ steps.build.outputs.version }}-fabric.jar" + dependencies: P7dR8mSH:required, XxWD5pD3:required, Ha28R6CL:required, lhGA9TYQ: required + version_type: release diff --git a/CHANGELOG.md b/CHANGELOG.md index 7569742..5ac60b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.4.3] - 2024-09-19 + +### Fixed + +- Rare issue that crashes client when drawing outline (#19) + ## [1.4.2] - 2024-07-23 ### Added diff --git a/common/src/main/kotlin/dev/lasm/betterp2p/client/RenderBlockOutline.kt b/common/src/main/kotlin/dev/lasm/betterp2p/client/RenderBlockOutline.kt index 8099746..42c8387 100644 --- a/common/src/main/kotlin/dev/lasm/betterp2p/client/RenderBlockOutline.kt +++ b/common/src/main/kotlin/dev/lasm/betterp2p/client/RenderBlockOutline.kt @@ -8,7 +8,6 @@ import dev.lasm.betterp2p.client.ClientCache.positions import dev.lasm.betterp2p.client.ClientCache.selectedFacing import dev.lasm.betterp2p.client.ClientCache.selectedPosition import dev.lasm.betterp2p.item.ItemAdvancedMemoryCard -import java.util.* import net.minecraft.client.Camera import net.minecraft.client.renderer.MultiBufferSource import net.minecraft.client.renderer.RenderStateShard @@ -19,6 +18,7 @@ import net.minecraft.world.entity.player.Player import net.minecraft.world.phys.AABB import net.minecraft.world.phys.shapes.Shapes import org.lwjgl.opengl.GL11 +import java.util.* object RenderBlockOutline { @JvmStatic @@ -72,7 +72,7 @@ object RenderBlockOutline { // 0x45DA75 } // 0x66CCFF - for (entry in positions) { + for (entry in positions.toList()) { val side = entry.component2() val boxes = ArrayList() val bch = BusCollisionHelper(boxes, side, true) diff --git a/fabric/build.gradle b/fabric/build.gradle index db18065..d484f55 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -1,9 +1,5 @@ -import net.darkhax.curseforgegradle.TaskPublishCurseForge - plugins { id "com.github.johnrengelman.shadow" version "7.1.2" - id "com.modrinth.minotaur" version "2.+" - id 'net.darkhax.curseforgegradle' version '1.1.+' } architectury { @@ -80,45 +76,3 @@ publishing { // Add repositories to publish to here. } } - -modrinth { - token = findProperty("modrinth_token") // Remember to have the MODRINTH_TOKEN environment variable set or else this will fail - just make sure it stays private! - projectId = "betterp2p" // This can be the project ID or the slug. Either will work! - versionName = "[Fabric 1.20.1] v${project.mod_version}" - uploadFile = remapJar // With Loom, this MUST be set to `remapJar` instead of `jar`! - gameVersions = ['1.20.1'] // Must be an array, even with only one version - loaders = ["fabric"] // Must also be an array - no need to specify this if you're using Loom or ForgeGradle - syncBodyFrom = rootProject.file("README.md").text - changelog = rootProject.file("CHANGELOG.md").text - dependencies { // A special DSL for creating dependencies - // scope.type - // The scope can be `required`, `optional`, `incompatible`, or `embedded` - // The type can either be `project` or `version` - required.project "fabric-api" - required.project "architectury-api" - required.project "ae2" - required.project "fabric-language-kotlin" - } -} - -// CurseForgeGradle -tasks.register('publishCurseforgeFabric', TaskPublishCurseForge) { - - apiToken = findProperty('curseforge_token') - debugMode = false - - // The main file to upload - def mainFile = upload(538092, remapJar) - mainFile.releaseType = 'release' - mainFile.changelog = rootProject.file('CHANGELOG.md') - mainFile.changelogType = 'markdown' - mainFile.addModLoader("Fabric") - mainFile.displayName = "[Fabric 1.20.1] v${project.mod_version}" - mainFile.addGameVersion('1.20.1') - mainFile.addRequirement('fabric-api') - mainFile.addRequirement('architectury-api') - mainFile.addRequirement('applied-energistics-2') - mainFile.addRequirement('fabric-language-kotlin') -} - -tasks.modrinth.dependsOn(tasks.modrinthSyncBody) diff --git a/forge/build.gradle b/forge/build.gradle index ff50bc7..65f8276 100644 --- a/forge/build.gradle +++ b/forge/build.gradle @@ -1,9 +1,5 @@ -import net.darkhax.curseforgegradle.TaskPublishCurseForge - plugins { id "com.github.johnrengelman.shadow" version "7.1.2" - id "com.modrinth.minotaur" version "2.+" - id 'net.darkhax.curseforgegradle' version '1.1.+' } architectury { @@ -95,43 +91,3 @@ publishing { // Add repositories to publish to here. } } - -modrinth { - token = findProperty("modrinth_token") // Remember to have the MODRINTH_TOKEN environment variable set or else this will fail - just make sure it stays private! - projectId = "betterp2p" // This can be the project ID or the slug. Either will work! - versionName = "[Forge 1.20.1] v${project.mod_version}" - uploadFile = remapJar // With Loom, this MUST be set to `remapJar` instead of `jar`! - gameVersions = ['1.20.1'] // Must be an array, even with only one version - loaders = ["forge"] // Must also be an array - no need to specify this if you're using Loom or ForgeGradle - syncBodyFrom = rootProject.file("README.md").text - changelog = rootProject.file("CHANGELOG.md").text - dependencies { // A special DSL for creating dependencies - // scope.type - // The scope can be `required`, `optional`, `incompatible`, or `embedded` - // The type can either be `project` or `version` - required.project "architectury-api" - required.project "ae2" - required.project "kotlin-for-forge" - } -} - -// CurseForgeGradle -tasks.register('publishCurseforgeForge', TaskPublishCurseForge) { - - apiToken = findProperty('curseforge_token') - debugMode = false - - // The main file to upload - def mainFile = upload(538092, remapJar) - mainFile.releaseType = 'release' - mainFile.changelog = rootProject.file('CHANGELOG.md') - mainFile.changelogType = 'markdown' - mainFile.addModLoader("Forge") - mainFile.displayName = "[Forge 1.20.1] v${project.mod_version}" - mainFile.addGameVersion('1.20.1') - mainFile.addRequirement('architectury-api') - mainFile.addRequirement('applied-energistics-2') - mainFile.addRequirement('kotlin-for-forge') -} - -tasks.modrinth.dependsOn(tasks.modrinthSyncBody) diff --git a/gradle.properties b/gradle.properties index c7e3f5b..3ab2cff 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,7 +4,7 @@ minecraft_version=1.20.1 enabled_platforms=fabric,forge archives_base_name=betterp2p -mod_version=1.4.2 +mod_version=1.4.3 maven_group=dev.lasm.betterp2p architectury_version=9.1.12