diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 00000000..c72cb038 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,23 @@ +on: + push: + branches: + - 'mc/*' + - 'main' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up JDK 17 + uses: actions/setup-java@v2 + with: + java-version: '17' + distribution: 'temurin' + - name: Setup Gradle + uses: gradle/gradle-build-action@v2 + with: + cache-read-only: false + gradle-home-cache-cleanup: true + - name: Build + run: ./gradlew build --no-daemon diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 00000000..2d3e77a8 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,22 @@ +on: + push: + tags: + - 'release/*' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up JDK 17 + uses: actions/setup-java@v2 + with: + java-version: '17' + distribution: 'temurin' + - name: Setup Gradle + uses: gradle/gradle-build-action@v2 + - name: Build & Publish + run: ./gradlew build publishMods --no-daemon + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CURSE_TOKEN: ${{ secrets.CURSE_TOKEN }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 06745acb..e8093043 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,17 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## 1.19.3 +### [1.14.1] + +#### Added + +- Miners Lights are now replaceable meaning you can place over them with normal block placement. This is a nice little quality of life fix :D + +#### Fixed + +- [#196](https://github.com/direwolf20-mc/mininggadgets/issues/196) don't allow the renderblock to be accelerated by ProjectE + - This is a preventative fix for when ProjectE is ported to 1.20.1+ + ### [1.14.0] #### Changed diff --git a/build.gradle b/build.gradle index 29da5b73..e4a04bd9 100644 --- a/build.gradle +++ b/build.gradle @@ -5,6 +5,7 @@ plugins { id 'eclipse' id 'maven-publish' id 'net.minecraftforge.gradle' version '5.1.+' + id "me.modmuss50.mod-publish-plugin" version "0.3.4" } apply { @@ -148,17 +149,81 @@ jar.finalizedBy('reobfJar') publishing { publications { - mavenJava(MavenPublication) { - artifact jar + maven(MavenPublication) { + from components.java + artifactId = project.archivesBaseName.toLowerCase() } } + repositories { - maven { - url "file:///${project.projectDir}/mcmodsrepo" - } +// maven { +// name = "GitHubPackages" +// url = "https://maven.pkg.github.com/Direwolf20-MC/MiningGadgets" +// credentials { +// username = providers.environmentVariable("GITHUB_ACTOR") +// password = providers.environmentVariable("GITHUB_TOKEN") +// } +// } } } tasks.withType(JavaCompile).configureEach { options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation } + +def makeChangelog() { + def changelogText = file("./CHANGELOG.md").text; + + def output = ""; + def readLines = false + for (line in changelogText.lines()) { + if (line.startsWith("### ") || line.startsWith("## ")) { + if (readLines) { + break; + } + + if (line.contains("${mod_version}") && line.startsWith("### ")) { + readLines = true; + } + } + if (readLines) { + output += line + "\n"; + } + } + + return output.trim(); +} + + +tasks.register("testChangelog") { + group = "tests" + + doLast { + println makeChangelog() + } +} + +publishMods { + dryRun = providers.environmentVariable("CURSE_TOKEN").getOrNull() == null + file = jar.archiveFile + changelog = makeChangelog() + type = STABLE + + modLoaders.add("forge") + + curseforge { + projectId = "351748" + accessToken = providers.environmentVariable("CURSE_TOKEN") + minecraftVersions.add(project.mc_version) + + optional { + slug = "charging-gadgets" + } + } + + github { + repository = "direwolf20-mc/MiningGadgets" + accessToken = providers.environmentVariable("GITHUB_TOKEN") + commitish = providers.environmentVariable("GITHUB_SHA").orElse("dryRun") + } +} diff --git a/gradle.properties b/gradle.properties index 44a85e32..afa05b25 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ org.gradle.jvmargs=-Xmx3G org.gradle.daemon=false #Mod Info -mod_version=1.14.0 +mod_version=1.14.1 #Dependencies mc_version=1.19.3 forge_version=44.1.8 diff --git a/src/main/java/com/direwolf20/mininggadgets/common/blocks/MinersLight.java b/src/main/java/com/direwolf20/mininggadgets/common/blocks/MinersLight.java index 405a48d3..26ae9b9e 100644 --- a/src/main/java/com/direwolf20/mininggadgets/common/blocks/MinersLight.java +++ b/src/main/java/com/direwolf20/mininggadgets/common/blocks/MinersLight.java @@ -10,6 +10,8 @@ import net.minecraft.world.level.block.RenderShape; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.material.Material; +import net.minecraft.world.level.material.MaterialColor; +import net.minecraft.world.level.material.PushReaction; import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.VoxelShape; @@ -23,7 +25,7 @@ public class MinersLight extends Block { public MinersLight() { super( Block.Properties - .of(Material.DECORATION) + .of(new Material(MaterialColor.NONE, false, false, false, false, false, true, PushReaction.DESTROY)) .noCollission() .strength(0.0f) .lightLevel(e -> 14) diff --git a/src/main/java/com/direwolf20/mininggadgets/common/blocks/RenderBlock.java b/src/main/java/com/direwolf20/mininggadgets/common/blocks/RenderBlock.java index 51c8472e..69d16ffc 100644 --- a/src/main/java/com/direwolf20/mininggadgets/common/blocks/RenderBlock.java +++ b/src/main/java/com/direwolf20/mininggadgets/common/blocks/RenderBlock.java @@ -25,7 +25,8 @@ public RenderBlock() { Properties.of(Material.METAL) .strength(50.0F, 1200.0F) .noOcclusion() - .isRedstoneConductor((a, b, c) -> false) // @mcp: setOpaque seems to replace isNormalBlock + .isRedstoneConductor((a, b, c) -> false) + // @mcp: setOpaque seems to replace isNormalBlock ); }