Skip to content

Commit

Permalink
fix: #196 & #218
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelHillcox committed Sep 2, 2023
1 parent 7987834 commit aa9f74a
Show file tree
Hide file tree
Showing 7 changed files with 136 additions and 8 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -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
22 changes: 22 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## 1.19.2

### [1.13.1]

#### Fixed

#### 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.16.5

### [1.7.5] - 2021-04-17
Expand Down
75 changes: 70 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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")
}
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false
#Mod Info
mod_version=1.13.0
mod_version=1.13.1
#Dependencies
mc_version=1.19.2
forge_version=43.1.3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
}

Expand Down

0 comments on commit aa9f74a

Please sign in to comment.