Skip to content

Commit

Permalink
Merge pull request #21 from FTBTeam/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
desht authored Jun 25, 2024
2 parents da19efa + 9d61db0 commit 2bfa68b
Show file tree
Hide file tree
Showing 13 changed files with 122 additions and 205 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
!contains(github.event.head_commit.message, '[ciskip]')
uses: FTBTeam/mods-meta/.github/workflows/standard-release.yml@main
with:
curse-publish-task: curseforge
curse-publish-task: publishMods
java-version: 21
secrets:
ftb-maven-token: ${{ secrets.FTB_MAVEN_TOKEN }}
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [3.2.0]

### Changed
* Ported to Minecraft 1.21. Support for Fabric and NeoForge.
* Forge support may be re-added if/when Architectury adds support for Forge

## [3.1.0]

### Changed
Expand Down
84 changes: 82 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
id "architectury-plugin" version "3.4-SNAPSHOT"
id "dev.architectury.loom" version "1.6-SNAPSHOT" apply false
id "me.modmuss50.mod-publish-plugin" version "0.5.1"
}

architectury {
Expand Down Expand Up @@ -81,14 +82,93 @@ allprojects {
}
}

tasks.withType(JavaCompile) {
tasks.withType(JavaCompile).configureEach {
options.encoding = "UTF-8"
options.release = 21
}

java {
withSourcesJar()
}

publishing {
repositories {
if (ftbPublishing.ftbToken) {
maven {
url ftbPublishing.ftbURL
credentials {
username = ftbPublishing.ftbUser
password = ftbPublishing.ftbToken
}
}
}

if (ftbPublishing.sapsToken) {
maven {
url ftbPublishing.sapsURL
credentials {
username = ftbPublishing.sapsUser
password = ftbPublishing.sapsToken
}
}
}
}
}
}

task curseforgePublish
publishMods {
dryRun = providers.environmentVariable("CURSEFORGE_KEY").getOrNull() == null
changelog = providers.environmentVariable("CHANGELOG").getOrElse("No changelog provided")
version = "${mod_version}"

// TODO: Migrate to something else
def tag = providers.environmentVariable("TAG").getOrElse("release")
type = tag == "beta" ? BETA : (tag == "alpha" ? ALPHA : STABLE)

def createOptions = (String projectName) -> {
publishOptions {
file = project.provider { project(":$projectName").tasks.remapJar }.flatMap { it.archiveFile }
displayName = "[${projectName.toUpperCase()}][${minecraft_version}] ${readable_name} ${mod_version}"
modLoaders.add(projectName.toLowerCase())
}
}

def fabricOptions = createOptions("fabric")
def neoForgeOptions = createOptions("neoforge")
// def forgeOptions = createOptions("forge")

def curseForgeOptions = curseforgeOptions {
accessToken = providers.environmentVariable("CURSEFORGE_KEY")
projectId = curseforge_id
minecraftVersions.add("${minecraft_version}")
requires('architectury-api')
optional('jei')
optional('roughly-enough-items')
}

curseforge("curseforgeFabric") {
from(curseForgeOptions, fabricOptions)
requires('fabric-api')
requires('ftb-library-fabric')
optional('ftb-quests-fabric')
optional('ftb-ranks-fabric')
optional('waystones-fabric')
}

curseforge("curseforgeNeoForge") {
from(curseForgeOptions, neoForgeOptions)
requires('ftb-library-neoforge')
optional('ftb-quests-neoforge')
optional('ftb-ranks-neoforge')
optional('waystones')
optional('kubejs')
}

// curseforge("curseforgeForge") {
// from(curseForgeOptions, forgeOptions)
// requires('ftb-library-forge')
// optional('ftb-quests-forge')
// optional('ftb-ranks-forge')
// optional('waystones')
// }
}
24 changes: 1 addition & 23 deletions common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ dependencies {
modApi("dev.ftb.mods:ftb-filter-system:${rootProject.ftb_filter_system_version}")

modCompileOnly("me.shedaniel:RoughlyEnoughItems-api:${rootProject.rei_version}")
modCompileOnly("mezz.jei:jei-1.20.4-common-api:${rootProject.jei_version}")
modCompileOnly("mezz.jei:jei-${rootProject.minecraft_version}-common-api:${rootProject.jei_version}")

compileOnly("net.luckperms:api:${rootProject.luckperms_api_version}")

Expand All @@ -37,26 +37,4 @@ publishing {
from components.java
}
}

