Skip to content

Commit

Permalink
update NeoForge & MaFgLib version
Browse files Browse the repository at this point in the history
  • Loading branch information
TexBlock committed May 3, 2024
1 parent 13b9d9d commit 5e73422
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 66 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: 17
- name: Cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
Expand All @@ -26,7 +26,7 @@ jobs:
chmod +x gradlew
./gradlew build
- name: Upload artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Artifacts-forge
path: ${{ github.workspace }}/build/libs
10 changes: 5 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,24 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up JDK 20
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: 20
- name: Cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
.gradle
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', 'build.gradle') }}
- uses: gradle/wrapper-validation-action@v1
- uses: gradle/actions/wrapper-validation@v3
- run: |
chmod +x gradlew
./gradlew build publishCurseForge publish modrinth --stacktrace -Porg.gradle.parallel.threads=4
./gradlew build publishMod --stacktrace -Porg.gradle.parallel.threads=4
env:
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
## Change
- port to 1.20.4 NeoForge
- update NeoForge & MaFgLib version
68 changes: 27 additions & 41 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
plugins {
id "dev.architectury.loom" version "1.4-SNAPSHOT"
id "dev.architectury.loom" version "1.5-SNAPSHOT"
id "maven-publish"
id 'com.modrinth.minotaur' version '2.+'
id 'net.darkhax.curseforgegradle' version '1.+'
id "com.hypherionmc.modutils.modpublisher" version "2.+"
}

sourceCompatibility = targetCompatibility = JavaVersion.VERSION_17

archivesBaseName = project.archives_base_name
base.archivesName = project.archives_base_name
version = "${project.mod_version}-mc${project.minecraft_version}"
group = project.maven_group

Expand Down Expand Up @@ -40,6 +37,9 @@ tasks.withType(JavaCompile) {
}

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17

withSourcesJar()
}

Expand All @@ -58,41 +58,6 @@ jar {
}
}

modrinth {
token = System.getenv("MODRINTH_TOKEN")

projectId = "${project.modrinth_id}"
versionNumber = "${project.version}"
versionType = "beta"
changelog = file("CHANGELOG.md").getText('UTF-8')
uploadFile = remapJar
additionalFiles = [sourcesJar]
gameVersions = ["1.20.3", "1.20.4"]
loaders = ["neoforge"]
dependencies {
required.project("mafglib")
}
}

task publishCurseForge(type: net.darkhax.curseforgegradle.TaskPublishCurseForge) {
apiToken = System.getenv("CURSEFORGE_TOKEN")
disableVersionDetection()

def mainFile = upload(project.curseforge_id, remapJar)
mainFile.displayName = "${project.version}"
mainFile.releaseType = "beta"
mainFile.changelog = file("CHANGELOG.md")
mainFile.changelogType = "markdown"
mainFile.addModLoader("NeoForge")
mainFile.addJavaVersion("Java 17", "Java 18")
mainFile.addGameVersion("1.20.3", "1.20.4")
mainFile.addRequirement("mafglib")

def sourcesFile = mainFile.withAdditionalFile(sourcesJar)
sourcesFile.changelog = file("CHANGELOG.md")
sourcesFile.changelogType = "markdown"
}

// configure the maven publication
publishing {
publications {
Expand All @@ -109,3 +74,24 @@ publishing {
// retrieving dependencies.
}
}

publisher {
apiKeys {
modrinth System.getenv("MODRINTH_TOKEN")
curseforge System.getenv("CURSEFORGE_TOKEN")
}

setCurseID("${project.curseforge_id}")
setModrinthID("${project.modrinth_id}")
setVersionType("release")
setChangelog(file("CHANGELOG.md").getText("UTF-8"))
setVersion("${project.version}")
setDisplayName("${project.version}")
setGameVersions("1.20.3", "1.20.4")
setLoaders("neoforge")
setCurseEnvironment("client")
setArtifact(remapJar)
addAdditionalFile(sourcesJar)
curseDepends { required("mafglib") }
modrinthDepends { required("mafglib") }
}
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ loom.platform=neoforge
# Base properties
# minecraft version
minecraft_version=1.20.4
neoforge_version=20.4.219
neoforge_version=20.4.234
yarn_mappings=1.20.4+build.3

# Mod Properties
mod_version=0.1.0
mod_version=0.1.1
maven_group=org.thinkingstudio.rocknroller
archives_base_name=RocknRoller
mod_id=rocknroller
Expand All @@ -19,4 +19,4 @@ loom.platform=neoforge
curseforge_id=916852

# Dependencies
malilib_version=0.1.4-mc1.20.4
malilib_version=0.1.5-mc1.20.4
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ pluginManagement {
maven { url "https://maven.fabricmc.net/" }
maven { url "https://maven.architectury.dev/" }
maven { url "https://maven.neoforged.net/releases/" }
maven { url "https://maven.firstdark.dev/releases" }
gradlePluginPortal()
}
}
19 changes: 7 additions & 12 deletions src/main/java/fi/dy/masa/itemscroller/ItemScroller.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,13 @@ public class ItemScroller {

public ItemScroller() {
if (FMLLoader.getDist().isClient()) {
this.onInitializeClient();
ForgePlatformUtils.getInstance().getClientModIgnoredServerOnly();
InitializationHandler.getInstance().registerInitializationHandler(new InitHandler());
ForgePlatformUtils.getInstance().getMod(Reference.MOD_ID).registerModConfigScreen((screen) -> {
GuiConfigs gui = new GuiConfigs();
gui.setParent(screen);
return gui;
});
}
}

public void onInitializeClient() {
ForgePlatformUtils.getInstance().getClientModIgnoredServerOnly();
InitializationHandler.getInstance().registerInitializationHandler(new InitHandler());

ForgePlatformUtils.getInstance().getMod(Reference.MOD_ID).registerModConfigScreen((screen) -> {
GuiConfigs gui = new GuiConfigs();
gui.setParent(screen);
return gui;
});
}
}

0 comments on commit 5e73422

Please sign in to comment.