Skip to content

Commit

Permalink
Setup modrinth publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
Patbox committed Jul 26, 2023
1 parent 443adfb commit 97fd820
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 4 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
workflow_name: 'minor_version'
version_key: ${{ steps.read_version.outputs.value }}
gist_token: ${{ secrets.GIST_TOKEN }}
skip_bump: true

- name: Grant execute permission for gradlew
run: chmod +x gradlew
Expand All @@ -54,6 +55,15 @@ jobs:
GITHUB_ACTIONS: true
SNAPSHOT: false
MINOR_VERSION: ${{ steps.minor_version.outputs.version_build_number }}
MODRINTH: ${{ secrets.MODRINTH_KEY }}
CHANGELOG: ${{ github.event.release.body }}
- name: Bump build number
uses: zyborg/gh-action-buildnum@v1
id: 'justbump'
with:
workflow_name: 'minor_version'
version_key: ${{ steps.read_version.outputs.value }}
gist_token: ${{ secrets.GIST_TOKEN }}
- uses: actions/upload-artifact@v2
with:
name: artifacts
Expand Down
29 changes: 25 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
id 'fabric-loom' version '1.1.+'
id 'maven-publish'
id "com.modrinth.minotaur" version "2.+"
}

sourceCompatibility = JavaVersion.VERSION_17
Expand Down Expand Up @@ -81,10 +82,10 @@ dependencies {
modApi include('xyz.nucleoid:more-codecs:0.3.2+1.20')
modApi include('xyz.nucleoid:stimuli:0.4.6+1.20')
modApi include('xyz.nucleoid:map-templates:0.1.8+1.20')
modApi include('eu.pb4:polymer-core:0.5.6+1.20.1')
modApi include('eu.pb4:polymer-resource-pack:0.5.6+1.20.1')
modApi include('eu.pb4:polymer-blocks:0.5.6+1.20.1')
modApi include('eu.pb4:polymer-virtual-entity:0.5.6+1.20.1')
modApi 'eu.pb4:polymer-core:0.5.6+1.20.1'
modApi 'eu.pb4:polymer-resource-pack:0.5.6+1.20.1'
modApi 'eu.pb4:polymer-blocks:0.5.6+1.20.1'
modApi 'eu.pb4:polymer-virtual-entity:0.5.6+1.20.1'
modApi include('eu.pb4:hologram-api:0.2.4+1.20')
modApi include('eu.pb4:sgui:1.2.2+1.20')
modApi include('eu.pb4:sidebar-api:0.1.2+1.19.3')
Expand Down Expand Up @@ -125,6 +126,26 @@ jar {
}
}

if (System.getenv("MODRINTH")) {
modrinth {
token = System.getenv("MODRINTH")
projectId = 'xUvfRSZh'// The ID of your modrinth project, slugs will not work.
versionNumber = "" + version // The version of the mod to upload.
versionType = isStable ? "release" : "beta"
uploadFile = remapJar // This links to a task that builds your mod jar and sets "uploadFile" to the mod jar.
gameVersions = [((String) project.minecraft_version)]
changelog = System.getenv("CHANGELOG")
dependencies {
required.project 'polymer'
}
loaders = ["fabric", "quilt"]
}

remapJar {
finalizedBy project.tasks.modrinth
}
}

publishing {
publications {
mavenJava(MavenPublication) {
Expand Down
Binary file added logo_16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added logo_32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added logo_512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions src/main/java/xyz/nucleoid/plasmid/util/InventoryUtil.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package xyz.nucleoid.plasmid.util;

import net.minecraft.item.ItemStack;
import net.minecraft.server.network.ServerPlayerEntity;

public final class InventoryUtil {
private InventoryUtil() {}

public static void clear(ServerPlayerEntity player) {
player.getInventory().clear();
player.playerScreenHandler.clearCraftingSlots();
player.playerScreenHandler.setCursorStack(ItemStack.EMPTY);
player.currentScreenHandler.setCursorStack(ItemStack.EMPTY);
}
}

0 comments on commit 97fd820

Please sign in to comment.