repositories {
if (ftbPublishing.ftbToken) {
maven {
url ftbPublishing.ftbURL
credentials {
username = ftbPublishing.ftbUser
password = ftbPublishing.ftbToken
}
}
}

if (ftbPublishing.sapsToken) {
maven {
url ftbPublishing.sapsURL
credentials {
username = ftbPublishing.sapsUser
password = ftbPublishing.sapsToken
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import net.minecraft.world.item.Item;

public class QuestItems {
private static final ResourceKey<Item> QUEST_BOOK = ResourceKey.create(Registries.ITEM, new ResourceLocation("ftbquests:book"));
private static final ResourceKey<Item> LOOT_CRATE = ResourceKey.create(Registries.ITEM, new ResourceLocation("ftbquests:lootcrate"));
private static final ResourceKey<Item> QUEST_BOOK = ResourceKey.create(Registries.ITEM, ResourceLocation.parse("ftbquests:book"));
private static final ResourceKey<Item> LOOT_CRATE = ResourceKey.create(Registries.ITEM, ResourceLocation.parse("ftbquests:lootcrate"));

private static Item questBook;
private static Item lootCrate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

@JeiPlugin
public class FTBQuestsJEIIntegration implements IModPlugin {
private static final ResourceLocation UID = new ResourceLocation(FTBXModCompat.MOD_ID, "ftbquests_jei");
private static final ResourceLocation UID = ResourceLocation.fromNamespaceAndPath(FTBXModCompat.MOD_ID, "ftbquests_jei");
public static IJeiRuntime runtime;

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import net.minecraft.world.item.ItemStack;

public class QuestCategory implements IRecipeCategory<WrappedQuest> {
public static final ResourceLocation TEXTURE = new ResourceLocation(FTBQuestsAPI.MOD_ID + ":textures/gui/jei/quest.png");
public static final ResourceLocation TEXTURE = ResourceLocation.fromNamespaceAndPath(FTBQuestsAPI.MOD_ID, "textures/gui/jei/quest.png");

private final IDrawable background;
private final IDrawable icon;
Expand Down
51 changes: 1 addition & 50 deletions fabric/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -111,59 +111,10 @@ components.java {

publishing {
publications {
mavenForge(MavenPublication) {
mavenFabric(MavenPublication) {
artifactId = "${rootProject.archives_base_name}-${project.name}"
version ftbPublishing.mavenVersion
from components.java
}
}

repositories {
if (ftbPublishing.ftbToken) {
maven {
url ftbPublishing.ftbURL
credentials {
username = ftbPublishing.ftbUser
password = ftbPublishing.ftbToken
}
}
}

if (ftbPublishing.sapsToken) {
maven {
url ftbPublishing.sapsURL
credentials {
username = ftbPublishing.sapsUser
password = ftbPublishing.sapsToken
}
}
}
}
}

if (ENV.CURSEFORGE_KEY) {
curseforge {
apiKey = ENV.CURSEFORGE_KEY
project {
id = project.curseforge_id
releaseType = ftbPublishing.relType
addGameVersion "Fabric"
addGameVersion project.minecraft_version
mainArtifact(remapJar.archiveFile)
relations {
requiredDependency 'architectury-api'
requiredDependency 'ftb-library-fabric'
optionalDependency 'ftb-quests-fabric'
optionalDependency 'ftb-ranks-fabric'
optionalDependency 'kubejs'
optionalDependency 'jei'
optionalDependency 'roughly-enough-items'
optionalDependency 'waystones-fabric'
}
changelog = ENV.CHANGELOG // expected to exist if ENV.CURSEFORGE_KEY does
changelogType = 'markdown'
}
}
}

rootProject.tasks.getByName("curseforgePublish").dependsOn tasks.getByName("curseforge")
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import java.util.concurrent.TimeUnit;

public class FTBChunksProtectionProvider implements ProtectionProvider {
public static ResourceLocation ID = new ResourceLocation(FTBChunks.MOD_ID, "provider");
public static ResourceLocation ID = ResourceLocation.fromNamespaceAndPath(FTBChunks.MOD_ID, "provider");
private static LoadingCache<GameProfile, ServerPlayer> FAKE_PLAYERS = null;

public static void init() {
Expand Down
49 changes: 0 additions & 49 deletions forge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -103,54 +103,5 @@ publishing {
from components.java
}
}

repositories {
if (ftbPublishing.ftbToken) {
maven {
url ftbPublishing.ftbURL
credentials {
username = ftbPublishing.ftbUser
password = ftbPublishing.ftbToken
}
}
}

if (ftbPublishing.sapsToken) {
maven {
url ftbPublishing.sapsURL
credentials {
username = ftbPublishing.sapsUser
password = ftbPublishing.sapsToken
}
}
}
}
}

if (ENV.CURSEFORGE_KEY) {
curseforge {
apiKey = ENV.CURSEFORGE_KEY
project {
id = project.curseforge_id
releaseType = ftbPublishing.relType
addGameVersion "Forge"
addGameVersion project.minecraft_version
mainArtifact(remapJar.archiveFile)
relations {
requiredDependency 'architectury-api'
requiredDependency 'ftb-library-forge'
optionalDependency 'ftb-quests-forge'
optionalDependency 'ftb-ranks-forge'
optionalDependency 'kubejs'
optionalDependency 'jei'
optionalDependency 'roughly-enough-items'
optionalDependency 'game-stages'
optionalDependency 'waystones'
}
changelog = ENV.CHANGELOG // expected to exist if ENV.CURSEFORGE_KEY does
changelogType = 'markdown'
}
}
}

rootProject.tasks.getByName("curseforgePublish").dependsOn tasks.getByName("curseforge")
45 changes: 23 additions & 22 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,41 +1,42 @@
org.gradle.jvmargs=-Xmx2048M

minecraft_version=1.20.6
minecraft_version=1.21
#enabled_platforms=fabric,forge,neoforge
enabled_platforms=fabric,neoforge

archives_base_name=ftb-xmod-compat
mod_version=3.1.0
readable_name=FTB XMod Compat
mod_version=3.2.0
maven_group=dev.ftb.mods
curseforge_id=889915

forge_version=50.0.9
neoforge_version=20.6.100-beta
neoforge_loader_version=1
fabric_loader_version=0.15.10
fabric_api_version=0.97.8+1.20.6
neoforge_version=21.0.14-beta
neoforge_loader_version=4
fabric_loader_version=0.15.11
fabric_api_version=0.100.1+1.21

architectury_version=12.1.3
architectury_version=13.0.1

ftb_library_version=2006.1.1
ftb_quests_version=2006.1.0-SNAPSHOT
ftb_chunks_version=2006.1.0
ftb_ranks_version=2006.1.0
ftb_essentials_version=2006.1.0
ftb_teams_version=2006.1.0
ftb_filter_system_version=2.1.0
ftb_library_version=2100.1.1
ftb_quests_version=2100.1.1
ftb_chunks_version=2100.1.0
ftb_ranks_version=2100.1.0
ftb_essentials_version=2100.1.0
ftb_teams_version=2100.1.0
ftb_filter_system_version=3.0.0

rei_version=15.0.728
rei_version=16.0.729
common_prot_api_version=1.0.0
luckperms_api_version=5.4
waystones_neoforge_version=5389804
waystones_forge_version=5389798
waystones_fabric_version=5389793
balm_neoforge_version=5389055
balm_forge_version=5389054
balm_fabric_version=5389051
waystones_neoforge_version=5427156
waystones_forge_version=5427151
waystones_fabric_version=5427150
balm_neoforge_version=5438018
balm_forge_version=5438000
balm_fabric_version=5437997
jei_version=19.0.0.11

# TODO compiling against 1.20.4 version for now
jei_version=17.3.0.49
kubejs_version=2004.7.0-build.16
gamestages_version=15.0.1
Loading

0 comments on commit 2bfa68b

Please sign in to comment.