Skip to content

Commit

Permalink
tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewperiut committed Mar 5, 2025
1 parent 599a2f4 commit 987e158
Show file tree
Hide file tree
Showing 12 changed files with 164 additions and 9 deletions.
31 changes: 30 additions & 1 deletion .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
java-version: 17

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
Expand Down Expand Up @@ -91,3 +91,32 @@ jobs:
chisel-reborn(required)
game-version-filter: releases # Defaults to selecting the latest compatible version of Minecraft, using the tag from the fabric.mod.json


- name: Upload forge artifacts
uses: Kir-Antipov/[email protected]
with:
modrinth-id: ht0eTMEs
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
modrinth-featured: true

curseforge-id: 640001
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}

github-token: ${{ secrets.GITHUB_TOKEN }}

name: '[${{ steps.versions.outputs.minecraft-version }}] Forge ${{ steps.versions.outputs.mod-version }}'
version: 'forge-${{ steps.versions.outputs.minecraft-version }}-${{ steps.versions.outputs.mod-version }}'

files: |
forge/build/libs/!(*-@(sources|dev|dev-shadow|javadoc).jar)
version-type: release

loaders: forge

dependencies: |
architectury-api(required)
chisel-reborn(required)
game-version-filter: releases # Defaults to selecting the latest compatible version of Minecraft, using the tag from the fabric.mod.json
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
java-version: 17

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
Expand Down
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ subprojects {
minecraft "net.minecraft:minecraft:$rootProject.minecraft_version"
mappings loom.layered {
it.mappings("net.fabricmc:yarn:$rootProject.yarn_mappings:v2")
it.mappings("dev.architectury:yarn-mappings-patch-neoforge:$rootProject.yarn_mappings_patch_neoforge_version")
}
modImplementation "com.periut.cryonicconfig:cryonicconfig-${project.name}:1.0.0+mc${project.minecraft_version}"
modImplementation "com.periut.chisel:chisel-${project.name}:2.0.0+mc${project.minecraft_version}"
}

Expand All @@ -52,12 +52,12 @@ subprojects {
// If you remove this line, sources will not be generated.
withSourcesJar()

sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

tasks.withType(JavaCompile).configureEach {
it.options.release = 21
it.options.release = 17
}

// Configure Maven publishing.
Expand Down
55 changes: 55 additions & 0 deletions forge/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
plugins {
id 'com.github.johnrengelman.shadow'
}

loom {
forge {
}
}

architectury {
platformSetupLoomIde()
forge()
}

configurations {
common {
canBeResolved = true
canBeConsumed = false
}
compileClasspath.extendsFrom common
runtimeClasspath.extendsFrom common
developmentForge.extendsFrom common

// Files in this configuration will be bundled into your mod using the Shadow plugin.
// Don't use the `shadow` configuration from the plugin itself as it's meant for excluding files.
shadowBundle {
canBeResolved = true
canBeConsumed = false
}
}

dependencies {
forge "net.minecraftforge:forge:$rootProject.forge_version"
modApi "dev.architectury:architectury-forge:${rootProject.architectury_version}"

common(project(path: ':common', configuration: 'namedElements')) { transitive false }
shadowBundle project(path: ':common', configuration: 'transformProductionForge')
}

processResources {
inputs.property 'version', project.version

filesMatching('META-INF/mods.toml') {
expand version: project.version
}
}

shadowJar {
configurations = [project.configurations.shadowBundle]
archiveClassifier = 'dev-shadow'
}

remapJar {
inputFile.set shadowJar.archiveFile
}
1 change: 1 addition & 0 deletions forge/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
loom.platform=forge
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.periut.factoryblocks.forge;

import com.periut.factoryblocks.FactoryBlocksMod;
import dev.architectury.platform.forge.EventBuses;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.fml.ModList;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;

@Mod(FactoryBlocksMod.MODID)
public class FactoryBlocksForge {
public FactoryBlocksForge() {
// Submit our event bus to let architectury register our content on the right time
IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus();
EventBuses.registerModEventBus(FactoryBlocksMod.MODID, FMLJavaModLoadingContext.get().getModEventBus());
FactoryBlocksMod.init();
modEventBus.addListener(this::commonSetup);
MinecraftForge.EVENT_BUS.register(this);
}

private void commonSetup(final FMLCommonSetupEvent event) {
FactoryBlocksMod.post(ModList.get().isLoaded("chisel"));
}
}
35 changes: 35 additions & 0 deletions forge/src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
modLoader = "javafml"
loaderVersion = "[47,)"
issueTrackerURL = "https://github.com/matthewperiut/factory_blocks/issues"
license = "MIT"

[[mods]]
modId = "factory_blocks"
version = "${version}"
displayName = "Factory Blocks"
authors = "slaincow"
description = '''
Adds Factory Blocks to Chisel Reborn or Chipped
'''
logoFile = "assets/factory_blocks/icon.png"

[[dependencies.factory_blocks]]
modId = "forge"
mandatory = true
versionRange = "[0,)"
ordering = "NONE"
side = "BOTH"

[[dependencies.factory_blocks]]
modId = "minecraft"
mandatory = true
versionRange = "[1.20.3,1.20.4]"
ordering = "NONE"
side = "BOTH"

[[dependencies.factory_blocks]]
modId = "architectury"
mandatory = true
versionRange = "[0,)"
ordering = "AFTER"
side = "BOTH"
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions forge/src/main/resources/pack.mcmeta
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"pack": {
"description": "Example Mod",
"pack_format": 15
}
}
6 changes: 4 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
org.gradle.jvmargs=-Xmx2048M

enabled_platforms=fabric,neoforge
enabled_platforms=fabric,neoforge,forge

mod_version=1.4.0
maven_group=com.periut.factoryblocks
Expand All @@ -17,4 +17,6 @@ fabric_api_version=0.97.0+1.20.4
#---

# https://projects.neoforged.net/neoforged/neoforge
neoforge_version=20.4.234
neoforge_version=20.4.234

forge_version=1.20.4-49.2.0
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ pluginManagement {
include("common")
include("fabric")
include("neoforge")
include("forge")

rootProject.name = "factory_blocks"

0 comments on commit 987e158

Please sign in to comment.