From eface1495e425fd02007a44012149ad6753d3071 Mon Sep 17 00:00:00 2001 From: Patbox <39821509+Patbox@users.noreply.github.com> Date: Sat, 19 Mar 2022 17:10:53 +0100 Subject: [PATCH] Fix #68, #69. Pre-setup auto releasing (#72) * Fix #68, #69. Pre-setup auto releasing --- .github/workflows/release.yml | 41 ++++++++++++++++ README.md | 39 ++++++--------- build.gradle | 48 +++++++++++++++++++ gradle.properties | 2 +- .../fabric/mixin/MixinLanguage.java | 2 +- .../dan200/computercraft/shared/Registry.java | 5 +- .../tags/blocks/mineable/pickaxe.json | 19 ++++++++ 7 files changed, 126 insertions(+), 30 deletions(-) create mode 100644 .github/workflows/release.yml create mode 100644 src/main/resources/data/minecraft/tags/blocks/mineable/pickaxe.json diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..66d760891 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,41 @@ +name: Release + +on: + release: + types: + - published + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/cache@v2 + with: + path: | + ~/.gradle/loom-cache + ~/.gradle/caches + ~/.gradle/wrapper + key: gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + gradle- + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v1 + with: + java-version: 17 + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Build and publish with Gradle + run: ./gradlew build publish + env: + CURSEFORGE: ${{ secrets.CURSEFORGE }} + MODRINTH: ${{ secrets.MODRINTH }} + CHANGELOG: ${{ github.event.release.body }} + - name: Upload GitHub release + uses: AButler/upload-release-assets@v2.0 + with: + files: 'build/libs/*.jar;!build/libs/*-sources.jar;!build/libs/*-dev.jar' + repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md index f8e2d36ef..0a6b4bf63 100644 --- a/README.md +++ b/README.md @@ -13,29 +13,27 @@ CC: R tries to maintain parity with CC: T, but may be behind or divergent in som ## Resource Packs This mod includes textures by [Jummit](https://github.com/Jummit) that are more in line with the style of Mojang's new texture-artist, Jappa. If you prefer the original textures, enable the "Classic" resource pack. -CC: Restitched We also have a second resourcepack made by [3prm3](https://github.com/3prm3), it features a complete overhaul and can be enabled by enabling the `overhaul` resource pack, go check out his resource pack over [here](https://github.com/3prm3/cc-pack/)! +CC: Restitched We also have a second resourcepack made by [3prm3](https://github.com/3prm3), it features a complete overhaul and can be enabled by enabling the `overhaul` resource pack, go check out his resource pack over [here](https://github.com/cc-orgs/cc-overhaul/tree/main)! -## Contributing +## Bleeding Edge Ver. +Bleeding edge builds can be found [here](https://github.com/cc-tweaked/cc-restitched/actions) at Github Actions. In the .zip file there should be a "-dev" jar, a "-javadoc" jar, a "-sources-dev" jar, a "-sources" jar, and a plain (jar without an affixed tag) jar. Put the plain jar in the mods folder. + +## Contributions Any contribution is welcome, be that using the mod, reporting bugs or contributing code. In order to start helping develop CC: R there are a few rules; -1) Make sure your code follows the checkstyle rules. You can test this by running `./gradle build` or `./gradle check`. -2) Do not alter the lua code unless those changes are taken directly from CC: Tweaked. If you wish to contribute changes to the in game rom please contribute upstream at [CC-Tweaked](https://github.com/SquidDev-CC/CC-Tweaked). +1) Follow the [Fabric](https://fabricmc.net/) programming guidelines as close as possible. This means you have to use [`loom`](https://fabricmc.net/wiki/tutorial:mappings) mappings, if you use anything else, your code will be rejected. +2) Make sure your code follows the checkstyle rules. You can test this by running `./gradle build` or `./gradle check`. +3) Do not alter the lua code unless those changes are taken directly from CC: Tweaked. If you wish to contribute changes to the in game rom please contribute upstream at [CC-Tweaked](https://github.com/SquidDev-CC/CC-Tweaked). +4) You cannot intentionally implement bugs and security vulnerabilities. +5) Unless the code is taken directly from CC: Tweaked, `lua` code is offlimits from alteration. -# Does this work Fabric's many rendering mods? +# Rendering Mod Compatability * [ YES ] Sodium * [ YES ] Optifine * Works with VBO Rendering (automatically set) * No issues -* [ EHH ] Iris Shaders +* [ OK ] Iris Shaders * "Works" with TBO Rendering (Default) - * Crashes with VBO Rendering - *
- Shaders are broken - - * Shaders will cause varrying results ranging from monitors being invisible, to straight up crashing. - * Not using shaders will result in odd Z-Fighting of the monitor display and the transparent texture - - ![](https://user-images.githubusercontent.com/10422110/136869483-91824c5f-841f-4316-bfb1-2412477a29ee.png) - - ![](https://user-images.githubusercontent.com/10422110/136869535-a16581a3-5e0a-4632-923f-c8de8cc8a6ea.png) -
+ * Works with VBO Rendering * [ YES ] Canvas * Works with TBO Rendering (Default) * Scuffed with VBO Rendering @@ -50,17 +48,8 @@ Any contribution is welcome, be that using the mod, reporting bugs or contributi - ![](https://i.imgur.com/OEmZXsx.png) -## Contributing -Any contribution is welcome, be that using the mod, reporting bugs or contributing code. In order to start helping develop CC: R there are a few rules; -1) Follow the [Fabric](https://fabricmc.net/) programming guidelines as close as possible. This means you have to use [`loom`](https://fabricmc.net/wiki/tutorial:mappings) mappings, if you use anything else, your code will be rejected. -2) You cannot intentionally implement bugs and security vulnerabilities. -3) Unless the code is taken directly from CC: Tweaked, `lua` code is offlimits from alteration. - -## Bleeding Edge Builds -Bleeding edge builds can be found [here](https://github.com/cc-tweaked/cc-restitched/actions) at Github Actions. - ## Community If you need help getting started with CC: Restitched, want to show off your latest project, or just want to chat about ComputerCraft, here is the [Forum](https://forums.computercraft.cc/) and the [Discord](https://discord.gg/H2UyJXe). -## Perpheral mods +## Perpheral Mods Unfortunately, CC: Restitched does not have as many peripherals mods available as CC: Tweaked. If you're an interested mod developer, please check out our `api` package. If you've already made a mod with CC: R peripheral support OR if you're a player who found a mod with ComputerCraft integration, please open an [issue here](https://github.com/cc-tweaked/cc-restitched/issues/new?assignees=&labels=peripheralShoutout&template=peripheral_shoutout.md) to let us know and we'll add it to the list! diff --git a/build.gradle b/build.gradle index 9888692b1..a3d135947 100644 --- a/build.gradle +++ b/build.gradle @@ -5,6 +5,8 @@ plugins { id "com.github.hierynomus.license" version "0.16.1" id "org.jetbrains.kotlin.jvm" version "1.5.21" id 'fabric-loom' version '0.10-SNAPSHOT' + id "com.modrinth.minotaur" version "2.+" + id 'com.matthewprenger.cursegradle' version '1.4.0' } def javaVersion = JavaLanguageVersion.of(17) @@ -247,3 +249,49 @@ publishing { // mavenLocal() } } + +if (System.getenv("MODRINTH")) { + modrinth { + token = System.getenv("MODRINTH") + + projectId = "eldBwa5V" + versionNumber = version + versionType = "release" + uploadFile = remapJar + gameVersions = [((String) project.mc_version)] + loaders = ["fabric"] + changelog = System.getenv("CHANGELOG") + } + + remapJar { + finalizedBy project.tasks.modrinth + } +} + +if (System.getenv("CURSEFORGE")) { + curseforge { + apiKey = System.getenv("CURSEFORGE") + + project { + id = "462672" + releaseType = "release" + changelog = System.getenv("CHANGELOG") + changelogType = "markdown" + addGameVersion ((String) project.mc_version) + addGameVersion "Fabric" + mainArtifact(remapJar) + + afterEvaluate { + uploadTask.dependsOn("remapJar") + } + } + + options { + forgeGradleIntegration = false + } + } + + remapJar { + finalizedBy project.tasks.curseforge + } +} diff --git a/gradle.properties b/gradle.properties index 3eca89e8c..513600ce6 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,7 +2,7 @@ org.gradle.jvmargs=-Xmx3G # Mod properties -mod_version=1.100.3 +mod_version=1.100.4 # Minecraft properties mc_version=1.18.2 diff --git a/src/main/java/dan200/computercraft/fabric/mixin/MixinLanguage.java b/src/main/java/dan200/computercraft/fabric/mixin/MixinLanguage.java index 4f79841c4..9296a91c7 100644 --- a/src/main/java/dan200/computercraft/fabric/mixin/MixinLanguage.java +++ b/src/main/java/dan200/computercraft/fabric/mixin/MixinLanguage.java @@ -15,8 +15,8 @@ import net.fabricmc.loader.api.FabricLoader; import net.fabricmc.loader.api.ModContainer; import com.google.common.collect.ImmutableMap; import com.google.gson.JsonParseException; -import org.apache.logging.log4j.Logger; import org.jetbrains.annotations.NotNull; +import org.slf4j.Logger; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; diff --git a/src/main/java/dan200/computercraft/shared/Registry.java b/src/main/java/dan200/computercraft/shared/Registry.java index c3d7ccabb..20e4e24ad 100644 --- a/src/main/java/dan200/computercraft/shared/Registry.java +++ b/src/main/java/dan200/computercraft/shared/Registry.java @@ -62,7 +62,6 @@ import net.minecraft.world.inventory.MenuType; import net.minecraft.world.item.*; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Blocks; -import net.minecraft.world.level.block.SoundType; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockBehaviour; @@ -148,12 +147,12 @@ public final class Registry private static BlockBehaviour.Properties properties() { - return BlockBehaviour.Properties.of( Material.GLASS ).strength( 2F ).sound( SoundType.STONE ).noOcclusion(); + return BlockBehaviour.Properties.of( Material.STONE ).strength( 2F ).noOcclusion(); } private static BlockBehaviour.Properties turtleProperties() { - return FabricBlockSettings.copyOf( Blocks.STONE ).strength( 2.5f ); + return BlockBehaviour.Properties.of( Material.STONE ).strength( 2.5f ); } private static BlockBehaviour.Properties modemProperties() diff --git a/src/main/resources/data/minecraft/tags/blocks/mineable/pickaxe.json b/src/main/resources/data/minecraft/tags/blocks/mineable/pickaxe.json new file mode 100644 index 000000000..84f9f8953 --- /dev/null +++ b/src/main/resources/data/minecraft/tags/blocks/mineable/pickaxe.json @@ -0,0 +1,19 @@ +{ + "replace": false, + "values": [ + "computercraft:monitor_normal", + "computercraft:monitor_advanced", + "computercraft:computer_normal", + "computercraft:computer_advanced", + "computercraft:computer_command", + "computercraft:turtle_normal", + "computercraft:turtle_advanced", + "computercraft:speaker", + "computercraft:disk_drive", + "computercraft:printer", + "computercraft:wireless_modem_normal", + "computercraft:wireless_modem_advanced", + "computercraft:wired_modem_full", + "computercraft:cable" + ] +}